test_ttpf_assets: read the original DDS before the rebuild removes it (FileNotFoundError once bcpack_calibration is built) #116

Closed
Andretuta wants to merge 1 commit from upstream-pr/116 into main
Andretuta commented 2026-11-24 02:21:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:21:23Z.


Carried over from old PR 9850 by Bios2000 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9850, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Bios2000: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116702080 (new item)

What and why

test_profile_added_after_strict_rejection in tests/test_ttpf_assets.py works in two steps:

  1. It builds a pool once with a calibration profile.
  2. It changes the profile and builds again, then compares the new DDS with original.read_bytes().

The second build switches the row to a new file and removes the one it replaced (remove_replaced in
tools/ttpf_assets.py). So the read of the original raises FileNotFoundError on every machine where
tools/bcpack_calibration is built. Without the library the test skips, which is why it can look green.

The test now does two things:

  • It keeps the original bytes before the second build.
  • It also asserts that the replaced file is gone, which is what remove_replaced promises.

No tool changes.

#7134 carried a fix for this test, among larger texture-pipeline changes, and was closed unmerged together with
the rest of the backlog.

Tested

Arch Linux, Python 3.14.10, at 2d53a8055, with cargo build --release --locked of
tools/bcpack_calibration so that the test runs instead of skipping. Neither the change nor its test uses the GPU.

  • On main: python -I tests/test_ttpf_assets.py gives FileNotFoundError: ...pool/000000_bcpack_v1-<hash>.dds
    at line 231 (31 tests, 1 error).
  • With the fix: OK, 31 tests, 1 skipped (RPF9DUMP_DLL not set for that one).
  • Whole suite, with this PR and the compare.py one on top of main at once, compared with main itself:
    • standard-library loop: 455 files, 24 failing, against 454 and 25 on main. The difference is this fix and
      the other PR's new test; every other failure is the same file on main.
    • pytest files, scripts/run_semantic_tests.py and node --test: identical to main.
    • compileall and make_game.py --help: OK.
    • The failures that main has were already there before this PR.
  • scripts/check_no_game_data.py and pyflakes on the changed file: clean.

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • 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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464862613 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/116). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:21:23Z. --- > Carried over from **old PR 9850** by `Bios2000` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9850`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Bios2000`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116702080 (new item) ### What and why `test_profile_added_after_strict_rejection` in `tests/test_ttpf_assets.py` works in two steps: 1. It builds a pool once with a calibration profile. 2. It changes the profile and builds again, then compares the new DDS with `original.read_bytes()`. The second build switches the row to a new file and removes the one it replaced (`remove_replaced` in `tools/ttpf_assets.py`). So the read of the original raises `FileNotFoundError` on every machine where `tools/bcpack_calibration` is built. Without the library the test skips, which is why it can look green. The test now does two things: - It keeps the original bytes before the second build. - It also asserts that the replaced file is gone, which is what `remove_replaced` promises. No tool changes. `#7134` carried a fix for this test, among larger texture-pipeline changes, and was closed unmerged together with the rest of the backlog. ### Tested Arch Linux, Python 3.14.10, at `2d53a8055`, with `cargo build --release --locked` of `tools/bcpack_calibration` so that the test runs instead of skipping. Neither the change nor its test uses the GPU. - On `main`: `python -I tests/test_ttpf_assets.py` gives `FileNotFoundError: ...pool/000000_bcpack_v1-<hash>.dds` at line 231 (31 tests, 1 error). - With the fix: OK, 31 tests, 1 skipped (`RPF9DUMP_DLL` not set for that one). - Whole suite, with this PR and the compare.py one on top of `main` at once, compared with `main` itself: - standard-library loop: 455 files, 24 failing, against 454 and 25 on `main`. The difference is this fix and the other PR's new test; every other failure is the same file on `main`. - pytest files, `scripts/run_semantic_tests.py` and `node --test`: identical to `main`. - `compileall` and `make_game.py --help`: OK. - The failures that `main` has were already there before this PR. - `scripts/check_no_game_data.py` and pyflakes on the changed file: clean. AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [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)
MoonEyes commented 2026-11-27 18:58:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T18:58:43Z.


Thanks a lot for this, @Andretuta. We checked and the change in this pull request is already in main: the same file content landed in commit e01d02262 ("test_ttpf_assets: read the original DDS before the rebuild removes it"), so there is nothing left to merge.

I am closing it to keep the queue clear. Please do reopen it if you see something we missed.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226064289 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/116#issuecomment-7226064289). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T18:58:43Z. --- Thanks a lot for this, @Andretuta. We checked and the change in this pull request is already in `main`: the same file content landed in commit e01d02262 ("test_ttpf_assets: read the original DDS before the rebuild removes it"), so there is nothing left to merge. I am closing it to keep the queue clear. Please do reopen it if you see something we missed. AI-assisted (Claude Code, Claude Opus 5.5)

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
ProjectLeonida/mandy!116
No description provided.