Repository navigation
awc_manifest: one row per stream and per music channel, named as awc_opus exports them (ASSET-446) - #5319
awc_manifest: one row per stream and per music channel, named as awc_opus exports them (ASSET-446)#5319leozinhoszg wants to merge 2 commits into
Conversation
|
On seven local Xbox 1.0.2.1 banks at The sample included a bank with 1,886 ordinary Opus streams and one repeated ID. Both files survived, and the second got the This checks compatibility on real banks. The sample contained no music-channel collision with another channel or an ordinary stream. The PR’s synthetic cases cover those paths. For the separate frequency question, the four-archive survey on #5279 already reports counts for 5,743 exportable music channels. Linux, CPython 3.12.3, CPU only. AI-assisted independent check. |
|
Reviewed Tests, same on both versions:
Mutation: with Read:
Nit, already on Not checked: how often real banks repeat an id. Extracting the banks from AI-assisted. |
|
**Tested a759c19 on Linux, Python 3.13 (CPU only, no GPU, no game files): pass Ran
Read AI-assisted (Claude Code). Generated by Claude Code** |
Kam471
left a comment
There was a problem hiding this comment.
Head a759c19.
Commands: python -I tests/test_awc_music_names.py -> 12 OK; python -I tests/test_awc_manifest.py -> 18 OK (2 skipped, symlink privilege); python -I tests/test_awc_opus.py -> 47 OK; python -I tests/test_awc_shorts.py -> 13 OK; python -I tests/test_awc_names.py -> 27 OK; git diff --check -> 0.
bank_stems now names channels after streams and earlier channels, and both export_bank and _bank_rows use it. Verdict: pass on the branch, but it depends on open #5279: the first commit d477528 is #5279's head. Merge #5279 first or expect that commit to travel with this PR.
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted independent CPU review at a759c19. Across six local streamed-music banks, all 17 channel IDs had the expected manifest multiplicity and all 17 stems matched files produced by the exporter. Those banks had no duplicate IDs. Synthetic stream/channel and three-channel collisions yielded 2/2 and 3/3 rows/files, versus 1/2 and 1/3 on d477528. A channel without packets retained its manifest row and produced no file.
…treams (ASSET-309) export_bank wrote each streamed-music channel as <id>.ogg outside export_stems. A second channel with the same id, or a channel sharing an Opus stream's id, overwrote that file while the counts still listed both. Music channels now take their stems from the same export_stems call as the ordinary streams, placed after every stream: the stream names stay the ones awc_manifest and awc_shorts report, and a repeated id gets the next ~N stem. Synthetic tests in tests/test_awc_music_names.py fail on main (4/4) and pass here.
…opus exports them awc_manifest let a streamed-music channel replace the row of an earlier stream or channel with the same id, so a bank with an Opus stream 0x456 and a music channel 0x456 listed one row while export_bank (after ItsNotRexed#5279) writes 00000456.ogg and 00000456~2.ogg; the stream vanished from the manifest. The naming now lives in awc_opus.bank_stems(), used by both export_bank and _bank_rows. A channel is written, and named, when it holds Opus packets (packet channels > 0, the same with and without packet collection), so the metadata-only manifest and the exporter agree. The manifest lists every row and notes "awc_opus exports it as <id>~N" on a repeated one; streamed_music_channel_count counts every channel. Stream stems are unchanged. Tests in tests/test_awc_music_names.py: 8 of the 12 fail on ItsNotRexed#5279's tools and pass here.
a759c19 to
facd8b6
Compare
|
Rebased onto
Windows 11, CPython 3.14.7, CPU only:
AI-assisted. |
|
Tested facd8b6 merged with main 561b65a on Linux (WSL2) Python 3.12.16: pass tests/test_awc_music_names.py (new): 12 run, 12 passed, 0 failed. Touched-module suites on the merged tree: test_awc_manifest 20, test_awc_opus 55, test_awc_markers 8, test_awc_names 30 (1 skipped), test_awc_shorts 13, test_audio_config 21, test_audio_stage_resume 12, test_audio_wav 40 (16 skipped), test_rsc8_audio 37, plus test_opus_tags, test_resource_hygiene, test_csv_line_endings, test_file_mode, test_pool_workers (2 skipped), test_report_paths: all OK, 0 failures. tests/test_docs_*.py (11 files): all OK. |
ASSET-446 (claim), the follow-up named in #5279.
Depends on: #5279. This branch is built on it, so its first commit (
d477528a) is #5279's; the change here is the second commit,a759c19d.Problem
tools/awc_manifest.py_bank_rowslet a streamed-music channel replace the row of an earlier stream or channel with the same id (the "as before" branch, kept from when rows were a dict keyed by id). With #5279's synthetic banks:export_bankwrites0x456+ music channel0x45600000456.ogg,00000456~2.ogg0x12300000123.ogg,~2.ogg,~3.oggFix
awc_opus.bank_stems(stream_ids, channels), and bothexport_bankand_bank_rowscall it, so the manifest and the exporter cannot drift.music_channelscomputes the same way with and withoutcollect_packets. The metadata-only manifest gets the same answer as the exporter.~N. Same behaviour as awc_opus: name streamed-music channels with export_stems, after the streams (ASSET-309) #5279, now spelled through the shared predicate.awc_opus exports it as <id>~N, worded like the existing stream note.streamed_music_channel_countnow counts every channel.export_stemsover the stream table), soawc_shorts.pyand the existing stream notes are unaffected.docs/audio.md(streamed-music section) and theawc_manifest.pydocstring describe the rows.Tests
Added to
tests/test_awc_music_names.py. It is #5279's new file, and staying out oftests/test_awc_manifest.pyavoids #4742, #4190 and #4516, which edit that file.00000456~2;None,~2,~3;00000123.ogg, holding the Opus channel;export_bankwrites;collect()over two banks: 5 rows, 4 streamed-music channels;bank_stems: the same result frommusic_channelswith and without packets, andbool(packets) == bool(packet channels).Against #5279's
awc_opus.pyandawc_manifest.py, 8 of the 12 tests fail (6 failures, 2 errors on the missingbank_stems). The other 4 are #5279's own. With this change all 12 pass.Run on Windows 11 Pro (26200), CPython 3.14.7, CPU only (no GPU involved):
python -I tests/test_awc_music_names.py: 12 OKpython -I tests/test_awc_manifest.py: 18 OKpython -I tests/test_awc_opus.py: 47 OKpython -I tests/test_awc_shorts.py: 13 OKpython -I tests/test_awc_names.py: 27 OKpython -I tests/test_docs_design_rows.py,tests/test_i18n_index.py: OKpython -m compileall -q,git diff --check: cleanNo game files were used. On a real copy the change shows up only in banks that repeat an id between a stream and a channel or between channels; that count is still open (see #5279).
#4742 adds a function right after
_bank_rows'sreturn rows. This change keeps that line and the blank lines after it, so the two should merge without a conflict.AI-assisted.