glb_skinning: avoid copying padded BIN data for every accessor #1754
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!1754
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/glb-skinning-padded-buffer-copies"
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: GLB-SKINNING-PADDED-BUFFER-COPIES
What and why
The analyzer copied each chunk before determining its purpose and sliced the BIN bytes down to the declared buffer length on each accessor read. With 1–3 bytes of alignment padding, each slice copied the entire buffer. Analysis now reads from a view of the original immutable bytes and enforces the existing declared-length checks. The public
parse_glbhelper still returns BIN bytes.Tested
On the integration checkout a synthetic three-vertex model with a 16 MiB padded BIN and a 16 MiB extension chunk produced identical reports before and after. Starting tracemalloc after constructing the input, peak traced allocation during analysis fell from 33,562,127 to 8,532 bytes (Python 3.14.7). The regression uses smaller chunks and also checks that a buffer view cannot read into BIN padding.
python -I tests/test_glb_skinning.pypassed all 28 tests on this branch (Windows, Python 3.14.7).git diff --checkand the repository game-data scan of all changed paths passed.bcaa13dapassed 6,287 semantic tests across 488 files.GPUs tested: N/A (CPU-only asset tooling).
AI-assisted: Yes.
Checklist
#1754 | head 0307e4c0fbd7e59e15b35063874011c80f78c5d7 (merged cleanly with main 24549bdb1) |
python -I tests/test_glb_skinning.py| red on main:FAILED (failures=1)(AssertionError: 8401635 not less than 4194304 : inspection allocated a full unused payload) | green on PR+main:34 tests OK| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_parse_chunks,parse_glb,_Reader.read, andanalyze_glbintools/glb_skinning.py(using amemoryviewover the BIN chunk during analysis and unpacking directly fromself.bin_chunkafter view/accessor bounds exclude BIN alignment padding, while keepingparse_glbreturningbytesfor external callers). Also verified clean merge (0conflicts) and combined execution with #1753 (36 tests OK), plustests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Red/green:
pytest tests/test_glb_skinning.pyfails on main (1 failed, 27 passed, 23 subtests passed) and passes on head 0307e4c0fbd7 merged with main (28 passed, 23 subtests passed).Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)