Commit Graph

20 Commits

Author SHA1 Message Date
7df404beee Merge upstream/main into fix/ttpf-assets-stage-cleanup 2026-11-30 13:37:43 +03:00
7798e28e11 tests/test_ttpf_assets: add regression tests for published_mode and mode restoration on replace failure 2026-11-30 13:37:43 +03:00
a23d691944 make_game assets: keep a full-chain DDS its decoder already wrote
With a calibration profile, a history edit changes the pass stamp, so the
pass decoded every calibrated row again and replaced its DDS with the same
bytes under the same name. Calibrated output does not depend on the
history, and a replacement denied for a file in use stopped the pass
before the strict fallbacks.

Skip a row whose decoder stamp and file name already match the pass and
whose file exists.
2026-11-28 16:45:29 +01:00
0507555a57 make_game assets: check BC6H/BC7 history ranges before strict decoding
load_history() checked the bc6h and bc7 sections through the table loaders,
which check shapes and integers only. A confirmed endpoint depth above the
known one (9 over 8) passed, and strict decoding then published a
provisional reconstruction as a confirmed DDS.

Move the range checks of bcpack_history_calib.py --verify into
check_history_tables() and run them on the parsed history before any pool
is opened. Both now also reject an entry with confirmed bits whose values
the table leaves out: the decoder read zeros there as confirmed values.
2026-11-28 16:45:20 +01:00
a1e0465356 test: cover mixed BCPack calibration and history 2026-11-28 00:59:20 +01:00
51b2819b65 make_game assets: reuse local BCPack history on resume 2026-11-28 00:02:00 +01:00
e01d02262f test_ttpf_assets: read the original DDS before the rebuild removes it
test_profile_added_after_strict_rejection rebuilds the pool with a changed calibration profile and
then compared the new file with original.read_bytes(). The rebuild switched the row to a new file
and removed the one it replaced (remove_replaced), so the read raised FileNotFoundError on every
machine where the bcpack_calibration library is built; without it, the test skips.

The test now keeps the original bytes before the rebuild and also checks that the replaced file is
gone, which is the behaviour remove_replaced promises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:33:52 +00:00
bb938f6395 ttpf_assets: the BCPack pass stamp hashes the decoder modules, so a fixed decoder completes old pools again (#6678)
Squash-merged after diff review of PR #6678
2026-11-23 10:59:15 -06:00
fcc0eb7705 make_game: a broken bcpack calibration profile is one ERROR line, not a JSON traceback (EGEN-TTPF-CALIB-PROFILE-BADJSON) (#6827)
Squash-merged after diff review of PR #6827 - make_game: a broken bcpack calibration profile is one ERROR line, not a JSON traceback (EGEN-TTPF-CALIB-PROFILE-BADJSON)
2026-11-23 09:51:40 -06:00
0e5ccb8c4a Round 44 test clashes: run_gpu_tests reports a --work it cannot create (#4544's message), the readback test pins the PerVertexKHR fallbacks off, ttpf listings skip the decoder record, image_fuzz refuses a file --work before opening the oracle (#4087)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:31:07 -05:00
314c042043 Merge pull request #4502 from bobcatchris
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:20 -05:00
c9ae6a1ee4 Merge pull request #4173 from francisco parata
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:12:01 -05:00
06916dffb0 tests: pin ttpf_assets publish, candidate and profile rules
The existing file drives the assets stage end to end; nothing unit-tested the
pieces it calls. Add 16 tests to the same file, leaving its four integration
tests unchanged: publish leaves no staging file and keeps the previous bytes and
mode on a failed replace, the candidate() selection rules for decoder claims and
partial chains, load_profile's missing/corrupt calibration cases, and
complete_pool's early returns before the pool is opened. Synthetic rows only.

AI-assisted.
2026-11-22 19:52:14 -06:00
12ada29a3c make_game: export texture pools again when the decoder changed
BUILD-866 gave the model and texture exports a decoder.sha256 record.
The texture-pool loop still took any complete pool manifest.json as
done, although rpf9dump ttpf decodes with the same rpf9-explorer Core
and keeps the DDS files it finds. After a submodule or tools/rpf9dump
change, assets/ttpf/** and assets/ttpf_pack/** kept the old decoder's
output.

Each pool folder now gets the same record, written before its export.
A folder with another record, or without one, is removed and exported
again, as the model and texture folders are.
2026-11-22 20:45:45 -03:00
760638c8fd ttpf_assets: a replaced DDS that was in use is removed by the next build
Review (@shdann): a file that could not be removed because it was open
stayed for good. The manifest had already switched away from it and the
pass was stamped, so later builds returned before any cleanup.

The manifest that switches the rows now lists the replaced files under
BCPackReplaced. They are removed after it is published, and the list is
written again with only what could not be removed (dropped when empty).
A build that finds the pass stamped still finishes that list. This also
covers a build stopped between the manifest write and the removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:13:06 +00:00
870e0553d0 ttpf_assets: look at each file once when removing replaced DDS files
Review: the same-file check compared every replaced name with every row's
file, os.path.samefile per pair, so a pool with thousands of rows and
replaced files took minutes to hours. Each row's file is now stat'ed once
into a set of (device, inode), and each replaced name once against it.
The removal moves into remove_replaced(), and a test fails if the check
is done per pair (50 rows and 50 replaced files: at most 100 stats).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:52:32 +00:00
e4f028b56b ttpf_assets: never remove the file just published, the manifest or a non-DDS file
Review fixes for the removal of replaced DDS files:
- A row that named the new file in another letter case (the same file on
  Windows and macOS) no longer has it removed: names are compared through
  normcase, and a file that is the same file on disk as one a row names is
  kept.
- Only names that end in .dds are removed, so a row that names
  manifest.json (or anything else) cannot remove it.
- A file that could not be removed is counted, and one line on stderr says
  how many stay next to the full-chain files.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 21:48:49 +00:00
c2d4135ac9 ttpf_assets: remove the lower-mip DDS a full-chain export replaces
complete_pool publishes <index>_bcpack_<method>.dds and switches the
manifest row to it, but left the file the row named before in the pool
folder, named by no row: every texture the pass completes was stored twice.

After the manifest is published, a superseded file that no row names any
more is removed. It stays when the manifest write fails (the row still
names it), when another row names it, and when it can't be removed; only a
plain file name inside the pool's folder is ever removed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 21:44:43 +00:00
2093c0268e ttpf_mips, ttpf_assets: skip unmapped ETPF sentinels in Pool.span and guard pool.codecs 2026-11-22 14:28:42 -03:00
23fe0a0c3a Complete BCPack DDS entries during the normal assets export 2026-11-22 16:04:49 +08:00