[PR #305] [CLOSED] bink_index: validate frame offsets within each stored stream #357

Closed
opened 2026-11-26 20:17:37 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/305
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/10040


📝 Commits (1)

  • eb30560 bink_index: validate frame offsets within each stored stream

📊 Changes

3 files changed (+146 additions, -13 deletions)

View changed files

📝 docs/movies.md (+11 -3)
📝 tests/test_bink_index.py (+80 -0)
📝 tools/bink_index.py (+55 -10)

📄 Description

Carried over from old PR 10040 by Tiller431 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10040, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Tiller431: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Coordination claim

What and why

The movie indexer can inventory a stream from its header even when the frame table points outside that stream. Add --validate-frames to check the table before publishing a report. It checks the table size, masks the keyframe bit and requires strictly increasing frame starts inside the payload. Diagnostics identify the stream and the first failed check. Default CSV and JSON output stays compatible.

Tested

  • On Windows with Python 3.13, all 22 RPF archives matched the Xbox 1.0.2.1 manifest by size and SHA-256. Four contained indexed Bink 2 streams. All 683,552 frame offsets in 797 streams passed (787 revision n, 10 revision j). This measures table structure. No decoding was involved.
  • All 41 indexer tests and all 10 playback-tool tests passed. On the movie archive, default and validated runs also produced byte-identical CSV and JSON on stdout. The adjacent naming suite has one Windows path-format assertion failure, reproduced on the unmodified base.
  • Python compilation, the changed-file game-data check and git diff --check passed. The translator suite ran 6,046 tests in 459 files with SPIRV-Tools 2026.4. Two files failed, test_exec_computed and test_image_atomics_guard. All 49 failing subcase IDs matched independent runs on the unmodified base at d083a2c.

AI-assisted: yes (Codex).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/305 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/10040` --- ### 📝 Commits (1) - [`eb30560`](https://github.com/ubiquitarianism/leonida/commit/eb30560bf2eaca377a515681030500273561bb98) bink_index: validate frame offsets within each stored stream ### 📊 Changes **3 files changed** (+146 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `docs/movies.md` (+11 -3) 📝 `tests/test_bink_index.py` (+80 -0) 📝 `tools/bink_index.py` (+55 -10) </details> ### 📄 Description > Carried over from **old PR 10040** by `Tiller431` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10040`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Tiller431`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): [Coordination claim](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116913175) ### What and why The movie indexer can inventory a stream from its header even when the frame table points outside that stream. Add `--validate-frames` to check the table before publishing a report. It checks the table size, masks the keyframe bit and requires strictly increasing frame starts inside the payload. Diagnostics identify the stream and the first failed check. Default CSV and JSON output stays compatible. ### Tested - On Windows with Python 3.13, all 22 RPF archives matched the Xbox 1.0.2.1 manifest by size and SHA-256. Four contained indexed Bink 2 streams. All **683,552 frame offsets in 797 streams** passed (787 revision n, 10 revision j). This measures table structure. No decoding was involved. - All 41 indexer tests and all 10 playback-tool tests passed. On the movie archive, default and validated runs also produced byte-identical CSV and JSON on stdout. The adjacent naming suite has one Windows path-format assertion failure, reproduced on the unmodified base. - Python compilation, the changed-file game-data check and `git diff --check` passed. The translator suite ran 6,046 tests in 459 files with SPIRV-Tools 2026.4. Two files failed, `test_exec_computed` and `test_image_atomics_guard`. All 49 failing subcase IDs matched independent runs on the unmodified base at `d083a2c`. AI-assisted: yes (Codex). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:37 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#357
No description provided.