Commits
Commits on
35abdb5e1f3dd67c89b0bd72a0e2a4d6d52ef79fFiltered to scripts/aac-tables/sbrpatchmap.pyClear filter2026-08-20
debug(aac): QMF-domain per-stage SBR HF energy dump, gated by EC_AAC_SBR_QMFDUMPAhmet Kaan Gümüş · ea6cc30
debug(aac): QMF-domain per-stage SBR HF energy dump, gated by EC_AAC_SBR_QMFDUMP Round-34's decisive measurement: dump per-QMF-band mean energy at analysis output, post-patch (pre-adjust), and post-adjust in sbr_chain.rs, and probe header A (kx=14/k2=43) at source bands p=0/5/13. Result: generate()'s patch application places content EXACTLY where build_patches predicts (verdict: generate()/adjust()/the kx-row synthesis copy are all exonerated) -- the "wrong target band" cluster reported by earlier rounds' sbrpatchmap.py probe was an artifact of that probe's own tone-placement bin math (k = p*32+16 assumed 32 core-MDCT bins per QMF band; empirically re-derived via this same dump to be 16, confirmed exact for p=0/5/13) plus a noise0=[2,2] "quiet" setting that was actually loud (low raw index = louder noise floor, matching sbr_env::dequant_noise's spec-correct direction). Both fixed in sbrpatchmap.py. The QMF-domain sanity gate (post-patch stage) now matches build_patches' prediction exactly for every probed p; the PCM/FFT-domain frequency-line readout still shows a separate, weaker artifact specific to this single-isolated-tone-with-flat-envelope probe shape (not chased this round -- out of Task 1's QMF-domain scope, and not corroborated by the real-file sweep, which is unchanged: 0.971793/0.967975 full-band, 0.956522/0.951190 whole-file mean, 0.992565/0.991558 below-crossover, identical to the pre-round-34 baseline since this change adds no new always-on code path).
probe(sbr): engagement bisection converges on the harness, not the payloadAhmet Kaan Gümüş · 854ea37
probe(sbr): engagement bisection converges on the harness, not the payload Round-32: field-by-field bisection of stream() (known-engaging) against stream_one_band() found every candidate flip (header shape, core content, delta-Huffman words) engages identically once wrapped through wrap_sbr's explicit-SBR ASC -- stream_one_band's bit construction was never the bug. sbrpatchmap.py's run_header() was still routing the reference side through bare-ADTS ffmpeg decode (P.decode), never adopting wrap_sbr after round-31 built it; ref_decode() fixes that, and the reference now shows genuine, per-source-band-varying patch maps with the dequant warning firing once at stream head only. Also fixes adts_to_pcm's --same-rate-sbr config, which independently diverged from wrap_sbr's ASC (object_type=2/AAC-LC and sample_rate=44100 for what is actually a 22050 Hz core) -- now built via the same write_audio_specific_config + with_config_bytes round trip wrap_sbr uses. Task 2's sanity gate (ours == build_patches prediction) still fails after both fixes -- our decoder's measured target set is a near-constant [14,15,18,19,20,21] band cluster regardless of source band or header, unlike the reference's now-varying read -- a distinct, unresolved defect in sbr_hf.rs's generate() or the QMF path, blocking Task 3/4 (the verdict).
diag(sbr): fix source-band placement math to 32 bins/band, surface a deeper SBR-engagement blockerAhmet Kaan Gümüş · 7049a6c
diag(sbr): fix source-band placement math to 32 bins/band, surface a deeper SBR-engagement blocker sbrpatchmap.py's probe placed its isolated tone at k = p*16 + offset, assuming a source (low) QMF band is 16 core-MDCT bins wide. It is 32 (1024-bin core MDCT / 32 core bands). Fixed to k = p*32 + 16 (band center, lands cleanly on a group boundary so no fractional-offset trick is needed). Calibrating that fix against the unambiguous header-A anchor ((13, 42, 1), a width-1 patch) surfaced a deeper, blocking problem: ffprobe shows these synthetic ADTS probe streams never engage the reference decoder's SBR/HE-AAC upsampling at all (sample_rate=22050, no HE-AAC profile, decoded PCM length exactly core-rate), unlike the real reeln fixture (profile=HE-AAC, sample_rate=44100). The "No quantized data read for sbr_dequant." warning's raw occurrence count (fires once per 26-frame stream) reads as benign by the charter's own heuristic but is not: an env0 power sweep shows the predicted target window is flat while a large, smoothly-scaling, envelope-driven signal appears well outside it, and never flips the decoder into HE-AAC output. Reproduces for both tone_core and broadband_core_bits content, so it's a property of the shared frame/extension-payload construction, not either core-spectrum writer -- a generalization of round-27's tone_core-specific dead-end. Sanity gate (our decoder's map == build_patches prediction) and the reference-map read are both gated on fixing that engagement bug first; sbr_hf.rs is left untouched pending it. crates/ec-aac --lib: 40/40.
fix(sbr-tables): stop sbrpatchmap's delta-huffman filler desyncing envelope1/noise1Ahmet Kaan Gümüş · a913c84
fix(sbr-tables): stop sbrpatchmap's delta-huffman filler desyncing envelope1/noise1 sbr_bits_full's slot() defaulted every un-supplied delta band to T.FILL (24 raw zero bits); ENV30_F/NOISE_F's shortest codeword (delta=0) is only 1 bit, so 23 leftover zero bits per slot bled into every field transmitted after the first multi-band delta run, silently corrupting envelope1/noise1's raw values to 0 regardless of what stream_one_band asked for (confirmed via EC_AAC_SBR_DEBUG before/after). Also switched the readout from power buckets to fractional-frequency-offset line detection per round-29's charter, and moved the tone off the ambiguous band-boundary bin. Sanity gate (ours vs build_patches) still fails: localized to the tone's bin-placement assumption (k = p*16), not build_patches or the runtime (patches dumped via EC_AAC_SBR_DEBUG match build_patches exactly). Left documented as open in the module docstring; reference maps not read this round since Task 1's own gate blocks it.
probe(sbr-patchmap): infra for measuring the reference's real HF patch mapAhmet Kaan Gümüş · e3a8adf
probe(sbr-patchmap): infra for measuring the reference's real HF patch map
adts_to_pcm example lets our own decoder be driven through the same
one-band-at-a-time probe streams sbrpatchmap.py builds for the reference
decoder (needs an explicit same-rate-SBR AudioSpecificConfig -- plain
AacDecoder::new() never turns SBR on from bare ADTS). sbrpatchmap.py reads
reeln's ACTUAL header off our own decoder's EC_AAC_SBR_DEBUG dump
(start_freq=5 stop_freq=8 xover_band=0 -> kx=14 k2=43 n_q=3, matching the
ledger's fact but NOT sbr_hf.rs's real_file_tables() unit test, whose
guessed stop_freq/xover_band=3/2 gives a different kx=16 k2=29 header) and
ports build_patches to Python for a live prediction-vs-measurement diff.
Blocked before a single measurement: tone_core()'s isolated-MDCT-bin core
(sbrchirp.py) fails outright against this header/grid shape ("channel
element 0.0 is not allocated" / "Invalid data found", zero PCM decoded),
reproducing round-19's "isolated-tone encoding does not round-trip" dead
end on the real header instead of the round-18 SBR-engagement bug it was
first seen with. Not fixed this round -- see ledger for next steps.