Commits
Commits on
1f91edd86ff5fbef5cdf0587e29ece28126eac62Filtered to crates/ec-av1/src/decode.rsClear filter2026-09-29
lane-av1refusalspan: bound a proving gate's body by its own closing braceAhmet Kaan Gümüş · cc885c2
lane-av1refusalspan: bound a proving gate's body by its own closing brace
The refusal inventory's anchor check needed a gate's own text, and the
window rule it used ("the body ends at the next `fn` at the same
indentation, or at end of file") is not a function boundary on this tree:
a top-level `#[test] fn` in decode.rs has its next same-indent `fn` tens
of thousands of lines away, so the window reached end of file constantly
and one row's 27,427-line "body" was satisfied by the CHROMA sibling's
string seven lines down.
`gate_body` now ends the slice at the brace that closes the gate's body,
found by a scan that walks Rust rather than lines: string, raw-string,
byte-string, char and lifetime forms, line comments and nestable block
comments are skipped, so a brace inside one cannot move the boundary.
Every failure mode is a FAILURE -- no definition, a definition that is
never closed, an ambiguous name, or a body that still carries another
same-indent `fn` -- and none of them widens the window.
Re-measured over real bodies: 26 rows quote the whole refusal string, 7
quote its leading clause, 0 match neither. Nine rows the previous
measurement counted as anchored were not (their anchor was neighbour
text), so the nine gates now name the refusal they prove and pin its
guard site through `pins_refusal`.
New tests: the boundary's own non-vacuity (neighbour isolation, a brace in
a literal, the last function in a file, an unclosed body), and the same
boundary exercised over all three real sources.lane-av1loss444kf: a sub-8x8 RECT leaf's chroma unit gets the LEAF's reachAhmet Kaan Gümüş · cecc096
lane-av1loss444kf: a sub-8x8 RECT leaf's chroma unit gets the LEAF's reach The 4:4:4 lossless 256x256 key frame (109215 B, sha256 4563a01f17786000...) decoded with 21 U + 28 V samples wrong over x 196..207 / y 200..203, luma exact, entropy bit-locked over all 81933 symbol reads and its 12288 transform units at identical absolute (plane, x, y). The whole filter chain is inert on both sides of that frame (the oracle's pre-deblock, post-deblock, post-CDEF and final dumps are byte-identical to each other, and so are ours), and on a lossless frame the pixel delta IS the prediction delta -- so the residual, the dequant scale and the 4x4 WHT placement are exonerated by arithmetic, not by search. libaom asks has_bottom_left with the LEAF's bsize, the unit's (row_off, col_off) and tx_size, and answers TRUE inside the left column whenever `row_off + count < plane_bh_unit` -- the block's own next row, already reconstructed. A 4x8 leaf's first TX_4X4 unit therefore has four real bottom-left samples. sub8_leaf_chroma444 looked a standalone BLOCK_4X4 up at the unit's own position instead, got false, and PlaneBuf::edges replicated the last left sample across the edge's full reach: the unit predicted D203/CFL from a fabricated edge. A from-scratch transcription of libaom's z3 + edge filter + upsample reproduces all 16 oracle samples of each damaged unit with the real column and all 16 of ours with the replicated one, and the damage in the 2nd and 3rd blocks is that first wrong block's pixels read back as their left edge. Fix: Reach::of_tu over the leaf's own (bw, bh, col_off, row_off, tx) with the block reach the function already computes -- at both lossless 4:4:4 arms, the intra one and the intrabc one, which is what the 4:2:2 twin of this function was already fixed to do (lane-av1-422kf2). 49 -> 0 on the 109215 B carrier and on the independent 109909 B one. Witness: a_lossless_444_sub8_rect_leaf_chroma_reach_decodes_the_key_frame_pixel_exact -- live re-encode pinned by length and fnv1a64, 4:4:4 header asserted, key frame byte-exact against aomdec --limit=1, and the new sub8_chroma444_lossless_tu_reach_hits() counter (86 on this cell) proving the fixed path fired. Red-before with only the two reach expressions reverted: "differs from aomdec in 49 samples (first Some((1, 201, 200, 160, 159)))". 4:2:0 and 4:2:2 are structurally untouched (every call site sits behind `chroma_444`), and a square 4x4 leaf is provably unchanged (of_tu falls through to the block's own answer, which for a square leaf IS the old lookup). -- lossless 444: 48/0. -- 420: 2/0. -- intrabc: 21/0. -- 422: 6/0.
ec-av1: step the intrabc-rect lossless chroma replay by the unit's own mi footprintAhmet Kaan Gümüş · 30d94ca
ec-av1: step the intrabc-rect lossless chroma replay by the unit's own mi footprint
lane-whtshape (f541d062, merged afa13bcf) gave `decode_intrabc_rect` the
per-TX_4X4 lossless chroma walk and the tail replay that re-stamps each
unit's own coefficient context over the whole-block record. The replay
stepped the mi origin by `4 >> ss_y(fctx)` cells, which is 4:2:0-only
arithmetic.
A TX_4X4 chroma unit covers `4 << ss` LUMA pixels, so its origin in the
luma-mi grid advances by `(4 << ss) / MI`. That is the form
`decode_inter_block`'s reference `mu_chroma_units` construction already
writes (decode.rs:43688, `at.0 + cr * ((cu << ss_y(fctx)) / MI)` with
cu = 4 on a lossless frame); this site was the outlier.
ss (1,1) 4:2:0: `4 >> 1` = 2 mi, and `(4 << 1) / 4` = 2 mi -- the SAME
number, so 4:2:0 is unchanged BY CONSTRUCTION, not by
measurement alone.
ss (0,0) 4:4:4: `4 >> 0` = 4 mi = 16 luma px per 4x4 chroma unit, where
the unit covers `4 << 0` = 4 luma px = ONE mi. Every replayed
unit was stamped at 4x its own mi row/column, writing over
cells belonging to other blocks.
Measured on `ll444_intrabc_rect_l2.obu` (testsrc2 512x128 yuv444p,
aomenc --lossless=1 --cpu-used=2 --lag-in-frames=0 --kf-max-dist=100
--limit=6, 121844 bytes, sha256 f0de080edce35d34cdd628b71f63dc452
f946e8328352b69d3c1da090a54ec67), which reaches it: before, 10604 samples
wrong in the KEY frame, first at byte 33216 (Y(64,448)) -- the corrupted
chroma context desyncs the following luma, which is why the first
divergence is luma at all; frames 1-5 123987..171988 wrong. After: all
six frames byte-exact against the oracle aomdec in decode order, and the
EC_SYMR ladder is 540833 reads on both sides with zero fork.
Gate `a_lossless_444_intrabc_rect_replay_steps_by_the_units_own_mi_footprint`
asserts the 4:4:4 shape from the stream's OWN parsed sequence header (at
(1,1) the two steps are the same number, so a 4:2:0 stream cannot fail
this gate), that lane-whtshape's own INTRABC_RECT_LOSSLESS_CHROMA4_HITS
counter fired so the corrected expression was evaluated, luma-sized chroma
extents, and decode-order byte-exactness. Control arm: the 128x96
4:4:4 lossless pin must read that counter 0 -- whole square blocks have no
multi-unit chroma plane block to step.
Mutation proof, run: reverting only the step expression and nothing else
turns the gate RED at "decode-order frame 0 of 6 differs from the oracle
at byte 33216 (ours 101 vs 100), 10604 bytes differ"; restored from a
saved copy with cp, verified with diff -q, LIVE run ok.Merge lane-av1leftwit @ d5ab6ef4 — +ss_y left-reference reachability, exact-counter census gate, four additive source correctionsAhmet Kaan Gümüş · 913d977Browse files
Merge lane-av1superpin @ 9646f74d — superres den=9 + mode-2 pins, shared helper, report correctionsAhmet Kaan Gümüş · c1b1e89
Merge lane-av1superpin @ 9646f74d — superres den=9 + mode-2 pins, shared helper, report corrections
- crates/ec-av1/fixtures/:
444_lossy_rect4_odd_130x122.obu (8945 B), 444_lossy_rect4_wide_256x128.obu
(15239 B), 444_lossy_superres_256x128_d9.obu (17437 B),
444_lossy_superres_256x128_d12.obu (14808 B),
444_lossy_superres_mode2_256x128.obu (16620 B) and the shared
a_444_superres_arm helper.
- crates/ec-av1/src/stream.rs: a_444_lossy_superres_stream_decodes_pixel_exact,
a_444_lossy_superres_mode1_den9_stream_decodes_pixel_exact,
a_444_lossy_superres_mode2_random_denom_stream_decodes_pixel_exact,
a_444_lossy_rect4_strip_stream_decodes_pixel_exact_at_odd_and_wide_geometries
and the flag-ignoring control arm.
- crates/ec-av1/src/decode.rs, lanes/av1444edge.report.md,
lanes/av1superpin.report.md, lanes/av1formatsweep.report.md.
- crates/ec-av1/src/gate_coverage.rs: the wave-wide retirement reconciliation
(below).
- lanes/merge-wave-2.report.md: the wave's merge table, every conflict
resolution, and the two post-merge fix tasks.
SPLICE from lane-park-av1444edge @ a02a2511 (that branch is NOT merged): the
§6.2 `130x122` row of lanes/av1formatsweep.report.md carries av1444edge's
CORRECTION — the cell is EXACT 4/4 (8945 B, sha c87ac65b…), the same H1
1:4-inter-strip chroma class, closed by lane-av1444rect's f92776ba (an ancestor
of main) and gated by
a_444_lossy_rect4_strip_stream_decodes_pixel_exact_at_odd_and_wide_geometries.
The original measurement text is KEPT inside the row ("was DIVERGENT from f3,
11521 samples, first (f3, s2208) = Y(128,16); now EXACT 4/4"), not deleted.
Nothing else from a02a2511 is taken: its r4 gates are content-equivalent
duplicates of superpin's a_444_superres_arm, and its two other fixtures are
byte-identical blobs under different names.
Conflicts resolved:
* decode.rs (2 hunks, both @ours): one comment-only hunk where MAIN's text is
more informative (it states what the counter is NOT evidence for), and one
where theirs has no counterpart — INTRABC_RECT4_OWN_CHROMA444_HITS is a
main-only addition from an earlier lane that superpin's older base predates.
* stream.rs: add/add at the end of `mod tests` producing INTERLEAVED hunks
that split ours' last gate mid-statement, so marker surgery does not apply.
Resolved by construction: this branch's stream.rs delta against its merge
base is 933 added lines at a single hunk, so merged = HEAD verbatim + that
block. That block re-adds a_444_lossy_rect4_inter_stream_decodes_pixel_exact,
byte-IDENTICAL (5905 B, extracted and compared) to the copy main already has
from lane-av1444rect e10a3b25, which superpin also carries; the appended
copy is DELETED here. All six of this branch's gates are present exactly once
afterwards.
* lanes/av1formatsweep.report.md (add/add): superpin's version with the spliced
130x122 row, as above.
gate_coverage.rs — the union of the wave's retirements, so
never_exercised_{8,10}bit_matches_the_gate_recipes is green on derived
evidence rather than on an edit:
enable-dist-wtd-comp (8b) a_distance_weighted_compound_stream_decodes_pixel_exact
enable-dual-filter (8b) a_real_aomenc_dual_filter_obmc_8x8_inter_sequence_decodes_pixel_exact
enable-dual-filter (10b) a_real_aomenc_10bit_dual_filter_obmc_8x8_inter_sequence_decodes_pixel_exact
enable-flip-idtx (8b) a_real_aomenc_stream_with_a_1d_tx_class_on_a_rect_transform_…
enable-rect-tx (8b and 10b) a_real_aomenc_{8,10}bit_stream_with_a_rect_transform_decodes_pixel_exact
Both lists are now empty; the census derives EMPTY (0 of 26 tools) at both
depths across 255 real-aomenc gate bodies. TOOL_UNIVERSE keeps all 26 tools,
enable-rect-tx included. The test was NOT weakened: it was red with
"the 8-bit list still names [\"enable-rect-tx\"] …" and
"the 10-bit list still names [\"enable-dual-filter\", \"enable-rect-tx\"] …"
immediately before this edit, and the retirement evidence is preserved as
comments above each emptied list.
Duplicate fixtures: measured after this merge, crates/ec-av1/fixtures/ holds
63 files with 63 DISTINCT sha256 prefixes — zero duplicates, so no blob is
carried twice under two names and no file was deleted for that reason.lane-av1leftwit: the +ss_y left-reference shape is reachable, and pinnedAhmet Kaan Gümüş · aec3e0f
lane-av1leftwit: the +ss_y left-reference shape is reachable, and pinned
The shipped `+ss_y` term on `smooth_uv_neighbour_unsnapped`'s left read had no
witness, and the two claims standing in for evidence were both wrong.
1. "Structurally absent, because aomenc never starts a block on an odd mi
row" -- 1 mi is 4 luma px, not 8; libaom's PARTITION_HORZ_4 puts its
`i == 0` child on the PARENT's own mi row, which for a 16x16 is a multiple
of 4 and therefore even (av1/decoder/decodeframe.c, `mi_row + i * bw / 4`),
and av1_ss_size_lookup[..][1][1] is non-INVALID for every 4-px-tall bsize.
2. "Six committed 4:2:0 fixtures reach it, and on reelb_ss600_key_frame.obu the
boolean flips" (a comment in decode.rs) -- never measured. Measured over all
48 committed fixtures that decode, reelb_ss600 reads mode_diff=0
smooth_diff=0 split1mi=0.
`uv_left_ss_y_reads` cannot tell "reached the shape" from "read two cells of
the same block", which is why both claims survived. New `uv_owner` per-cell
owner stamp (epoch-tagged per tile, written beside `uv_mode_grid`) plus
`UV_LEFT_1MI_SPLIT_HITS` / `uv_left_1mi_split_hits()` count decode-path reads
whose two cells were written by different blocks -- the run-of-length-1
geometry. It is NOT zero: 5 of 48 fixtures, 15 reads (gm_small_side 5,
reelc_sb128_inter 7, av112bit-{inter,compound,compound-masked} 1 each), all on
the decode path, all at even mi rows, with a 32x16 block above a 16x4 one.
The term is kept: `chroma_left_mi = base_mi[ss_y * mi_stride - 1]`
(av1_common_int.h:1411) is exactly the shipped read. What stays unwitnessed is
narrower and now says so: in all 15 reads the two blocks agree on `uv_mode`,
so the term moves no pixel (byte-identical on all five with the term reverted,
§6 of the report). A 115-encode targeted hunt -- 1-mi chroma bands, phase-
shifted vertical stripes, sub-transform noise, random mosaics, 36 real lavfi
arms, min/max-partition 4..128, lossless and cq 8..45 -- produced no
1-mi-tall leaf at all, and the `EC_LEFTSSY` leaf census says why: a wide block
codes 1-D structure almost for free, and content fine enough to force small
blocks stops at 8x8, which is 2 mi tall.
Gate: `a_committed_4to20_stream_presents_a_one_mi_left_neighbour_to_a_decode_path_read`
pins the census on two fixtures. Non-vacuous: removing the `uv_owner` stamp
drops both arms to 0 and fails it. Deliberately NOT a mutation of the term
itself, which leaves these reads untouched.
The 16x4/4x16 pair witness's counter-only mirror (decode.rs:17629) is kept --
it measures a live comparison and fires 51/24/121/0/1 on the fixtures
censused -- but both it and the `decode_path` flag no longer claim to be
evidence about this term.
Report: lanes/av1leftwit.report.md (hunt table, corpus census, red/green).Merge lane-whtshape @ f541d062 — the lossless WHT shape-total fixAhmet Kaan Gümüş · ec131f6
Merge lane-whtshape @ f541d062 — the lossless WHT shape-total fix - crates/ec-av1/src/transform.rs: a non-4x4 unit is RECONSTRUCTED as a 4x4 raster instead of being asserted away — of libaom's highbd_inv_txfm_add_*_c only the 4x4 one carries a `lossless` branch, the rest fall through to the IDCT, and this call site was passing a rect lossless shape that no such function can accept. - crates/ec-av1/src/decode.rs: decode_intrabc_rect no longer codes a rect intra-BC block's chroma plane as ONE rect transform unit. - crates/ec-av1/fixtures/ll444_sb64_1to4_lossless.obu (51107 B). - crates/ec-av1/src/stream.rs: a_444_lossless_sb64_intrabc_rect_chroma_walks_4x4_units. - lanes/whtshape.report.md (the RELEASE premise refuted, the call site fixed, the residual fork named). Conflict resolved in stream.rs: add/add at the end of `mod tests`. Both lanes append at the same anchor and git produced TWO interleaved hunks that split ours' last gate mid-statement, so the marker surgery does not apply. Resolved by construction instead: this lane's stream.rs delta against the common base is a single 199-line block appended at the tail, so the merged file is HEAD's stream.rs verbatim (tail brace kept) + that block + the module's closing brace. `cargo check -p ec-av1 --all-targets` is clean and the per-parent `fn a_*` set difference shows zero lost and zero replaced.
Merge lane-av1lm444loss @ 9249442f — the lossless frame-edge TX-grid clip fix + gateAhmet Kaan Gümüş · cb2465d
Merge lane-av1lm444loss @ 9249442f — the lossless frame-edge TX-grid clip fix + gate
- crates/ec-av1/src/decode.rs: libaom clips the transform-unit grid at the
frame edge (max_block_high/max_block_wide fold mb_to_bottom_edge /
mb_to_right_edge in before the shift), so decode_token_recon_block now
bounds the square AND the rect mu walks by the part of the block inside the
frame, with the LOSSLESS_EDGE_CLIPPED / LOSSLESS_EDGE_CLIP_UNITS counters as
the non-vacuity evidence. Identical arithmetic for a block that fits.
- crates/ec-av1/src/stream.rs: the H1 gate.
- lanes/av1lm444loss.report.md (appendix r2 diagnoses the remaining lead (b)
blocking defect).
No conflict: decode.rs auto-merged — the region is disjoint from
lane-av1chrtx's per-unit leaf tx_type work (~7.8k/~28.2k) and from
lane-av1distwtd's compound counter.
Tip note: the branch head 5519aaf8 is one commit past this tip
("ec-av1: ss-aware chroma geometry + lossless TX_4X4 raster in
decode_intrabc_rect") and is NOT merged here; the dispatched tip is 9249442f.
That delta is the follow-on lead (b) work the report's appendix names as
still open.Merge lane-av1distwtd @ 1aaf7e0b — dist-wtd-comp witness gate + census detector fix + two retirementsAhmet Kaan Gümüş · deb9682
Merge lane-av1distwtd @ 1aaf7e0b — dist-wtd-comp witness gate + census detector fix + two retirements - crates/ec-av1/src/decode.rs: DIST_WTD_COMP_HITS counter on the `compound_idx == 0` arm in decode_inter_block / decode_inter_block8, with dist_wtd_comp_hits() / reset_dist_wtd_comp_hits(). - crates/ec-av1/src/stream.rs: a_distance_weighted_compound_stream_decodes_pixel_exact — spells --enable-dist-wtd-comp=1 AND asserts the PARSED sequence header's enable_jnt_comp, with the =0 arm asserting false from the same recipe. - crates/ec-av1/src/gate_coverage.rs: gate_bodies() now resolves CALLS as well as spellings (encoder_fns/calls_fn/fn_units/legacy_gate_tokens) and covers_both_depths() recognises the pair-of-pixel-formats marker; the new test the_detector_sees_the_gates_the_spelling_filter_missed pins the fix as strictly ADDITIVE against the old spelling-only filter. Retirements: enable-dist-wtd-comp, enable-dual-filter (8-bit) and enable-flip-idtx (8-bit) leave NEVER_EXERCISED_8BIT; enable-dual-filter STAYS in the 10-bit list with a corrected reason. - lanes/av1distwtd.report.md. Conflict resolved in stream.rs: add/add at the end of `mod tests` (both lanes append there). Kept BOTH sides; the shared trailing ` }` / `}` was hoisted out of the hunk, so ours' last test needed its closing ` }` re-inserted between the two blocks — verified by `cargo check -p ec-av1 --all-targets`. FOREIGN EDITS PRESERVED, NOT COMMITTED: while this merge was in flight two untracked/unstaged changes belonging to other lanes appeared in the primary checkout. Neither is part of this lane. 1. A 465-line addition to crates/ec-av1/src/gate_coverage.rs (the lane-av1txsearch `bound_values` / `spelling_values` / `resolved_on_state` detector work, which duplicates four functions this merge had just added). Byte copy: $HOME/.cache/merge-wave-2-keep/gate_coverage.rs.lane-av1txsearch-leak — its owner lands it in /home/user/.cache/wt/av1txsearch. 2. lanes/av1mergecheck.report.md (a sibling read-only review pass's verdict). Byte copy: $HOME/.cache/merge-wave-2-keep/av1mergecheck.report.md.foreign — left untracked in the worktree for its owner to commit.
ec-av1: settle the 4:4:4 coefficient-read count asymmetry by measurementAhmet Kaan Gümüş · cf7d7f8
ec-av1: settle the 4:4:4 coefficient-read count asymmetry by measurement The av1444rect round-4 report left 636 square chroma reads against the oracle's 1086 (and 2052 vs 1309 luma) as "most likely a counting-shape difference", established neither way. This measures it. A new per-unit census rung (EC_CENSUS_UNIT) counts one unit per read_coeffs/read_coeffs_rect call -- the object the round-4 count measured -- carrying plane, w/h, tx_type, eob, all_zero and the msac state before and after the unit. Paired against the oracle's existing EC_COEFF / EC_COEFF_VAL bracket per av1_read_coeffs_txb call BY post_rng, never by plane label or walk position. On every pixel-exact 4:4:4 arm the counts are identical, unit for unit: ll444_minp8_inter 11292/11292 (3764 per plane both sides, 975/1793/1859 coded), 444_lossy_rect4_inter_witness 1373/1373, 444_quad_leaf_tx_type 192/192. Bucket (i) is the whole census; there is no asymmetry to explain. The round-4 numbers came from 444_intrabc_rect4_witness, which DIVERGES (390380 of 921600 samples wrong) -- there the surplus is the divergence itself, so the count could never have separated the two hypotheses. Verdict: counting shape, and not even that on a pixel-exact arm. Gate: a_pixel_exact_444_stream_walks_the_same_coefficient_units_the_oracle_does pins the walk's object shape on two exact arms -- the all-TX_4X4 lossless stream and a mixed-shape rect4 stream, which is what makes a var-tx fold visible. Mutation-proven: dropping 8x8 units turns it red by name. The census is armed per frame from the sequence subsampling, so the 4:2:0 control asserts exactly (0, 0, 0).
lossless WHT: a non-4x4 unit is reconstructed as a 4x4 raster, not asserted awayAhmet Kaan Gümüş · c465d06
lossless WHT: a non-4x4 unit is reconstructed as a 4x4 raster, not asserted away
libaom cannot code a lossless transform unit that is not 4x4: read_tx_mode
(decodeframe.c:140) returns ONLY_4X4 for a coded_lossless frame before it
looks at the tx_mode symbol, read_tx_size (:1117) returns TX_4X4 before it
looks at a tree, get_vartx_max_txsize (blockd.h:1447) returns TX_4X4 for
EVERY plane of a lossless block, and of idct.c's highbd_inv_txfm_add_*_c only
highbd_inv_txfm_add_4x4_c carries a lossless branch -- the rest fall through
to the IDCT, because there is no non-4x4 lossless inverse transform to
dispatch to. So a non-4x4 lossless unit is this decoder's own transform-unit
geometry being wrong, and neither refusing nor papering over it is what the
reference does: the honest total is the raster of 4x4 WHT units libaom's
lossless geometry would have produced for that footprint.
MEASURED, not assumed: the premise that a RELEASE build "silently runs a
wrong-shape transform" is REFUTED. On the two independent 4:4:4 lossless
witnesses the debug build stops at decode.rs:2787
`debug_assert_eq!((self.w, self.h), (4, 4))` with `left: (8, 4)`, and the
RELEASE build dies one frame later with an opaque
`range end index 8 out of range for slice of length 0` -- it panics, it does
not mis-transform. The defect is real either way: a debug-only assert was the
only thing naming the invariant, and release's failure message named neither
lossless nor the transform.
decode.rs
- TxParams::run: the debug-only shape assert (and the debug-only
`tx_type == DctDct` assert on an argument the WHT never reads) are
replaced by a counted call into the shape-total entry. Counted by
LOSSLESS_WHT_SPLIT_UNITS, which must read 0 on any stream whose lossless
unit geometry is right.
- decode_intrabc_rect: a LOSSLESS rect intra-BC block's chroma plane block
is now `bw >> ss_x` by `bh >> ss_y` (av1_get_max_uv_txsize is
ss_size_lookup[bsize], no halving of its own -- at 4:4:4 that is the
block's own footprint) walked as a (cw/4)*(ch/4) PLANE-MAJOR raster of
TX_4X4 units through the existing read_inter_chroma_lossless, with the
per-unit coefficient contexts replayed over the whole-block
record_split_luma_rect_mi (class override-slot-on-one-arm, the same one
decode_rect_split's ll_chroma_units replay exists for). Counted by the
exclusive INTRABC_RECT_LOSSLESS_CHROMA4_HITS. Scoped to `lossless` on
purpose: the 4:2:0 halving is right at 4:2:0, and zero pinned fixtures
decode a LOSSLESS intrabc rect block, so no green pin moves.
transform.rs
- dequant_and_inverse_wht: the shape-total lossless entry. 4x4 is the same
single call it always was, so the lossless fast path is bit-for-bit
unchanged; any other shape is the raster of 4x4 WHT units over a
row-major w-wide grid, zero-filled on a partial tile, empty-grid marker
preserved. No shape panics and no shape returns a buffer its caller
cannot index.
MEASURED: the pinned witness (fixtures/ll444_sb64_1to4_lossless.obu, 51107 B,
sha256 fdb64679.., testsrc2 256x256 yuv444p10le, aomenc --lossless=1
--profile=1 --i444 --enable-1to4-partitions=1 --min-partition-size=4
--max-partition-size=64 --sb-size=64 --enable-intrabc=1) went from a RELEASE
panic / DEBUG Golomb-tail refusal to 2 decoded frames, 24576 lossless WHT
units and 0 non-4x4 ones. 43 named lossless / 4:4:4 / intrabc-rect gates stay
green (21 `lossless`, 16 `444`, 5 `intrabc_rect`, 1
`rect16x4_chroma_reach`), in release.
The gate's pixel arm is a measured per-frame, per-plane exact PREFIX, not an
exactness claim: frame 0 is byte-exact to sample 32992 of 65536 on all three
planes and frame 1 to 55008 (Y) / 9378 (U,V). The residual forks are a
separate defect, named with their coordinates in lanes/whtshape.report.md r3.ec-av1: clip a lossless block's TX grid at the frame edgeAhmet Kaan Gümüş · 589db23
ec-av1: clip a lossless block's TX grid at the frame edge A lossless block's transform-unit grid was built as `side / MI` square, unbounded by the frame. libaom bounds it: `max_block_high` / `max_block_wide` (av1_common_int.h:1565, :1579) fold `mb_to_bottom_edge` / `mb_to_right_edge` into `block_size_high/wide` before `>> MI_SIZE_LOG2`, and `decode_token_recon_block` then caps every mu chunk with `unit_height = ROUND_POWER_OF_TWO(AOMMIN(mu_blocks_high + row, max_blocks_high), ss_y)` -- so the units of an overhanging block that fall outside the frame are never read. The var-tx branch of `read_block_tx_size` twenty lines below already applied exactly this clip (`max_w_mi`/`max_h_mi`); the lossless branch, and the same branch of `read_block_tx_size_rect`, did not. Mechanism, measured on the pinned 128x96 4:4:4 lossless stream (96 is not a multiple of the 128 superblock, so each of its five inter frames carries one unsplit 128 root overhanging the bottom by 32 px). The frame is 24 mi tall, so `max_blocks_high >> 2` is 24 transform rows where the block's own `side / MI` is 32. The unclipped walk therefore read 8 rows x 32 columns = 256 transform units per inter frame that libaom never codes: 2560 all_zero reads per frame against the oracle's 2304. The `EC_SYMR` ladder put the first fork at read 71322, exactly on that row-24 boundary -- `EC_COEFF_STEP tag=all_zero` shows the oracle moving to `plane=1 bc=0 br=16` (chroma, txb_skip ctx 10) where we were still reading `plane=0` luma ctx 1. Both sides read the same `decodetxb.c:158` txb_skip CDF, so this was never the coefficient reader Agent04-2's census excluded: the walk was still in the wrong PLANE. After the fix the ladder is 235940 reads on both sides with zero fork, and all six frames match the oracle `aomdec --rawvideo` in decode order exactly (the unclipped tree was wrong from frame 1: 5596 samples at the first differing byte 16544, growing to 33561 by frame 5). The clip is a no-op on any block that fits, which is what keeps every other lossless and 4:2:0 pin byte-identical; the gate's control arm pins that direction (both counters must read 0 on a stream whose blocks all fit). Gate: `a_lossless_block_clips_its_transform_grid_at_the_frame_edge`. Non-vacuous -- `lossless_edge_clipped()` fires 5 times (once per 128 root) and reads 0 on a frame that fits, `lossless_edge_clip_units()` reads exactly 1280 = 5 x 256, and every sample of every frame is asserted against the oracle. Mutation proof, run: reverting the clip to the unclipped grid turns it RED at the counter assertion (0/5 roots), and the same reverted build is 5596..33561 samples off the oracle.
av1: close the enable-dist-wtd-comp coverage hole with a real witness streamAhmet Kaan Gümüş · b93fec6
av1: close the enable-dist-wtd-comp coverage hole with a real witness stream The coverage census listed `enable-dist-wtd-comp` in NEVER_EXERCISED_8BIT with the reason "distance-weighted compound is unimplemented". That reason was WRONG. The combine is implemented: `compound::dist_wtd_comp_weight_assign` (lane-av1comp) and `mc::combine_compound`'s weighted path have been in the tree for a long time. What was missing was a stream CARRYING the tool, so the census read the entry as open and no gate ever proved the tool fires. STEP 0 (producibility, against aom 3.13.3): the flag maps onto the sequence header's `enable_jnt_comp` bit -- `av1_cx_iface.c:1062` -> `order_hint_info.enable_dist_wtd_comp`, written at `bitstream.c:2681` under `enable_order_hint` and AND-masked by it at `av1_cx_iface.c:1491`. The parsed header is asserted, never the flag spelling. Measured: the same recipe parses `jnt_comp=true` with `=1` and `jnt_comp=false` with `=0`, and the arms differ on the wire (6855 B vs 6911 B). A flag the encoder accepted but ignored would fail both asserts. The gate: `--enable-dist-wtd-comp=1` over rotating mandelbrot at `--min-partition-size=32 --cq-level=30` (both load-bearing -- at min=16 the encoder emits 8x8 inter leaves this decoder refuses BY NAME before the `compound_idx` read runs, and at cq 45/55 the stream has no compound block at all). Three hard asserts: the PARSED header carries `enable_jnt_comp`; the `compound_idx == 0` arm fired (`dist_wtd_comp_hits() > 0`); and every frame is pixel-compared against the oracle with lengths asserted first. decode.rs is additive only -- a `DIST_WTD_COMP_HITS` counter and two `hit!` calls inside the existing `idx == 0` arm. No blend arithmetic is touched, so the single-reference path is unaffected (neither bump site is reachable without a second reference) and 12-bit is unaffected (`combine_compound` already carries the `round_delta` post-round from lane-av112bit). Measured: 25 oracle frames, 21 distance-weighted blocks. Red-before, both directions. Mutating `dist_wtd_comp_weight_assign` to return the (8, 8) simple average reds the pixel compare at decode-order frame 7 (552 bytes differ); disabling the counter reds `dist_wtd_comp_hits > 0` with the pixels still green, which is what separates "the counter can fire" from "the pixel compare alone would catch it". Regression: 35/35 compound gates green (8/10/12-bit, including the 12-bit 8x8 leaf) and 15/15 4:4:4 gates green. 4:4:4 reaches the same arm independently (22 blocks at cq 20, 21 at cq 30, pixel-exact both) and 12-bit reaches it too (15 blocks), so the tool is not 4:2:0-only.
ec-av1: resolve each rect inter chroma unit's tx_type from its own luma leafAhmet Kaan Gümüş · 7a36733
ec-av1: resolve each rect inter chroma unit's tx_type from its own luma leaf read_inter_rect_chroma -- the sibling of the two 4:4:4 four-unit arms -- still handed every chroma unit the BLOCK-level luma_tx_type (the top-left leaf's type) after lane-av1444chr pointed those two arms at covering_leaf_tx_type. av1_get_tx_type (blockd.h:1287-1297) instead reads xd->tx_type_map at the chroma unit's own position scaled back to luma, and read_coeffs' all_zero arm stamps DCT_DCT into that leaf's map cell (decodetxb.c:199-203), so a unit over a luma leaf that coded NOTHING inherits DctDct, not the block's type. Measured on a new pinned witness (fixtures/444_rect_strip_leaf_tx_type.obu, 26839 bytes, sha256 06174a66e92aaeb751a8e86db59711fcb1f18d74bde2d77e1ef1be7983eb7c80, testsrc2 256x256 yuv444p x3, aomenc --profile=1 --cq-level=30 --cpu-used=0 --sb-size=64 --min-partition-size=32 --max-partition-size=64 --enable-tx-size-search=1 --passes=1 --end-usage=q --threads=1 --row-mt=0 --lag-in-frames=0 --kf-max-dist=100 --limit=3 --obu): the 32x64 inter strip at mi(32,48) has a 4:4:4 chroma plane of (32,64) = TWO TX_32X32 units over a five-leaf luma tree (Idtx 32x32 on top, then VDct/DctDct/ HDct/VDct 16x16). The lower unit inherits VDct where the block-level value is Idtx, once per chroma plane. Red-before: reverting only the resolve to the block-level type turns the new gate red -- "decode-order frame 1 of 3 (3 shown, 0 hidden) differs from the oracle at byte 105949 (ours 166 vs 167), 1998 bytes differ". Restored: green. The DIFF counter (not the route counter) is the non-vacuity bar: a route counter fires on any rect chroma read, and a committed control (444_sb128rect_lr_witness.obu, 2 units resolved, 0 differing) is exactly the shape a no-op fix would look green on. Witness hunt (200+ encodes over 4:4:4 sources, partition / tx-size-search and cpu-used sweeps): multi (nx*ny > 1) is false BY CONSTRUCTION at 4:2:0 -- a side <= 64 block's chroma plane is at most 32x32, one unit -- so the arm needs 4:4:4 AND a rect block that keeps a 64-px axis, and only cpu-used=0 with --min-partition-size=32 made aomenc pick the 32x64 strip. Two new gate counters CHROMA_RECT_LEAF_TX_HITS / CHROMA_RECT_LEAF_TX_DIFF_HITS, separate from CHROMA_QUAD_LEAF_TX_HITS because that pair gates a 4:2:0 control asserting exactly 0 and this route IS reachable at 4:2:0. Plus a unit test on covering_leaf_tx_type itself (mixed-leaf lookup, interior cells, out-of-extent -> None, empty leaf list -> None), mutation-proven red by turning the containment '<' into '<='.
ec-av1: thread the real plane index into read_coeffs_rect's EC_COEFF_STEP tracesAhmet Kaan Gümüş · 0789576
ec-av1: thread the real plane index into read_coeffs_rect's EC_COEFF_STEP traces read_coeffs_rect printed a hardcoded plane=0 on its two tagged trace lines (tag=all_zero, tag=tx_type), so every chroma rect coefficient read was logged as a luma one. Two independent lane reports mis-read a chroma unit's txb_skip / tx_type symbol on those lines and followed the luma arm; the log could not tell them apart. Adds a plane parameter and passes the caller's own plane index at all twenty call sites (read_inter_plane_rect / read_rect_chroma_unit / leaf8_chroma422_unit / sub8_leaf_chroma444 carry plane or plane_idx; the luma readers pass 0). read_chroma_coeffs_rect takes the same parameter and passes it through, so the U/V call sites in decode_block_rect, decode_leaf_rect, decode_block_rect4, decode_rect4_16_strip and decode_block_rect64 stop collapsing U and V into one tag. Measurement (EC_TRACE_COEFF=1 on the 4:4:4 rect gate a_444_lossy_rect4_inter_stream_decodes_pixel_exact): the all_zero lines now split 312 plane=0 / 310 plane=1 / 310 plane=2 where every chroma line previously read plane=0. No gate output changes; the traces are env-gated and off by default.
2026-09-28
ec-av1: 4:4:4 inter chroma units inherit their own quadrant's luma tx_typeAhmet Kaan Gümüş · dc2a1dd
ec-av1: 4:4:4 inter chroma units inherit their own quadrant's luma tx_type The 64x64 four-unit chroma arm (ss 0/0, chroma_side > chroma_tx) handed all four TX_32X32 units the block-level luma_tx_type -- the TOP-LEFT luma leaf's coded type. libaom's av1_get_tx_type (blockd.h:1287-1297) instead reads the map cell at the chroma unit's own position scaled back to luma, and a luma leaf that coded nothing is stamped DCT_DCT there (decodetxb.c:199-203), so every unit sitting over a skipped luma quadrant was reconstructed with the wrong transform. leaf_tx_types was only collected under , so at 64 it was empty and there was nothing to resolve from; it is now collected at every size, both copies of the arm resolve per quadrant through the shared covering_leaf_tx_type (extracted from the three inline copies that already existed -- one convention, not four), and two counters record the route and the cases where the resolved type DIFFERS from the block-level one. Witness pinned as fixtures/444_quad_leaf_tx_type.obu (27933 B, sha256 a06c9f7a0862252f6ab7ebdcec340d0602e730e38089365f14747db37f8e78d5): decode-order frames 1/2/3 went from 777/640/554 wrong V samples to byte-exact, and the per-unit type census against aomdec's EC_DQCOEFF goes from 4 disagreements to 0 of 136. Reverting only the per-quadrant resolve turns the new gate red on frame 1 with 777 bytes differing. The new gate asserts the DIFFERS count (8 on the witness), not the route count (96) -- a route counter fired on the one block of an earlier no-op port that changed zero pixels. A 4:2:0 control asserts both counters stay at 0.
ec-av1: lane-av1444rect -- a 1:4 inter strip's chroma context was gathered at the 4:2:0 pair extent at ss (0,0), forking the coder (H1)Ahmet Kaan Gümüş · 84fa44c
ec-av1: lane-av1444rect -- a 1:4 inter strip's chroma context was gathered at the 4:2:0 pair extent at ss (0,0), forking the coder (H1) At 4:4:4 `is_chroma_reference` (av1_common_int.h:1454) reduces both parity clauses to `!subsampling_y` / `!subsampling_x`, so EVERY block is its own chroma reference and no 1:4 pair exists. `decode_inter_block`'s `around_c` never gated on ss, so a HORZ_4 16x4 strip read its chroma coefficient context over the 4:2:0 pair extent (16x8 luma = left[mi_r] and left[mi_r+1]) instead of its own 4-px one. The U unit's `get_txb_ctx` then saw a left neighbour libaom does not have and forked the arithmetic coder. The 4:4:4 lossy + RECT cell -- the largest correctness gap the chroma-format sweep left (lanes/av1formatsweep.report.md H1) -- had NO exactness gate at all: the whole committed 4:4:4 base is lossless 8-bit. Witness: testsrc2 128x96 rate=25 yuv444p, aomenc --profile=1 --passes=1 --end-usage=q --cq-level=20 --cpu-used=2 --threads=1 --row-mt=0 --lag-in-frames=0 --kf-max-dist=100 --limit=2, 6441 B, sha256 77f727e7... Red before: frame 1, 8884/36864 samples wrong, first at Y(91,32); the first wrong symbol was read 26263, both sides at mi (8,16) -- ours a luma-shaped txb_skip row (re-indexed chroma ctx 1), the oracle decodetxb.c:158 on the U plane with txb_skip_ctx 7. Green after: 2/2 frames byte-exact vs aomdec. Gate `a_444_lossy_rect4_inter_stream_decodes_pixel_exact` pins the fixture (len + FNV), asserts the ss (0,0) full-resolution chroma shape, the byte-exact compare through the oracle aomdec, and non-vacuity on the corrected route via `rect4_inter_own_chroma444_hits` (9 gathers here, 0 on the 4:2:0 control, which also carries 16 HORZ_4 / 28 VERT_4 strips and is itself compared byte-for-byte so a widening past ss_x 0 goes red). Mutation proof: restoring the old arm with the counter left in place turns the gate red at byte 4187 (ours 35 vs 38), 8884 bytes differing. Identity: the crate's whole 444 family (9), rect_strip family (10), the 16-level rect-leaf gate, and all three new chroma-format-sweep gates (444 lossless 10-bit, 444 12-bit, odd coded dimensions) run green against this decode.rs. H2 (4:4:4 lossy tx-size-search chroma +/-1, 608/36864 from frame 2) is unchanged and still divergent -- it is reconstruction arithmetic, not entropy, and belongs to its own lane. H3's tile-column recipe (77847 B, 6 frames) is byte-exact here. (cherry picked from commit f92776bab2442319e32d4f56844af6956e2fc18b)
ec-av1: lane-av1444edge -- the inter-frame pre-filter rung did not exist, and its counter restartedAhmet Kaan Gümüş · 689d3e0
ec-av1: lane-av1444edge -- the inter-frame pre-filter rung did not exist, and its counter restarted Two defects in the same measurement rung, both of which report success while measuring nothing useful. `EC_AV1_PREFILT_WIDE_DUMP` is the only rung that writes the pre-loop-filter reconstruction cropped to each plane's mi-ALIGNED extent, i.e. the shape aomdec's own rung 7 writes (`y_width`/`y_height`), so it is the rung that separates "already wrong in reconstruction" from "introduced by a loop filter". 1. It was inlined in the KEY-frame tile path only (`decode_key_frame_tile_with_cdfs`). `decode_inter_frame_tile_with_cdfs` has no wide prefilter dump at all, so every divergence localized to an inter frame had no pre-filter rung on our side to compare against the oracle's, and the nearest usable rung (the padded `EC_AV1_PREFILT_DUMP`) has a different byte shape from every oracle rung. Measured cost on the 4:4:4 lossy cells this lane was handed: `EC_AV1_POSTDEBLOCK_DUMP` / `EC_AV1_POSTCDEF_DUMP` came out 61440 B against the oracle's 52224 B (our 160x128 padded surface vs its 136x128 aligned buffer) and the oracle's POSTDEBLOCK wrote 3 files for a 4-frame stream, so the stage ladder could not be read at all. With the rung on the inter path the same two cells' pre-filter dumps are 52224 B and 4 files, and the verdict is immediate: reconstruction already diverges at the same first sample as the final output, so no filter is involved. 2. Its counter was a FUNCTION-LOCAL `static IDX2`. Rust gives each monomorphisation of the enclosing function its own copy, so the index restarted and every frame after the first overwrote `.f0` -- a per-frame bisection silently compared the last decoded frame and reported it as frame 0. Measured directly: before this change the rung wrote exactly one file for a four-frame stream. The counter is now the shared per-var `dump_stage_idx` map the other stage dumps already use, and the block is a shared `dump_prefilter_wide` called from both tile paths, beside each path's existing padded `EC_AV1_PREFILT_DUMP` so the two agree on the point they sample. No decode-path behaviour changes: the only writes are inside the existing `if let Ok(path) = crate::envflags::var(...)` arms, which are off unless the env var is set. (cherry picked from commit b2148831481f741a05830ac7014876dfc67f8d07)
docs+ec-av1: lane-av1444rect r5 -- the counters document that they prove reach, not that the fix bites; the retraction derives its length from plane extentsAhmet Kaan Gümüş · 4b6247d
docs+ec-av1: lane-av1444rect r5 -- the counters document that they prove reach, not that the fix bites; the retraction derives its length from plane extents Main's two notes, both taken. 1. Both route counters now say in their own doc comments that a non-zero count proves REACH and nothing more, and point at skill://ec-av1-pipeline-gate-counters: a counter needs a DIFFERS-style assertion to carry a claim. The intra-BC one is also recorded as deliberately armed OUTSIDE the own444 expression, so the mutation still increments it and the red lands on the pixel/entropy arm -- what carries the claim is the measured fork move (read 11750 -> 12465, luma first wrong 164416 -> 205264, 455240 -> 390380) and the mutation, not the count. 2. The retraction's re-measurement wrote assert len(ours) == 2 * len(ref). That factor is a coincidence of 4:4:4 against 4:2:0 at the same geometry -- it is the bits-per-sample ratio (our dump_yuv emits u16, the oracle's 8-bit dump is u8) and has nothing to do with chroma, so it is wrong at 4:2:2, at any high bit depth, or on any fixture where the two sides disagree on bit depth. The report now says to derive the expected byte length from the plane extents and the two bit depths and assert the oracle dump against that, never against a copied constant. Also recorded in the method notes: the 636-vs-1086 chroma and 2052-vs-1309 luma unit-count asymmetry from the round-4 census is explicitly NOT claimed as a defect, since luma is pixel-exact to 205264 and the surplus is most likely a counting-shape difference (our var-tx leaves vs libaom's unit walk).
av1h5: shared mu_chunk_order helper, control pin, gate helpersAhmet Kaan Gümüş · 0bb7c3c
av1h5: shared mu_chunk_order helper, control pin, gate helpers Folds the four copies of the chunk-major sort into one mu_chunk_order() helper that also reports whether it permuted the list, so mu_chunk_order_hits counts real reorderings rather than executions. Pins the --max-partition-size=64 control stream and factors the pinned- fixture read and the aomdec rawvideo comparison into read_pin() and assert_rawvideo_matches().
av1h5: read a 128 root's tokens CHUNK-major, not block-rasterAhmet Kaan Gümüş · f93609f
av1h5: read a 128 root's tokens CHUNK-major, not block-raster libaom's decode_token_recon_block (decodeframe.c:972) walks 64x64 mu chunks with the PLANE loop INSIDE the chunk loop. The var-tx leaf list is a BLOCK-wide raster, so a chunk's members are not contiguous: leaf 0..15 is chunk (0,0) row 0, but chunk (0,0) rows 1..15 are leaves 32..47, 64..79, ... The chunk test on the given order therefore closed the chunk every SIXTEEN leaves and coded each chunk's chroma sixteen times -- 64 chroma walks per 128 root where libaom codes 4, and 24576 chroma units per inter frame against the oracle's 1536. Reorder the leaf walk chunk-major at side > 64 (a no-op below 64, where a block IS one chunk) at all four sites carrying this test: the 128x128 inter arm, the 128x64/64x128 inter arm, and the two intra arms. Measured on the pinned 128x96 yuv444p10le lossless 10-bit stream (sha256 bbffb979..., 63429 B), against aomdec: chroma walks per frame 64 -> 4 chroma units per frame 24576 -> 1536 (oracle: 1536, exact) first ctx divergence unit 1539 -> unit 2573 first differing pixel byte 74769 -> byte 90272 Control arm (--max-partition-size=64, no 128 root) stays byte-exact. New gate a_lossless_444_128_root_lossless_stream_reads_chunks_chunk_major pins the route (mu_chunk_order_hits) and the first-difference position; mutating the chunk key back to the block raster turns it red.
ec-av1: lane-av1444rect r2 -- the same class, second instance, in the intra-BC 1:4 strip; plus an H3 retractionAhmet Kaan Gümüş · 2bcb6de
ec-av1: lane-av1444rect r2 -- the same class, second instance, in the intra-BC 1:4 strip; plus an H3 retraction RETRACTION. My previous report said the 4:4:4 lossless + tile-columns stream (77847 B, sha256 87b0d1a5...) was "byte-exact 6/6". It is not, and the claim is withdrawn. My throwaway compare script carried the H1 fixture's 128x96 geometry, so it zipped our first 36864 samples against the oracle's 98304-byte dump -- zip truncates to the shorter operand, making it a PREFIX compare, and the divergence at x >= 108 fell outside the window. Re-measured with the right geometry: 63-162 wrong chroma samples in every frame, first at U(110,26), luma exact. H3 is OPEN and belongs to Agent142-2; no H3 gate is pinned here. The crate's own decode_all_frames_vs_oracle asserts frame length before comparing, which is why the committed gates were never exposed to this. THE CLASS, SECOND INSTANCE. decode_rect4_16_intrabc applied the 4:2:0 pair geometry at every ss: (pw, ph) = (16,8)/(8,16), pair_mi = lmi - 1, cpx = pair_mi * MI / 2. At ss (0,0) is_chroma_reference makes an intra-BC 1:4 strip its own chroma reference, so libaom codes a 16x4 chroma block at the strip's own origin, not an 8x4 a quarter of the way off. It is LIVE, not latent: a testsrc2 640x480 --tune-content=screen --enable-intrabc=1 --enable-palette=1 --cq-level=60 stream (1016 B, sha256 7fe888ed..., 17 intrabc 16x4 strips at ss (0,0)) diverges 455240/921600 with the entropy fork at read 11750. --enable-intrabc=0 is byte-exact and the 4:2:0 twin is byte-exact. One own444 = ss_x == 0 && ss_y == 0 gate on (pw, ph), (cw, ch), pair_mi and (cpx, cpy); 4:2:0 and 4:2:2 keep every constant verbatim. Measured per plane: the luma first-wrong sample moves 164416 -> 205264 and the entropy fork 11750 -> 12465, but both chroma planes still first diverge at 20532 and 390380 of 921600 samples are still wrong. This is a PARTIAL improvement and is committed as one: no exactness is claimed, and the gate is a progress gate, not an exactness gate. It pins both fixtures, requires intrabc_rect4_own_chroma444_hits() > 0 (18 on the 4:4:4 witness, 0 on the 4:2:0 twin, armed outside the mutated expression so the mutation fails on the pixel arm), compares the 4:2:0 twin byte-for-byte through the length-asserting helper, and asserts the 4:4:4 LUMA plane is byte-exact to sample 205264 -- a floor that only grows, so the next lane's fix cannot turn it red. The untouched chroma divergence is named, never asserted exact. Mutation: own444 = false turns it red at 164416. Handed on: the remaining 4:4:4 intra-BC divergence is in CHROMA, first at U/V index 20532 (x=52, y=32), entropy fork read 12465 at mi (90,108), not yet localized to a line. Identity on this tip: the crate's 444 family (10), intrabc (20), rect_strip (10), 1to4 (11) and the 16-level rect-leaf gate, plus all three new chroma-format-sweep gates run in ~/.cache/wt/av1fmt against this decode.rs.
ec-av1: lane-av1444rect -- a 1:4 inter strip's chroma context was gathered at the 4:2:0 pair extent at ss (0,0), forking the coder (H1)Ahmet Kaan Gümüş · 9470822
ec-av1: lane-av1444rect -- a 1:4 inter strip's chroma context was gathered at the 4:2:0 pair extent at ss (0,0), forking the coder (H1) At 4:4:4 `is_chroma_reference` (av1_common_int.h:1454) reduces both parity clauses to `!subsampling_y` / `!subsampling_x`, so EVERY block is its own chroma reference and no 1:4 pair exists. `decode_inter_block`'s `around_c` never gated on ss, so a HORZ_4 16x4 strip read its chroma coefficient context over the 4:2:0 pair extent (16x8 luma = left[mi_r] and left[mi_r+1]) instead of its own 4-px one. The U unit's `get_txb_ctx` then saw a left neighbour libaom does not have and forked the arithmetic coder. The 4:4:4 lossy + RECT cell -- the largest correctness gap the chroma-format sweep left (lanes/av1formatsweep.report.md H1) -- had NO exactness gate at all: the whole committed 4:4:4 base is lossless 8-bit. Witness: testsrc2 128x96 rate=25 yuv444p, aomenc --profile=1 --passes=1 --end-usage=q --cq-level=20 --cpu-used=2 --threads=1 --row-mt=0 --lag-in-frames=0 --kf-max-dist=100 --limit=2, 6441 B, sha256 77f727e7... Red before: frame 1, 8884/36864 samples wrong, first at Y(91,32); the first wrong symbol was read 26263, both sides at mi (8,16) -- ours a luma-shaped txb_skip row (re-indexed chroma ctx 1), the oracle decodetxb.c:158 on the U plane with txb_skip_ctx 7. Green after: 2/2 frames byte-exact vs aomdec. Gate `a_444_lossy_rect4_inter_stream_decodes_pixel_exact` pins the fixture (len + FNV), asserts the ss (0,0) full-resolution chroma shape, the byte-exact compare through the oracle aomdec, and non-vacuity on the corrected route via `rect4_inter_own_chroma444_hits` (9 gathers here, 0 on the 4:2:0 control, which also carries 16 HORZ_4 / 28 VERT_4 strips and is itself compared byte-for-byte so a widening past ss_x 0 goes red). Mutation proof: restoring the old arm with the counter left in place turns the gate red at byte 4187 (ours 35 vs 38), 8884 bytes differing. Identity: the crate's whole 444 family (9), rect_strip family (10), the 16-level rect-leaf gate, and all three new chroma-format-sweep gates (444 lossless 10-bit, 444 12-bit, odd coded dimensions) run green against this decode.rs. H2 (4:4:4 lossy tx-size-search chroma +/-1, 608/36864 from frame 2) is unchanged and still divergent -- it is reconstruction arithmetic, not entropy, and belongs to its own lane. H3's tile-column recipe (77847 B, 6 frames) is byte-exact here.
ec-av1: ss-aware chroma reach in the lossless 16x4/4x16 pair walkAhmet Kaan Gümüş · eb65242
ec-av1: ss-aware chroma reach in the lossless 16x4/4x16 pair walk
The sweep's H4 ("4:4:4 lossless + --tile-rows=1, frame 3 onward the plane
goes flat") is not a tile defect. Two measured corrections:
- `--tile-rows=1` at 256x128 is a no-op: aomenc's default superblock is
128px, so 256x128 is 2x1 superblocks with no second superblock row to
split, and the "tiled" stream is byte-identical to the untiled one.
Tile rows at 4:4:4 lossless are exact at 1, 2 and 4 rows, both axes,
on four geometries.
- the "flat plane from frame 3" signature is a decode-order vs
display-order mismatch in the measurement itself: aomdec dumps 7
frames in decode order, ffmpeg emits 6 in display order, and
aomdec-vs-ffmpeg alone reproduces the identical damage with no edith
decoder in the loop.
The defect behind it is real and tile-INDEPENDENT (it reproduces on the
zero-tile stream). The lossless 16x4/4x16 chroma-pair walk passed
`tu_reach` a hardcoded 4:2:0 luma footprint (`ox * 2, oy * 2, 8`); at
4:4:4 a 4x4 chroma unit is 4x4 luma, so the footprint is doubled and
`Reach::of_tu`'s `col_off + tx_w < bw` test answers against a block twice
its real width -- every unit past the midpoint wrongly reports
`above_right = false` and a directional chroma strip predicts from a
neighbour libaom never reads. Patched to the ss-aware form already used
by the block-walk sibling at decode.rs:35342; the 4:2:0 answer is
unchanged because `<< 1` is `* 2`.
Measured site: testsrc2 256x128 yuv444p, `--profile=1 --lossless=1
--cpu-used=2 --lag-in-frames=0 --kf-max-dist=100 --limit=6`, first wrong
sample U(110,26) (ours 8, ref 7), 63 samples wrong per frame (U 29 + V
34, deltas -10..+13) on the key frame and all five inter frames. Entropy
is bit-identical: 351109 EC_SYMR reads compared on both sides with the
CDF convention reconciled, zero divergence -- reconstruction, not a fork.
Gate `a_lossless_444_rect16x4_chroma_reach_is_ss_aware` pins the fixture
(77918 bytes, sha256 382e67c0cc0988d14c500a62f5c3457a3f3b5f76d05acce2f655b1089bb8e7e3),
asserts the header really is ss (0,0)/8-bit/256x128, requires
rect4_16_lossless_chroma_hits to fire (80 on this fixture, 0 for a 4:2:0
stream of the same content), and compares every frame against aomdec in
decode order and ffmpeg in display order. Reverting the two calls turns
it red at byte 39534 -- U(110,26), the measured site.
Identity: 10/10 a_lossless, 9/9 444, 3/3 tile gates, and the sweep's 3
new gates all green.
Not fixed here, handed to the H1 lane: 512x128 --lossless=1 --cpu-used=2
(130708 wrong by frame 5) also forks entropy (459866 oracle reads vs
369136 ours) and is unchanged by this fix.lane-av1leftref: read the LEFT chroma reference one mi row down at ss_y=1Ahmet Kaan Gümüş · c52da7e
lane-av1leftref: read the LEFT chroma reference one mi row down at ss_y=1 libaom's set_mi_row_col puts chroma_left_mi at base_mi[ss_y * mi_stride - 1], one mi row DOWN at 4:2:0 and 4:4:0 and on its own row at 4:2:2 and 4:4:4 (av1/common/av1_common_int.h:1395-1401). This read its own row at every subsampling; the above COLUMN's +ss_x term had already landed (a9611ea2/4b9c4cd8) and this is its counterpart on the left read. 4:2:2 and 4:4:4 are a no-op by construction (ss_y == 0). 4:2:0 and 4:4:0 move one mi row down. smooth_uv_neighbour_unsnapped gains ss_y and a decode_path flag: the 16x4/4x16 pair witness calls it as a counter-only mirror at an ODD mi row, and counting that mirror's flips is what made the shape look reachable (50 "hits" on reelb_kf900) when no committed fixture reaches it on a decode path (0). Counters: uv_left_ss_y_reads (22292 on reelb_kf900) proves the arm is live; uv_left_ss_y_mode_diff_hits / _smooth_diff_hits compare libaom's cell against the pre-lane own-row cell and read 0 on every committed fixture and ~1000 swept encodes, so the change is a proven no-op on today's material. Gate: a_4to20_key_frame_takes_the_left_chroma_reference_read_its_libaom_row -- all THREE planes vs ffmpeg, not luma alone, because a chroma edge-filter type moving is invisible to a luma-only assertion. Report: lanes/av1leftref.report.md, including why the shape is structurally absent (uv_mode_grid runs down a left mi column are always even length: libaom only starts a block on an odd mi row with an 8-px strip, and the 4-px HORZ_4 strips aomenc does pick all land inside one mi row), and why this gate does NOT discriminate: both reads agree everywhere measured.
Merge branch 'lane-av1422warp'Ahmet Kaan Gümüş · 9d19aad
Merge branch 'lane-av1422warp' # Conflicts: # crates/ec-av1/src/decode.rs # crates/ec-av1/src/stream.rs
Merge lane-av1-ibc128chunk: per-axis chroma chunk walk in decode_intrabc_128rectAhmet Kaan Gümüş · b430562
Merge lane-av1-ibc128chunk: per-axis chroma chunk walk in decode_intrabc_128rect - de-square-cuts the mu-chunk chroma read walk and the mu_chroma replay (chunk-then-unit, the twin's shape); witnessed red/green on two pinned 4:2:2 intrabc sb128 fixtures, byte-exact vs aomdec - reviewer PASS after rework (replay coverage regression found and fixed) - suite 640/0 on server-3 # Conflicts: # crates/ec-av1/src/decode.rs
lane-av1422warp r33: reviewer rework -- OBMC snap, hot-path env, two docs, one wrong numberAhmet Kaan Gümüş · 4e1fb23
lane-av1422warp r33: reviewer rework -- OBMC snap, hot-path env, two docs, one wrong number
Reviewer FAIL addressed, all five findings.
P2 (a4532a41) OBMC PAIR-MERGE SNAP. The snap was clamped on the wrong
value. libaom (obmc.h:44-46) snaps the pair index `& ~1` UNCONDITIONALLY
and reads at `snap + 1`; only the REPORTED offset
(`above_mi_col - mi_col`) is negative, and it feeds
`av1_setup_build_prediction_by_above_pred` while the READ feeds
`above_filter.get(mi_col + src4)` and the MiInfo itself. Clamping the
snapped index to `mi_col`/`mi_row` silenced the underflow and in exchange
read the neighbour one column RIGHT of libaom's, then stepped past
`mi_col + 1` entirely. Both sites now keep the snap and clamp only the
offset. The tuple is `usize`, so libaom's -1 is carried as 0; that is
noted in the code rather than glossed.
New gate the_obmc_pair_merge_snap_reads_libaoms_neighbour_not_one_to_the_
right pins the snapped READ against a synthetic grid with distinguishable
neighbours at the pair's even half, odd half, and the column to the right.
Mutation-proven both ways. It is necessary because NO STREAM IN THE CORPUS
exercises this branch: a1.obu's 1338 traced OBMC neighbours are identical
before and after the fix, since its 4-wide pair never starts on an odd
edge.
P2 HOT-PATH ENV LOOKUP. `SymbolDecoder::symbol` called
`std::env::var_os("EC_SYMR")` on every symbol read of every stream,
production formats included. Now `envflags::env_flag!("EC_SYMR")`, one
LazyLock per call site (the ecdump_armed precedent at msac.rs:1059).
Proved byte-identical: same build, both forms, identical 246735-line
EC_SYMR traces.
P3 MI_SIZE DOC. The doc claimed "MI_SIZE (aom_scale.h)" and 8. libaom's
MI_SIZE is 4 (av1/common/enums.h:39-40) and lives in enums.h. Renamed
MI_SIZE_8PX; both its doc and read_lr's are restated in 8-pixel terms,
with why the value is double libaom's (its denom is a pixel count, so
numerator and denominator already sit on opposite scales) and the paired
trace named as the authority. The rename is so nobody corrects it to 4.
P3 TOP-HALF CENSUS WAS AN UPPER BOUND, AND 248 WAS WRONG.
top_half_warp_hits incremented on "either slot's model > TRANSLATION"
alone, omitting `is_globalmv && side >= 8`, so it counted blocks that are
not global-mv blocks. It now increments on `is_global_mv0 || is_global_mv1`
-- libaom's own `is_global_mv_block` -- with the census moved below their
definition. CORRECTED UPPER-HALF FIGURE: 3 warp, 3 compound. Not 248.
Frame-global figures unchanged (compound_warp 25, compound_warp_8 18,
rotzoom_gm_warp 84, lr_wiener 22, lr_sgrproj 10). The gate doc and the
lift section are corrected; 248 was never a count of anything real.
P3 ACCESSOR DOCS. Both claimed a committed reader that does not exist and
cannot: with the header refusal standing no committed test decodes a 4:2:2
stream. Both now say so.
NO CHANGE to the 4:2:2 refusal, which stays unconditional. NO committed
bypass. Stream still 246735/246735 paired and 16/16 pixel-exact.lane-av1422warp: fix the 4:2:2 loop-restoration corner bug; pin the coverage witnessAhmet Kaan Gümüş · 7373100
lane-av1422warp: fix the 4:2:2 loop-restoration corner bug; pin the coverage witness The 4:2:2 sequence header refusal is UNCHANGED and unconditional. This commits the fix that makes a second 4:2:2 coverage witness decode pixel-exact through the env-gated probe bypass, and pins that witness. THE DEFECT. Two errors in the per-superblock restoration-unit range that had been cancelling each other: 1. `read_lr` derived the ROW corners from the COLUMN axis. libaom's `av1_loop_restoration_corners_in_sb` (restoration.c:1303-1338) steps rows by `MI_SIZE >> subsampling_y` and columns by `MI_SIZE >> subsampling_x` -- the axes are not symmetric. This decoder had one `mi_size = 4 >> subsampling_x` for both, on a base of 4 where libaom's `MI_SIZE` is 8. At 4:2:2 (ss_x 1, ss_y 0) that made the row range 4x too small, so `rrow0 == rrow1` -- an empty range, zero `read_lr_unit` calls -- wherever libaom reads a chroma unit. 2. The 128x128 superblock's mode-info extent was passed as `SB_MI * 2`, and the two 64px call sites carried the same half-mi convention. Both are 2x too large. The two cancelled exactly at 4:2:0 (4*32 == 8*16), which is why 4:2:0 and 4:4:4 decoded byte-exact while carrying the bug and why the 4:2:0 evidence was never evidence of correctness here. At 4:2:2 the cancellation breaks, because the row term stops following the column axis. A third, smaller correction: the `read_lr` call is the ONE consumer that turns a superblock's mode-info origin into ABSOLUTE frame space (it divides by the restoration-unit size, a real pixel count), and it was handed `(sb_r & !1) * SB_MI` -- twice the true mi row, since `sb_r` indexes 64px superblocks. The partition decode is self-consistent with that value (relative offsets only), which is why the 128 path decoded correctly everywhere else; the origin is corrected only where it is converted to absolute frame space. EVIDENCE. The entropy stream pairs bit-for-bit against the instrumented oracle -- 246735 symbol reads on each side, no divergence anywhere in the stream, not merely at the window this lane spent nine rounds narrowing. All 16 frames pixel-exact vs `aomdec --rawvideo` (2359296 bytes, sha256 4bfc2395e5ca6ea178f606e6b1ced773e26fc2d85bc3a6cdb63a402939aeb203 both sides). 4:2:0 control byte-exact, 4:4:4 LR witness byte-identical to its pre-lane decode, both previously pinned 4:2:2 witnesses pixel-exact. LR gate family 12/12. Scoped battery over 420/444/inter/superres/cdef 118 passed, 0 failed, 7 ignored. The wide gate is pin + refuse-by-name, the established 4:2:2 pattern: with the header refusal standing, no committed test can decode a 4:2:2 stream, because the bypass that would allow it must never be committed. The exactness and engagement figures live in the gate's doc comment with the encode recipe. Mutation-proven both ways -- a flipped fixture byte panics "bytes drifted", a wrong refusal string panics "must refuse by name". ENGAGEMENT, measured above the vertical midpoint on the exact stream. Every pre-existing warp counter is frame-global, so this adds `top_half_warp_hits` and `top_half_compound_hits`: 248 upper-half blocks on a non-TRANSLATION global-motion model, 3 upper-half GLOBAL_GLOBALMV compound blocks. Frame-globally: compound_warp 25, compound_warp_8 18, rotzoom_gm_warp 84, lr_wiener 22, lr_sgrproj 10, cdef_idx 53, part128_split 95. Fixture: crates/ec-av1/fixtures/422_residual_compound_warp_16f.obu, 38845 bytes, sha256 d78e2afb43ce311d3d82335a945c6f80f62db4537966d881c1349a68b3aecb95, fnv1a64 0x0e73a51e2cc0c424.
lane-av1422warp: instrument -- EC_SYMR cdf tag is ONE-SHOT; tag the inter readsAhmet Kaan Gümüş · 372f8f5
lane-av1422warp: instrument -- EC_SYMR cdf tag is ONE-SHOT; tag the inter reads No behaviour change; identity re-proved (4:2:0 control byte-identical to aomdec --rawvideo, 4:4:4 witness byte-identical to the pre-lane build, both pinned 422 witnesses pixel-exact). Main's suspicion was right and is fixed: the cdf tag was STICKY -- set at a read site and carried by every later read -- which is exactly how an 8-SYMBOL read came to be labelled `interintra`, a 2-SYMBOL table. `SymbolDecoder::symbol` now CONSUMES the tag, so an empty `cdf=` means "no table set for this read", never the previous read's table. That also retracts round 28's "the two missing reads are interintra", which rested on the sticky label. Remaining inter-path reads tagged so the window is readable: y_mode, uv_mode, motion_mode, skip_mode, comp_group_idx, compound_idx, interintra. Verified sparse on a1.obu: comp_group_idx 947, interintra 945, uv_mode 895, motion_mode 736, compound_idx 726, y_mode 293, rest empty. Oracle side snapshotted separately (one-shot plus its own tags).
lane-av1422warp: instrument -- EC_SYMR carries the CDF table nameAhmet Kaan Gümüş · e9a6ad8
lane-av1422warp: instrument -- EC_SYMR carries the CDF table name No behaviour change: set_symr_cdf only feeds the env-gated print. Identity re-proved after the edit: 4:2:0 control a420.obu byte-identical to aomdec --rawvideo, 4:4:4 444_sb128rect_lr_witness.obu byte-identical to the pre-lane build, both pinned 422 witnesses pixel-exact. `cdf0` alone cannot identify a table -- two rows can share a first entry -- which is what stopped round 27 from naming the two missing reads. EC_SYMR now prints `cdf=`, set at the read sites for the tables in this window: interintra, comp_group_idx, compound_idx (both sides; the oracle's tags are snapshotted separately). With the oracle side tagged, read 107517 at mi(30,62) carries `cdf=interintra` and the two reads this decoder omits sit either side of it. That is NOT yet an attribution: the matching gate on our side (`enable_interintra_compound && !skip_mode`) is TRUE on every one of its 451 firings, so this decoder is not skipping the interintra read there, and the cdf tag on our side has not been verified against a known read. Recorded in the report as an open question rather than closed.
lane-av1422warp: instrument -- EC_SYMR carries a phase, and a CORRECTED inter miAhmet Kaan Gümüş · c39e6f5
lane-av1422warp: instrument -- EC_SYMR carries a phase, and a CORRECTED inter mi No behaviour change: `set_symr_phase` and the extra `set_symr_mi` only feed the env-gated print. Identity re-proved after the edit: 4:2:0 control a420.obu byte-identical to aomdec --rawvideo, 4:4:4 444_sb128rect_lr_witness.obu byte-identical to the pre-lane build, both pinned 422 witnesses pixel-exact. Two changes, both prompted by round 26's failed coverage check. 1. PHASE on every read. The coefficient rungs stop well before the frame-3 divergence on BOTH sides, so the per-read stream is the only instrument that reaches it, and a read with no phase is unattributable. `EC_SYMR` now prints `ph=`: "inter" over the inter mode-info path, "inter8" over the sub-8x8 arm, "" elsewhere. 2. THE INTER mi LABEL WAS WRONG, and fixing it changes the answer. Round 27 first published the mi from `decode_inter_block`'s entry `at`, which labels a DIFFERENT block -- it reported mi(28,52) for reads this decoder makes for mi(30,62). The `EC_MODE_VAL8` rung, printed by the function that actually reads the mode, reports mi(30,62). The phase/mi are now also published from `decode_inter_block8` at the block's own `leaf_mi`, which is what makes the inter mi trustworthy -- round 22's misattribution was exactly this class of error, and it is now closed at the source rather than worked around. With the label correct, reads 107514-107516 pair at mi(30,62) on both sides and the divergence is clean: the oracle reads two n=2 inter-mode symbols (107517, 107518) that this decoder does not, and its n=8 at 107519 is identical to our n=8 at 107517 -- a two-symbol shift, same block.
lane-av1422warp: clamp the OBMC pair-merge snap so it cannot land below the blockAhmet Kaan Gümüş · 2375b81
lane-av1422warp: clamp the OBMC pair-merge snap so it cannot land below the block
Both OBMC neighbour walks snap back to the chroma pair's even row/column
(`row &= !1` / `col &= !1`) so the ODD half is the neighbour for both
strips. That snap rounds DOWN, so at an ODD `mi_row` / `mi_col` it lands
on `mi_row - 1` / `mi_col - 1` and the `row - mi_row` / `col - mi_col`
offsets pushed into the neighbour list UNDERFLOW: `usize::MAX` in
release, and a debug-build panic ("attempt to subtract with overflow",
`overlappable_left` / `overlappable_above` called from
`decode_inter_block`).
Witness: a1.obu decodes clean, but with EC_TRACE_MODE_STEP=1 it panics at
decode.rs:31540 and then 31491 -- reproducibly, single- AND
multi-threaded. I could not explain why the flag is needed to reach the
path, and am recording that as unexplained rather than inventing a
reason.
Both snaps are now clamped with `.max(mi_row)` / `.max(mi_col)`: the
offset can never be negative, and where it was already non-negative the
arithmetic is unchanged.
NOT the frame-3 divergence: the 16-frame EC_SYMR sequence diff is
unchanged, first divergence still seq=107517 at mi(64,56). So this fix
removes a real defect the stream does not exercise in a normal decode;
it does not move the boundary. Identity re-proved after the edit: 4:2:0
control byte-exact, 4:4:4 witness byte-identical to the pre-lane build,
both pinned 422 witnesses pixel-exact.lane-av1422warp: instrument -- EC_SYMR names its own block (mi on every read)Ahmet Kaan Gümüş · 5e7ae32
lane-av1422warp: instrument -- EC_SYMR names its own block (mi on every read) No behaviour change: the three `set_symr_mi` calls and the new thread-local only feed an env-gated print. Identity re-proved after the edit: 4:2:0 control a420.obu byte-identical to aomdec --rawvideo, 4:4:4 444_sb128rect_lr_witness.obu byte-identical to the pre-lane build, pinned 422_allskip_2f.obu and 422_sb128_3f.obu still pixel-exact. A symbol read carries no mi, so the per-read stream could only be located by correlating it against a SEPARATE trace. That correlation is what mis-attributed reads in rounds 22 and 23: the divergence was pinned on a 4x4 leaf at mi(24,57) that the EC_SYMR stream shows is nowhere near it. With mi on every read the same divergence names its OWN block, and the answer changes: it is the 32x32 intra block at **mi(64,56)** -- the frame's bottom-right corner at 4:2:2 -- whose mode-info reads pair exactly (skip/cdef/dq/mode=3/angle_y=-2/uv_mode=8/angle_uv=-1) and whose COEFFICIENT reads diverge. The oracle side is the same edit, already snapshotted in the oracle tree as 35d97e5, so both sides carry mi and the streams are directly comparable read for read. `mi` is a LABEL for attribution and is deliberately NOT part of the divergence criterion: the oracle publishes it one read later than we do, so requiring equality on it would report a spurious divergence at read 5.
lane-av1422warp: gate the 32x16 strip reader's 4:2:2 chroma dc-sign voteAhmet Kaan Gümüş · b86686a
lane-av1422warp: gate the 32x16 strip reader's 4:2:2 chroma dc-sign vote decode_block_rect built its chroma vote with `around_rect` and no 4:2:2 rerouting -- the sibling decode_leaf_rect, which lane's round-6 fix gated, was not. At ss (1,0) that strip's chroma is a square (side/2, side) block whose above cells spread over `side` LUMA mi columns, so the per-mi rect gather double-counts every chroma column's whole-unit dc sign. Found with the EC_SYMR sequence diff (see the report): of 46260 symbol reads on a1_f0.obu, reads 0..45259 pair EXACTLY on value, range, CDF row (32768 - ours == oracle), alphabet, symbol and post-read range, and read 45260 is the first divergence -- the chroma-U 4x4 transform of the 32x16 strip at mi(68,16), whose DC sign this decoder reads from dc_sign_ctx 1 where libaom reads row 0. Same position, same symbol, same bits, different row: the signature the ladder cannot see. After the fix all 46260 reads match at state level (the only residual difference is the `bit` field over the last 17 reads, which is the reference's own buffer-end tell convention). Frame 0 is PIXEL-EXACT against aomdec for the first time on this stream; the 16-frame measure goes 0/16 -> 3/16 frames exact and 1619115 -> 1332125 differing samples. Identity, all four unchanged: the 4:2:0 control a420.obu byte-identical to aomdec --rawvideo; 444_sb128rect_lr_witness.obu byte-identical to the pre-lane build; pinned 422_allskip_2f.obu and 422_sb128_3f.obu still pixel-exact against aomdec. The gate is ss (1,0), so 4:2:0 and 4:4:4 never reach the sampler. Also restores EC_SYMR in SymbolDecoder::symbol (msac.rs), which an earlier `git checkout` in this lane had wiped along with the oracle's copy; the format follows skill ec-av1-consumption-gap-symr Step 3.
lane-av1422warp: a 4:2:2 rect leaf's chroma dc-sign vote must sample chroma cellsAhmet Kaan Gümüş · cb5d22b
lane-av1422warp: a 4:2:2 rect leaf's chroma dc-sign vote must sample chroma cells
decode_leaf_rect's around_mi_rect call was the one 4:2:2 chroma gather in
the file still ungated: at ss (1,0) a 16x8/8x16 luma leaf's chroma is a
SQUARE (side/2, side) block, so `side` chroma 4-px cells above it spread
over `side` LUMA mi columns, one chroma column per PAIR of luma mi cells,
and both cells of a pair carry the covering unit's whole-unit dc sign. The
per-mi rect gather therefore double-counts every chroma column's sign.
around_mi_422_chroma's every-second above-cell sampling IS libaom's
txb_w_unit sum, and every sibling gather in this file already routes
through it under `ss_x == 1 && ss_y == 0`; this one did not, so a 4:2:2
rect leaf voted over luma unit counts.
Measured on the pinned 4:2:2 rotzoom stream (a1.obu frame 0, cut to
a1_f0.obu). The 16x8 leaf at mi(48,28) resolved its V plane's dc sign
from vote 0 -- dc_sign_cdf[0] -- where the oracle resolves a negative
vote, dc_sign_cdf[1]:
before EC_DCDUMP mi=(48,28) plane=2 wh=(16,8) vote=0
above=[None/6,None/6,Some(false)/7,Some(false)/7] FOUR cells
after EC_DCDUMP422 mi=(48,28) plane=2 wh=(16,8) vote=-1
above=[None/6,Some(false)/7] TWO cells
Red/green. The bit offset between the two decoders is a clean constant
through coefficient unit 1418 and turned 6 bits at 1419; after this fix
unit 1418 pairs and the first divergence moves to unit 2427. Frame 0
coefficient units: 1959 wrong-shaped before, 2680 after (oracle 2512).
Whole stream, 16 frames vs aomdec --rawvideo: 1619115 -> 1380482
differing samples. Still 0/16 frames exact -- see the hand-off below.
Identity, measured four ways, all unchanged:
- 4:2:0 control a420.obu byte-identical to aomdec --rawvideo. The gate
is ss (1,0), so the sampler is not reached at 4:2:0 or 4:4:4; `chroma_422`
is already computed in this arm for the scan selection.
- 4:4:4 444_sb128rect_lr_witness.obu byte-identical to the pre-lane build.
- pinned 422_allskip_2f.obu (2 frames) and 422_sb128_3f.obu (3 frames)
still pixel-exact against aomdec.
- the decodetxb/aomdec EC_DCSIGN and EC_COEFF_STEP bitpos rungs used to
pin this are all reverted; aomdec is rebuilt to its committed shape.
Hand-off: the new first divergence is at coefficient unit 2427 / TU 2428,
mi(64,24), where the oracle codes a 32x32 luma TU and we code 8x8 leaves.
That is a different CLASS from this fix -- block/partition structure, not a
neighbour vote -- so it is reported rather than chased.lane-av1422warp: correct the chroma-reference comment and report; no behaviour changeAhmet Kaan Gümüş · 10647bf
lane-av1422warp: correct the chroma-reference comment and report; no behaviour change Comment-only. The decode paths are byte-identical to a9611ea2; re-verified after the edit: the 4:2:0 control a420.obu is still byte-exact against aomdec --rawvideo and 444_sb128rect_lr_witness.obu is still byte-identical to the pre-lane build. Two false statements are corrected, in decode.rs's smooth_uv_neighbour_unsnapped comment and in the lane report. 1. The left-reference derivation. The comment claimed `base_mi[ss_y*mi_stride - 1]` is a COLUMN offset of -1 whose row delta is 0 "at every subsampling, since the row term is at most `stride - 1` elements". That is arithmetically wrong: at `ss_y == 1` the offset is a FULL row down less one element, so the row delta is 1 and the column delta -1. The comment also contradicted itself -- one line said "ss_y ROWS down", the next claimed row delta 0. The block now states the two offsets as plain (row, column) deltas and drops the bogus arithmetic. 2. "only 4:2:2 takes the new column" was wrong. The above column term is `+ss_x`, so it moves the read at 4:2:0 and 4:4:0 as well (both have `ss_x == 1`); only 4:4:4 (`ss_x == 0`) leaves it alone. What the measurement actually showed is that the resulting boolean was unchanged on the 4:2:0 control -- not that the shift is the identity there. The comment and the report now say that. Both now also carry the consequence as a NAMED UNRESOLVED discrepancy rather than a settled one: the left read's `+ss_y` row term is NOT shipped, because no committed fixture presents a 1-mi-tall left neighbour (an 8x4 leaf's left block) at 4:2:0/4:4:0 and so nothing in the tree can witness the correct term today. Unblock is one such stream. History note: the a9611ea2 commit message overreaches. It asserts the shipped form "is libaom's own at every subsampling" and that the left read "never moved" -- both follow from the wrong arithmetic corrected here. Left unamended per history hygiene; this commit supersedes it.
ec-av1: lane-av1-ibc128chunk r2 -- the mu_chroma replay walks chunk THEN unit, report red counts correctedAhmet Kaan Gümüş · fda214d
ec-av1: lane-av1-ibc128chunk r2 -- the mu_chroma replay walks chunk THEN unit, report red counts corrected
Review r1 found a real coverage regression this lane introduced, and a
wrong attribution in the report.
P2, the defect. r1 gave the mu_chroma replay per-axis EXTENTS but kept the
old STEP: rows/cols count mu CHUNKS (ch / chunk_chroma_h) while the loop
body advanced the mi origin and read the grid PER UNIT (cr *
(unit_luma_h / MI), grid (cr * chunk_chroma_h)). Those agree only when a
chunk holds exactly one unit. At 4:2:0 (chunk_chroma == cu == 32) it is
line-identical to the parent, so nothing measured it; at 4:2:2
(chunk_chroma_h = 64 = 2 * cu) the body reached only the FIRST of the two
stacked units per chunk, so rows mi_r+8 .. mi_r+16 kept the composed-grid
smearing the replay exists to undo. The parent reached those rows (wrong
span, full coverage), so this was a regression r1 added, not a pre-existing
gap.
The reshape is the twin's chunk-then-unit loop (decode_inter_block's
mu_chroma_units, lane-av1-444 c8): (ur, uc) = (chunk_chroma_h / cu,
chunk_chroma_w / cu), inner `for kr in 0..ur { for kc in 0..uc {`, mi
origin (cr * 64 + kr * unit_luma_h) / MI per axis -- cr * 64 is the mu
chunk's LUMA-px step, 64 on both axes at every subsampling, which is why
the twin can write it unshifted -- and grid origin (cr * chunk_chroma_h +
kr * cu). At 4:2:0 ur/uc are 1 so kr/kc are 0 and the whole thing
collapses to r1's walk, line for line.
The LOSSLESS arm is pre-existing and deliberately untouched. On a lossless
frame cu is 4 and the composed grid is a raster of TX_4x4 units, so the
chunk-counted rows/cols do not enumerate it at all: that arm re-stamps
only the 4x4 at each chunk's top-left with a 2x2-mi span, where the twin
raster-walks the whole plane block (lane-av1-llinter). It is a 4:2:0
defect, not a subsampling square-cut, so it is out of this lane's class,
and fixing it would change 4:2:0 LOSSLESS output on a reconstruction with
no witness to verify it. Measured unreachability: a temporary env-gated
counter in the arm records 0 hits across the whole lossless and intrabc
gate battery (13 + 19 tests). Unblock named in the report.
P3, the report. The red counts were attributed to the wrong fixture: the
primary witness 422_intrabc_sb128_strip.obu is 46891 (f0) / 44842 (f3) on
the parent, 45135 / 44540 is the _notxsearch arm's. Both re-measured per
fixture and the table now reports each arm separately. The first
difference is byte 98368 = f0 Y row 256 col 64 on both -- the top-left of
the first 128x64 intrabc block at mi(64,0) -- and green is 0/0/0/0/0.
Re-measured after the reshape: both witnesses byte-identical to r1's
output (6 blocks, 48 chroma units, 5/5 frames exact vs aomdec), so the
reshape is a pure coverage repair. Gate battery 7/0 -- the four named
gates, both new gates and the bigblock pin gate -- plus intrabc 19/0 and
422+444+lossless 20/0; cargo check --all-targets 0 warnings. The source
scan gains the chunk-then-unit pins and its non-vacuity is measured twice:
forcing (ur, uc) = (1, 1) fails it (found 0), and re-introducing the
square cut at the read-walk site fails it (left: 1, right: 0). The
EC_AV1_ALLOW_422_PROBE bypass is NOT in the commit.lane-av1422warp: the chroma-above reference is one mi column right of libaom'sAhmet Kaan Gümüş · cc66ecf
lane-av1422warp: the chroma-above reference is one mi column right of libaom's smooth_uv_neighbour_unsnapped read the above chroma neighbour at (mi_r - 1, mi_c) and the left at (mi_r, mi_c - 1). libaom's set_mi_row_col (av1_common_int.h:1395-1412) puts them at base_mi[-stride + ss_x] and base_mi[ss_y*stride - 1], with base_mi the block's own mi already de-offset by (mi_row & ss_y) / (mi_col & ss_x) -- which is exactly the snap the caller applies. So the above read is (mi_r - 1, mi_c + ss_x) and the left read is (mi_r, mi_c - 1): the ss_y*stride term is a COLUMN offset of -1 (row delta 0) at every subsampling, so only the above COLUMN gains ss_x. One chroma column spans two luma mi columns, so the chroma edge reaches into the right-hand luma block's territory and that is where its reference lives. Measured on the pinned 4:2:2 rotzoom stream (a1.obu, frame 0 PREFILT vs aomdec): 56142 -> 53395 diffing samples. The first divergent block is fixed outright -- the chroma 4x8 D67_PRED block at chroma (88, 72) = mi(18,44) now reproduces the oracle's prediction exactly (row0 132,150,157,148) instead of the strength-0 edge (135,147,172,145), and its reconstructed U row is byte-equal. Identity, measured three ways: - 4:2:0 control (a420.obu, same recipe at --profile=0) byte-identical to aomdec --rawvideo before and after; - 4:4:4 (444_sb128rect_lr_witness.obu) output byte-identical to this branch's pre-change build (ss_x == 0 makes the column term vanish); - the left read is unchanged, so the one term an earlier attempt got wrong (applying ss_y to the left ROW) is gone -- that term alone was what regressed 4:2:0.
lane-av1422warp: OBMC strides the 4:2:2 chroma prediction with the plane block's own widthAhmet Kaan Gümüş · 16a2dff
lane-av1422warp: OBMC strides the 4:2:2 chroma prediction with the plane block's own width obmc_plan/obmc_run carried the enclosing square chroma_side and used it as the chroma PREDICTION buffer's stride. At 4:2:2 that buffer is (chroma_stride, chroma_buf_h) = (plane block width, plane block height) since lane-av1-422blockhalf, so every chroma blend read row r at r*side instead of r*chroma_stride. Measured on a real aomenc --profile=2 stream (256x288, 16 frames): a 32x16 luma strip's left-pass chroma blend wrote row 15 at index 15*32 = 480 of the 256-sample 16x16 buffer -- the index-out-of-bounds panic in obmc_blend_h. The stream decoded zero frames before this and all 16 after. All four chroma blend call sites and both EC_MCB prediction dumps now use chroma_stride, matching every other consumer of pred_u/pred_v in the same block. chroma_stride == chroma_side at 4:2:0 and 4:4:4, so those are unchanged: a same-recipe 4:2:0 control stream (a420.obu, sha256 1f43ef1a) is byte-identical to aomdec --rawvideo before and after.
ec-av1: lane-av1-ibc128chunk -- the 128-root intrabc strip's mu-chunk chroma walk de-square-cut, with a red/green 4:2:2 witnessAhmet Kaan Gümüş · a50f363
ec-av1: lane-av1-ibc128chunk -- the 128-root intrabc strip's mu-chunk chroma walk de-square-cut, with a red/green 4:2:2 witness decode_intrabc_128rect cut each mu chunk's chroma plane block with `chunk_chroma = cside * 64 / side` -- a `chroma_side`-SQUARE chunk, i.e. the 4:2:0 unit count on BOTH axes. This is the same defect lane-av1-422bigblock fixed and witnessed in decode_inter_block and decode_block_128rect; this copy was deferred there as unwitnessed. It is now witnessed: a real `aomenc --i422 --profile=2 --sb-size=128 --enable-intrabc=1` stream reaches the shape. A 64x64 mu chunk's chroma plane block is (64 >> ss_x) x (64 >> ss_y) -- 32x32 at 4:2:0, 32x64 at 4:2:2 (TWO STACKED TX_32X32 per plane, which av1_get_max_uv_txsize still caps at 32 per axis), 64x64 at 4:4:4. At 4:2:2 the square cut read one chroma unit per plane per chunk instead of two, left the chunk's lower 32 chroma rows with no residual at all, and stamped each unit's entropy context over a 16x16-mi luma square instead of 16x8; the block's own plane block was still the 4:2:0-hardcoded `bw/2 x bh/2` (and `px/2, py/2`) even though the same function's two mv_to_q4 calls already scaled the DV per axis by ss_y. The halved unit count desynced the tile. Fix: per-axis at BOTH sites (the mu-chunk read walk and the mu_chroma per-unit context replay) in the same expression shape the two witnessed twins carry -- chunk_chroma_w/h = 64 >> ss, unit_luma_w/h = cu_tx << ss, around_mi_rect/record_mi_chroma on the per-axis spans, per-axis unit origins and composed-grid offsets, and cw/ch = bw/bh >> ss for the block's chroma plane block. Red before (parent a7d22aec, on the EC_AV1_ALLOW_422_PROBE patch-run-restore build): 8 chroma units stamped over 2 reached blocks, frames 0 and 3 diverge from aomdec (45135 / 44540 of 245760 samples), first difference at Y row 256 col 64 -- the top-left of the first 128x64 intrabc block. Green after: 48 chroma units, all 6 blocks decoded, and all FIVE frames byte-identical to aomdec --rawvideo. The recovered 4 blocks are the signal as much as the pixel count. Both witnesses pinned (422_intrabc_sb128_strip.obu sha f92000db, 422_intrabc_sb128_strip_notxsearch.obu sha 80dd0d4e) and gated by the_pinned_422_intrabc_sb128_strip_witnesses_refuse_by_name (byte pins plus the unconditional refusal-by-name contract; decode_stream still refuses 4:2:2 in committed code, so the decode-level assertions are probe-measured and reproducible from the lane report's recipe) and a comment-stripped source-scan arm the_intrabc_128rect_chroma_chunk_walk_stays_per_axis, whose non-vacuity is measured: re-introducing the square cut fails it. Two new counters (INTRABC_128RECT_CHROMA_CHUNK_HITS, INTRABC_128RECT_CHUNK_SHAPE) pin the walk for the probe arms. 4:2:0 is byte-identical (64 >> 1 = 32, 32 << 1 = 64, bw >> 1 = bw/2) and proven by the tree's own sb128 intrabc-rect gate -- same recipe as the witness, at yuv420p/yuv420p10le, 30 blocks through the changed walk, all three arms decode-order pixel-exact. DISCLOSED 4:4:4 behavior change: at ss (0,0) the walk now codes four TX_32X32 per chunk per plane and the block's chroma plane block is luma-sized; the parent's was provably wrong there (chroma_side is the 4:2:0 half-side, so the old 32x32 chunk covered a quarter of a 64x64 4:4:4 chunk and the origin was off by half a superblock). No committed 4:4:4 fixture engages this function at all (ibc128=0 on all six), so the change is landed on the twins' geometry argument and flagged as needing its own 4:4:4 witness. Battery green: an_sb128_rect_strip_with_intrabc_decodes_pixel_exact, an_sb128_screen_stream_with_intrabc_decodes_pixel_exact, a_444_sb128_root_rect_stream_with_restoration_decodes_pixel_exact, a_lossless_sb128_rect_intra_block_decodes_sample_exact, the two other intrabc gates, the bigblock pin gate; intrabc filter 19/0, 422+444 filters 12/0; cargo check --all-targets 0 warnings. The EC_AV1_ALLOW_422_PROBE bypass is NOT in the commit.
av1tailfix: document the span-mismatch counter as per-block (review nit)Ahmet Kaan Gümüş · 2f0f6f8Browse files
ec-av1: stamp the 128-root tail replay per axisAhmet Kaan Gümüş · 8fb4cf6
ec-av1: stamp the 128-root tail replay per axis `decode_block_128rect`'s end-of-block replay re-stamped every coded chroma transform unit with the block's LUMA WIDTH on both axes, while the walk that read those units stamped them with the per-axis height (`luma_span_h`). `record_mi_chroma`'s height drives the `left[]` rows, so wherever the two spans differ the replay reached 8 mi rows past the block's own extent on its last unit. At 4:2:2 (ss 1,0, luma spans 64x32) that is exactly the shape's tall axis; 4:2:0 (ss 1,1) and 4:4:4 (ss 0,0) have equal spans, so the line is a no-op on every stream this decoder admits and 4:2:2 -- the one format where they differ -- is refused by name at the sequence header. The comment at the site pins that, and `SB128RECT_CHROMA_REPLAY_HITS` / `SB128RECT_REPLAY_SPAN_MISMATCH_HITS` make the arm and the 4:2:2 signature observable: the 4:4:4 superblock-128 rect gate and the 4:2:0 lossless superblock-128 rect gate now assert the replay fired (32 and 512 chroma units on their pinned streams) with no span mismatch. Two same-class sites are marked, not fixed: `decode_intrabc_128rect`'s chroma walk and the tile 128-root writer both hardcode a square per-axis chroma unit (one TX_32X32 per 64x64 mu chunk at span 64 on both axes). That is a 4:2:2 port, not a one-line span fix, and it is unreachable while the format is refused.
2026-09-27
Merge 86b328fd (422stripanchor) — suite green: 422stripanchor 624/0Ahmet Kaan Gümüş · ba6dea5
Merge 86b328fd (422stripanchor) — suite green: 422stripanchor 624/0 # Conflicts: # crates/ec-av1/src/decode.rs