OLD-10040: bink_index: validate frame offsets within each stored stream #1022

Merged
klikso merged 1 commit from upstream-pr/1022 into main 2026-11-28 21:52:46 +00:00
klikso commented 2026-11-24 17:00:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by klikso on 2026-11-24T17:00:40Z.


Claimed in the coordination issue as: OLD-10040

What and why

Carries forward old-pr/10040 (draft #305) rebased onto current main:

  • Validates frame offsets within each stored Bink video stream in tools/bink_index.py.
  • Updates documentation in docs/movies.md.
  • Adds regression unit tests in tests/test_bink_index.py.

Original commit preserved: Tiller431 <[email protected]>.

Tested

  • python -I tests/test_bink_index.py: 41/41 passed
  • python -I scripts/check_no_game_data.py tools/bink_index.py tests/test_bink_index.py docs/movies.md: passed (no game data)
  • python -I tests/test_text_write_line_endings.py: passed
  • python -m compileall -q make_game.py tools tests: clean

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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 rule).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476680585 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1022). Originally posted by [klikso](https://github.com/klikso) on 2026-11-24T17:00:40Z. --- Claimed in the coordination issue as: OLD-10040 ### What and why Carries forward `old-pr/10040` (draft #305) rebased onto current `main`: - Validates frame offsets within each stored Bink video stream in `tools/bink_index.py`. - Updates documentation in `docs/movies.md`. - Adds regression unit tests in `tests/test_bink_index.py`. Original commit preserved: `Tiller431 <22901311+[email protected]>`. ### Tested - `python -I tests/test_bink_index.py`: 41/41 passed - `python -I scripts/check_no_game_data.py tools/bink_index.py tests/test_bink_index.py docs/movies.md`: passed (no game data) - `python -I tests/test_text_write_line_endings.py`: passed - `python -m compileall -q make_game.py tools tests`: clean GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [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 rule).
PierreEbele commented 2026-11-25 07:01:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T07:01:09Z.


Reviewed 77df8717:
ran tests/test_bink_index.py in the sandbox (41 OK on PR; 34 OK on main, 46 errors with PR's tests on main),
test_bink_names/test_report_source_collision/test_csv_line_endings OK on both trees, doc tests OK, and
check_no_game_data.py clean. frame_index_error() matches the documented canonical Bink 2 layout and exits 2
before writing on bad tables or unsupported revisions. Non-blocking note: parse_header()'s pre-existing 0x2C
fallback for i/j/k/n is untracked; if strictness is ever wanted, refuse fallback layouts in a follow-up.
AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155399308 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1022#issuecomment-7155399308). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T07:01:09Z. --- Reviewed 77df8717: ran `tests/test_bink_index.py` in the sandbox (41 OK on PR; 34 OK on main, 46 errors with PR's tests on main), `test_bink_names`/`test_report_source_collision`/`test_csv_line_endings` OK on both trees, doc tests OK, and `check_no_game_data.py` clean. `frame_index_error()` matches the documented canonical Bink 2 layout and exits 2 before writing on bad tables or unsupported revisions. Non-blocking note: `parse_header()`'s pre-existing `0x2C` fallback for `i/j/k/n` is untracked; if strictness is ever wanted, refuse fallback layouts in a follow-up. AI-assisted review. **Recommendation:** Merge
OreoFR commented 2026-11-28 21:46:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:46:19Z.


Verified by OreoFR

  • Base: main 5cb45921e + PR head 77df8717a
  • Test: python -I tests/test_bink_index.py
  • Red on main: 46 ERROR (AttributeError frame_index_error): frame_index_error is the validator the PR adds, so the missing function itself (the whole test class calls it in setUp)
  • Green with the PR: 46 OK
  • Verdict: READY
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246259587 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1022#issuecomment-7246259587). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:46:19Z. --- **Verified by OreoFR** - Base: main `5cb45921e` + PR head `77df8717a` - Test: `python -I tests/test_bink_index.py` - Red on main: 46 ERROR (AttributeError frame_index_error): frame_index_error is the validator the PR adds, so the missing function itself (the whole test class calls it in setUp) - Green with the PR: 46 OK - Verdict: READY - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
MoonEyes commented 2026-11-28 21:52:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T21:52:48Z.


Merged after OreoFR's red/green check (check) (RTX 4070 Laptop, driver 621.40, Windows 11) and a local re-check here. Merged after local re-verification: this PR merged onto main e4933c33d without conflict, and its test file(s) (tests/test_bink_index.py) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246339563 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1022#issuecomment-7246339563). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T21:52:48Z. --- Merged after **OreoFR**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/1022#issuecomment-7246259587)) (RTX 4070 Laptop, driver 621.40, Windows 11) and a local re-check here. Merged after local re-verification: this PR merged onto `main` e4933c33d without conflict, and its test file(s) (`tests/test_bink_index.py`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1022
No description provided.