tests: RBF0 report outputs that differ only in letter case (carry of #1346) #3106

Merged
leonida/mandy
MoonEyes merged 8 commits from carry/1346 into main 2026-12-02 12:13:59 +00:00

Pull request successfully merged and closed

MoonEyes commented 2026-12-02 11:09:29 +00:00

Claimed in the coordination issue as: RBF0-TREE-SHARED-REPORT-PATH (https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7143541315) and RBF0-INDEX-SHARED-REPORT-PATH (https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7143809247), both first claimed by breachato and taken over in #1346 by xel1uz.

What and why

Carry of #1346 (xel1uz), as aslan2142's review asked: only the integration tests. #1346 was stacked on #1214 and #1227, which were closed; main already routes both guards through report_paths.same_report_path with newer code, so the tool changes of #1346 are dropped and main's tools stay as they are. This branch is main merged with the head of #1346 (e4c409e20), so the author's commits are kept.

Two tests cover a case the existing ones do not, outputs that differ only in letter case when neither file exists yet:

  • tests/test_rbf0_index.py: test_new_report_with_a_case_variant_of_the_carve_manifest (the report is a case variant of the carve's index.json).
  • tests/test_rbf0_tree.py: test_new_json_and_csv_paths_that_differ_only_in_case (out and --csv differ only in case).

Each test first asks the filesystem whether it folds case and expects the refusal (exit 2) where it does and two separate files where it does not, so the result is the same on NTFS, APFS and ext4. Every file stays in the test's own temporary folder.

Tested

Windows 11, no GPU, no game files, on current main plus this branch:

  • python -I tests/test_rbf0_index.py: 31 OK. python -I tests/test_rbf0_tree.py: 39 OK, 1 skipped.
  • Red: with same_report_path replaced by a case-sensitive abspath comparison, both new tests fail (older tests on hard links and streams fail too).
  • python -I scripts/check_no_game_data.py on both files: clean.
  • Not run: Linux and macOS locally (CI covers Linux), the full suite.

GPUs tested: n/a (tool tests only)

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md).
  • A new translator rule is in the contract table of docs/design.md. (n/a: tests only)

Supersedes #1346 once merged; the original stays open until a maintainer decides.

🤖 Generated with Claude Code

Claimed in the coordination issue as: RBF0-TREE-SHARED-REPORT-PATH (https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7143541315) and RBF0-INDEX-SHARED-REPORT-PATH (https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7143809247), both first claimed by breachato and taken over in #1346 by xel1uz. ### What and why Carry of #1346 (xel1uz), as aslan2142's review asked: only the integration tests. #1346 was stacked on #1214 and #1227, which were closed; `main` already routes both guards through `report_paths.same_report_path` with newer code, so the tool changes of #1346 are dropped and `main`'s tools stay as they are. This branch is `main` merged with the head of #1346 (`e4c409e20`), so the author's commits are kept. Two tests cover a case the existing ones do not, outputs that differ only in letter case when neither file exists yet: - `tests/test_rbf0_index.py`: `test_new_report_with_a_case_variant_of_the_carve_manifest` (the report is a case variant of the carve's `index.json`). - `tests/test_rbf0_tree.py`: `test_new_json_and_csv_paths_that_differ_only_in_case` (`out` and `--csv` differ only in case). Each test first asks the filesystem whether it folds case and expects the refusal (exit 2) where it does and two separate files where it does not, so the result is the same on NTFS, APFS and ext4. Every file stays in the test's own temporary folder. ### Tested Windows 11, no GPU, no game files, on current `main` plus this branch: - `python -I tests/test_rbf0_index.py`: 31 OK. `python -I tests/test_rbf0_tree.py`: 39 OK, 1 skipped. - Red: with `same_report_path` replaced by a case-sensitive `abspath` comparison, both new tests fail (older tests on hard links and streams fail too). - `python -I scripts/check_no_game_data.py` on both files: clean. - Not run: Linux and macOS locally (CI covers Linux), the full suite. GPUs tested: n/a (tool tests only) AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md). - [ ] A new translator rule is in the contract table of `docs/design.md`. (n/a: tests only) Supersedes #1346 once merged; the original stays open until a maintainer decides. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
enlight3d commented 2026-12-02 11:55:01 +00:00

RUN (independent run on Windows, #3106 head fff970e61, merged locally into main a252854a2 with git merge --no-ff, no conflicts. The merge adds only the two tests, and tools/ is unchanged. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)

  • History: #1346's head e4c409e20 is an ancestor of the head through the merge 7c245a359. The commits of breachato and xel1uz are kept under their names. #1346's tool hunks are left out, as the body says. The pull request's diff against main is exactly #1346's two test additions (+21 in tests/test_rbf0_index.py, +19 in tests/test_rbf0_tree.py).
  • python -I tests/test_rbf0_index.py -v: main 30 tests OK; merge 31 tests OK.
  • python -I tests/test_rbf0_tree.py -v: main 38 tests OK (1 skipped, POSIX permission bits); merge 39 tests OK (the same skip). These match the body.
  • python -m pytest on the 12 test files that name rbf0_index or rbf0_tree (including test_report_paths and test_report_source_collision): main 168 passed / 9 skipped; merge 170 passed / 9 skipped.
  • No red on main is possible: this pull request changes no tool, and its two tests pass with main's tools (31 OK, 39 OK). The red comes from mutations, on NTFS, where both tests take their case-folding branch:
    • The mutation the body describes, same_report_path replaced in both tools by a case-sensitive os.path.abspath(a) == os.path.abspath(b): killed. Both new tests fail. Older tests fail as well: the hard-link test in test_rbf0_index.py, and the stream test in test_rbf0_tree.py (3 failures in that file), because that comparison also loses the hard-link and stream checks.
    • A narrower one in tools/report_paths.py: same_report_path keeps realpath and samefile, but returns False instead of comparing folded names when a path does not exist yet. Killed by exactly the two new tests (1 failure in each file), and by nothing else in these two files. With main's own copies of these two files, this mutation passes (30 OK, 38 OK). Only tests/test_report_paths.py catches it there (5 failures). So these tests are the first to pin the not-yet-existing case-variant case at the level of the two RBF0 commands.
  • Linux: I did not get a local run. WSL (Ubuntu) on this machine did not answer within 10 minutes, and I stopped there. CI's linux-python-and-viewer job on the head runs the standard-library test loop on ubuntu-24.04, and its log lists tests/test_rbf0_index.py and tests/test_rbf0_tree.py with "658 files, 0 files failed". That is where the case-sensitive branch (two separate files) ran.

Not covered here: a local Linux or macOS run, and the whole standalone suite on Windows.

Verdict: PASS. The two tests pass on main and on the merge, and on NTFS they catch both the coarse mutation and a narrow one that only drops case folding for paths that do not exist yet, which no other RBF0 test catches. The original commits are kept, and CI ran the case-sensitive branch on Linux.

Machine: Windows 11 Pro 26300 (NTFS), i9-13900K, 64 GB, CPython 3.13.12 (CI uses 3.12); unit tests only, no GPU or game files used.

RUN (independent run on Windows, #3106 head fff970e61, merged locally into `main` a252854a2 with `git merge --no-ff`, no conflicts. The merge adds only the two tests, and `tools/` is unchanged. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) - History: #1346's head e4c409e20 is an ancestor of the head through the merge 7c245a359. The commits of breachato and xel1uz are kept under their names. #1346's tool hunks are left out, as the body says. The pull request's diff against `main` is exactly #1346's two test additions (+21 in `tests/test_rbf0_index.py`, +19 in `tests/test_rbf0_tree.py`). - `python -I tests/test_rbf0_index.py -v`: main 30 tests OK; merge 31 tests OK. - `python -I tests/test_rbf0_tree.py -v`: main 38 tests OK (1 skipped, POSIX permission bits); merge 39 tests OK (the same skip). These match the body. - `python -m pytest` on the 12 test files that name `rbf0_index` or `rbf0_tree` (including `test_report_paths` and `test_report_source_collision`): main 168 passed / 9 skipped; merge 170 passed / 9 skipped. - No red on `main` is possible: this pull request changes no tool, and its two tests pass with `main`'s tools (31 OK, 39 OK). The red comes from mutations, on NTFS, where both tests take their case-folding branch: - The mutation the body describes, `same_report_path` replaced in both tools by a case-sensitive `os.path.abspath(a) == os.path.abspath(b)`: killed. Both new tests fail. Older tests fail as well: the hard-link test in `test_rbf0_index.py`, and the stream test in `test_rbf0_tree.py` (3 failures in that file), because that comparison also loses the hard-link and stream checks. - A narrower one in `tools/report_paths.py`: `same_report_path` keeps `realpath` and `samefile`, but returns `False` instead of comparing folded names when a path does not exist yet. Killed by exactly the two new tests (1 failure in each file), and by nothing else in these two files. With `main`'s own copies of these two files, this mutation passes (30 OK, 38 OK). Only `tests/test_report_paths.py` catches it there (5 failures). So these tests are the first to pin the not-yet-existing case-variant case at the level of the two RBF0 commands. - Linux: I did not get a local run. WSL (Ubuntu) on this machine did not answer within 10 minutes, and I stopped there. CI's `linux-python-and-viewer` job on the head runs the standard-library test loop on ubuntu-24.04, and its log lists `tests/test_rbf0_index.py` and `tests/test_rbf0_tree.py` with "658 files, 0 files failed". That is where the case-sensitive branch (two separate files) ran. Not covered here: a local Linux or macOS run, and the whole standalone suite on Windows. Verdict: PASS. The two tests pass on `main` and on the merge, and on NTFS they catch both the coarse mutation and a narrow one that only drops case folding for paths that do not exist yet, which no other RBF0 test catches. The original commits are kept, and CI ran the case-sensitive branch on Linux. Machine: Windows 11 Pro 26300 (NTFS), i9-13900K, 64 GB, CPython 3.13.12 (CI uses 3.12); unit tests only, no GPU or game files used.
Kal0s-design commented 2026-12-02 11:58:17 +00:00

Ran natively on Windows 11 (NTFS), Python 3.13, head fff970e61 merged with current main. I also tried the one Windows setup where the two new tests have to take their other branch: a directory with NTFS per-directory case sensitivity on (fsutil file setCaseSensitiveInfo <dir> enable, which new subfolders inherit), with TMP/TEMP pointed into it.

default TEMP (folds case) case-sensitive TEMP
tests/test_rbf0_index.py 31 OK 31 OK
tests/test_rbf0_tree.py 39 OK, 1 skipped 3 subtests fail, see below

On the case-sensitive directory, both new tests pass by taking the "two separate files" branch, so the probe really asks the volume and does not just look at os.name:

  • test_new_report_with_a_case_variant_of_the_carve_manifest
  • test_new_json_and_csv_paths_that_differ_only_in_case

The 3 failures are all subtests of an older test, test_out_csv_or_xml_over_a_stream_of_the_source_folder_is_refused. They fail the same way with main's own test file (38 tests, same 3 failures), so they are not caused by this PR.

  • The first case picks 00000000.BIN when os.name == "nt" and expects it to alias 00000000.bin. In a case-sensitive directory those are two files. The tool correctly writes the new one and exits 0, so the test's returncode == 2 assertion fails.
  • The other two subtests then fail only because of the leftover file: ['00000000.BIN', '00000000.bin'] != ['00000000.bin'].

That older test could use the same case-folding probe as the two new ones, as a follow-up. Per-directory case sensitivity is rare on Windows (mostly folders shared with WSL), so this is not a blocker.

Not run: Linux and macOS (CI covers Linux).

GPUs tested: n/a (tool tests only).

AI-assisted: yes (Claude Code).

Ran natively on Windows 11 (NTFS), Python 3.13, head `fff970e61` merged with current `main`. I also tried the one Windows setup where the two new tests have to take their other branch: a directory with NTFS per-directory case sensitivity on (`fsutil file setCaseSensitiveInfo <dir> enable`, which new subfolders inherit), with `TMP`/`TEMP` pointed into it. | | default TEMP (folds case) | case-sensitive TEMP | |---|---|---| | `tests/test_rbf0_index.py` | 31 OK | 31 OK | | `tests/test_rbf0_tree.py` | 39 OK, 1 skipped | 3 subtests fail, see below | On the case-sensitive directory, both new tests pass by taking the "two separate files" branch, so the probe really asks the volume and does not just look at `os.name`: - `test_new_report_with_a_case_variant_of_the_carve_manifest` - `test_new_json_and_csv_paths_that_differ_only_in_case` The 3 failures are all subtests of an older test, `test_out_csv_or_xml_over_a_stream_of_the_source_folder_is_refused`. They fail the same way with `main`'s own test file (38 tests, same 3 failures), so they are not caused by this PR. - The first case picks `00000000.BIN` when `os.name == "nt"` and expects it to alias `00000000.bin`. In a case-sensitive directory those are two files. The tool correctly writes the new one and exits 0, so the test's `returncode == 2` assertion fails. - The other two subtests then fail only because of the leftover file: `['00000000.BIN', '00000000.bin'] != ['00000000.bin']`. That older test could use the same case-folding probe as the two new ones, as a follow-up. Per-directory case sensitivity is rare on Windows (mostly folders shared with WSL), so this is not a blocker. Not run: Linux and macOS (CI covers Linux). GPUs tested: n/a (tool tests only). AI-assisted: yes (Claude Code).
MoonEyes commented 2026-12-02 11:58:50 +00:00

Merging. Head fff970e61 merges cleanly with main 9b4d71899 and does not force a rebase of #2566. Independent check on head fff970e61: enlight3d's red/green on main + this head (the case-sensitive abspath mutation is killed by both new tests on NTFS, related suite 168 -> 170), comment 7344584080; the Linux side is covered by CI ubuntu-24.04; xel1uz's commits from #1346 are ancestors; CI 5/5 green incl. no-game-data; tests only, as aslan2142's review asked; items RBF0-TREE/INDEX-SHARED-REPORT-PATH claimed in #14. Merged by MoonEyes.

AI-assisted (Claude Code).

Merging. Head `fff970e61` merges cleanly with `main` `9b4d71899` and does not force a rebase of #2566. Independent check on head fff970e61: enlight3d's red/green on main + this head (the case-sensitive abspath mutation is killed by both new tests on NTFS, related suite 168 -> 170), comment 7344584080; the Linux side is covered by CI ubuntu-24.04; xel1uz's commits from #1346 are ancestors; CI 5/5 green incl. no-game-data; tests only, as aslan2142's review asked; items RBF0-TREE/INDEX-SHARED-REPORT-PATH claimed in #14. Merged by MoonEyes. AI-assisted (Claude Code).
Sign in to join this conversation.
No description provided.