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))
Browse files at this commit54adc86b2d75b5abfe085a8e6a207d3db913ea40Parent: 7ea5133- test
- 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
2 changed files +11 -6
crates/ec-av1/examples/enc_probe.rsmodified+7 -0
| @@ -73,6 +73,13 @@ fn main() { | ||
| 73 | 73 | println!(" census luma SAD rank of RD winner: {}", pct(&luma_rank)); |
| 74 | 74 | println!(" census chroma SAD rank of RD winner: {}", pct(&chroma_rank)); |
| 75 | 75 | } |
| 76 | + // lane-arfmode: the engagement counter of the top ARF's offer-set | |
| 77 | + // lever, taken once per point so an armed run PRINTS a non-zero count | |
| 78 | + // (class gate-blind-to-feature; a BD number over a counter of zero | |
| 79 | + // proves nothing). Zeros when `EC_AV1_ARFMODE` is unset, which is the | |
| 80 | + // control's own expectation. | |
| 81 | + let hits = ec_av1::encode::take_arfmode_hits(); | |
| 82 | + println!(" arfmode hits: {} {} {}", hits[0], hits[1], hits[2]); | |
| 76 | 83 | } |
| 77 | 84 | println!("wall {:.3}s", start.elapsed().as_secs_f64()); |
| 78 | 85 | } |
crates/ec-av1/src/encode.rsmodified+4 -6
| @@ -7845,15 +7845,13 @@ fn arfmode_hit_and_no() -> bool { | ||
| 7845 | 7845 | false |
| 7846 | 7846 | } |
| 7847 | 7847 | |
| 7848 | -/// Takes (and clears) the counts. | |
| 7849 | -#[cfg(test)] | |
| 7850 | -pub(crate) fn take_arfmode_hits() -> [usize; 3] { | |
| 7848 | +/// Takes (and clears) the counts. `pub` for `examples/enc_probe`, so a | |
| 7849 | +/// probe point can print a non-zero engagement count under the env knob | |
| 7850 | +/// itself -- the counter the gate BD numbers are read against. | |
| 7851 | +pub fn take_arfmode_hits() -> [usize; 3] { | |
| 7851 | 7852 | [0, 1, 2].map(|i| ARFMODE_HITS[i].swap(0, std::sync::atomic::Ordering::Relaxed)) |
| 7852 | 7853 | } |
| 7853 | 7854 | |
| 7854 | -/// [`Search::top_k`]'s value: `None` keeps every mode's search unchanged | |
| 7855 | -/// (the default, until a lever's quality gate justifies pruning by default); | |
| 7856 | -/// `EC_AV1_PRUNE_K` sweeps it in a test build without touching callers. | |
| 7857 | 7855 | fn prune_top_k() -> Option<usize> { |
| 7858 | 7856 | #[cfg(test)] |
| 7859 | 7857 | { |