From cc561435f2378ba3f7c4fe4019955e4e88eee68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 20 Aug 2026 07:46:01 +0300 Subject: [PATCH] diag(aac): AU-level failure printing for the sbr_real_library sweep EC_AAC_SBR_AU_FAIL_DEBUG=1 gates a per-AU index/error/first-bytes dump in our_decode(), for tracing which access units a real HE-AAC track fails to decode. Run against the HE-AAC commentary candidate (48kHz, mkv, absolute stream 3): zero of 1500 access units fail this round -- the "N/1500 AUs fail" fact recorded earlier in the investigation no longer reproduces at HEAD, superseded by intervening grid/pointer fixes. That file's catastrophic full-band decorrelation persists with a clean, non-dropped AU count, so it is not a timeline-shift artifact of missing samples -- the remaining cause is upstream of AU-level decode failure and is not root-caused this round. --- crates/ec-aac/tests/sbr_real_library.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/ec-aac/tests/sbr_real_library.rs b/crates/ec-aac/tests/sbr_real_library.rs index dfc0acc0..ef33b642 100644 --- a/crates/ec-aac/tests/sbr_real_library.rs +++ b/crates/ec-aac/tests/sbr_real_library.rs @@ -133,11 +133,19 @@ fn our_decode( let rate = decoder.output_sample_rate().unwrap_or(0); let mut planes: Vec> = Vec::new(); let mut failed = 0; - for au in &aus { + let debug_failures = std::env::var("EC_AAC_SBR_AU_FAIL_DEBUG").as_deref() == Ok("1"); + for (au_idx, au) in aus.iter().enumerate() { let frame = match decoder.decode(au, None) { Ok(f) => f, - Err(_) => { + Err(e) => { failed += 1; + if debug_failures { + let head: Vec = au.iter().take(16).copied().collect(); + eprintln!( + " AU {au_idx} FAILED len={} err={e:?} head={head:02x?}", + au.len() + ); + } continue; } };