OLD-9850: test_ttpf_assets: read the original DDS before the rebuild removes it #1771

Merged
leonida/mandy
potatoe0100 merged 1 commit from carry/old-9850 into main 2026-11-27 17:56:01 +00:00

Pull request successfully merged and closed

potatoe0100 commented 2026-11-25 11:47:58 +00:00

Claimed in the coordination issue as: OLD-9850 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161513239)

What and why

Carries on old PR 9850 (draft #116, branch old-pr/9850, listed in #17; commit author David), rebased on current main with the author's commit kept.

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 switches the row to a new file and removes the one it replaced (remove_replaced), so that read raises FileNotFoundError on every machine where the bcpack_calibration library is built; without the library the test skips, which is why CI stays green. The test now keeps the original bytes before the rebuild and also checks that the replaced file is gone, which is what remove_replaced promises. Test-only change.

Tested

  • Built tools/bcpack_calibration (cargo build --release --offline, Rust stable, Linux) so the test actually runs instead of skipping.
  • python -I tests/test_ttpf_assets.py on this branch: 31 tests OK (1 skipped, needs RPF9DUMP_DLL).
  • The same with main's test file: FileNotFoundError in test_profile_added_after_strict_rejection (1 error), so this fixes a real failure.

GPUs tested: n/a (no GPU code)

AI-assisted: yes (Claude rebased and tested; the original commit was AI-assisted too)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

Claimed in the coordination issue as: OLD-9850 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7161513239) ### What and why Carries on old PR 9850 (draft #116, branch `old-pr/9850`, listed in #17; commit author David), rebased on current `main` with the author's commit kept. `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 switches the row to a new file and removes the one it replaced (`remove_replaced`), so that read raises `FileNotFoundError` on every machine where the `bcpack_calibration` library is built; without the library the test skips, which is why CI stays green. The test now keeps the original bytes before the rebuild and also checks that the replaced file is gone, which is what `remove_replaced` promises. Test-only change. ### Tested - Built `tools/bcpack_calibration` (`cargo build --release --offline`, Rust stable, Linux) so the test actually runs instead of skipping. - `python -I tests/test_ttpf_assets.py` on this branch: 31 tests OK (1 skipped, needs `RPF9DUMP_DLL`). - The same with `main`'s test file: `FileNotFoundError` in `test_profile_added_after_strict_rejection` (1 error), so this fixes a real failure. GPUs tested: n/a (no GPU code) AI-assisted: yes (Claude rebased and tested; the original commit was AI-assisted too) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PierreEbele commented 2026-11-25 18:48:40 +00:00

Reviewed e01d022: test-only fix. tests/test_ttpf_assets.py runs 31 tests OK (2 skips) identically on this branch
and on main; the changed test skips in this environment because its native gate needs the built bcpack_calibration
library (no Rust toolchain here), so the fixed path was verified by code reading: the rebuild names the export with
sha256(decoder_digest + profile bytes), the old file lands in the manifest's PENDING list and remove_replaced
unlinks it, so the old line's original.read_bytes() raised FileNotFoundError, and the new
assertFalse(original.exists()) is exactly the removal remove_replaced promises. No findings. AI-assisted review.

Recommendation: Merge

Reviewed e01d022: test-only fix. tests/test_ttpf_assets.py runs 31 tests OK (2 skips) identically on this branch and on main; the changed test skips in this environment because its native gate needs the built bcpack_calibration library (no Rust toolchain here), so the fixed path was verified by code reading: the rebuild names the export with sha256(decoder_digest + profile bytes), the old file lands in the manifest's PENDING list and remove_replaced unlinks it, so the old line's `original.read_bytes()` raised FileNotFoundError, and the new `assertFalse(original.exists())` is exactly the removal remove_replaced promises. No findings. AI-assisted review. **Recommendation:** Merge
Sign in to join this conversation.
No description provided.