bink_names: reject duplicate stream locations before assigning names #2452
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2452"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T10:34:45Z.
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_locationspython -I tests/test_bink_index.pygit diff --checkpassed.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
Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T15:01:07Z.
Review: COMMENTED
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.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T06:36:16Z.
#2452 | head
921212bc71(merged cleanly with main6dfca6428) |python -I tests/test_bink_names.py| red on main:-k test_duplicate_stream_locations_are_not_named_twiceFAILED (failures=1:0 != 1) | green on PR+main: Ran 37 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yesDiff reviewed across both touched files (
load_streamsnormalizes slashes, sorts by(source, offset), and rejects adjacent duplicate(source, offset)entries before writing--out;git merge origin/mainat6dfca6428applies cleanly, including#1792's Windows error-path fix so all 37/37 tests pass on Windows). Also verified on mergedPR+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, andscripts/check_no_game_data.py(clean).Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:43:28Z.
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 main8b318bd).Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
7daa4a4a5in GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)