fog_volumes: find a zlib header that starts on a scan-range boundary (carry of #2108) #3091
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!3091
Loading…
Reference in a new issue
No description provided.
Delete branch "carry/2108"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: FOG-VOLUMES-SCAN-BOUNDARY (the original author's item ID, claimed in https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7173922396)
What and why
Carry of #2108 (syfyra), unchanged since 2026-11-25; branch = main + the author's head (commit kept) + conflict resolution. I added no commit of my own: the reviews on #2108 only ask for a rebase and a CI run, and raise no code defect.
tools/fog_volumes.pyscans an RPF in ranges, one per worker, and_scan_rpf_chunksearched for the 2-byte zlib header only up to the range end. A header starting atend - 1was found by no range, so that resource was missing from the report for some--jobsvalues. The search now runs toend + 1and keeps only a match that starts beforeend, so each header is counted by exactly one range.Conflict resolution:
tools/fog_volumes.pymerged cleanly.tests/test_fog_volumes.pyconflicted because main appended three report-writing tests at the end of the file and the PR appended two boundary tests at the same place; I kept all of them.Tested
Windows 11, no GPU, no game files, on main a917c54d6 plus this branch:
python -I tests/test_fog_volumes.py: Ran 15 tests, OK.tools/fog_volumes.pyrestored to main's version, the same command gives Ran 15 tests, FAILED (failures=2):test_a_header_on_a_range_boundary_is_found_once(split=257) andtest_jobs_do_not_change_what_is_found(jobs=2). The file was restored afterwards.python -I scripts/check_no_game_data.py tools/fog_volumes.py tests/test_fog_volumes.py: clean.Not run: the full suite, CI.
GPUs tested: n/a (unit tests only)
AI-assisted: yes. Models: Claude Opus 5.5 in Claude Code (carry, conflict resolution, fixes, tests); separate read-only reviewer agent: Claude Opus 5.5.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)Supersedes #2108 once merged; the original stays open until a maintainer decides.
🤖 Generated with Claude Code
Ran natively on Windows 11, Python 3.13, head
9089dae4emerged into currentmain(23a51c494), no conflicts.py -3.13 -I tests/test_fog_volumes.py: 15 tests OK. With main'stools/fog_volumes.pythe same two subtests fail as in the body (split=257, jobs=2), so nothing new there.The tests check one resource and five split points. I wanted every split point, more than one resource, and more than two ranges, so I wrote throwaway RPF-like buffers (
9FPR+ padding + the test file'sbuild_synthetic_fog_0x7aoutput, zlib-compressed) and compared_scan_rpf_chunkon the whole buffer with the sum over the ranges:0x78as the very last byteOn main the misses are exactly split = header + 1 for each resource (for example split 17 loses the resource at 16, split 243 loses the one at 242), which matches the bug described. With the PR no split point changes the offsets or the complete/incomplete counts, the stream in between is never counted, and a
0x78in the last byte of the file (whereend + 1is capped at the file size) does not break anything.Not checked: real archives (no game files used), continuation pages joined by
world_census.assembleacross a boundary,--jobsabove 2.GPUs tested: n/a (CPU-only tests).
AI-assisted: yes (Claude Code).
Merging. Head
9089dae4emerges cleanly withmainbf7886746and does not force a rebase of #2566. Independent check on head 9089dae4e: Kal0s-design's native run on Windows 11 merged into main (on main every split at header + 1 loses the resource just before it, as the bug describes; with this head none is lost), comment 7346101754; syfyra's commit from #2108 is kept; CI green incl. no-game-data; no open review or question. Merged by MoonEyes.AI-assisted (Claude Code).