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

Open
opened 2026-11-26 20:17:00 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/116
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9850


📝 Commits (1)

  • 43769a0 test_ttpf_assets: read the original DDS before the rebuild removes it

📊 Changes

1 file changed (+5 additions, -2 deletions)

View changed files

📝 tests/test_ttpf_assets.py (+5 -2)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/116 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9850` --- ### 📝 Commits (1) - [`43769a0`](https://github.com/ubiquitarianism/leonida/commit/43769a0702a7f9c20d9525364f350d874a3e5b02) test_ttpf_assets: read the original DDS before the rebuild removes it ### 📊 Changes **1 file changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_ttpf_assets.py` (+5 -2) </details> ### 📄 Description > 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#168
No description provided.