OLD-7263: restore old upstream PR 7263 - gamedata_blobs: Region 1's lowest cell offset decides where Region 3 starts #714
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!714
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/714/head"
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?
@aslan2142 on GitHub · 2026-11-24 12:45 UTC · original
aslan2142:gamedata-spatial-grid-region3→main· +85 −2 · 2 files · 1 commits · merged 2026-11-25 22:24 UTCClaimed in the coordination issue as: OLD-7263 #14
Restoration of my original pull request, old upstream PR 7263 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at21625bca8c; the commit applied without conflicts and the code is unchanged; only the commit message changed, citing the old finding's number as plain text.What and why
parse_spatial_grid_blobfound Region 3 as the trailing run of 4-byte-aligned words below the blob size.docs/gamedata.mdlocates Region 3 as the trailing run matchingmin(cell_offs). The run is now only the search range. Region 3 starts at the lowest start in it where Region 1 (which ends at the lowest Region 3 word) has that start as its lowest cell offset.Tested
Linux, Python 3.14, CPU only, synthetic blobs built in the test (no game files):
python -I tests/test_gamedata_blobs.py: on main with only this PR's test changes, 4 of 10 tests error (three colliding-word subtests and the multi-word Region 2 tail). On this branch, all 10 pass.python -m compileall -q tools tests,git diff --checkandpython -I scripts/check_no_game_data.pyon the changed files: clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
parse_spatial_grid_blob found Region 3 as the trailing run of 4-byte-aligned words below the blob size. When the last word(s) of Region 2 happen to be such a value, the run took them in, Region 3 started too early and a valid grid was rejected ("Region 3 start ... does not match lowest cell offset ..." or "Region 3 offset leaves Region 2 bounds"). docs/gamedata.md (the 0x23c000 row) locates Region 3 as the trailing run matching min(cell_offs). The run is now only the search range: Region 3 starts at the lowest start in it where Region 1 (which ends at the lowest Region 3 word) has that start as its lowest cell offset. Blobs main accepted parse the same; with no agreeing start the old checks still reject the blob. Tests: cynbun's repro with several colliding last words, a run of three colliding Region 2 words, truncated blobs, and a skipped first Region 3 word that has no consistent split. The colliding cases fail on main. Finding by cynbun in old upstream 7049 (old numbers link nowhere now). Co-Authored-By: Claude Opus 5.5 <[email protected]>@aslan2142 on GitHub · 2026-11-25 22:24 UTC · original
Merged:
gamedata_blobs: Region 1's lowest cell offset decides where Region 3 starts.main, and no review point is open.tests/test_gamedata_blobs.pypasses onmain+ this head (Linux, CPython 3.14).maineaa3792fd+15f30f0a9: the semantic suite passes (492 files, 6,315 tests, 0 files failed);test_gamedata_blobspass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).