From 54adc86b2d75b5abfe085a8e6a207d3db913ea40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 13 Sep 2026 05:53:36 +0300 Subject: [PATCH] test(av1): enc_probe prints the arfmode engagement counter per point -- the probe's arm rows must print a non-zero count under EC_AV1_ARFMODE itself, not rely on the in-process witness (take_arfmode_hits is pub now, was cfg(test)); the first probe sweep never exported the knob and every arm row came back byte-identical to the control, which is how that class looks from the outside --- crates/ec-av1/examples/enc_probe.rs | 7 +++++++ crates/ec-av1/src/encode.rs | 10 ++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/ec-av1/examples/enc_probe.rs b/crates/ec-av1/examples/enc_probe.rs index 4f9afc34..27684562 100644 --- a/crates/ec-av1/examples/enc_probe.rs +++ b/crates/ec-av1/examples/enc_probe.rs @@ -73,6 +73,13 @@ fn main() { println!(" census luma SAD rank of RD winner: {}", pct(&luma_rank)); println!(" census chroma SAD rank of RD winner: {}", pct(&chroma_rank)); } + // lane-arfmode: the engagement counter of the top ARF's offer-set + // lever, taken once per point so an armed run PRINTS a non-zero count + // (class gate-blind-to-feature; a BD number over a counter of zero + // proves nothing). Zeros when `EC_AV1_ARFMODE` is unset, which is the + // control's own expectation. + let hits = ec_av1::encode::take_arfmode_hits(); + println!(" arfmode hits: {} {} {}", hits[0], hits[1], hits[2]); } println!("wall {:.3}s", start.elapsed().as_secs_f64()); } diff --git a/crates/ec-av1/src/encode.rs b/crates/ec-av1/src/encode.rs index 7bdedba2..7aa68273 100644 --- a/crates/ec-av1/src/encode.rs +++ b/crates/ec-av1/src/encode.rs @@ -7845,15 +7845,13 @@ fn arfmode_hit_and_no() -> bool { false } -/// Takes (and clears) the counts. -#[cfg(test)] -pub(crate) fn take_arfmode_hits() -> [usize; 3] { +/// Takes (and clears) the counts. `pub` for `examples/enc_probe`, so a +/// probe point can print a non-zero engagement count under the env knob +/// itself -- the counter the gate BD numbers are read against. +pub fn take_arfmode_hits() -> [usize; 3] { [0, 1, 2].map(|i| ARFMODE_HITS[i].swap(0, std::sync::atomic::Ordering::Relaxed)) } -/// [`Search::top_k`]'s value: `None` keeps every mode's search unchanged -/// (the default, until a lever's quality gate justifies pruning by default); -/// `EC_AV1_PRUNE_K` sweeps it in a test build without touching callers. fn prune_top_k() -> Option { #[cfg(test)] {