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.
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.
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>
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)
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.
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.
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>
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>
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>
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>