Skip to content

bink_index: ask report_paths for the report-path guard - #2637

Merged
MoonEyes merged 2 commits into
ProjectLeonida:mainfrom
breachato:bink-index-shared-report-path
Nov 30, 2026
Merged

MoonEyes merged 2 commits into
ProjectLeonida:mainfrom
breachato:bink-index-shared-report-path

Conversation

@breachato

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: BINK-INDEX-SHARED-REPORT-PATH

What and why

tools/bink_index.py refuses a report that would overwrite an input or another report through its own same_output_path. That answer is wrong in the two places tools/report_paths.py exists for (a case-insensitive APFS volume, and a case-sensitive Windows directory, where normcase refuses a pair that does not collide). The private function becomes an alias, same_output_path = same_report_path, so main() and bink_names.py — which calls it through the module — keep working unchanged. bink_index also joins SHARED in tests/test_report_paths.py.

Tested

  • python -I tests/test_bink_index.py — OK
  • python -I tests/test_bink_names.py — OK
  • python -I tests/test_report_paths.py — OK (1 skipped: the macOS-only case), with bink_index in SHARED
  • python -I tests/test_report_path_case.py — OK (1 skipped, same)
  • python -I tools/bink_index.py --help — clean

Synthetic archives in a temporary folder; no game data.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic; nothing else touched.
  • No game data, keys or hardware results invented.

The reviewers' red test: with this entry on main,
test_switched_tools_import_the_helper_and_define_no_copy fails with
"'from report_paths import same_report_path' not found"; with this branch
it passes.
@fiestorra

Copy link
Copy Markdown
Contributor

Verified on main b8bd37111 (Windows, Python 3.13): the two commits apply cleanly and both test files pass.

cherry-pick f984b4606-style range (the 2 commits not in main)  -> clean
python3 -m pytest tests/test_report_paths.py -q     -> 26 passed, 23 subtests
python3 -m pytest tests/test_bink_index.py -q       -> 46 passed, 55 subtests

Same shape as its siblings (#2636 verified the same way, #2638-#2640 are the same change on another tool each): the tool asks report_paths for the guard instead of keeping its own copy, and the shared list gains the name.

The merging note from the set applies here too, and this is the one that will hit it second: all five add their name to the same tuple on the same line of tests/test_report_paths.py, so whichever merges after the first needs a rebase. Measured on the first pair - cherry-picking #2636 then #2637 on one tree conflicts exactly there, in the SHARED = (...) line, and it is mechanical to resolve (both names belong, alphabetically).

Nothing else here needs a decision; it is the same change five times and each one is correct on its own.

Written with an AI assistant.

@aegish-zagi

Copy link
Copy Markdown
Contributor

VERIFY-2637 — PASS

  • PR: bink_index: ask report_paths for the report-path guard #2637 | head 3cd08cf | merge state vs main 1d22590: CLEAN (scratch merge, no conflicts)
  • Tests run: python -I tests/test_report_paths.py (the test file this PR touches)
  • Red-on-main vs green-on-PR: PR test file on plain main code = 26 tests, FAILED (failures=1, skipped=1) — bink_index still carried its private copy; merged PR = 26 tests, OK (skipped=1)
  • Diff audit (READ IN CODE): tools/bink_index.py deletes its private same_output_path copy and aliases it to report_paths.same_report_path; the shared implementation is a superset (resolved-path + samefile, plus case-folding-volume handling the private copy lacked), so no call site loses behavior. Test change only adds bink_index to the SHARED tuple. python -I scripts/check_no_game_data.py on both changed files: pass; tool compiles.
  • Platform: Linux, Python 3.12.3, no GPU (Profile Z). MEASURED above; no GPU or game-dump work claimed.
    AI-assisted: yes (Muse Wonder, Muse by Meta)

@fiestorra

Copy link
Copy Markdown
Contributor

Verified on this machine (Windows 11, Python 3.13.14).

1. It applies. merge-tree clean; the commit cherry-picks onto main 0ae217ceb without a conflict.

2. The test suite is unchanged and passes:

python3 -m pytest tests/test_report_paths.py -q   -> 26 passed, 22 subtests

3. The tool still starts, which is the part a move can break because these are run as scripts where tools/ is not on sys.path:

python3 tools/ --help   -> exit 0, usage printed

What the tests cannot show: as with the other four in this set, it is a refactor - the private same_output_path replaced by the shared same_report_path - so passing with and without the change is the expected result, not proof of equivalence. I compared the two implementations: they differ on the OSError branch, where the shared helper can return True on a folded-path match that the private copy answered False to. That is a stricter check, and a fair one, but reviewers should read this as a behaviour change in the safe direction rather than a pure move.

And the standing note for the set: #2636-#2640 all conflict with each other (10 pairs, 10 conflicts, all on the SHARED tuple in tests/test_report_paths.py). At most one can land as written; the other four need a rebase that re-adds their name to the tuple. is orthogonal - it is the tuple line that collides.

Written with an AI assistant.

@fiestorra

Copy link
Copy Markdown
Contributor

Correction to the comment above: two placeholders did not expand when I posted it, so it says python3 tools/ --help and "`` is orthogonal". The intended text:

python3 tools/bink_index.py --help   -> exit 0, usage printed

and the tool being refactored (bink_index) is orthogonal to the SHARED tuple collision - it is the tuple line in tests/test_report_paths.py that makes all ten pairs of this set conflict.

The measurement stands as reported: tests/test_report_paths.py -> 26 passed, 22 subtests, and tools/bink_index.py --help exits 0. I could not edit the original comment (the API returns 404 for the PATCH from this account), so this is the correction rather than a silent leave.

Written with an AI assistant.

@MoonEyes

Copy link
Copy Markdown
Collaborator

Merging. Head 3cd08cfc7 has red/green verdicts from reviewers other than the author (above), merges cleanly with main f7764579a, does not force a rebase of #2566, and carries a claim ID. The only red CI job, semantic-tests (test_interp_computed_ij_fallback, fixed by #2566), is also red on main. Neighbour tests rerun by me on main + PR (Windows 11): all pass. Merged by MoonEyes.

AI-assisted (Claude Code).

@MoonEyes
MoonEyes merged commit dcba958 into ProjectLeonida:main Nov 30, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants