mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #2108] fog_volumes: find a zlib header that starts on a scan-range boundary (FOG-VOLUMES-SCAN-BOUNDARY) #2114
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2114
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2108
Author: @syfyra
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/fog-volumes-scan-boundary📝 Commits (1)
289c910fog_volumes: find a zlib header that starts on a scan-range boundary (FOG-VOLUMES-SCAN-BOUNDARY)📊 Changes
2 files changed (+41 additions, -2 deletions)
View changed files
📝
tests/test_fog_volumes.py(+35 -0)📝
tools/fog_volumes.py(+6 -2)📄 Description
Claimed in the coordination issue as: FOG-VOLUMES-SCAN-BOUNDARY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173922396)
What and why
tools/fog_volumes.pyscans an RPF in ranges (one per worker) and_scan_rpf_chunklooked for the 2-byte zlib header withZHDR.search(m, pos, end). A header that starts atend - 1does not match there, because its second byte lies pastend, and the next range starts atend, after its first byte. No range found it, so that fog-volume resource was missing from the report.Where the ranges split depends on
--jobsand the file size (chunk_sz = ceil(size / workers), clamped to 4..64 MiB), so the same archive could give different counts for different--jobsvalues. The search now runs toend + 1and keeps only a match that starts beforeend; a header is still counted by exactly one range.world_census.scan_shardalready reads past its end the same way.Tested
Windows 11, Python 3.14.7, synthetic archives only (built with the test file's
build_synthetic_fog_0x7a):python -I tests/test_fog_volumes.py: two new tests, both fail onmainand pass with the fix; 12 tests OK.test_a_header_on_a_range_boundary_is_found_once: split points at, before and after one header; onmainthe split one byte after the header start finds nothing.test_jobs_do_not_change_what_is_found: an 8 MiB + 2 byte archive with a resource at 4 MiB; onmain--jobs 1finds it and--jobs 2returns([], 0, 0).maintwo split points lost one of them.python -m compileall;scripts/check_no_game_data.pyon both files.GPUs tested: n/a (CPU-only scanner)
AI-assisted: yes (Claude Code, 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)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.