Repository navigation
rsc8_audio: the AWC start/end cue records matched into region pairs, record by record (ASSET-320) - #5518
rsc8_audio: the AWC start/end cue records matched into region pairs, record by record (ASSET-320)#5518zzEmmazz wants to merge 1 commit into
Conversation
…cord by record (ASSET-320) docs/rsc8_audio.md read the near-equal start/end counts on five cue names (196/197, 101/101, 54/54, 49/49, 20/19) as region pairs and labelled it a hypothesis, because the split was counted and not matched. pair_marker_regions() matches them: inside one 0xbd tag, a pair is a start whose next record of the same name is an end at the same or a later offset; every other record of such a name is an exception. Every scan summary gets a marker_regions block (per name hash: starts, ends, pairs, exceptions by kind, pair lengths; pairs per tag; overlaps between names; where each exception sits in its tag). Counts, sample offsets and 32-bit hashes only. Measured over all of audio.rpf (7,162 banks, 420,168 0xbd tags, 781,350 records): 841 region records in 22 tags, 420 start, 420 end, one third value; 418 pairs, 20 of 22 tags pair completely, 5 exceptions in two tags, none at an edge of its tag. The other three archives with ADAT banks have none. Tests build their records and banks by hand. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The streamed-music descriptors provide a length check for all 22 region-cue tags. I scanned the complete 1.0.2.1 audio archive at Using the decoded per-channel frame count (the helper accounts for the descriptor’s interleaved count), all 418 region starts, all 418 ends, all five exceptions, and the final marker record of each of the 22 tags were strictly between zero and that channel’s length. For the five exceptions, the smallest distance to either boundary was 17,556,673 in those sample units. That rules out an exception at sample zero or at the declared channel end under the sample-offset interpretation. It leaves the meaning of the unmatched cue records open. CPU only, CachyOS, AI-assisted (OpenAI Codex). Aggregate measurements only. |
|
@Kev-Ball thanks, that closes the one item this PR listed as not checkable from its own tool: AI-assisted. |
kacper-serewis
left a comment
There was a problem hiding this comment.
AI-assisted CPU review at 2e21419 using the existing bank-header parser and an independent cue matcher. All 418 pairs across 22 retail tags matched on both record indices and both endpoint timestamps. All five exceptions matched (two unmatched starts, two unmatched ends, one other value). Exhaustive comparison found 43 contained and 11 crossing overlaps. Of the contained overlaps, 26 shared an endpoint. Two additional cross-name pairs only touched and shared zero samples. No consecutive same-name cue records tied in timestamp. The proposed alternate closures remain hypotheses.
Kam471
left a comment
There was a problem hiding this comment.
Review at head 2e2141993 (Windows 11).
Commands:
python -I -m pytest tests/test_rsc8_audio.py -q
git diff --check 3faac557b..HEAD
Results: 46 passed; diff --check clean.
Negative control: copied this PR's test file into a clean 3faac557b worktree and ran the same command against main's tools/rsc8_audio.py — 11 failed, 35 passed. Every new MarkerRegionsTest fails on main, so the tests do exercise the new pairing; the 35 existing tests are unaffected.
The change is additive (marker_regions block; no new option/file). Per-name invariants (starts == pairs + start_without_end + end_before_start) are asserted by the tests, and the fast 0xbd walk only adds records.
Verdict: approve. The docs section matches the measured table; no file overlap with #3916.
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed change in PR #5518: rsc8_audio: the AWC start/end cue records matched into region pairs, record by record (ASSET-320).
Scope: docs/rsc8_audio.md, tests/test_rsc8_audio.py, tools/rsc8_audio.py
Diff: +617 / -13 across 3 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via automated batch review.
|
Thanks @zzEmmazz - I went through rsc8_audio: the AWC start/end cue records matched into region pairs, record by record (... and the diff around |
|
Merging the current head (Checked with (PR cleanup: #8919.) AI-assisted (Claude Code). |
ASSET-320, claimed in the coordination issue: #5361 (comment)
What and why
docs/rsc8_audio.mdsaid that five AWC cue names storejoaat("start")orjoaat("end")in theirvalueword"in equal or near-equal numbers (196/197, 101/101, 54/54, 49/49, 20/19), which reads as region start/end pairs",
and labelled it a hypothesis because the split was counted, not matched. This matches them record by record.
tools/rsc8_audio.py:marker_records(the raw records of a0xbdtag),pair_marker_regions(the matching)and
marker_region_overlaps. Every scan summary gets amarker_regionsblock: per name hash the starts, ends,pairs, each kind of exception and the pair lengths (min / median / max in samples); pairs per tag; overlaps
between names; and a list of the exceptions with where each sits in its tag. Counts, sample offsets and 32-bit
hashes only. No new option and no new output file.
startwhose next recordof the same name is an
endat the same or a later offset. Every other record of such a name is an exception(
start_without_end,end_without_start,end_before_start,other_value), so per namestarts == pairs + start_without_end + end_before_startand the same for ends. Tags that fail the existingchecks (size, offsets never decrease) are counted as
marker_invalidas before and are not paired.docs/rsc8_audio.md: the hypothesis sentence is replaced by a "Region cues" section with the counts below.tools/awc_markers.py, which counts these records per type); either can landfirst.
Measured
audio.rpfof the Xbox Series 1.0.2.1 package, whole archive: 7,162 banks, 1,606,241 streams, 420,1680xbdtags, 781,350 records, 0 invalid (the page's existing numbers; the summary differs from main's only in the new
block). 22 tags hold region cues: 841 records of the five names, 420
start, 420end, one with a third value.startend0xda559149end0x1df219ec0x77edd3a2start, 1end, the record with the third value0x994ee6450xccb465d1starttwo tags. The 54/54 name has two unpaired records, so equal counts did not prove the pairing.
0xda559149: a secondend16,717 samples after theendthat closes the region before it (record 744 of1,435).
0x77edd3a2: astart(record 40 of 834) followed 118,171 samples later by a record of the same name whosevalue is
0xdaa2d5ec, the only value on these names that is neither word. Hypothesis: it closes the region.0xccb465d1: astart(record 773 of the same tag, the last of its name) directly followed by a0x77edd3a2endthat nostartopens (record 774), 114,697 samples later. Hypothesis: one region whose two recordscarry different names. Both distances are inside the pair lengths of the names involved.
unclosed
0xccb465d1startis 18,219,408 samples before its tag's last offset.extrais the same on both records of all 418 pairs.0xda559149and one of the other four (13 / 7, 19 / 4, 2 / 0, 9 / 0). The other four never overlap each other.0x76tag, so there is no sample count to compare a region's end with.story000.rpf,shared_minigame000.rpfandstory000_restofworld.rpf(226,788, 1,959 and 220xbdtags):no record with either value.
Reproduce (prints the summary; nothing is written):
Tested
python -I tests/test_rsc8_audio.py: 46 tests, OK (35 before, 11 new inMarkerRegionsTest). The new testsbuild their records and banks by hand: well-formed pairs (touching and zero-length ones included), an unmatched
start, an unmatched end, an end before its start (in record order and in offsets), nesting inside one name,
two names interleaved (crossing, nested, touching), a third value, and the bank / archive / directory /
single-bank / CLI JSON paths with the merged counts and the listed exceptions.
Negative control: the same test file against main's
tools/rsc8_audio.py(3faac557): the 11 new testserror, the 35 old ones pass.
python -m compileall -q make_game.py tools tests;tests/test_docs_links.py(6),test_docs_repo_paths.py(2),
test_docs_list_items.py(2),test_docs_design_rows.py(4),test_text_write_line_endings.py(3),test_audio_config.py(21),test_awc_manifest.py(18),test_file_mode.py(5, 2 skipped),test_rpf9_carve.py(17): all OK.Full scans on Windows 11, Python 3.14.0:
audio.rpf(28.5 GB) in 57, 58 and 87 s over three runs (the testswere running beside the last one), against 55 s for main's tool on the same file;
story000.rpfin 37 s. Thepairing was also run by a second walk of the archive (bank by bank, reading only the
0xbdtags) with thesame per-name counts, and the overlap counts were checked against a brute-force comparison of every two
regions in a tag.
No GPU involved.
No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
Not checked
0xdaa2d5ec; nothing was tried against game strings.0x76tag and the tool does not read thestreamed-music descriptor, so "at the edge" is judged against the tag's own records. Lengths are not converted
to seconds for the same reason.
AI-assisted.