Expand description
Per-kernel-family SIMD ablation switch (measurement only, __ablate feature).
§Why this exists
CpuLevel::Scalar / rav1d_set_cpu_flags_mask(0) does not disable the
safe-SIMD kernels on aarch64: every safe_simd/*_arm.rs dispatcher gates on
archmage::Arm64::summon() (a compile/run-time CPU token) and never reads
rav1d_cpu_flags_mask. So there was no way to ask “which kernel family is
responsible for this failing conformance vector?”.
This module adds one: a process-global bitmask of disabled families. A
disabled dispatcher returns false (“not handled”) at its entry, so the
caller falls through to the generic scalar reference. Ablating family X and
re-running the corpus turns correlational evidence (“this kernel logs
mismatches”) into causal evidence (“these N vectors’ MD5s are wrong
because of X”).
§Cost when the feature is off
is_off is #[inline(always)] and returns a const false when
__ablate is not enabled, so every dispatcher’s guard folds away entirely.
This is compile-time-gated for the same reason __simd_test is: no
per-call atomic load on the hot path in a production build.
§Scope
Measurement infrastructure. Never enable __ablate in a shipped build —
ablating a family makes the decoder slower, not wrong (the scalar path is
the reference), but the switch is process-global and racy by design.
Enums§
- Family
- A dispatchable SIMD kernel family, at the granularity a fix would target.
Constants§
- ENABLED
- Whether the ablation switch is compiled in.
Functions§
- activity_
reset - Zero every counter (call between vectors to get per-vector numbers).
- activity_
snapshot - Per-family counts in
Family::ALLorder. All zero without__ablate. - is_off
- Compiles to a constant
false— every dispatcher’s guard folds away. - itx_
shape_ report - Header only: the counters do not exist without
__ablate. - itx_
shape_ reset - Zero the census (call between vectors to get per-vector numbers).
- note
- Record that
fprocessedunitsof work (pixels, unless noted). - note_
itx_ shape - Record one inverse-transform call: its size index, its bit depth, and
whether a SIMD kernel took it (
false= fell through to the reference). - set_
disabled - Disable every family in
families(and only those).