diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 9a6974fa..69b2203a 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -3028,6 +3028,14 @@ fn cfl_src_rect(px: usize, py: usize, bw: usize, bh: usize) -> CflSrc { /// `reconstruct_mc_rect` reads both of its buffers at. #[derive(Clone, Copy)] pub(crate) struct TxParams { + /// The plane this unit belongs to (0 luma, 1 U, 2 V), carried from the + /// reader that OWNS the unit. `dequant_and_inverse_wht4x4`'s `EC_DQCOEFF` + /// twin prints it so its ladder pairs with the oracle's: the per-unit + /// census plane could not, because the callers that route a lossless 4x4 + /// unit into the WHT are not all the ones that stamp the census plane + /// (measured on `ll444-lossless-key.obu`: 1663 of 1663 chroma units paired + /// by count, 1660 of them against an empty grid). + pub(crate) plane: usize, pub(crate) w: usize, pub(crate) h: usize, pub(crate) bit_depth: u8, @@ -3118,6 +3126,7 @@ impl TxParams { } crate::transform::dequant_and_inverse_wht( grid, + self.plane, self.w, self.h, self.bit_depth, @@ -8029,6 +8038,7 @@ fn read_eob(dec: &mut SymbolDecoder, coding: &mut TxbTables, class: TxClass) -> let (range, value) = dec.debug_state(); eprintln!("EC_AV1_EOBPT_CDF {eob_pt:?} range={range} value={value}"); } + crate::msac::SymbolDecoder::set_symr_cdf("eob_pt"); let group = dec.symbol(eob_pt) + 1; if trace { eprintln!("TRACE eob_pt value={group} rng={}", dec.debug_state().0); @@ -8277,6 +8287,7 @@ fn read_coeffs( if crate::envflags::env_flag!("EC_AV1_EOBPT_CDF") && len == 3 { eprintln!("EC_AV1_TXTYPE32_CDF {tx_type_cdf:?}"); } + crate::msac::SymbolDecoder::set_symr_cdf("tx_type"); let t = dec.symbol(tx_type_cdf); crate::census::tx_type(len, t); if coeff_trace_on() { @@ -21465,6 +21476,19 @@ fn read_plane( // filter-intra is on) -- caller passes the raw filter-intra mode 0..4 in // `filter_intra`, only meaningful for `plane_idx == 0` (chroma has no // filter-intra in AV1). + // lane-av1444chr: per-TU mode trace with the PLANE named. `PlaneBuf`'s own + // `OUR_PRED` rung cannot carry it (reconstruction does not know its + // plane), and a rung whose plane has to be guessed from the values has + // already produced wrong claims twice this session -- `read_coeffs_rect` + // labelling its unit `plane=0`, and a sweep reading a second-luma-unit + // phantom out of that label (class `rung-mislabels-plane`). Diagnostic + // only: no gate asserts decode behaviour off this line. + if crate::envflags::env_flag!("EC_TRACE_MODE") { + eprintln!( + "OUR_MODE plane={plane_idx} x={x} y={y} side={side} mode={predict_mode} \ + ad={angle_delta} fi={filter_intra:?} reach={reach:?}" + ); + } let tx_mode = if plane_idx == 0 { fi_tx_row(tx_mode, filter_intra) } else { @@ -21554,6 +21578,7 @@ fn read_plane( let levels = extend_corner(grid, tx_side, tx_side, side, side); let (dc_delta, ac_delta) = plane_q_delta(plane_idx, fctx); let tx = TxParams { + plane: plane_idx, w: side, h: side, bit_depth: bit_depth(fctx), @@ -27204,6 +27229,7 @@ fn decode_leaf_rect8( // fixture: the DCT route left ±1..30 sample errors on every // walked leaf's luma. let tx = TxParams { + plane: 0, w: tw, h: th, bit_depth: crate::decode::bit_depth(fctx), @@ -30606,6 +30632,7 @@ fn read_inter_plane_rect( // stride, so the dense `w x h` residual is re-laid at that stride // (`TxParams::stride`) after the inverse transform. let tx = TxParams { + plane: plane_idx, w, h, bit_depth: bit_depth(fctx), @@ -37710,6 +37737,7 @@ fn read_inter_plane( let grid = extend_corner(grid, tx_side, tx_side, side, side); let (dc_delta, ac_delta) = plane_q_delta(plane_idx, fctx); let tx = TxParams { + plane: plane_idx, w: side, h: side, bit_depth: bit_depth(fctx), diff --git a/crates/ec-av1/src/refusal_inventory.rs b/crates/ec-av1/src/refusal_inventory.rs index b00dd341..fa57f17e 100644 --- a/crates/ec-av1/src/refusal_inventory.rs +++ b/crates/ec-av1/src/refusal_inventory.rs @@ -301,7 +301,47 @@ const REFUSALS: &[&str] = &[ /// `a_real_aomenc_mixed_lossless_segment_frame_decodes_sample_exact` is the /// witness. #[cfg(test)] -const PROVEN: &[(&str, &str)] = &[ +/// Which KIND of proof each [`PROVEN`] row carries. +/// +/// A 2-tuple made every row look equally proven, which is the whole defect: +/// a row whose gate drives a hand-built stream into the guard and a row +/// whose gate sweeps an alphabet and shows nothing reaches it are held to +/// the same standard and read the same way. `label()` is what the tests +/// print, so the distinction is visible in the suite's own output. +/// +/// lane-av1refusalclaim r3 also proposed a third variant, `TablePin` +/// ("the arms are pinned exactly but the domain the table is REACHED over +/// is unestablished"). It is deliberately NOT carried: the one row it was +/// minted for now has a gate that establishes the reach domain +/// (`every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table` +/// reads the eight `decode_block_rect` call sites' own literal `bw`/`bh`, +/// pins the resulting chroma table exactly, and asserts the `(4,8)`/`(8,4)` +/// residual is UNPRODUCIBLE), so `Enumeration` is the honest tag and a +/// variant with no row would be dead weight. Re-add it the day a gate really +/// pins a table without measuring its caller domain -- and give it a row. +#[cfg(test)] +enum Proof { + /// A written stream REACHES the guard and is refused by this exact + /// string: the gate goes RED if the guard is removed. + NegativeGate, + /// The gate enumerates every input the guard can be reached over and + /// shows that none of them reaches it: it proves UNREACHABILITY, so it + /// is GREEN if the guard is removed. + Enumeration, +} + +#[cfg(test)] +impl Proof { + fn label(&self) -> &'static str { + match self { + Proof::NegativeGate => "NEGATIVE (reaches the guard; red on removal)", + Proof::Enumeration => "ENUMERATION (proves unreachability; green on removal)", + } + } +} + +#[cfg(test)] +const PROVEN: &[(&str, &str, Proof)] = &[ // lane-t900 r20, census: three real streams present exactly the 18 // `(side, write_w, write_h)` triples `INTER_BLOCK_SHAPES` lists, and // `rect_inter_residual_supported` covers every rectangular one -- the only @@ -318,6 +358,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding", "a_block_shape_census_over_three_real_streams_leaves_the_rect_residual_refusal_unreachable", + Proof::Enumeration, ), // lane-t900 r20, census: the shapes that can reach `decode_intra_rect_in_inter`'s // size-group/tx-category lookup are the ten rectangular census shapes with @@ -326,6 +367,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "an intra-coded {bw}x{bh} block on the inter block path (no size-group/tx-category row for that shape here)", "every_intra_in_inter_shape_the_census_lists_has_a_size_group_row", + Proof::Enumeration, ), // lane-t900 r20, census: the only sub-8 footprints three real streams // present are the 16x4/4x16 strips of a 16x16-level 1:4 partition, whose @@ -334,6 +376,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "an intra 16x4/4x16 strip inside an inter 16x16-level 1:4 partition (its 4:2:0 chroma pair is coded once for two strips; only the inter path implements that pairing)", "a_sub8_footprint_census_over_real_streams_leaves_the_intra_16x4_pairing_refusal_unreachable", + Proof::Enumeration, ), // lane-t900 r20, census: the rect transform tables and scans, enumerated // over the shapes the measured block-shape domain hands each helper (block @@ -347,14 +390,17 @@ const PROVEN: &[(&str, &str)] = &[ ( "a rectangular inter luma transform unit whose shape has no coefficient table set here", "every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan", + Proof::Enumeration, ), ( "a rectangular inter chroma transform unit whose shape has no coefficient table set here", "every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan", + Proof::Enumeration, ), ( "a rectangular transform unit whose shape has no coefficient scan table here", "every_rect_transform_shape_the_census_lists_has_a_coefficient_table_and_scan", + Proof::Enumeration, ), // lane-t900 r21, enumeration: a var-tx leaf is never larger than the unit // the tree was entered with, and both callers enter at or below their own @@ -363,10 +409,12 @@ const PROVEN: &[(&str, &str)] = &[ ( "an inter var-tx tree with a leaf transform larger than 32x32", "a_var_tx_tree_never_presents_a_leaf_larger_than_the_unit_it_entered", + Proof::Enumeration, ), ( "an inter var-tx tree with a leaf transform larger than 64x64", "a_var_tx_tree_never_presents_a_leaf_larger_than_the_unit_it_entered", + Proof::Enumeration, ), // Pre-existing proofs, registered by lane-t900 r21: a negative gate (a // hand-built 12-bit sequence header is refused BY THIS EXACT STRING rather @@ -380,32 +428,38 @@ const PROVEN: &[(&str, &str)] = &[ ( "a 32x32 partition type this decoder does not code (value={part32})", "every_partition_value_of_an_enumerated_alphabet_has_an_arm", + Proof::Enumeration, ), ( "an INTER 32x32 partition type this decoder does not code (value={part32})", "every_partition_value_of_an_enumerated_alphabet_has_an_arm", + Proof::Enumeration, ), ( "a 128x128 superblock partition value outside the 8-symbol alphabet", "every_partition_value_of_an_enumerated_alphabet_has_an_arm", + Proof::Enumeration, ), // lane-t900 r24, enumeration: the key-frame superblock root's own `match` // has an arm for all ten `partition_w64` values. ( "a superblock-level partition value outside PARTITION_NONE..PARTITION_VERT_4", "every_partition_value_of_an_enumerated_alphabet_has_an_arm", + Proof::Enumeration, ), // lane-t900 r24, enumeration: the inter 16x16-level if/else chain's // branches name all ten `partition_w16` values between them. ( "an inter 16x16-level partition value outside NONE/HORZ/VERT/SPLIT/AB/1:4", "every_partition_value_of_an_if_chain_alphabet_is_named_by_a_branch", + Proof::Enumeration, ), // lane-t900 r24, enumeration: every (CDF width, symbol) pair a tx_type row // can present maps to a distinct member of that width's own set. ( "a tx_type symbol outside its CDF's own set: {t}", "every_tx_type_symbol_of_every_cdf_width_maps_into_its_own_set", + Proof::Enumeration, ), // lane-t900 r24 + lane-av1txr RE-PIN, measured: the reader covers spec // 5.11.40's whole value domain (`0..=(1 << 20) - 2`, both ends of every @@ -419,6 +473,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a Golomb tail longer than this decoder reads", "read_golomb_reads_every_value_a_conformant_stream_can_carry", + Proof::Enumeration, ), // lane-t900 r25, enumeration: `parse_tile_group` is the only producer of // the `tiles` vector `decode_stream` tests, and its success path always @@ -427,6 +482,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a frame OBU with no tile group", "a_frame_obu_that_parses_always_carries_at_least_one_tile", + Proof::Enumeration, ), // lane-t900 r25, negative gates: hand-built streams that reach each // refusal by name and output no picture (a `show_existing_frame` header @@ -434,10 +490,12 @@ const PROVEN: &[(&str, &str)] = &[ ( "a show_existing_frame header naming an empty reference slot", "a_show_existing_frame_header_naming_an_empty_slot_is_refused_by_name", + Proof::NegativeGate, ), ( "an inter frame with no key frame before it", "an_inter_frame_opening_a_stream_is_refused_by_name", + Proof::NegativeGate, ), // lane-t900 r25, enumeration: a motion_mode/obmc symbol is read only under // `is_motion_variation_allowed_bsize` (min side >= 8), and each of the 17 @@ -446,6 +504,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a motion_mode symbol for a block shape with no CDF row here", "every_shape_that_allows_motion_variation_has_a_motion_mode_cdf_row", + Proof::Enumeration, ), // lane-av112bit: real-aomenc 12-bit streams, each refused by name // (the gates encode with aomenc --bit-depth=12 and assert the exact @@ -470,6 +529,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a chroma format of 4:2:2 (subsampling_x != subsampling_y): this decoder decodes 4:2:0 and 4:4:4; 4:2:2 is not ported, and 4:4:0 (0,1) is not a codable cell", "a_non_420_subsampled_sequence_header_is_refused_by_name", + Proof::NegativeGate, ), // lane-av1txr-r2 paired, lane-av1-qmatrix RETIRED with its gate: the // refusal's witness is now @@ -488,6 +548,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "an intra mode this decoder does not code (round 2)", "every_intra_mode_symbol_of_the_y_mode_alphabet_is_coded", + Proof::Enumeration, ), // lane-t900 r26, enumeration: `compute_image_size` is 0 only for a zero // frame width/height, which no path a header can code produces (swept @@ -495,6 +556,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a frame with no mode-info grid", "every_frame_size_a_header_can_code_has_a_mode_info_grid", + Proof::Enumeration, ), // lane-t900 r26, negative gates: written streams that reach each refusal // by name (a 64x32 inter frame over a 64x64 reference; a stream opening on @@ -511,6 +573,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a reference frame selected with no picture at this frame's own ref_frame_idx slot for it", "a_selected_reference_with_an_empty_ref_frame_idx_slot_refuses_by_name", + Proof::NegativeGate, ), // lane-t900 r27, negative gate + census: a written key frame carrying // each of the three mode-overriding features (over three segment ids) is @@ -536,6 +599,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a frame whose segmentation enables SEG_LVL_REF_FRAME/SKIP/GLOBALMV (this decoder reads segment_id but never lets a segment override a block's reference, skip or mode)", "a_frame_whose_segmentation_overrides_a_block_mode_is_refused_by_name", + Proof::NegativeGate, ), // lane-t900 r27, structural audit + witness: `record_inter_rect_mi` is the // single writer of the interp-filter neighbour band, and no call site @@ -549,6 +613,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "an OBMC neighbour whose switchable interp filter was never recorded", "every_inter_record_publishes_an_obmc_readable_filter", + Proof::Enumeration, ), // lane-t900 r28: all three scaled-reference (superres) refusals -- the // 8x8 partition leaf, the sub-8x8 inter block and warp -- are LIFTED and @@ -564,10 +629,12 @@ const PROVEN: &[(&str, &str)] = &[ ( "a coded HORZ/VERT strip whose chroma transform has no rect coefficient tables here", "every_rect_strip_shape_the_split_path_codes_has_a_luma_and_chroma_table", + Proof::Enumeration, ), ( "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma coefficient tables for that shape here)", "every_rect_strip_shape_the_split_path_codes_has_a_luma_and_chroma_table", + Proof::Enumeration, ), // lane-av1-refusalaudit, enumeration + witness2 hunt: decode_block_rect64's // chroma-unit table covers every conformant 64-axis strip unit in both @@ -581,6 +648,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a 64-axis strip whose chroma unit has no coefficient table", "every_chroma_unit_a_64_axis_strip_can_present_has_a_coefficient_table", + Proof::Enumeration, ), // lane-av1rect8x16, enumeration: `decode_block_rect`'s `_` arm. The nine // textual `decode_block_rect(` matches are 1 declaration + 8 call sites @@ -602,6 +670,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "a rectangular chroma transform whose size has no coefficient table", "every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table", + Proof::Enumeration, ), // lane-t900 r33, enumeration: each of the four symbols this guard tests is // read under a size gate that no 128-pixel side passes (the call site's @@ -610,6 +679,7 @@ const PROVEN: &[(&str, &str)] = &[ ( "CfL, filter intra or a palette on a 128-root HORZ/VERT intra block (every one of their size gates caps at 64x64 or below, so none of these symbols exists there)", "no_128_root_half_reads_a_cfl_filter_intra_or_palette_symbol", + Proof::Enumeration, ), // lane-av1txr: the sub-8x8 intrabc refusal this census pinned is GONE (the // capability landed; see the note in `REFUSALS`). The census gate survives @@ -628,10 +698,12 @@ const PROVEN: &[(&str, &str)] = &[ ( "a reference picture whose height does not match this frame's own true size", "an_inter_frame_shorter_than_its_reference_is_refused_by_name", + Proof::NegativeGate, ), ( "a frame naming primary_ref_frame at a reference slot with no saved CDF state", "an_inter_frame_naming_an_unrefreshed_primary_ref_slot_is_refused_by_name", + Proof::NegativeGate, ), ]; @@ -703,7 +775,8 @@ pub(crate) fn pins_refusal(src: &str, refusal: &str) -> bool { #[cfg(test)] mod tests { use super::{ - CAPABILITY_CLAIMS, GATES_THAT_SKIP_ON_A_DECODE_ERROR, PROVEN, REFUSALS, squash_source, + CAPABILITY_CLAIMS, GATES_THAT_SKIP_ON_A_DECODE_ERROR, PROVEN, Proof, REFUSALS, + squash_source, }; use std::collections::BTreeSet; @@ -2544,7 +2617,7 @@ mod tests { let mut neither: Vec<&str> = Vec::new(); let mut unanchored: Vec = Vec::new(); let mut unbounded: Vec = Vec::new(); - for (reason, gate) in PROVEN { + for (reason, gate, _kind) in PROVEN { assert!( found.contains(*reason), "{reason:?} is listed as proven but is no longer a decode-path refusal -- \ @@ -2646,7 +2719,7 @@ mod tests { #[test] fn every_named_gate_body_is_bounded_in_these_files() { let mut resolved = 0usize; - for (reason, gate) in PROVEN { + for (reason, gate, _kind) in PROVEN { let body = gate_body(gate).unwrap_or_else(|why| panic!("{reason:?} names {gate}: {why}")); assert!( @@ -2668,6 +2741,82 @@ mod tests { } } + /// The taxonomy is a CLAIM about each row, so it carries its own + /// non-vacuity: every variant is used by at least one row (a variant no + /// row can be in is not a category), the two labels do not collapse into + /// one string, and the row lane-av1refusalclaim r3 wanted to RE-TAG is + /// tagged from evidence inside its own gate BODY -- never from the + /// gate's name, which is the only thing the previous 2-tuple carried. + /// + /// r3 minted a `TablePin` variant because "a rectangular chroma transform + /// whose size has no coefficient table" was pinned to a table whose + /// REACHED-OVER domain had never been measured. Main has since replaced + /// that row's gate with one that reads the eight `decode_block_rect` call + /// sites' own literal `bw`/`bh`, pins the resulting chroma table exactly, + /// and asserts the `(4,8)`/`(8,4)` residual is UNPRODUCIBLE. `Enumeration` + /// is therefore the honest tag and `TablePin` is not carried; if a later + /// edit weakens that gate back to a bare table pin, the three evidence + /// pins below go red instead of leaving the row quietly overclaiming. + #[test] + fn every_proven_row_names_which_kind_of_proof_it_carries() { + let mut negative = 0usize; + let mut enumeration = 0usize; + for (reason, gate, kind) in PROVEN { + eprintln!(" {} -- {reason:?} -> {gate}", kind.label()); + match kind { + Proof::NegativeGate => negative += 1, + Proof::Enumeration => enumeration += 1, + } + } + assert_eq!( + negative + enumeration, + PROVEN.len(), + "a PROVEN row carries no proof kind, so the table says nothing about it" + ); + assert!( + negative > 0, + "no row is tagged NEGATIVE, so the NegativeGate variant is dead weight" + ); + assert!( + enumeration > 0, + "no row is tagged ENUMERATION, so the Enumeration variant is dead weight" + ); + assert_ne!( + Proof::NegativeGate.label(), + Proof::Enumeration.label(), + "the two kinds print the same string, so the taxonomy is one category in two hats" + ); + + let (reason, gate, kind) = PROVEN + .iter() + .find(|(reason, _, _)| { + *reason == "a rectangular chroma transform whose size has no coefficient table" + }) + .map(|(reason, gate, kind)| (*reason, *gate, kind)) + .expect("the (4,8) chroma-table row left PROVEN"); + assert!( + matches!(kind, Proof::Enumeration), + "{reason:?} is tagged {:?}, but its gate enumerates the caller domain", + kind.label() + ); + let body = gate_body(gate).unwrap_or_else(|why| panic!("{reason:?} names {gate}: {why}")); + for evidence in [ + "the number of decode_block_rect call sites changed", + "for residual in [(4usize, 8usize), (8, 4)]", + "the caller set can now produce a 4x8/8x4 chroma shape", + ] { + assert!( + body.contains(evidence), + "{gate} no longer carries {evidence:?}, so the Enumeration tag on {reason:?} \ + claims a reach domain the gate has stopped measuring" + ); + } + eprintln!( + "refusal inventory: {negative} NEGATIVE, {enumeration} ENUMERATION of {} PROVEN rows", + PROVEN.len() + ); + } + /// Lane-av1refusalspan: the invariant that catches a boundary that /// over-reaches. Tested on its own text, so it cannot be satisfied by the /// scanner happening to be right on the current sources. diff --git a/crates/ec-av1/src/transform.rs b/crates/ec-av1/src/transform.rs index dce1830d..4e8b1d4b 100644 --- a/crates/ec-av1/src/transform.rs +++ b/crates/ec-av1/src/transform.rs @@ -1381,6 +1381,15 @@ pub fn dequant_and_inverse_typed_wh( // the twin of the oracle's `EC_DQCOEFF` rung (whose own layout is // column-major `input[c * h + r]`), so a residual mismatch whose // levels already agree is separable into dequant vs transform. + // + // LOSSY PATH ONLY (lane-av1loss444mm): a LOSSLESS 4x4 unit never + // reaches this function -- `decode.rs` routes it to + // `dequant_and_inverse_wht4x4` -- so on a lossless stream this rung + // printed NOTHING while the oracle's printed thousands of lines, and + // that silence reads as "no coefficients" rather than "wrong function". + // The lossless twin is `OUR_DQW` in `dequant_and_inverse_wht4x4`, + // below; both carry `plane=` so a chroma grid can be told from a luma + // one (the oracle's line carries it too). if crate::envflags::env_flag!("EC_DQCOEFF") { let nz: Vec = dq .iter() @@ -3144,6 +3153,7 @@ pub fn inverse_wht4x4(dq: &[i32]) -> Vec { /// marker contract). pub fn dequant_and_inverse_wht4x4( levels: &[i32], + plane: usize, bit_depth: u8, q_idx: i32, dc_delta: i32, @@ -3160,6 +3170,35 @@ pub fn dequant_and_inverse_wht4x4( crate::quant::dequant_wh_into( levels, &mut dq, 4, 4, bit_depth, q_idx, dc_delta, ac_delta, None, ); + // lane-av1loss444mm: the LOSSLESS half of the oracle's `EC_DQCOEFF` + // twin. Same env var, same `pos:value` nonzero form, PLUS `plane=` + // -- which is what makes the two ladders pairable: without it a 4x4 + // chroma grid is indistinguishable from a luma one and an + // order-paired comparison of the two sides collapses (measured on + // `ll444-lossless-key.obu`: equal unit counts and value ratios of + // exactly 1.0, yet 16 of 2053 units matched). + if crate::envflags::env_flag!("EC_DQCOEFF") { + let nz: Vec = dq[..16] + .iter() + .enumerate() + .filter(|&(_, &v)| v != 0) + .map(|(i, &v)| format!("{i}:{v}")) + .collect(); + // `lv=` is the RAW level grid the dequant consumed: if `nz` is + // empty while `lv` is not, `dequant_wh_into` is what zeroed it, and + // this line says so instead of leaving the next lane to infer it. + let lv: Vec = levels[..16] + .iter() + .enumerate() + .filter(|&(_, &v)| v != 0) + .map(|(i, &v)| format!("{i}:{v}")) + .collect(); + eprintln!( + "OUR_DQW plane={plane} w=4 h=4 q={q_idx} dcd={dc_delta} acd={ac_delta} nz={} lv={}", + nz.join(","), + lv.join(",") + ); + } inverse_wht4x4(&dq[..16]) }) } @@ -3200,6 +3239,7 @@ pub fn dequant_and_inverse_wht4x4( /// Returns the same empty-grid marker as [`dequant_and_inverse_wht4x4`]. pub fn dequant_and_inverse_wht( levels: &[i32], + plane: usize, w: usize, h: usize, bit_depth: u8, @@ -3208,7 +3248,7 @@ pub fn dequant_and_inverse_wht( ac_delta: i32, ) -> Vec { if w == 4 && h == 4 { - return dequant_and_inverse_wht4x4(levels, bit_depth, q_idx, dc_delta, ac_delta); + return dequant_and_inverse_wht4x4(levels, plane, bit_depth, q_idx, dc_delta, ac_delta); } if crate::decode::is_zero_grid(levels) { return Vec::new(); @@ -3227,7 +3267,8 @@ pub fn dequant_and_inverse_wht( }; } } - let res = dequant_and_inverse_wht4x4(&tile, bit_depth, q_idx, dc_delta, ac_delta); + let res = + dequant_and_inverse_wht4x4(&tile, plane, bit_depth, q_idx, dc_delta, ac_delta); // An all-zero tile dequantizes to the same empty marker a 4x4 // caller passes straight through, and `out` is already zero -- // copying out of it would index an empty slice. @@ -3342,12 +3383,13 @@ mod lossless_tx_tests { }; for &(w, h) in &[(8usize, 4usize), (4, 8), (8, 8), (16, 4), (4, 16), (16, 16)] { let levels: Vec = (0..w * h).map(|_| next()).collect(); - let got = super::dequant_and_inverse_wht(&levels, w, h, 10, 0, 0, 0); + let got = super::dequant_and_inverse_wht(&levels, 0, w, h, 10, 0, 0, 0); let mut want = vec![0i32; w * h]; for ty in 0..h / 4 { for tx in 0..w / 4 { let unit = super::dequant_and_inverse_wht4x4( &tile_of(&levels, w, tx, ty), + 0, 10, 0, 0, @@ -3382,7 +3424,7 @@ mod lossless_tx_tests { levels[0] = 400; levels[1] = -240; levels[2] = 88; - let got = super::dequant_and_inverse_wht(&levels, 8, 4, 10, 0, 0, 0); + let got = super::dequant_and_inverse_wht(&levels, 0, 8, 4, 10, 0, 0, 0); assert_eq!(got.len(), 32, "8x4 residual length"); let mut want = vec![0i32; 32]; for (tx, ty) in [(0usize, 0usize), (1, 0)] { @@ -3392,7 +3434,7 @@ mod lossless_tx_tests { t[r * 4 + c] = levels[(ty * 4 + r) * 8 + tx * 4 + c]; } } - let unit = super::dequant_and_inverse_wht4x4(&t, 10, 0, 0, 0); + let unit = super::dequant_and_inverse_wht4x4(&t, 0, 10, 0, 0, 0); if unit.is_empty() { continue; } @@ -3422,8 +3464,8 @@ mod lossless_tx_tests { }) .collect(); assert_eq!( - super::dequant_and_inverse_wht(&levels, 4, 4, 8, 0, 0, 0), - super::dequant_and_inverse_wht4x4(&levels, 8, 0, 0, 0), + super::dequant_and_inverse_wht(&levels, 0, 4, 4, 8, 0, 0, 0), + super::dequant_and_inverse_wht4x4(&levels, 0, 8, 0, 0, 0), "levels={levels:?}" ); } @@ -3437,7 +3479,7 @@ mod lossless_tx_tests { #[test] fn a_non_4x4_all_zero_lossless_unit_keeps_the_empty_marker() { assert!( - super::dequant_and_inverse_wht(&[0i32; 32], 8, 4, 10, 0, 0, 0).is_empty(), + super::dequant_and_inverse_wht(&[0i32; 32], 0, 8, 4, 10, 0, 0, 0).is_empty(), "an all-zero 8x4 lossless unit must stay the empty marker" ); } diff --git a/lanes/av1444rect.report.md b/lanes/av1444rect.report.md index 709ecc4a..5c907ad0 100644 --- a/lanes/av1444rect.report.md +++ b/lanes/av1444rect.report.md @@ -352,6 +352,42 @@ most likely a counting-shape difference (our var-tx leaves versus libaom's unit walk) rather than a walk defect; it is NOT established either way, and I am not claiming it. +### Round 6 — the caller is NAMED + +Main's ask was to name the caller of the `read_coeffs_rect(4, 8, skip_ctx=0)` +shape. Done with `#[track_caller]` on `read_coeffs_rect` and on +`read_inter_plane_rect`, which turns every call into a file:line tag with no +backtrace and no per-site edit. One run, exact answer: + +| bit | call site | plane | x, y | w x h | around | +|---|---|---|---|---|---| +| 6885 | `decode.rs:13165` | 0 | 416, 368 | 8x16 | (0,0,0) | +| **6893 (the fork)** | **`decode.rs:13184`** | **1 (U)** | **208, 184** | **4x8** | **(0,0,0)** | +| 6902 | `decode.rs:13202` | 2 (V) | 208, 184 | 4x8 | (0,0,0) | + +All three are inside **`decode_intrabc_rect`** (`decode.rs:12955`), its +non-lossless whole-block rect arm — the `read_inter_plane_rect` triple for +luma then U then V off one shared +`around_mi_rect((mi_r, mi_c), bw, bh)` gather. The luma unit is 8x16, the +chroma units 4x8, which at ss (0,0) means a **4x8 chroma unit under a 4x16 +luma plane block** — the sub-8 unit walk, which is exactly the prior Agent142-2's +census established and exactly the class shape. + +So the third instance of this lane's class is not a pair extent at all in its +outward form: it is one gather, taken at the LUMA footprint, serving a CHROMA +unit whose own extent is half that on the long axis. At 4:2:0 the two coincide +after subsampling, which is why the 4:2:0 twin is byte-exact; at 4:4:4 they do +not. + +**A second observation that is NOT yet established and I am not claiming:** at +this same bit the oracle reports mi (90,108) — luma px (360,432) — while our +chroma unit is at px (208,184), mi (46,52). Every read before this one paired +exactly, so both decoders are at the same bit position after the same number of +reads, which is hard to reconcile with a different block. Either the oracle's +`xd->mi_row/mi_col` is not naming the same block our `x, y` name, or there is a +position divergence I have not localised. Not established; recorded so the next +lane does not have to rediscover the discrepancy. + **Handed back, not landed.** The remaining 4:4:4 intra-BC defect is a **4x8 rect coefficient unit**, present with 1:4 and rect partitions both disabled, and it is neither of the two candidates the follow-up named. Landing a partial @@ -370,10 +406,16 @@ fork left in this cell. ## 7. Residue handed on, not fixed here -- **4:4:4 intra-BC chroma** — a 4x8 rect coefficient unit: read 12465, - mi (90,108), `read_coeffs_rect(w=4, h=8, skip_ctx=0)` at bit 6893; U and V - first wrong at index 20532. Per §6; both originally-named candidates - eliminated by measurement, so this needs a fresh start, not a continuation. +- **4:4:4 intra-BC chroma** — a 4x8 rect coefficient unit. CALLER NAMED in + round 6: `decode_intrabc_rect` (`decode.rs:12955`), the non-lossless + whole-block rect arm, at `decode.rs:13184` (U) and `13202` (V). One gather, + `around_mi_rect((mi_r, mi_c), bw, bh)`, taken at the LUMA footprint and + serving a 4x8 chroma unit under a 4x16 luma plane block; at 4:2:0 the two + coincide after subsampling (hence the exact 4:2:0 twin) and at 4:4:4 they do + not. Fork read 12465, bit 6893, U and V first wrong at index 20532. Both + originally-named candidates and the token-order hypothesis remain dead by + measurement. Unexplained and unclaimed: at that bit the oracle reports mi + (90,108) while our unit is at px (208,184) — see §6. - **H2** and **H3** are with Agent24-2 as of this writing (Agent142-2's round closed with the census committed); §5's retraction is the record they need. - **H4** — 4:4:4 lossless + tile rows, hard divergence. Own lane; untouched. diff --git a/lanes/av1readcensus.report.md b/lanes/av1readcensus.report.md index c7e24d21..41be7e3e 100644 --- a/lanes/av1readcensus.report.md +++ b/lanes/av1readcensus.report.md @@ -1,8 +1,9 @@ # lane-av1readcensus — the 4:4:4 coefficient-read count asymmetry, settled -**Branch:** `lane-av1readcensus`, worktree `~/.cache/wt/av1readcensus`, stacked on -`lane-av1chrtx` (`ff7cf47c`, whose `d791c464` threaded the real plane index into -`read_coeffs_rect`'s traces — the census pairs on that). +**Branch:** `lane-av1chrtx` (my charter's branch), worktree `~/.cache/wt/av1chrtx`. +The census commit `ea97eb0c` sits on top of `ff7cf47c`, whose `d791c464` threaded +the real plane index into `read_coeffs_rect`'s traces — the census pairs on that, +and reuses its `plane` argument rather than adding a second one. **Verdict: COUNTING SHAPE — and not even that. On every pixel-exact 4:4:4 arm there is no asymmetry at all: both sides walk the same number of units, in the diff --git a/lanes/av1testcount.report.md b/lanes/av1testcount.report.md new file mode 100644 index 00000000..43093e88 --- /dev/null +++ b/lanes/av1testcount.report.md @@ -0,0 +1,161 @@ +# lane-av1testcount — test-count census of the 13-branch merge wave + +**Read-only.** No repository file was edited except this report, which is +committed on branch `lane-av1testcount` (worktree `~/.cache/wt/av1testcount`). +Every number comes from `cargo test -p ec-av1 --lib -- --list` executed in a +throwaway `git worktree` at each commit, in per-batch private +`CARGO_TARGET_DIR`s (`~/.cache/cargo-target-tc1..4`) — the shared house target +dir is not used, because a shared dir serves a sibling lane's binary and would +have made this census a census of someone else's tree +(`skill://counterfactual-ab-target-dir-provenance` variant 5). All 15 census +worktrees were removed afterwards. + +**Re-measured 2026-09-30 (lane-breconcile), because main has moved well past +`9623bcab` and a reader must not mistake this for a count of TODAY's tests.** +Both anchors re-derived from scratch with `cargo test -p ec-av1 --lib -- --list` +on fresh `git archive` extracts with private target dirs: + +``` +298f75c4 (pre-merge base) 712 raw --list lines, 712 unique +9623bcab (merged main) 742 raw, 742 unique +b307aaeb (this tree) 802 raw, 802 unique +``` + +So the load-bearing arithmetic still holds — 712 and 742 are what they were, +and they are immutable facts about two immutable commits — but the tree this +report's numbers would be compared against is now **802**, not 742. The 13 +per-branch tip counts in §1 were NOT re-taken (13 more throwaway builds); they +are the lane's own figures and are not re-verified here. What is re-verified is +the pair the reconciliation stands on, plus zero duplicate registrations at +both anchors, which is the property §2 names. + +## 1. The two commits + +| role | commit | subject | +|---|---|---| +| pre-merge base | `298f75c4` | `gitignore: let per-crate fixture pins be added without -f` | +| merged main | `9623bcab` | `Merge lane-av1superpin @ 9646f74d — superres den=9 + mode-2 pins, shared helper, report corrections` | + +The 13 merges in `298f75c4..9623bcab`, newest first, with the branch tip taken +from each merge's second parent: + +| # | merge | branch | tip | tests at the tip | NEW names vs base | base tests the tip does NOT carry | note | +|---|---|---|---|---|---|---|---| +| 1 | `9623bcab` | lane-av1superpin | `9646f74d` | 708 | **+4** | **8** | **the tip predates 8 base gates** — see the correction below | +| 2 | `afa13bcf` | lane-whtshape | `f541d062` | 717 | +5 | 0 | | +| 3 | `9a9e3674` | lane-av1lm444loss | `9249442f` | 713 | +1 | 0 | | +| 4 | `764ba257` | lane-av1dualfilter10 | `c2b969c8` | 715 | +3 | 0 | | +| 5 | `a5867794` | lane-av1distwtd | `1aaf7e0b` | 714 | +2 | 0 | | +| 6 | `7f8817cb` | lane-av1pins | `44a05b40` | 712 | +0 | 0 | | +| 7 | `e96de012` | lane-av1superhbd | `a2da03e4` | 717 | +5 | 0 | | +| 8 | `b4c45166` | lane-av1tilemeasure | `df1370dd` | 716 | +4 | 0 | | +| 9 | `962945ce` | lane-av1toolgates | `4c4bd3e2` | 714 | +2 | 0 | | +| 10 | `10db0dc2` | lane-av1mutproof | `ffd8d138` | 712 | +0 | 0 | | +| 11 | `0eb19c11` | lane-av1gates444 | `555c83f3` | 715 | +3 | 0 | | +| 12 | `5e9c7715` | lane-av1skipfix | `960be978` | 712 | +0 | 0 | | +| 13 | `e443a86e` | lane-av1chrtx | `ea97eb0c` | 715 | +3 | 0 | | +| | | | **sum** | | **+32** | **8** | | + +**Correction (r1, after review).** The first version of this table had a +`tests at tip (base-relative delta)` column that printed `708 (+4)` on row 1, +which does not satisfy `tip = base + delta` — 712 + 4 = 716, not 708 — while +every other row did, on the row that names the merge head. The cause: the +column conflated two different numbers, "names the tip adds" and "net change". +`lane-av1superpin`'s tip `9646f74d` is **708 = 712 + 4 new - 8 removed**: it +was cut from a tree OLDER than `298f75c4` and does not carry 8 gates the base +already had — + +``` +a_444_12bit_inter_sequence_decodes_pixel_exact +a_444_intrabc_rect4_reads_its_own_chroma_plane_block +a_4to20_key_frame_takes_the_left_chroma_reference_read_its_libaom_row +a_lossless_444_10bit_inter_stream_decodes_pixel_exact +a_lossless_444_128_root_lossless_stream_reads_chunks_chunk_major +a_lossless_444_rect16x4_chroma_reach_is_ss_aware +a_pinned_444_inter_stream_chroma_units_inherit_their_own_quadrants_tx_type +a_real_aomenc_odd_coded_dimension_streams_decode_pixel_exact +``` + +— all eight of which ARE on merged main, so nothing was lost; the merge simply +took the base's copies. The conclusion of §2 is unaffected, because it is +stated over the UNION of new names and separately over base-minus-main, and +both of those are 0. What changes is the rule a future census must state +explicitly: **a branch tip is not `base + delta` unless the tip also carries +every base test.** The per-branch column is now three numbers, and a tip with a +non-zero "does NOT carry" cell is flagged. + +## 2. The arithmetic + +``` +pre-merge base 298f75c4 712 tests +sum of the 13 branches' NEW names + 32 (4+5+1+3+2+0+5+4+2+0+3+0+3) +distinct new names across all 13 - 2 (two names declared by TWO branches) + ------ +base + distinct new = 712 + 30 = 742 +merged main 9623bcab 742 tests +DELTA 0 +``` + +The 32 is a sum over the "NEW names" column, not over net per-branch deltas: +one tip (`9646f74d`) is cut from an older base and does not carry 8 base +tests, so its net is -4 while it adds 4. Summing nets would give 712 + 20 and +would NOT reconcile — which is exactly why the per-branch column above is +three numbers now. The reconciliation that holds is the one over the UNION of +new names plus the separate, independent check that the base survives intact +(`base - main = 0`, below): 8 base tests that one branch never carried are +still on main, taken from the base side of the merge. + +Every set operation, computed on the sorted name lists: + +| check | result | +|---|---| +| branch test names ABSENT from merged main (a silently dropped gate) | **0** | +| tests on merged main that are in no branch and not in the base | **0** | +| tests in the base that are GONE from merged main (a rename or a removal) | **0** | +| duplicate registrations on merged main (`--list \| sort \| uniq -d`) | **0** — 742 raw lines, 742 unique | +| per-branch duplicate NAMES (the risk that matters) | **2**, both resolved below | + +**The census reconciles exactly: 712 + 30 = 742, delta 0, nothing lost, +nothing renamed, nothing duplicated.** The merge dropped no gate, and no +conflict resolution silently took one side of an add/add. + +## 3. The two duplicate names, checked for a lost assertion + +A duplicate name across branches is the one way the count can look right while +an assertion is lost: the merge keeps one side, the other side's body is gone. +Both were diffed, body against body, at the two tips that declare them: + +| duplicate name | declared by | verdict | +|---|---|---| +| `stream::tests::a_distance_weighted_compound_stream_decodes_pixel_exact` | lane-av1dualfilter10 (`c2b969c8`) and lane-av1distwtd (`1aaf7e0b`) | **byte-identical** (188 lines each, `cmp` equal) — the same gate declared twice, not two gates. Nothing lost. | +| `gate_coverage::tests::the_detector_sees_the_gates_the_spelling_filter_missed` | lane-av1distwtd (`1aaf7e0b`) and lane-av1dualfilter10 (`c2b969c8`) | **byte-identical** (61 lines each, `cmp` equal) — same. lane-av1toolgates does not declare it at all, so the pair is the one above. | + +So the 2-test difference between "sum of deltas" (32) and "distinct new names" +(30) is fully explained: two gates were each written twice, identically, by two +lanes that had not seen each other. That is a coordination miss between +lane-av1dualfilter10 and lane-av1distwtd, not a merge loss. + +## 4. The number for the next wave + +A wave that merges N branches should satisfy +`merged == pre_merge_base + (sum of branch deltas) - (duplicate names across +branches)`, and separately report `base - merged == 0` (nothing renamed or +dropped) and `--list | sort | uniq -d` empty (nothing shadowed). This wave: +**712 -> 742, +30 distinct tests (+4.2%), 13 branches, ~2.3 tests per branch.** +The charter's expectation of "~35 gates this wave added" is close but high by +five: measured 30 distinct (32 summed before the duplicate collapse). Three of +the thirteen branches (pins, mutproof, skipfix) add no test at all, which is +where the difference lives. + +## 5. Limits of this census, stated so nobody over-reads it + +- It compares NAMES. A branch that changed the BODY of an existing gate in + place (rather than adding one) moves no name and is invisible here — the + per-branch diffs of `stream.rs` would be the tool for that, and this lane + makes no claim about bodies. +- It counts `#[test]`s in the `ec-av1` LIB target only (`--lib`), which is + where every gate in this crate lives; the crate has no `tests/` directory and + no other test target. +- `--list` was used throughout; nothing was run, so a test that is registered + but red would still count as present. That is the question this census asks + (did it survive the merge), not whether it passes. diff --git a/lanes/av1tilerows.report.md b/lanes/av1tilerows.report.md index e6e7fd97..8b922706 100644 --- a/lanes/av1tilerows.report.md +++ b/lanes/av1tilerows.report.md @@ -308,3 +308,49 @@ no-op for the only format with committed coverage on this path. **Net class status: the class is closed except for this one site, which is proven reachable and documented rather than silently changed.** + +## 17. Round 9 — on merged main (`e719050d`): the fork is GONE + +Main absorbed seven lanes at `e719050d`, including a 128-root token-walk +change (`mu_chunk_order`) that sits squarely in the area rounds 3-8 were +chasing. Re-measured on a clean detached worktree at `e719050d` (`main` is +already checked out elsewhere); my fix `4e151813` is an ancestor there and +the reach call is ss-aware, so the base is sound. + +**Step 1 — does the fork still exist? NO.** + +Same recipe and stream (`v2_c40.obu`, 4:4:4 lossy cq-40, `--sb-size=128`, +256x256, 36 shown frames): + +| tree | wrong per frame | +|---|---| +| my base (rounds 3-8) | 1415 ... 62614 ... diverges throughout | +| **merged main `e719050d`** | **0 on all 36 frames** | + +And the entropy, which is the authoritative measure: + + oracle reads 217570 merged-main reads 217570 + ENTROPY LOCKSTEP over 217570 reads + +Identical read COUNTS and no value/range/symbol/post_rng divergence over the +entire stream. The read-41976 fork, the 32-vs-64 transform-class +disagreement, and every downstream desync are absent on main. + +**Which merged change owns it — partially answered, and I will not guess past +what I measured.** The obvious candidate in my named area is av1h5's +`mu_chunk_order` ("read a 128 root's tokens CHUNK-major, not block-raster", +absent from my base). Ablated it: `4155c7c7` + my fix + `8a91ee14` alone +**still diverges** (1415, 1582, 478, 62614, 60028, ...). So that commit is +NOT sufficient on its own. I could not build the all-three-av1h5 arm — the +cherry-pick of `34b56884`/`f6fbad26` onto my base **conflicts** — so this +round reports one negative result and stops, rather than attributing. + +**What this means for rounds 3-8.** The 128-root leaf-size disagreement those +rounds named is real, was correctly localised to the 128-root token walk, and +is fixed on main by one of the seven merged lanes. What produced it: the +`EC_SYMR` read-class tags (which proved both decoders were in the SAME read +function and that the difference was table class, not symbol class), the +`n=7` disambiguation against libaom's `eob_flag_cdf64`, and the four +retractions that kept a wrong fix from shipping. The parked inter-64x64 +`EC_PART_VAL` alignment fix stays parked — main now answers the question +outright, so it is no longer needed. diff --git a/lanes/breconciliation.report.md b/lanes/breconciliation.report.md new file mode 100644 index 00000000..8f3567bf --- /dev/null +++ b/lanes/breconciliation.report.md @@ -0,0 +1,367 @@ +# Branch reconciliation — landing (or refuting) the census's ranked residue + +**Branch:** `lane-breconcile`, worktree `~/.cache/wt/breconcile`, forked from +`main`@`7538a841`. +**Nothing pushed, nothing merged to `main`, no rustfmt, no lane branch edited or +deleted.** The primary checkout was never written to (§6). + +**Inputs.** `lanes/branchcensus2.report.md` §2, ranked 1-9. Its §1 snapshot was +`main`@`52c62c15`; rank #1 had already landed as `7538a841` before this lane +started, so this pass covers ranks #2-#9. + +**The governing fact.** The census's §2 ranking is a snapshot of *what was +missing*, and it was measured, not argued: every classification in it survives. +What does NOT always survive is the *reason* it gave. Two of the nine items rest +on a rationale written against a weaker artifact that main has since replaced — +#2's `Proof::TablePin` and #4/#3's premise about which gate a row names. Those +were re-checked against main's current code and one is refuted (§1.3, §1.5). + +--- + +## 1. One line per rank + +| # | census item | branch | verdict | commit | evidence | +|---|---|---|---|---|---| +| 1 | `e55ad654` four mislabelled partition rungs | `lane-av1tilerows2` | **ALREADY LANDED** | `7538a841` (base) | out of scope for this pass | +| 2 | `Proof` enum + `Proof::TablePin` | `lane-av1refusal` | **LANDED, `TablePin` REFUTED** | `29951312` | 21/0; 3 red-before mutations; §1.3 | +| 3 | `6dfd827e` + `7586358f` + `c8ed05f3` | `lane-av1loss444mm` | **LANDED** (one helper dropped as dead) | `2be41696` | check 0/0; 248/0 pixel-exact; §1.5 | +| 4 | `bf88d5e1` two `set_symr_cdf` tags | `lane-av1tilerows2` | **LANDED** | `d100dc47` | check 0/0; 248/0; §1.4 | +| 5 | `571b4090` round-9 retraction | `lane-av1leafsize` | **LANDED** | `47bcb11e` | §1.5a — cherry-picked clean | +| 6 | `0beaf6c5` round-6 caller | `lane-av1444rect` | **LANDED** | `d3226c2e` | blob byte-identical; §1.5b | +| 7 | `f0ae03c8` + `f61ebe79` test-count census | `lane-av1testcount` | **LANDED, re-measured** | `13b752ff` | 712/742/802 re-derived; §1.7 | +| 8 | `5a1388f2` plane-tagged `OUR_MODE` | `lane-av1444chr` | **LANDED** | `b307aaeb` | check 0/0; 248/0; §1.8 | +| 9 | `6cc9ea6f` report header | `lane-av1chrtx` | **LANDED** (cosmetic) | `b307aaeb` | text-only; §1.9 | + +Six source commits, two report-only, one report-only-plus-source. Diffstat of +the whole pass: **488 insertions, 19 deletions, 7 files** — 46 of the +insertions are report text. + +### 1.2 What each landed commit actually is + +Seven commits on `lane-breconcile`, oldest first: + +``` +13b752ff lanes/av1testcount: the 13-branch wave reconciled exactly, re-measured +b307aaeb ec-av1: the plane-tagged OUR_MODE per-TU mode trace; fix the readcensus header +2be41696 ec-av1: the lossless OUR_DQW twin, plane-tagged, with the raw levels beside dq +d100dc47 ec-av1: tag the EC_SYMR reads in read_eob and read_coeffs' tx_type +29951312 refusal_inventory: say WHICH kind of proof each PROVEN row carries +d3226c2e docs(av1444rect): round 6 -- the fork's caller is NAMED +47bcb11e lanes/av1tilerows: round 9 -- the 4:4:4 128-root leaf-size fork is gone on main +``` + +Every commit message states what was NOT landed with it and why. No open defect +was fixed: this lane lands instruments and records. + +### 1.3 #2 `Proof` — the enum landed, `TablePin` is REFUTED + +**What landed** (`29951312`): `enum Proof { NegativeGate, Enumeration }` with a +`label()`, a third tuple element on **all 32** `PROVEN` rows, both consumer +loops updated, and one new test. + +The census's premise was that main's `PROVEN` is a 2-tuple so every row "looks +equally proven". That is true and it is worth fixing: 7 rows carry a gate that +drives a stream into the guard (`NEGATIVE`, red on removal), 25 carry a gate +that sweeps a domain and shows nothing reaches it (`ENUMERATION`, green on +removal). Those are different standards and the table said so nowhere. + +**What is refuted** is `Proof::TablePin`. The census wrote, of the `(4,8)` +chroma-table row: *"its gate pins a table's arms exactly but the domain the +table is REACHED OVER is unestablished, so an `Enumeration` tag there would +claim unreachability the gate's own comment admits it has not shown."* That +comment is the BRANCH's, not main's. `lanes/branchcensus2.report.md:108-112` +quotes it as if it were main's — the census read the branch file. + +On main that row names a different, stronger gate: +`every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table` +(`refusal_inventory.rs:1666`), which + +1. reads all eight `decode_block_rect` call sites' own literal `bw`/`bh` + (`assert_eq!(sites, 8, "the number of decode_block_rect call sites changed")`), +2. walks them through `bw >> ss_x` / `bh >> ss_y` for all three codable + subsamplings and asserts each has a table row, +3. pins the table exactly (six arms), and +4. asserts the residual is UNPRODUCIBLE: `!produces.contains(&(4, 8)) && + !produces.contains(&(8, 4))`, "the caller set can now produce a 4x8/8x4 + chroma shape but the table has no such row -- the chroma refusal is LIVE". + +The reach domain r3 called unestablished is measured. `Enumeration` is the +honest tag, and a third variant with zero rows is dead weight. The enum's doc +comment records exactly when to re-add it. (The census was right that the row +is *representable*; it was wrong about which way.) + +**Non-vacuity — three mutations, each reverted, each RED:** + +| mutation | result | +|---|---| +| flip the `(4,8)` row's tag to `NegativeGate` | RED — *"is tagged NEGATIVE …, but its gate enumerates the caller domain"* | +| turn all 7 `NegativeGate` rows into `Enumeration` | RED — *"no row is tagged NEGATIVE, so the NegativeGate variant is dead weight"* | +| **weaken the GATE**: replace `assert_eq!(sites, 8, "…call sites changed")` with `let _ = sites;` (the gate itself still passes) | RED — *"…no longer carries \"the number of decode_block_rect call sites changed\", so the Enumeration tag … claims a reach domain the gate has stopped measuring"* | + +The third is the one that matters and the one a weaker test would miss: the tag +is pinned to evidence inside the gate's **body**, so a future edit that guts the +gate's caller-domain measurement reds the taxonomy rather than leaving the row +quietly overclaiming. Mutating the test's own expectation list instead would +have proved nothing, and did not. + +**Suite:** `every_proven_refusal_names_a_test_that_exists`, +`every_named_gate_body_is_bounded_in_these_files`, and the new test — +**21 passed, 0 failed** (20 pre-existing + 1 new). Measured distribution printed +by the new test: **7 NEGATIVE, 25 ENUMERATION of 32 PROVEN rows**. + +### 1.4 #4 — the two `set_symr_cdf` tags (`d100dc47`) + +Two lines, `crates/ec-av1/src/decode.rs`. `set_symr_cdf` existed with 24 call +sites; nothing tagged the two reads the 4:4:4 partition-walk work pairs against +the oracle's per-read `site=`. `SYMR_CDF` is a `Cell<&'static str>` thread-local +reset after each symbol (`msac.rs:491`) and read only by the `EC_SYMR` eprintln, +so the tag is a trace label and nothing else; placement matches the 24 existing +`y_mode`/`uv_mode` tags. + +### 1.5 #3 — the lossless `OUR_DQW` twin (`2be41696`) + +Re-derived onto current main, and it did **not** cherry-pick: main has since +generalised `dequant_and_inverse_wht4x4` to any shape (lane-whtshape's 4x4 +raster), so `TxParams::run` no longer calls the 4x4 entry. `plane` is threaded +through **both** functions so the raster path's tiles carry it too. + +- `TxParams.plane`, set by the reader that OWNS the unit (`plane_idx` at the + three multi-plane sites, `0` at `decode_leaf_rect8`, which is luma-only — + `plane_q_delta(0, …)` and `push_intra(0, …)` at that arm). +- `OUR_DQW`, the LOSSLESS half of the oracle's `EC_DQCOEFF` rung, under the same + env var, with `plane=` and `lv=` (the RAW level grid the dequant consumed, so + "dequant produced nothing" is distinguishable from "the reader produced + nothing"). + +**The open defect it instruments:** item (a) of `lanes/av1loss444mm.report.md` +r10 — 4:4:4 lossless **key frame**, reconstruction-only, 21 U + 28 V samples off +by up to ±63, luma exact, entropy bit-identical. Named there with a three-file +search space. Note the census's own caveat is kept: r9 already exonerated +dequant ("0 of 2053 units have non-zero levels with an empty `dq`"), so this rung +buys **diagnosis, not a fix**. + +**One artifact dropped:** `census_plane()`, added by `7586358f`. On the branch's +own tip (`87d1518d`) it is defined and **never called** — `6dfd827e` replaced its +one use with the field. Not landed. + +### 1.5a #5 — the round-9 retraction (`47bcb11e`) + +`git cherry-pick -x 571b4090` **applied clean** (the census expected drift). +Verification is text, by blob: + +- main's `lanes/av1tilerows.report.md` and the branch's differ — expected, and + not a problem: main carries two RETRACTION blocks in §8 + (`RETRACTED by lanes/av1txsizeaudit.report.md §3.1` and *"a subsampling- + parameterised expression can only be certified by the measured value at every + subsampling"*) that the branch predates. Landing must ADD round 9 on top of + those, not overwrite them. +- The round-9 section itself — the 45 lines from `## 17. Round 9` to EOF — is + **byte-identical** to the branch's (`diff` of the `sed -n '/Round 9/,$p'` window + of both blobs: no output). + +This is the commit that changes what the record says: main ended at §8's claim +that one site is "proven reachable and documented", and round 9 measures 0 +divergence over 36 frames and 217570 reads in entropy lockstep on merged main, +and explicitly refuses to attribute it to its own fix. + +### 1.5b #6 — the round-6 caller (`d3226c2e`) + +Also cherry-picked clean. Strongest verification available: + +``` +git rev-parse lane-breconcile:lanes/av1444rect.report.md + = 69c428477984ea530d1fed94807c1876febd7820 +git rev-parse lane-av1444rect:lanes/av1444rect.report.md + = 69c428477984ea530d1fed94807c1876febd7820 +``` + +Byte-identical blobs. Main's §7 said the 4:4:4 intra-BC chroma fork "needs a +fresh start, not a continuation"; round 6 names it: +`decode_intrabc_rect`'s non-lossless whole-block rect arm, one +`around_mi_rect((mi_r, mi_c), bw, bh)` gather taken at the **luma** footprint and +reused for a 4x8 chroma unit under a 4x16 luma plane block — coincident at 4:2:0 +after subsampling, not at 4:4:4. That defect is still open; this records its call +site and does not fix it. + +### 1.7 #7 — the test-count census, re-measured (`13b752ff`) + +The census called this stale and said to land it only with a fresh count. Both +anchors were re-derived from scratch — fresh `git archive` extracts, private +target dirs, `cargo test -p ec-av1 --lib -- --list`: + +``` +298f75c4 (pre-merge base) 712 raw --list lines, 712 unique +9623bcab (merged main) 742 raw, 742 unique +b307aaeb (this tree) 802 raw, 802 unique +``` + +**The reconciliation stands**: 712 + 30 distinct = 742, delta 0, and zero +duplicate registrations at both anchors. Those are immutable facts about +immutable commits. But the tree this report would now be compared against is +**802**, and the report says so in a header paragraph so no reader mistakes it +for a count of the present. + +The 13 per-branch tip counts were **not** re-taken (13 more throwaway builds) and +the report states which figures are re-verified and which are the lane's own. + +### 1.8 / 1.9 #8 and #9 (`b307aaeb`) + +`5a1388f2` cherry-picked clean — the only source commit in the census's set that +did. 13 lines, env-gated print only, at `read_plane`, where `plane_idx` is a +parameter and therefore nameable. The census notes its motivating gap closed on +main by `RECON_PLANE`/`recon_plane()`; that is true and is not a reason to skip +it. `RECON_PLANE` stamps the plane at RECONSTRUCTION (which does not know its +plane); this rung names it at the READER. Its reason to exist is the class +`rung-mislabels-plane`, which has already produced two wrong claims this session +— `read_coeffs_rect` labelling its unit `plane=0`, then a sweep reading a +phantom second luma unit out of that label. The H3 defect the lane chased is +still open and unowned. + +`6cc9ea6f` is the 4-line header correction only. The census is right that the +gate name it was blamed for is already correct on main +(`a_pixel_exact_444_stream_walks_the_same_coefficient_units_the_oracle_does`), +so nothing else moved. + +--- + +## 2. Behaviour-freeness + +Claim per landed commit, and the proof each one got. + +| commit | claim | proof | result | +|---|---|---|---| +| `d100dc47` | env-gated trace tag only | `cargo check --all-targets` + pixel-exact | 0 err 0 warn; **248/0** | +| `2be41696` | `TxParams.plane` reaches nothing but an `eprintln` | same | 0 err 0 warn; **248/0** | +| `b307aaeb` | env-gated `eprintln` in `read_plane` | same | 0 err 0 warn; **248/0** | +| `29951312` | `#[cfg(test)]` taxonomy + a test | 21/0 + 3 mutations | **21 passed, 0 failed** | +| `13b752ff`, `47bcb11e`, `d3226c2e` | report text only | blob / text comparison | §1.5a, §1.5b, §1.7 | + +Common run, on the final tree: + +``` +$ CARGO_TARGET_DIR=$HOME/.cache/tgt/breconcile EC_NOMEMGUARD=1 \ + cargo test -p ec-av1 --lib -- pixel_exact +test result: ok. 248 passed; 0 failed; 0 ignored; 0 measured; 554 filtered out +``` + +248 includes `real_superres_streams_with_sub8_leaf8_and_warp_decode_pixel_exact`, +`the_chroma_rect_gates_excluded_seed_46_decodes_pixel_exact`, +`an_sb128_rect_strip_with_intrabc_decodes_pixel_exact`, +`an_sb128_screen_stream_with_intrabc_decodes_pixel_exact` and the pinned 4:2:0 +odd-height and 4:4:4 quadrant witnesses — i.e. exactly the cells the new +`plane` field and the two new tags touch. + +``` +$ cargo test -p ec-av1 --lib -- every_proven_refusal refusal_inventory \ + every_named_gate_body every_proven_row which_kind_of_proof +test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 781 filtered out +``` + +--- + +## 3. Regression on the final tree + +``` +$ cargo test -p ec-av1 --lib -- 420 422 444 lossless warp intra \ + --skip bitrate_target_lands_within_5_percent_over_48_frames +test result: ok. 181 passed; 0 failed; 2 ignored; 0 measured; 619 filtered out + (271.45s) + +$ cargo check -p ec-av1 --all-targets + Finished `dev` profile — 0 errors, 0 warnings +``` + +The 2 ignored are pre-existing `#[ignore]` attributes in the crate, not +anything this pass added; nothing in this lane changed an ignore. + +`main` advanced `7538a841 -> 0f9ea788` during this run. +`git diff --stat 7538a841..main -- crates/` is **one new fixture** +(`420_lossless_tallinter_8x16.obu`) and zero source lines, so every +classification above is unaltered against `0f9ea788` as well. + +--- + +## 4. Deliberately NOT landed + +| artifact | why | +|---|---| +| `Proof::TablePin` (rank #2) | **REFUTED.** Its one row's gate on main measures the reach domain the tag's premise says is unestablished, so the tag would overclaim and the variant would carry no rows. §1.3. | +| `census_plane()` (`7586358f`) | **DEAD on the branch's own tip** — defined, never called; `6dfd827e` replaced its use with `TxParams.plane`. | +| `lane-av1tilerows.report.md` §9-§16 (`fdaec88c`…`d5ffc0c9`, `bf88d5e1`'s report half) | rounds 2-7 are measurements on an OLD main, and round 9 (landed, #5) measures the fork GONE on merged main — 0/36 divergence, entropy lockstep over 217570 reads. Landing §16 would re-record a fork that no longer exists. | +| `lane-av1loss444mm`'s 8 report commits | report-only history of an open defect; the defect is still open and its owner has not started. | +| `lane-av1refusal`'s `lanes/av1refusalclaim.report.md` (r1-r7) | report-only; r7's third-weak-anchor finding was closed on main by `797fa52b`, which took a LATER, stronger version of r3-r7's boundary and **dropped** `body_of`. Merging the branch report would document as open what main closed. | +| `lane-av1444chr`'s 3 report commits (H3 rounds 2-4) | report-only; they record a narrowing whose conclusion is "the owner of the remaining line has not been identified", which is still true and belongs with whoever picks it up, not with an instrument landing. | +| `lane-av1lm444loss` | **Author-declared DO-NOT-MERGE** (`lanes/av1lm444loss-corr.report.md:16-17`). Not touched. Census §3 names what merging it would break. | +| rank #1 `e55ad654` | already on this branch's base as `7538a841`. | + +--- + +## 5. Branch containment, for a later prune + +`git cherry` is patch-id and **cannot see a re-derivation**, so the column below +is by CONTENT (distinctive literals grepped in this tree), which is the only +decisive detector. + +| branch | unlanded commits | touches `crates/` | source residue left | report residue left | prune? | +|---|---|---|---|---|---| +| `lane-av1leafsize` | **0** | — | none | none | **YES** — fully contained (`git cherry` says so too) | +| `lane-av1444rect` | **0** | — | none | none | **YES** — blob-identical report | +| `lane-av1chrtx` | 1 | none (report only) | none | none | **YES** — `6cc9ea6f`'s content is in `b307aaeb` | +| `lane-av1testcount` | 2 | none (report only) | none | none | **YES** — report imported at its corrected revision | +| `lane-av1444chr` | 4 | `5a1388f2` | **none** — `OUR_MODE plane=` present | 3 H3 report commits (§4) | source-complete; prune only if the reports are abandoned | +| `lane-av1tilerows2` | 8 | `e55ad654`, `bf88d5e1` | **none** — both landed (`7538a841`, `d100dc47`) | §9-§16, deliberately (§4) | source-complete | +| `lane-av1loss444mm` | 11 | `1a6e4f56`, `7586358f`, `6dfd827e`, `c8ed05f3` | **none** — `1a6e4f56` was on main via `c0727d64`; the other three are in `2be41696` | 8 report commits (§4) | source-complete | +| `lane-av1refusal` | 8 | `d6682aa4`, `72b83ba1`, `0c834cd1`, `40849868` | **none** — `d6682aa4` via `e429acfb`/`2ec19064`, `0c834cd1`+`40849868` via `797fa52b` (`fn gate_body`, `fn leading_clause`, `fn squash_source` all present), `72b83ba1`'s Proof half in `29951312` | `lanes/av1refusalclaim.report.md` r1-r7 (§4) | source-complete | + +**Every one of the eight census branches is now source-complete in this work.** +The only residue left anywhere is REPORT text, and each item of it has a stated +reason in §4. Two branches are fully contained and prunable today. + +Verification of the "none" column, run in this tree: + +``` +fn every_frame_size_a_header_can_code_has_a_mode_info_grid stream.rs:1, refusal_inventory.rs:1 +fn gate_body refusal_inventory.rs:2 +fn leading_clause refusal_inventory.rs:1 +fn squash_source refusal_inventory.rs:1 +(cc * chunk_chroma_w, cr * chunk_chroma_h), decode.rs:4 +set_symr_cdf("eob_pt") decode.rs:1 +set_symr_cdf("tx_type") decode.rs:1 +OUR_DQW plane= transform.rs:1 +pub(crate) plane: usize, decode.rs:1 +OUR_MODE plane= decode.rs:1 +``` + +--- + +## 6. Non-interference + +- **No push, no merge to `main`, no rebase of any lane branch, no tag, no + branch or worktree deleted.** All seven commits live on `lane-breconcile` in + `~/.cache/wt/breconcile`. +- **The primary checkout was never written to.** + `git -C /home/user/Documents/Code/Rust/edith_codecs status --porcelain` + is empty, verified at the end of the run. Every path this lane edited or + created is under `/home/user/.cache/wt/breconcile/`. +- `lane-av1lm444loss` was not checked out, read from, or written to. +- Scratch builds used `CARGO_TARGET_DIR=$HOME/.cache/tgt/{breconcile,tc-a,tc-b,tc-c}` + — lane-private, never the house dir. The three `git archive` extracts for the + test-count re-measurement lived in `/tmp/tc` and were removed; + `df -h /tmp` was 22% used before the suite runs and no `/tmp/ec-av1-*` staging + existed. + +## 7. Method notes for the next pass + +- **A census item's RATIONALE decays faster than its content.** Two of nine + items here rest on a lane's own commit message describing an artifact main + has since replaced. The census read the branch file and attributed its comment + to main (`branchcensus2.report.md:108-112`). Re-read the CURRENT gate before + carrying a tag that was minted against an older one. +- **`git cherry-pick` beat the census's conflict prediction on 3 of 4 + report-only commits** (only `72b83ba1` and the source commits conflicted). + Try the cherry-pick before re-deriving; it is 2 seconds and it is decisive. +- **A helper can be dead on its own branch's tip.** `census_plane()` was added + by `7586358f` and made dead by `6dfd827e`; grep the TIP, not the commit. +- **A test that pins a taxonomy must pin the SUBJECT, not its own expectation + list.** Mutating the test's expectation proves nothing (measured: green). + Mutating the gate's body is what reds it. \ No newline at end of file