From a460dca390642c1303605d2fd52b69e42bf4654b 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 02:58:31 +0300 Subject: [PATCH] refusal_inventory: normalise whitespace in the 128-root cfl anchor + mutation-prove it The anchor was a 3-line literal carrying 12-space indentation while the anchored call site (decode.rs read_intra_mode_rect at the 128 root) sits at 8 spaces, so the guard counted 0 matches and went RED. ATTRIBUTION (measured by an independent review pass): the guard was ALREADY red at the wave's own common base 4155c7c7 -- the dedent happened in an ancestor of that base, so the wave inherited a pre-existing red rather than causing it. The invariant it guards was intact: the call site still passes cfl=false. Fix: whitespace-normalised match (squash_ws on both sides), keeping the semantic anchor (both comment lines + the false, argument) and count() == 1. Mutation-proved: cfl=true turns it RED, revert turns it green. Class swept: no other source-scan anchor in the crate embeds indentation (21 include_str! guards checked); the rule is recorded in skill://reformat-breaks-source-scan-anchors. --- crates/ec-av1/src/refusal_inventory.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/ec-av1/src/refusal_inventory.rs b/crates/ec-av1/src/refusal_inventory.rs index 8bb391a5..14768f1c 100644 --- a/crates/ec-av1/src/refusal_inventory.rs +++ b/crates/ec-av1/src/refusal_inventory.rs @@ -1690,10 +1690,20 @@ mod tests { // The 128-root call site's own `cfl` argument, with the comment that // explains it -- the two lines are matched together so that reordering // the arguments cannot leave this test pointing at another `false`. - const CFL_OFF_AT_128: &str = " // `is_cfl_allowed` caps CFL at 32x32: `uv_mode` comes off the\n \ - // 13-symbol no-CFL CDF here, never the 14-symbol one.\n false,"; + // + // Whitespace-normalised (2026-09-28): the anchor used to be matched with + // its exact indentation, so any dedent or reformat of the call site -- + // the wave merge dedented it by four spaces -- turned this enumeration + // red without the invariant it guards changing at all. Collapsing runs + // of whitespace keeps the SEMANTIC anchor (both comment lines plus the + // `false,` argument, in order) asserted while removing that fragility. + const CFL_OFF_AT_128: &str = "// `is_cfl_allowed` caps CFL at 32x32: `uv_mode` comes off the \ + // 13-symbol no-CFL CDF here, never the 14-symbol one. false,"; + fn squash_ws(s: &str) -> String { + s.split_whitespace().collect::>().join(" ") + } assert_eq!( - src.matches(CFL_OFF_AT_128).count(), + squash_ws(src).matches(&squash_ws(CFL_OFF_AT_128)).count(), 1, "the 128-root call site no longer passes cfl=false -- a CfL alpha can reach the \ guard, so this enumeration proves nothing"