[PR #451] Repair zero-byte DDS files on TTPF export resume #502

Open
opened 2026-11-26 20:18:05 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/451
Author: @EdenBendheim
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: ubiq/ttpf-zero-byte-dds-resume


📝 Commits (1)

  • 031bab2 Repair zero-byte DDS files on TTPF resume

📊 Changes

4 files changed (+164 additions, -36 deletions)

View changed files

📝 make_game.py (+29 -8)
📝 tests/test_make_game_dry_run.py (+59 -27)
📝 tests/test_ttpf_export_resume.py (+61 -0)
📝 tools/rpf9dump/Program.cs (+15 -1)

📄 Description

Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123161839

What changed

  • make_game.py (ttpf_manifest): Require every listed DDS output to be a non-empty regular file (st_size > 0) before accepting a pool manifest on resume, preserving the single-pass os.scandir() fast path (with os.stat() fallback only for case-only spelling misses) and keeping File: null unsupported rows valid.
  • tools/rpf9dump/Program.cs (HasNonemptyDds): Treat zero-byte DDS outputs as incomplete on resume (following symlink targets and handling inaccessible/non-regular paths safely) so the existing atomic writer regenerates broken files while leaving valid sibling DDS files untouched.
  • Tests (tests/test_ttpf_export_resume.py, tests/test_make_game_dry_run.py): Synthetic tests verifying byte-for-byte repair, untouched sibling bytes/mtime, preserved skipped rows, symlink handling, os.scandir() fast path, and fallback error rejection (with LF line endings pinned).

Scope is intentionally limited to listed, extractable DDS outputs (unlisted files in the pool folder are never deleted).

Testing & Disclosure

  • AI-assisted: Implemented with Codex (gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).
  • Environment: macOS 27.3, Apple M1 Max (CPU-only, synthetic fixtures, zero game data).
  • Verified on ubiquitarianism/leonida main (8f481cf16): dotnet build -c Release (0 warnings, 0 errors), test_ttpf_export_resume.py (6/6), test_make_game_dry_run.py (25/25), check_no_game_data.py, LF check — all passed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/451 **Author:** [@EdenBendheim](https://github.com/EdenBendheim) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `ubiq/ttpf-zero-byte-dds-resume` --- ### 📝 Commits (1) - [`031bab2`](https://github.com/ubiquitarianism/leonida/commit/031bab29f8905a5c6eba0c306f5e328e23b54e54) Repair zero-byte DDS files on TTPF resume ### 📊 Changes **4 files changed** (+164 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+29 -8) 📝 `tests/test_make_game_dry_run.py` (+59 -27) 📝 `tests/test_ttpf_export_resume.py` (+61 -0) 📝 `tools/rpf9dump/Program.cs` (+15 -1) </details> ### 📄 Description Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123161839 ### What changed - **`make_game.py` (`ttpf_manifest`)**: Require every listed DDS output to be a non-empty regular file (`st_size > 0`) before accepting a pool manifest on resume, preserving the single-pass `os.scandir()` fast path (with `os.stat()` fallback only for case-only spelling misses) and keeping `File: null` unsupported rows valid. - **`tools/rpf9dump/Program.cs` (`HasNonemptyDds`)**: Treat zero-byte DDS outputs as incomplete on resume (following symlink targets and handling inaccessible/non-regular paths safely) so the existing atomic writer regenerates broken files while leaving valid sibling DDS files untouched. - **Tests (`tests/test_ttpf_export_resume.py`, `tests/test_make_game_dry_run.py`)**: Synthetic tests verifying byte-for-byte repair, untouched sibling bytes/mtime, preserved skipped rows, symlink handling, `os.scandir()` fast path, and fallback error rejection (with LF line endings pinned). Scope is intentionally limited to listed, extractable DDS outputs (unlisted files in the pool folder are never deleted). ### Testing & Disclosure - **AI-assisted:** Implemented with Codex (`gpt-6.2-sol`) and reviewed with Codex (`gpt-6.2-astra`). - **Environment:** macOS 27.3, Apple M1 Max (CPU-only, synthetic fixtures, zero game data). - **Verified on `ubiquitarianism/leonida` `main` (`8f481cf16`):** `dotnet build -c Release` (0 warnings, 0 errors), `test_ttpf_export_resume.py` (6/6), `test_make_game_dry_run.py` (25/25), `check_no_game_data.py`, LF check — all passed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#502
No description provided.