audio_config: scan individual configuration files in bounded chunks #2448
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2448"
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 ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T10:34:11Z.
Claimed in the coordination issue as: AUDIO-CONFIG-STREAM-SINGLE-BLOBS
What and why
The ordinary scan loaded each complete config blob and examined it byte by byte. Reuse the existing incremental marker scanner for each file, resetting offsets at file boundaries. Records spanning read boundaries are recovered. In separate processes, scanning an 8 MiB zero-filled synthetic file gave zero records in both cases and reduced the traced allocation peak from 8,520,807 to 2,230,022 bytes.
Tested
Windows, Python 3.14.7. The regression reproduced on the parent and passed with the change.
python -I tests/test_audio_config.pygit diff --checkpassed.The integrated checkout passed 6,374 semantic tests across 500 files. An extra 500 randomized synthetic cases matched the in-memory scanner. CI's macOS job failed in the calibrated-texture replacement test, as it did on the unchanged main baseline.
GPUs tested: N/A (CPU-only synthetic tests).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T15:05:26Z.
Review: COMMENTED
Verified on the PR branch: python3 -m unittest tests.test_audio_config -v -> 23 tests OK, including the new bounded-chunk scanning cases. Not approving yet: the branch is 606 commits behind current main, so a rebase is needed before reviewing the final diff.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T09:46:36Z.
#2448 | head
fc4f6311a4(merged cleanly with main3ca0707dd) |python -I tests/test_audio_config.py| red on main:FAILED (failures=2)(AssertionError: unbounded read: -1intest_individual_files_use_bounded_readsand0 != 1) | green on PR+main:23 tests OK(-k test_individual_files_use_bounded_reads:1 test OK) | Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_file_chunksandcollectintools/audio_config.py(streaming individual.binfiles throughscan_stream(_file_chunks(path))inJOIN_BLOCK_BYTESchunks instead of reading full blobs into memory, resolving the earlier staleness hold against currentmain3ca0707dd). Also passedtests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.pyon the merged tree.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:13:59Z.
Red/green: classified READY by oreo-lot3 (red on main
b1619e0a3, green on head merged with main); headfc4f6311a4unchanged since 2026-11-27, before that run.Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)