Advance scene_records cursor by consumed deflate bytes only #232
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/235"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by alexander-src on 2026-11-21T18:54:52Z.
Change
Update
scene_records()intools/resource_inventory.pyto advance the scan cursor bystored - len(stream.unused_data)instead of the full declaredstoredspan.When a record's declared
storedandrepeatedlengths exceed the raw-DEFLATE stream length,stream.eofis still true and any following record sits insidestream.unused_data. Advancing bystoredskipped that next record, matching the issue fixed intools/extract_shaders.pyin #192.trailing_byte_countsstill recordslen(stream.unused_data)as before.Add regression coverage in
tests/dxcontainer_part_offsets_check.pyfor both normal trailing padding (tail=b"pad") and oversized spans whoseunused_dataholds a following valid shader record.Verification
Commit
a9382b8on Linux (Python 3.14):python3 -B tests/dxcontainer_part_offsets_check.py -v: ran 7 tests, all passed.main:tools/resource_inventory.py:test_scene_records_advances_cursor_by_consumed_deflate_bytesfailed on both oversized-span subtests (AssertionError: 1 != 2).python3 -B tests/script_state_check.py,bcpack_check.py,resource_ranges_check.py,layout_chunks_check.py,dependency_paths_check.py,intake/paths_check.py,shader_probe_check.py,rdna2_tools_check.py, andgpu_report_format_check.py: all passed (rdna2_tools_check.py: 17 ran, 1 skipped without localLLVM_LIB).tests/scene_records_check.pywithroot_probe.exelocally because this environment is Linux without the Windows build; verified the samescene_records()fixture assertions locally with synthetic containers andvalidator=None(passed).Evidence and follow-up
All new test inputs are synthetic 32-byte minimal DXContainer fixtures generated in
tests/dxcontainer_part_offsets_check.py. No game assets or external files are used.Checklist
AI-assisted: yes.