Batch export can overwrite a DDS or input profile with its JSON manifest #3278

Closed
opened 2026-11-28 05:02:17 +00:00 by github-bot · 0 comments
Owner

@⁠wish131400 on GitHub · 2026-11-28 04:56 UTC · original

At 240e0fb9c460f24d51683abe2d4cce2800b136c1, the batch exporter permits its JSON manifest path to name a DDS requested by the same batch.

For example, a batch selecting index 0 with output directory out and --manifest out/tex_00000.dds first exports that DDS, then replaces it with JSON when it publishes the manifest. The resulting manifest still reports success and a checksum for the DDS bytes that were replaced. A failed or skipped export can also lose an older DDS that the worker deliberately preserved.

The synthetic fixture in tests/ttpf_batch_export_check.py can reproduce this without a texture pool or decoder: use MockTtpfModule, request index 0, and set manifest_path to the generated tex_00000.dds path. Indices 1 and 2 exercise the failed/skipped paths. Test each with and without an existing DDS. The current code accepts all six collisions.

Expected behavior: reject the conflicting destination before starting any worker or creating output files. A manifest with the same filename in a separate directory should remain valid, and its recorded checksum should match the exported DDS.

The same final manifest writer can replace an input supplied with --history or --calibration when --manifest names that file. Synthetic valid-profile controls reproduce both cases: the exporter reads the profile, succeeds, then replaces the input JSON object with its results array. These collisions should also be rejected before loading the tools or beginning an export.

Environment: Windows 10 build 19045, Python 3.14. All input data in the regression is constructed by the test. Related batch-export tracking: #458.

**@⁠wish131400** on GitHub · 2026-11-28 04:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3276) At `240e0fb9c460f24d51683abe2d4cce2800b136c1`, the batch exporter permits its JSON manifest path to name a DDS requested by the same batch. For example, a batch selecting index 0 with output directory `out` and `--manifest out/tex_00000.dds` first exports that DDS, then replaces it with JSON when it publishes the manifest. The resulting manifest still reports success and a checksum for the DDS bytes that were replaced. A failed or skipped export can also lose an older DDS that the worker deliberately preserved. The synthetic fixture in `tests/ttpf_batch_export_check.py` can reproduce this without a texture pool or decoder: use `MockTtpfModule`, request index 0, and set `manifest_path` to the generated `tex_00000.dds` path. Indices 1 and 2 exercise the failed/skipped paths. Test each with and without an existing DDS. The current code accepts all six collisions. Expected behavior: reject the conflicting destination before starting any worker or creating output files. A manifest with the same filename in a separate directory should remain valid, and its recorded checksum should match the exported DDS. The same final manifest writer can replace an input supplied with `--history` or `--calibration` when `--manifest` names that file. Synthetic valid-profile controls reproduce both cases: the exporter reads the profile, succeeds, then replaces the input JSON object with its results array. These collisions should also be rejected before loading the tools or beginning an export. Environment: Windows 10 build 19045, Python 3.14. All input data in the regression is constructed by the test. Related batch-export tracking: #458.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:02:18 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/R0Y00--Xbox2Windows#3278
No description provided.