Files
Sylpheed/crates/sylpheed-export/examples/bgm_size_census.rs
Sylpheed port agent f4ebd3dc1c port: audit my own multi-leg claims -- the load-bearing one holds, and now says why
The Decoder's sharpest addition: a conclusion with two supports reads as better
evidenced than one with a single support, so if one is decorative the appearance
of redundancy is itself the misinformation -- a reason to strip a weak second
argument rather than leave it as colour.

Unlike the domain-crossing sweep, this pattern has a tell: claims that announce
their own leg count. Six in my authored data. The load-bearing one is audio.json's
'Static code, disc census and runtime all agree'.

Read literally, two of those three could be one comparison. The sentence beneath
says BGM_103.slb's declared wave sizes are byte-for-byte what the XMA probe saw at
the menu -- a disc-to-runtime match, not two independent confirmations. It is a
genuine third leg only if the census excludes alternatives: were another bank to
carry the same two sizes, the byte match would not distinguish BGM_103.

Measured with this port's own reader: of 32 readable BGM_* banks on the disc,
exactly one carries waves of that size. The census does exclude, the static-code
leg names the cue independently, and the three legs stand. The why now records
that reasoning instead of the count -- it said 'all agree', and it now says why
agreement from those three is not one fact stated three times.

The audit did not find a defect. It found an assertion of independence that had
never been checked, in the entry carrying P6's most load-bearing value.

Reach: I checked one of the six. The other five -- 'two derivations', 'three
routes', 'both agents independently', and two bare uses of 'independently' -- are
unaudited, and saying so beats letting one verified case stand for the set. Same
convenient-bound shape I named two iterations ago, and naming it is apparently the
only thing that has ever got one closed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N7FiFFFwbvG2uxdcEh8HyF
2026-08-31 03:08:39 +00:00

48 lines
2.3 KiB
Rust

//! Is `BGM_103` the ONLY bank with those two wave sizes?
//!
//! `authored/audio.json` says *"Static code, disc census and runtime all agree"*
//! — three legs. Reading the sentence beneath it, legs two and three are **one**
//! comparison: the disc's declared wave sizes matched byte-for-byte against what
//! the XMA probe saw at the menu. That is a disc-to-runtime match, not two
//! independent confirmations.
//!
//! It is a third leg only if the census independently EXCLUDES alternatives — if
//! some other bank carried the same two sizes, the byte match would not
//! distinguish it. So the sizes are counted across every `BGM_*` bank on the
//! disc.
//!
//! Prompted by the Decoder's point that a decorative second support is worse
//! than none: **a conclusion with two supports reads as better evidenced than
//! one with a single support, so apparent redundancy is itself the
//! misinformation.**
use sylpheed_formats::media;
fn main() {
let root = std::env::var("SYLPHEED_DISC").unwrap_or_else(|_| "/disc".into());
let src = media::DirectorySource::new(&root);
const WANT: [usize; 2] = [3_876_864, 3_930_112];
let (mut found, mut matches) = (0usize, Vec::new());
for n in 0..=199u32 {
let name = format!("BGM_{n:03}.slb");
let Ok(riffs) = media::sound_bank_riffs(&src, &name) else { continue };
if riffs.is_empty() { continue }
found += 1;
let sizes: Vec<usize> = riffs.iter().map(|r| r.len()).collect();
// Compare on the DATA payload the port sums, not on the RIFF wrapper:
// a wrapper differs by header bytes and would hide a real collision.
let near = sizes.iter().any(|s| WANT.iter().any(|w| s.abs_diff(*w) < 4096));
if near {
matches.push((name.clone(), sizes.clone()));
}
}
println!(" {found} BGM_* bank(s) readable on this disc");
for (n, s) in &matches {
println!(" {n:<14} wave sizes {s:?}");
}
println!("\n {} bank(s) carry a wave within 4 KiB of {WANT:?}", matches.len());
println!(" Exactly 1 means the census EXCLUDES alternatives and is a real third");
println!(" leg. More than 1 means the byte match does not distinguish BGM_103,");
println!(" and \"three legs\" is two. Zero means this reader cannot see the");
println!(" incumbent and its answer means nothing.");
}