tooling: inventory bounded AWC music bank metadata #577
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/583"
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 legacy-code-archaeologist on 2026-11-22T14:07:41Z.
Change
tools/awc_metadata.pynow also reads streamed (music) AWC banks, which it rejected before with "Streamed AWC banks are unsupported". It follows the music header layout in the public reader already cited for #305 (vgmstreamawc.c@24ffd6ce). For a bank whose first stream ID is 0, the command reports these fields from the ID-0 stream's music header tag (0x48):block_chunk,It reads only the bank header, the stream table, the ID-0 stream's tag descriptors and the music header. It never reads data tags or the other streams' tags.
Sound-effect banks keep the same JSON, results and error precedence:
read_formatsis unchanged apart from moving the header checks into a shared helper.Some rules are stricter than the public reader:
0xff000001and0xff020001are accepted, the same two as for sound-effect banks.These rules are documented, and each has a negative control. Should any of them be relaxed once someone measures a real music bank? The public reader also accepts flag bits
0x00010000,0x00040000and0x00080000.No overlapping open issue or PR was found (searched "awc").
Verification
At
2b8bdc6(rebased onbbebcad) on Windows 11 (build 26100.9168), Python 3.12.10, MSVC 19.52.37029:out\pe-env\Scripts\python.exe -B tests\awc_metadata_check.py -v: 11 tests OK. The 4 existing tests are unchanged. The 7 new tests cover:read_formatsstill rejecting music banks;read_bankon the sound-effect fixture;0xff000001, and codec ID 0 on every channel;ctest --preset dev --no-tests=error -R '^audio_awc_metadata$' -V: passed.tests/docs_links_check.pyandtests/bidi_controls_check.py: passed.ctest --preset dev -j 4on the same change before the rebase (based896867): 272 tests. Everything passed except capability skips (exit 77) and the two timeouts below.pixel_aot_hardwareandpixel_aot_predicate_rounding_hardware, both at the 60 s limit.d896867before this change, together withpixel_aot_blend_scalar_hardware.Evidence and follow-up
The fixtures are synthetic bytes built in the test from the documented layout (MIT, this repository). No game files are involved. No local music bank was inspected, so how the rules fit real banks is still unverified. The meaning of
block_chunkbeyond the reader'sfull_block_sizeis unverified too.docs/experiments.md#awc-sound-effect-format-metadata.ctest --preset dev --no-tests=error -R '^audio_awc_metadata$' -VChecklist
AI-assisted: written with Claude Code (design reviewed by independent read-only agents, precommit review by a fresh agent); checked and submitted by the account owner.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by romn4rch on 2026-11-22T16:05:44Z.
Review: COMMENTED
Independent check of
2b8bdc6, pure-Python part only.Environment: Linux x64, Python 3.12.16.
tools/awc_metadata.pyandtests/awc_metadata_check.pyat2b8bdc6,tools/paged_resource.pyfrommain(3ffc193). No Windows, CMake or CTest run.Command:
python -B tests/awc_metadata_check.py -v2b8bdc62b8bdc6main(4)maintest_music_commandfailed and 5 music/read_banktests erroredThe new tests fail without the change and pass with it, so they detect the new behavior rather than passing vacuously.
Reference lines: I checked every vgmstream range cited in
docs/experiments.mdat24ffd6ce:awc.c92, 195, 328–346, 349–377, 379, 384–387, 414–422, 434–486, 475, 480–481, 508–534, 564–595 and 597–600, plusAWC_MAX_MUSIC_CHANNELS 32atawc_streamfile.hline 6. Each one says what the text attributes to it, including the stricter and more lenient rules listed.Code read:
_musicbounds each ID-0 tag againstheader_size..sizeand rejects overlaps before it reads the0x48header. It reads only12 + 16 * channelsbytes and never reads0x55data.read_formatsdiffers frommainonly by the shared_headerhelper. A minor non-blocking point: for a sound-effect bank,read_bankparses the header twice (_header, thenread_formats). That is harmless.Not verified here: the Windows CTest registration of
audio_awc_metadata, real music banks (none available, as the PR also states) and the meaning ofblock_chunk.Verdict: no blocking findings for the Python behavior at
2b8bdc6.AI-assisted (Microsoft Copilot); posted with the account owner's approval.
Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-22T16:20:18Z.
Thanks for the independent check, @romanv9, and for running the new tests against
mainas a control.On the double header parse: it is intentional.
read_bankreads the 16-byte header and the stream table once to choose the layout. For a sound-effect bank it then callsread_formatsunchanged, so that function keeps its exact error precedence and messages (the four existing tests are untouched). Both reads stay within the metadata range.On the Windows side:
audio_awc_metadatais the existing CTest registration and needs no CMake change.ctest --preset dev --no-tests=error -R '^audio_awc_metadata$' -Vpassed at2b8bdc6on Windows 11 26100.9168. The branch still merges cleanly withmainat2f1f832.AI-assisted (Claude Code).