forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 70849e07ad7e30da44cd8a7f390dc93bfb49542eFiltered to scripts/aac-tables/sbrchirp.pyClear filter

2026-08-20

fix(sbr-probe): tone_core's pulse/tns/gain flags sat after spectral data, not beforeAhmet Kaan Gümüş · 23f057e
fix(sbr-probe): tone_core's pulse/tns/gain flags sat after spectral data, not before

tone_core() (scripts/aac-tables/sbrchirp.py) is the isolated-single-MDCT-line
probe writer used by sbrpatchmap.py's patch-map fingerprinting; it desynced
the reference decoder on every real-header probe ("channel element X.Y is not
allocated" / "buffer exhausted before END"). Byte-accounted against sce_core's
proven field order: the `pulse_data_present/tns_data_present/gain_control_
data_present` 3-bit field must precede spectral_data(), not follow it -- the
misplaced write shifted every bit after it. Core-only round-trip is now
byte-clean (0 errors) and the real reeln header/grid shape (kx=14/k2=43)
decodes to nonzero PCM instead of 0.

Also fixes sbr_hf.rs's `real_file_tables()` test fixture, whose stop_freq=3/
xover_band=2 guess was wrong (gave kx=16/k2=29); the real value read off the
file's own bitstream is stop_freq=8/xover_band=0 (kx=14/k2=43) -- confirmed
build_patches() on the corrected header exactly matches sbrpatchmap.py's
independently-ported prediction: [(0,14,14),(3,28,11),(0,39,3),(13,42,1)].

Running the full three-header patch-map sweep against both the reference and
our own decoder (adts_to_pcm) surfaced a new blocker, not fixed here: our own
decoder's *measured* map disagrees with build_patches' own prediction (empty
for source band 0, a constant band range for every other source band) even
though build_patches itself is proven correct in isolation -- the runtime HF
generation/envelope path or the probe's PCM analysis is unverified, not
build_patches. Per the probe's own sanity rule this blocks trusting the
reference's measured map until resolved.

2026-08-19

probe(sbr-chirp): repair the non-engaging instrument, refute the bw-per-level hypothesisAhmet Kaan Gümüş · 9a984c9
probe(sbr-chirp): repair the non-engaging instrument, refute the bw-per-level hypothesis

Round-18's stream() never exercised the reference decoder's SBR gain stage:
amp_res=0 (coarse envelope resolution) and num_env=1 (FIXFIX single
envelope) each independently make it ignore the payload's envelope AND
bs_invf_mode, and the same recipe was missing the FIL byte-padding loop
before END (silent bitstream desync, masked because the byte-count still
happened to work out on most inputs). Bisected against a known-working CPE
probe to isolate both culprits.

Repaired stream() (SCE, FIXFIX num_env=2, amp_res=1, byte-padded) engages:
sweeping envelope raw value 3->60 swings output power by three-to-four
orders of magnitude. On this working instrument, the four bs_invf_mode
levels (NONE/LOW/MID/HIGH) produce indistinguishable output (<0.1% power
drift, no resolvable flatness difference) against a BW_TABLE spanning
0.0..0.98 -- STOP RULE: hypothesis refuted for this measurement, sbr_hf.rs
left unchanged.
scripts(sbr): black-box chirp/bw probe -- dead end, harness never engaged SBR envelopeAhmet Kaan Gümüş · 054aa95
scripts(sbr): black-box chirp/bw probe -- dead end, harness never engaged SBR envelope

Attempted to measure the reference decoder's per-invf-mode bandwidth-
expansion factor by black box (round 18, Task 1). Two dead ends recorded
in the script's own docstring for a successor:

* An isolated single-MDCT-line core (for an exact-AR2 pure-tone source,
  whose LPC coefficients are analytically known) desyncs the bitstream --
  most HCB3 codewords beyond the one tuple earlier probes exercised are
  unverified.
* Falling back to the already-proven-clean broadband comb core, every
  real SBR decode attempt makes the reference print "No quantized data
  read for sbr_dequant." and then produce PCM that is value-independent
  of both bs_invf_mode (all four levels byte-identical) and the envelope
  amplitude itself -- the envelope/gain stage never engages, for a reason
  the byte-count oracle (which only checks framing) cannot see.

No bw fingerprint extracted; sbr_hf.rs is unchanged -- no measurement to
base a fix on, and the task's own stop rule forbids fitting constants to
noise.