Fix duplicate archive index candidates at read boundaries #2

Open
github-bot wants to merge 1 commit from github-bot/gh-2 into main AGit
Owner

@⁠yefan911 on GitHub · 2026-11-26 18:09 UTC · original
yefan911:fix/index-scan-boundaries → main · +96 −2 · 4 files · 1 commits · open

Both index scanners retain eight bytes between reads. That carries complete signatures into the next iteration, so an ADAT or KB2 signature near a read boundary is reported twice. For example, 16-byte reads with signatures at offsets 12 and 24 return [12, 12, 24, 24]; limit=2 returns [12, 12] and misses the second distinct candidate.

Keep only the incomplete signature suffix: three bytes for ADAT and two for KB2. This preserves signatures spanning reads without emitting complete matches again. The change leaves alignment filtering and range semantics intact.

Added six synthetic regression tests covering duplicate offsets, distinct-candidate limits, signatures split across reads as small as one byte, alignment filtering, empty input, and ADAT start/stop bounds. The new regressions fail against the original scanners.

Validation on Windows with Python:

  • python tests/test_index_scanning.py — 6 tests pass.
  • python tests/test_extraction_tools.py — PASS.
  • python tests/test_robustness.py --rounds 200 — PASS (231 generated inputs).
  • git diff --check — clean.

All fixtures are generated synthetic bytes. No GTA VI archives, executables, assets, dumps, or private SDK material were accessed or included. This verifies scanner behavior only; no game-runtime or performance claim is made.

**@⁠yefan911** on GitHub · 2026-11-26 18:09 UTC · [original](https://github.com/lynxnathan/rage-tools-vi/pull/2) `yefan911:fix/index-scan-boundaries` → `main` · +96 −2 · 4 files · 1 commits · open Both index scanners retain eight bytes between reads. That carries complete signatures into the next iteration, so an ADAT or KB2 signature near a read boundary is reported twice. For example, 16-byte reads with signatures at offsets 12 and 24 return `[12, 12, 24, 24]`; `limit=2` returns `[12, 12]` and misses the second distinct candidate. Keep only the incomplete signature suffix: three bytes for ADAT and two for KB2. This preserves signatures spanning reads without emitting complete matches again. The change leaves alignment filtering and range semantics intact. Added six synthetic regression tests covering duplicate offsets, distinct-candidate limits, signatures split across reads as small as one byte, alignment filtering, empty input, and ADAT start/stop bounds. The new regressions fail against the original scanners. Validation on Windows with Python: - `python tests/test_index_scanning.py` — 6 tests pass. - `python tests/test_extraction_tools.py` — PASS. - `python tests/test_robustness.py --rounds 200` — PASS (231 generated inputs). - `git diff --check` — clean. All fixtures are generated synthetic bytes. No GTA VI archives, executables, assets, dumps, or private SDK material were accessed or included. This verifies scanner behavior only; no game-runtime or performance claim is made.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:53:12 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2/head:github-bot/gh-2'
git switch 'github-bot/gh-2'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2'
git switch 'github-bot/gh-2'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2'
git switch 'github-bot/gh-2'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2'
git switch 'main'
git merge --squash 'github-bot/gh-2'
git switch 'main'
git merge --ff-only 'github-bot/gh-2'
git switch 'main'
git merge 'github-bot/gh-2'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.