From 408e7cfde1f269e91d73435a21a6e41036001dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 29 Sep 2026 06:56:48 +0300 Subject: [PATCH] lanes: classify the ignored ec-av1 probes, un-ignore the 1080p tile gate lane-av1probes. The release triage dispositioned the 15 process-global gates and skipped the probe/benchmark set; that set was a black box. This lands the classification and the three fixes it found. Measured (release, one cargo invocation per test name, EC_AV1_REQUIRE_FFMPEG=1 EC_AV1_REQUIRE_AOMENC=1 EC_REQUIRE_FIXTURES=1, TMPDIR off the tmpfs) on server host-a and on the workstation for the real-library rows: 38 ignored non-gate items at base 745c60e7 -- 32 REAL DIAGNOSTIC VALUE, 5 STAGING, 1 ROBUST-RED, 0 DEAD WEIGHT, 0 decoder defects. Nothing in the set is dead; what was broken is the REASON TEXT, which is what this commit fixes. 1. UN-IGNORE a_1080p_multi_tile_stream_decodes_sample_exact_through_both_decoders. It was ignored only for its wall ("1080p encode: minutes") and is the only 1080p arm in the ignored set that ASSERTS. Plain release run on this tree: 1080p 2x1/2x2/4x2 tiles, 84488/84208/84685 bytes, all sample-exact, ok in 27.39 s. The check is a per-frame first-differing-luma-sample comparison against ffmpeg, not a length or non-empty smoke. Both skippable halves route through the crate's EXISTING probes (h264_clip_frames -> have_ffmpeg() + clip.exists(), and have_ffmpeg() for the ffmpeg arm); no new presence-check shape. Ignore count 51 -> 50. 2. REASON REWRITES, 11 items whose reason misdescribed them. The wall benchmarks now carry their measured wall and their host floor (tile_search_wall_1080p TIMED OUT at 2400 s on a 4-core server and takes 1243 s on 12 cores); filter_stage_wall_film says it measures the BARS fixture without EC_AV1_WALL_CLIP; the four bare #[ignore] scratch probes name their env vars, including the three geometry vars of scratch_isolate_pinned_mismatch whose 64/64/1 default is wrong for every real pin; sweep_rectx_recipes stops carrying a lane label; tpl_intra_denominator_histogram stops claiming film fixtures it never opens; the two prune_k sweeps say they are local-run because their clip paths are hard-coded /home/user absolutes; probe_split says it panics on its own lossless synthetic rows. 3. stage_timing_breakdown_inter printed "motion search (NEWMV) 17.82ms (of which interpolation 148.63ms)" -- a sub-number larger than its parent. Both timers were always real; the print's attribution was wrong. Bucket 0 times only the NEWMV/GLOBAL sub-search (stage_since(0) fires after find_best_new_mv and the global-MV search), and bucket 1 is EVERY mc::predict call including a committed block's final prediction, which runs outside any bucket-0 region. Bucket 1 is now its own top-level row with the overlap quantified and explicitly not added to the total; the residual is labelled for what it contains. The accounting closes: 107.27 + 157.56 = 264.83 ms against a 264.82 ms wall. No decoder logic changed: every source edit is a #[ignore] reason, a doc comment, or the one eprintln block above. --- crates/ec-av1/src/encode.rs | 92 +++++++++--- crates/ec-av1/src/encoder.rs | 41 ++++-- crates/ec-av1/src/stream.rs | 32 ++++- crates/ec-av1/src/transform.rs | 12 +- lanes/av1probes.report.md | 256 +++++++++++++++++++++++++++++++++ 5 files changed, 394 insertions(+), 39 deletions(-) create mode 100644 lanes/av1probes.report.md diff --git a/crates/ec-av1/src/encode.rs b/crates/ec-av1/src/encode.rs index 63520782..df721010 100644 --- a/crates/ec-av1/src/encode.rs +++ b/crates/ec-av1/src/encode.rs @@ -17755,7 +17755,14 @@ mod tests { /// the sweep pictures and whatever clips `EC_AV1_CLIPS` names. This is what /// sets [`SPLIT_BLOCKS`]; the table it prints is in the lane report. #[test] - #[ignore = "a sweep, not a gate"] + // ROBUST-RED on this tree, and the red is in the MEASURE, not the codec: + // the `stripes` picture codes LOSSLESSLY at q110/90/70, so both ladders + // come back as three identical `(inf, 1.8260748027008264)` points and + // `bd_rate` has an empty trapezoid to integrate, which panics with + // "the two ladders have to overlap in PSNR". Row 1 (`test card`) still + // prints its number before the panic. Point `EC_AV1_CLIPS` at a real lossy + // clip, or read only row 1. + #[ignore = "a sweep, not a gate; PANICS on its own lossless synthetic rows (stripes is lossless at q110/90/70, so bd_rate has no PSNR overlap) -- point EC_AV1_CLIPS at a lossy clip"] fn probe_split() { let _knobs = crate::speed::knob_read(); let fctx = &crate::decode::FrameCtx::for_encoder(); @@ -19964,13 +19971,25 @@ mod tests { } /// Breaks one inter frame's own cost into the four [`STAGE_NS`] buckets - /// (motion search, [`crate::mc::predict`], transform+quantize, - /// `coeff_bits`), plus what is left over once those are subtracted -- - /// the thirteen-mode intra-candidate loop `search_inter_block` still - /// runs on every inter block (its own transform/quant/entropy calls are - /// already inside buckets 2/3, so "left over" here is everything NOT - /// timed: `crate::intra::predict` for those 13 modes, RD bookkeeping, - /// symbol-cost lookups outside `coeff_bits`). + /// plus what is left over once buckets 0/2/3 are subtracted. + /// + /// lane-av1probes: the two search-shaped buckets OVERLAP and the old + /// print denied it. Bucket 0 is not "the motion search": `stage_since(0, + /// ..)` fires only after `find_best_new_mv` and the global-MV search + /// (`encode.rs:11959`, `:12080`), so it is the NEWMV/GLOBAL sub-search + /// alone. Bucket 1 is EVERY `crate::mc::predict` call, from the search's + /// candidates *and* from a committed inter block's final prediction -- + /// and that final prediction runs OUTSIDE any bucket-0 region. So bucket 1 + /// is neither inside bucket 0 nor smaller than it, and a print that shows + /// it as "motion search (of which interpolation ...)" necessarily shows + /// a sub-number bigger than its parent. Measured: bucket 0 = 17.82 ms, + /// bucket 1 = 148.63 ms. + /// + /// Which number is real: BOTH timers are right; only the old ARITHMETIC + /// was wrong. Bucket 1 is now printed as its own top-level row, the + /// overlap is stated, and the residual is labelled for what it is -- it + /// absorbs the committed block's own interpolation, so it is not a pure + /// "13-mode intra candidate loop" figure either. /// /// `cargo test -p ec-av1 --release stage_timing_breakdown_inter -- --ignored --nocapture`. #[test] @@ -20007,23 +20026,34 @@ mod tests { .unwrap(); let total_t = t.elapsed(); let [motion_search, interpolation, transform_quant, entropy] = stage_read(); + // Buckets 0 and 2 and 3 are disjoint and additive. Bucket 1 (every + // `mc::predict` call) is NOT added: it overlaps bucket 0 wherever a + // search candidate calls predict, and it also covers the committed + // block's final prediction, which no other bucket times. Adding it + // would double-count the overlap; leaving it out puts the committed + // prediction (and the intra candidate loop, RD glue, and the symbol + // lookups outside `coeff_bits`) into the residual, which is what the + // residual has always been. let accounted = motion_search + transform_quant + entropy; - // motion_search already contains interpolation's own time (every - // candidate the search costs calls crate::mc::predict), so it is not - // added again here -- interpolation is reported alongside as "of - // which interpolation", not as a fifth additive bucket. let other = total_t.saturating_sub(accounted); + let overlap = interpolation.saturating_sub(motion_search); eprintln!( "\n=== inter frame {width}x{height}, one frame ===\n\ total: {total_t:>9.2?} ({} bytes)\n\ - motion search (NEWMV): {motion_search:>9.2?} (of which interpolation \ - {interpolation:>9.2?})\n\ - transform + quantize: {transform_quant:>9.2?}\n\ - coeff_bits (entropy pricing): {entropy:>9.2?}\n\ - everything else (13-mode intra {other:>9.2?}\n\ - candidate loop's own predict/bookkeeping, NEARESTMV's own \ - predict, RD glue):", + NEWMV/GLOBAL sub-search (bucket 0): {motion_search:>9.2?}\n\ + transform + quantize (bucket 2): {transform_quant:>9.2?}\n\ + coeff_bits, entropy pricing (bucket 3): {entropy:>9.2?}\n\ + buckets 0+2+3 accounted: {accounted:>9.2?}\n\ + \n\ + OVERLAPPING, not additive: every mc::predict call (bucket 1) {interpolation:>9.2?}\n\ + \x20 -- of which {overlap:>9.2?} is OUTSIDE bucket 0 (a committed\n\ + \x20 inter block's final prediction, which no bucket above times)\n\ + \x20 and the rest is the search candidates' interpolation, already\n\ + \x20 inside bucket 0. It is deliberately NOT added to the total.\n\ + \n\ + residual (13-mode intra candidate loop, the committed block's\n\ + \x20 interpolation above, NEARESTMV's own predict, RD glue): {other:>9.2?}", inter.stream.len(), ); } @@ -20038,7 +20068,12 @@ mod tests { /// so it stays `#[ignore]`, run by hand with real clips on this machine. /// `cargo test -p ec-av1 --release prune_k_quality_sweep -- --ignored --nocapture`. #[test] - #[ignore = "needs real clips and ffmpeg; prints numbers for the lane report to judge"] + // The three clip paths are HARD-CODED ABSOLUTES under /home/user, not + // env-driven: off this workstation every row prints `SKIP