bink_names: reject duplicate stream locations before assigning names #2452

Merged
leonida/mandy
kirigayakazima merged 1 commit from codex/bink-names-duplicate-stream-locations into main 2026-11-28 19:43:31 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-27 10:34:45 +00:00

Claimed in the coordination issue as: BINK-NAMES-DUPLICATE-STREAM-LOCATIONS

What and why

Two index rows for one source and byte offset could assign separate names to the same physical movie. Check adjacent sorted, normalized stream locations and reject duplicates before publishing output. The regression covers a repeated offset across distinct sources (valid), slash variants within one source (duplicate) and preservation of a previous report.

Tested

Windows, Python 3.14.7. The regression reproduced on the parent and passed with the change.

  • python -I tests/test_bink_names.py -k duplicate_stream_locations
  • python -I tests/test_bink_index.py
  • Changed-path no-game-data scan and git diff --check passed.
  • Full Windows Bink naming suite has one pre-existing failure, test_unreadable_mount_directory_preserves_the_report, due to the escaped separators in the rendered PermissionError. Reproduced on the unmodified base.

The integrated checkout passed 6,374 semantic tests across 500 files. CI's macOS job failed in the calibrated-texture replacement test, as it did on the unchanged main baseline.

GPUs tested: N/A (CPU-only synthetic tests).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.
Claimed in the coordination issue as: [BINK-NAMES-DUPLICATE-STREAM-LOCATIONS](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215934316) ### What and why Two index rows for one source and byte offset could assign separate names to the same physical movie. Check adjacent sorted, normalized stream locations and reject duplicates before publishing output. The regression covers a repeated offset across distinct sources (valid), slash variants within one source (duplicate) and preservation of a previous report. ### Tested Windows, Python 3.14.7. The regression reproduced on the parent and passed with the change. - `python -I tests/test_bink_names.py -k duplicate_stream_locations` - `python -I tests/test_bink_index.py` - Changed-path no-game-data scan and `git diff --check` passed. - Full Windows Bink naming suite has one pre-existing failure, `test_unreadable_mount_directory_preserves_the_report`, due to the escaped separators in the rendered PermissionError. Reproduced on the unmodified base. The integrated checkout passed 6,374 semantic tests across 500 files. CI's macOS job failed in the calibrated-texture replacement test, as it did on the [unchanged main baseline](https://github.com/ubiquitarianism/leonida/actions/runs/45977772928/job/140433726198). GPUs tested: N/A (CPU-only synthetic tests). AI-assisted: Yes. ### Checklist - [x] Based on current main and merges cleanly with the tested base. - [x] One topic. - [x] No game data, keys or decryption. - Translator contract table: N/A.
MSedgeMC reviewed 2026-11-27 15:01:07 +00:00
MSedgeMC left a comment
No description provided.
Verified on the PR branch: python3 -m unittest tests.test_bink_names -v -> 37 tests OK, including the new duplicate-stream-location case (rc=1, output file untouched). Not approving yet: the branch is 606 commits behind current main, so a merge would bring in unrelated history. Please rebase and re-run the suite.
zmasi commented 2026-11-28 06:36:16 +00:00

#2452 | head 921212bc71c0cf1ad9f28ec9633fbf59e84318af (merged cleanly with main 6dfca6428) | python -I tests/test_bink_names.py | red on main: -k test_duplicate_stream_locations_are_not_named_twice FAILED (failures=1: 0 != 1) | green on PR+main: Ran 37 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed across both touched files (load_streams normalizes slashes, sorts by (source, offset), and rejects adjacent duplicate (source, offset) entries before writing --out; git merge origin/main at 6dfca6428 applies cleanly, including #1792's Windows error-path fix so all 37/37 tests pass on Windows). Also verified on merged PR+main: test_bink_index.py (34/34 OK), test_runner_calls_all_tests.py (3/3 OK), test_text_write_line_endings.py (3/3 OK), compileall, git diff --check, and scripts/check_no_game_data.py (clean).

#2452 | head 921212bc71c0cf1ad9f28ec9633fbf59e84318af (merged cleanly with main 6dfca6428) | `python -I tests/test_bink_names.py` | red on main: `-k test_duplicate_stream_locations_are_not_named_twice` FAILED (failures=1: `0 != 1`) | green on PR+main: Ran 37 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed across both touched files (`load_streams` normalizes slashes, sorts by `(source, offset)`, and rejects adjacent duplicate `(source, offset)` entries before writing `--out`; `git merge origin/main` at `6dfca6428` applies cleanly, including `#1792`'s Windows error-path fix so all 37/37 tests pass on Windows). Also verified on merged `PR+main`: `test_bink_index.py` (34/34 OK), `test_runner_calls_all_tests.py` (3/3 OK), `test_text_write_line_endings.py` (3/3 OK), `compileall`, `git diff --check`, and `scripts/check_no_game_data.py` (clean).
MoonEyes commented 2026-11-28 19:43:28 +00:00

Red/green: tests/test_bink_names.py fails 1 assertion on main (duplicate stream locations get two names) and passes with the PR (cloud run on main 7daa4a4, re-run on Windows against main 8b318bd).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: tests/test_bink_names.py fails 1 assertion on main (duplicate stream locations get two names) and passes with the PR (cloud run on main 7daa4a4, re-run on Windows against main 8b318bd). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.