forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on c9d2302aed8506fc7ced361194ebfdf837a9d010

2026-09-02

feat(av1): palette on a square 8x8 intra leaf (decode_leaf8 passed None palette ctx/cache and refused every real 8x8 palette block)Ahmet Kaan Gümüş · c9d2302
feat(av1): palette on a square 8x8 intra leaf (decode_leaf8 passed None palette ctx/cache and refused every real 8x8 palette block)

decode_leaf8 handed read_intra_mode `None`/`&[]` for the palette mode ctx and
colour cache, so `palette_y_mode` was read off CDF row 0 and any block that
actually used a palette refused by name -- and at 8 bit aomenc palettes SQUARE
blocks, so with --min-partition-size=8 every screen-content stream stopped
there. Wired the leaf's own per-mi ctx/cache (av1_get_palette_mode_ctx /
av1_get_palette_cache, decodemv.c:567), kept the decoded PaletteY/PaletteUv,
reconstructed through the existing PALETTE_PRED slot (whole 8x8, or a per-4x4-TU
window slice under a split tx_depth) and stamped the leaf's real palette state
into the per-mi neighbour bands.

Gate a_real_aomenc_palette_stream_with_8x8_leaves_decodes_pixel_exact: 48 real
aomenc arms (testsrc2/smptebars x 8+10 bit x cq 30/40/55 x tx-size-search 0/1 x
tile-columns 0/1, --tune-content=screen --enable-palette=1
--min-partition-size=8), 44 8x8-leaf palette blocks across 24 arms, 47 arms /
47 frames compared pixel-exact vs ffmpeg, 0 out-of-scope mismatches.

The superblock-level (64-level) HORZ/VERT strip palette refusal was measured,
not assumed: removing it decodes testsrc2-10bit-cq55-txs0-tc1 with a whole-frame
mismatch, so it stays and the gate asserts an arm still reaches it.
merge lane-kf900Ahmet Kaan Gümüş · 377b730Browse files
Merge branch 'lane-intersub8' (a5b9770): sub-8x8 inter partitions (SPLIT, HORZ, VERT) lifted and gatedAhmet Kaan Gümüş · 89682ac
Merge branch 'lane-intersub8' (a5b9770): sub-8x8 inter partitions (SPLIT, HORZ, VERT) lifted and gated

The "an inter partition below 8x8" refusal is gone: the sub-8x8 inter arms decode,
with the CDEF skip band for the 8x4/4x8 pair, and are gated at both bit depths.
Four narrower refusals take its place (intra 4x4 / 8x4 / 4x8 inside the sub-8x8
split, sub-8x8 under a scaled reference, COMPOUND_WEDGE on a non-square block).

Merge resolution: this lane's compound-8x8-leaf interp read is DROPPED -- lane-interp3
landed the same read with the is_nontrans_global_motion suppression term, and keeping
both would have read the switchable_interp symbol twice. The lane's palette-on-1:4
refusal is not carried (lane-kf900 lifted that shape). Trace rungs from both sides kept.

Gates: sub8x8_inter (1), dual_filter_obmc_8x8 (1), obmc (5), refusal_inventory (3),
gate_coverage (9), base_ctx_rect_offsets (1) -- all pass.
Merge branch 'lane-interp3' (10b801a): compound 8x8 leaf interp read, ref ctx bands, per-ref global warpAhmet Kaan Gümüş · c4478d5
Merge branch 'lane-interp3' (10b801a): compound 8x8 leaf interp read, ref ctx bands, per-ref global warp

- compound 8x8 leaf reads its interp filter; ref-frame ctx bands; global-mv flags and
  per-ref global warp; EC_OBMC trace emitter; dual_filter_obmc_8x8 gate.
- Merge resolution: lane-golomb already converted the same neighbour_filter panic to a
  refusal, so ONE string survives ("an OBMC neighbour whose switchable interp filter was
  never recorded") in decode.rs, refusal_inventory.rs and this lane's unit test. The
  lane's palette-on-1:4-strip refusal is not carried (lane-kf900 lifted that shape).

Gates: dual_filter_obmc_8x8 (1), obmc (5), refusal_inventory (3), gate_coverage (9),
base_ctx_rect_offsets (1) -- all pass.
Merge branch 'lane-rectchroma2' (48216c2): MC kernels take the block's true dims, and the edge gate goes full-planeAhmet Kaan Gümüş · 458e5c1
Merge branch 'lane-rectchroma2' (48216c2): MC kernels take the block's true dims, and the edge gate goes full-plane

mc.rs predict_with_filters_kern / predict_scaled_kern /
predict_compound_intermediate_kern now decide the per-axis narrow (4-tap) kernel from
the TRUE block dims, and decode_inter_block's twelve prediction calls pass
write_w/write_h plus the chroma dims -- the root cause of every "luma exact, chroma
+-1" rect inter residue. New full-plane gate narrow_kernel, RECT_NARROW_KERN_HITS.

Same commit: lane-interedge's a_real_aomenc_inter_frame_edge_half_strip gate flips
from luma-only to full-plane (30 attempts + the 192x128 control, chroma_bad now
asserted 0) -- the residue it tolerated was ours, and it is gone.

Gates: narrow_kernel (1), inter_frame_edge_half_strip (1, full-plane),
superblock_level_rect_partition (1), obmc (3), refusal_inventory (3),
gate_coverage (9), base_ctx_rect_offsets (1) -- all pass.
Merge branch 'lane-interedge' (9920c36): inter 32-level HORZ/VERT second-strip frame-edge guardAhmet Kaan Gümüş · cfa93c0
Merge branch 'lane-interedge' (9920c36): inter 32-level HORZ/VERT second-strip frame-edge guard

The second half of an inter HORZ/VERT at the true frame edge carries no symbols and
no grid writes (libaom decode_partition's has_rows/has_cols guard); the oddh inter
arm is un-ignored. Merge resolution keeps BOTH witness counters at the four sites --
lane-golomb's bump_edge32 before the guard and this lane's bump_inter_edge_strip in
the else.

Gates: inter_frame_edge_half_strip (1), odd (4), 32x32_frame_edge (1),
refusal_inventory (3), gate_coverage (9), base_ctx_rect_offsets (1) -- all pass.
test(av1): full-plane gate for rect inter chroma narrow-kernel predictionAhmet Kaan Gümüş · cd6e06e
test(av1): full-plane gate for rect inter chroma narrow-kernel prediction

a_real_aomenc_rect_inter_block_predicts_chroma_with_the_narrow_kernel_pixel_exact:
real aomenc mandelbrot 192x128 and its transposed twin 128x192, 8- and
10-bit, cq 20/32/45, 6 frames, lag-in-frames=0 so every decode-order frame is
compared on Y, U and V against ffmpeg; CDEF and loop restoration on. Hard
asserts 12/12 arms compared (a refusal fails, never SKIPs) and the
rect-narrow-kernel counter nonzero at both depths and both orientations.
test(av1): enable-intrabc leaves the 10-bit never-exercised list -- the new palette+tx-size-search gate arms spell --enable-intrabc=1 and pixel-compare at 10 bitAhmet Kaan Gümüş · 94e1d30
test(av1): enable-intrabc leaves the 10-bit never-exercised list -- the new palette+tx-size-search gate arms spell --enable-intrabc=1 and pixel-compare at 10 bit

`never_exercised_10bit_matches_the_gate_recipes` caught this itself: the r6 gate arms
`smptebars-screen-txs-cq40/cq55` run at 8 AND 10 bit with `--enable-intrabc=1`, so the
10-bit coverage hole for the tool is closed by the same arms that gate the palette fix.
Merge branch 'lane-cdef' (2d76270): CDEF skip band for 8x8 inter leaves, cdef_find_dir paddingAhmet Kaan Gümüş · 2bca382
Merge branch 'lane-cdef' (2d76270): CDEF skip band for 8x8 inter leaves, cdef_find_dir padding

- 8x8 inter leaves write their CDEF skip band; cdef_find_dir padding fixed;
  straddling-band gate added.
- Merge resolution: the per-frame stage-dump index exists once, as this lane's
  dump_stage_idx helper (lane-sbrect10 had the same fix as a local atomic).

Gates: cdef (3), straddling_band (1), refusal_inventory (3), gate_coverage (9),
base_ctx_rect_offsets (1) -- all pass.
Merge branch 'lane-golomb' (173b793): frame-edge partition bits, luma-only deblock grid, cropped reference guardsAhmet Kaan Gümüş · 58dfef5
Merge branch 'lane-golomb' (173b793): frame-edge partition bits, luma-only deblock grid, cropped reference guards

- frame-edge partition bits at the 32 level; edge32 gate.
- chroma deblock grid keeps the block's own av1_get_max_uv_txsize -- the var-tx
  leaf write is LUMA only (libaom get_transform_size splits for AOM_PLANE_Y alone).
  Merge resolution: lane-r14's RECT (row,col,tw,th) leaves are kept and routed
  through this lane's fill_lf_grid_leaf_luma.
- inter chroma tx_type set narrowing, cropped reference-size guard, loop-restoration
  crop, mc.rs:203 panic converted to a refusal (OBMC neighbour with no recorded
  switchable interp filter). The lane's second refusal string (palette on a 1:4 rect
  strip) is NOT carried: lane-kf900 lifted that shape, and it no longer exists in
  decode.rs.

Gates: 32x32_frame_edge (1), refusal_inventory (3), gate_coverage (9),
base_ctx_rect_offsets (1), vartx (1), 1to4 (6) -- all pass.
fix(av1): rect inter blocks picked the 4-tap chroma kernel from the square prediction buffer, not the blockAhmet Kaan Gümüş · 759e688
fix(av1): rect inter blocks picked the 4-tap chroma kernel from the square prediction buffer, not the block

decode_inter_block predicts a rectangular block over its enclosing square
buffer (side x side, chroma_side x chroma_side; write_w/write_h govern only
the pixel write). The narrow-block decision lived in mc::predict_with_filters
and read that buffer's dimensions, while libaom
av1_get_interp_filter_params_with_block_size takes it per axis from the
prediction block's own w/h -- so the chroma of an 8x16 / 16x8 inter block
(4x8 / 8x4) used the 8-tap kernel where libaom uses the 4-tap one. Luma is
never <= 4 wide on this path, which is why such streams decoded luma-exact
and differed by +-1 on scattered chroma samples (lane-interedge r1's 192x128
control, no frame-edge node, cdef/LR off).

mc gains predict_with_filters_kern / predict_scaled_kern /
predict_compound_intermediate_kern (old entry points delegate with kern =
block dims) plus a RECT_NARROW_KERN_HITS counter; decode_inter_block's 12
prediction calls pass write_w/write_h and write_chroma_w/write_chroma_h.

New gate a_real_aomenc_rect_inter_block_predicts_chroma_with_the_narrow_kernel_pixel_exact:
real aomenc mandelbrot 192x128 and 128x192, 8- and 10-bit, cq 20/32/45,
6 frames, lag-in-frames=0, every decode-order frame compared on Y, U and V;
12/12 arms exact, narrow-kernel counter nonzero at both depths and in both
orientations. Same recipe mismatched chroma in all arms before the fix.
fix(av1): the neighbour palette side bands were indexed on the 16px SUB cell, so a 16x8 strip pair shared one slot and the second strip read the first's palette size -- every screen key frame with palette + tx-size-search decoded whole-superblocks wrongAhmet Kaan Gümüş · c642e28
fix(av1): the neighbour palette side bands were indexed on the 16px SUB cell, so a 16x8 strip pair shared one slot and the second strip read the first's palette size -- every screen key frame with palette + tx-size-search decoded whole-superblocks wrong

libaom keeps `palette_size`/`palette_colors` per 4x4 mi cell in `MB_MODE_INFO`, and
`av1_get_palette_cache`/`av1_get_palette_mode_ctx` (pred_common.c:73, pred_common.h:197)
read `xd->above_mbmi`/`xd->left_mbmi` -- the mi cell immediately above/left of the
block. Our `Neighbours::{above,left}_palette_{size,colors}` (and the UV pair) were one
entry per 16px SUB cell, a corner-cut whose own comment said it was "safe today because
every sub-16 leaf path refuses palette outright". Since lane-kf900 r4 lifted the rect
palette refusals that stopped being true: a 32x8 / 16x8 strip pair sits inside ONE cell,
so strip 1's left (above) neighbour lookup returned strip 0's -- or an already
overwritten sibling's -- palette, the colour cache came out one entry short, and
`read_palette_colors_y`'s cache-hit branch narrowed a different interval.

Measured on `$HOME/.cache/kf900-r6/DIFF_45_1_1_test.obu` (r6's ladder): exact through
mi(0,8) `angle_uv` rng=42372, then the first colour-index-map symbol at 34824 (oracle)
vs 51354 (ours) -- libaom's `xd->left_mbmi` for mi(0,8) is mi(0,7), palette size 3, ours
had been overwritten by mi(2,4)'s size 2.

Fix: the eight palette side arrays are mi-granular (`cols * (SUB / MI)`), every
record/lookup takes the block's REAL mi position, and `record_strip_palette`'s
split-axis `last` hack is gone -- it only existed because all four 1:4 strips aliased
onto one SUB slot. `palette_ctx_and_cache_mi`/`palette_uv_cache_mi` drop their separate
`mi_r` argument (the whole coordinate is mi now); the SUB-taking wrappers convert.

Gate: `a_real_aomenc_rect_strip_palette_decodes_pixel_exact` grows arms 3-4,
`smptebars-screen-txs-cq40/cq55` -- `--tune-content=screen --enable-palette=1
--enable-tx-size-search=1 --enable-1to4-partitions=1 --enable-intrabc=1`, 8 and 10 bit,
whole-frame compare. Both streams were DIFF before this fix and are pixel-exact after
(same bytes: `$HOME/.cache/kf900-r6/DIFF_{40,55}_1_1_smpt.obu`). Gate reports 5 firing
attempts, 4 named refusals, 6 frames compared, 0 out-of-scope mismatches.
Merge branch 'lane-kf1200' (d44afba): second 10-bit key-frame fixture for the skipped-leaf transform gridAhmet Kaan Gümüş · edebe88
Merge branch 'lane-kf1200' (d44afba): second 10-bit key-frame fixture for the skipped-leaf transform grid

Same decode_leaf8 root cause as lane-kf900 (kept once, kf900's comment); this lane
contributes an independent 10-bit key-frame fixture (reelb_ss600_key_frame.obu, a partial
8-px bottom superblock row) that pins it pixel-exact including chroma, plus the
frame-edge partition-bit gate and the trace_edge rung.

Gates: ss600 (1), frame_edge_partition_bit (1), skipped_8x8_intra_leaves (1),
refusal_inventory (3), gate_coverage (9), base_ctx_rect_offsets (1) -- all pass.
Merge branch 'lane-kf900' (cbfe32d): skipped-leaf tx grid, chroma-reference neighbour snap, palette and intrabc on rect stripsAhmet Kaan Gümüş · b4cddf3
Merge branch 'lane-kf900' (cbfe32d): skipped-leaf tx grid, chroma-reference neighbour snap, palette and intrabc on rect strips

- skipped 8x8 intra leaves publish their BLOCK side (not the resolved TX_4X4) to
  the next block's tx-size context; new 10-bit key-frame fixture reelb_kf900.obu gates it
  luma-exact with a >=15 hit assert.
- smooth_uv_neighbour now snaps to the chroma REFERENCE mi (mi & !1) like libaom's
  set_mi_row_col, which subsumes main's per-call pair_mi fix at the 16x4/4x16 arm.
  Merge resolution: the RECT4_16_UV_PAIR_FILT_HITS witness would have gone
  tautologically 0 (both sides snap to the same mi), so it now compares the snapped
  answer against a new smooth_uv_neighbour_unsnapped -- it measures what the snap
  buys, and the 16-level 1:4 gate keeps its hard assert.
- 10-bit palette literals, palette + use_intrabc on 1:4 / sub-16 rect strips.

Gates: skipped_8x8_intra_leaves (1), palette (7), intrabc (1), 1to4 (6), smooth (3),
refusal_inventory (3), gate_coverage (9), base_ctx_rect_offsets (1) -- all pass.
docs(intersub8): r5 gate re-run at the counter fix, film probe at the census offsetAhmet Kaan Gümüş · 9d47eed
docs(intersub8): r5 gate re-run at the counter fix, film probe at the census offset

Gate + cdef sibling + refusal_inventory + gate_coverage re-run on b64da0d:
14 passed, 0 failed; sub-8x8 gate fired=10 horz=5 vert=3 rect_masked=2 with
out_of_scope_mismatch==0. Film probe corrected to the census offset (ss=0, -t 2):
the 3840x1608 10-bit stream now decodes 30 frames with horz8x4=8 vert4x8=9 and
stops one refusal later, on the non-DC chroma 8x8 inter leaf.
wip(rectchroma2): merge lane-golomb 173b793 + partial work from the interrupted roundAhmet Kaan Gümüş · 51ce8e8
wip(rectchroma2): merge lane-golomb 173b793 + partial work from the interrupted round

Conflict resolutions: dump_stage per-picture index keeps the thread-local
counter; var-tx leaf lf grid keeps main's rect (tw,th) leaves with golomb's
luma-only fill (libaom get_transform_size splits only for AOM_PLANE_Y).
Merge branch 'lane-sqdrift' (7d498c0): square-only inter sequence with a 64x64 intra superblock gateAhmet Kaan Gümüş · 566a617
Merge branch 'lane-sqdrift' (7d498c0): square-only inter sequence with a 64x64 intra superblock gate

Root cause (the no-CfL uv_mode alphabet on 64-axis blocks) landed on main via
lane-sbrect10 (9f1f108); this lane confirmed it by ablation and contributes the
square-only gate plus two trace rungs (EC_IIS intra-in-inter symbol trace,
pre_rng on the partition_w64 TRACE line).

Gates: a_real_aomenc_square_only_inter_sequence_with_a_64x64_intra_superblock_decodes_pixel_exact,
a_real_aomenc_inter_frame_with_a_64x64_intra_block_reads_the_no_cfl_uv_alphabet -- both pass.
fix(av1): an intrabc block's chroma tx_type is inherited from its luma transform, not derived from the chroma intra mode -- every screen-content key frame with a real intra-block-copy block desynced at the first chroma eob symbolAhmet Kaan Gümüş · d68cb84
fix(av1): an intrabc block's chroma tx_type is inherited from its luma transform, not derived from the chroma intra mode -- every screen-content key frame with a real intra-block-copy block desynced at the first chroma eob symbol

libaom av1_get_tx_type (blockd.h) branches PLANE_TYPE_UV on is_inter_block, and
is_inter_block counts is_intrabc_block (blockd.h:373), so an intrabc block's
chroma tx_type is the colocated luma transform's coded type. We applied the
intra rule (intra_mode_to_tx_type of the chroma mode) and read DCT_DCT where
libaom had V_DCT: TX_CLASS_2D instead of TX_CLASS_VERT changes eob_multi_ctx,
the scan order and every nz context. Ladder (EC_TRACE_COEFF both decoders,
256x192 8-bit screen key frame): luma exact through after_bases rng=58543,
first divergence at the chroma eob, ref 65032 (eob 8) vs ours 37532 (eob 5).

The chartered premise -- a desync inside read_intrabc_dv -- was stale: the
oracle's EC_TRACE_IBC rung and our own trace both give dv=(-512,-608) at that
block, and a wrong DV predictor cannot move the bitstream position anyway.

Gate a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips grows from
3 to 7 arms, spells --enable-intrabc=1, compares every frame of every decoding
arm and asserts a per-arm intrabc-block counter: 4 intrabc blocks across 3 arms,
all pixel-exact vs ffmpeg, 0 out-of-scope mismatches. gate_coverage drops
enable-intrabc from its 8-bit never-exercised list (its stated premise, "every
real stream's intrabc block sits under TX_MODE_SELECT", is disproven).
fix(av1): inter 32x32-level HORZ/VERT decoded the frame-edge second strip libaom never codedAhmet Kaan Gümüş · ca58ed5
fix(av1): inter 32x32-level HORZ/VERT decoded the frame-edge second strip libaom never coded

Merges lane-cdef 8c6065e (cdef_find_dir at a crop edge) and fixes the inter tile's
32-level PARTITION_HORZ/PARTITION_VERT, which decoded the second 32x16/16x32 strip
unconditionally. libaom decode_partition guards it with has_rows/has_cols, so at a
frame edge (height or width mod 16 == 8 -- both of the user's films) we read symbols
the encoder never wrote: without the guard a 72x192 cq32 stream refuses outright and
a 104x192 one decodes luma rows 127..191 of frame 5 wrong.

Adds an inter_edge_strip counter per level (64/32/16) x axis and un-ignores
lane-oddh r2's inter arm as a 5-size real-aomenc gate: 30 attempts luma-exact,
edge hits [109,34,0,3,2,432], 0 refusals, control 192x128 zero hits.
fix(av1): count the 8x8 inter leaf's fall-through CDEF skip-band write tooAhmet Kaan Gümüş · 408ab87
fix(av1): count the 8x8 inter leaf's fall-through CDEF skip-band write too

lane-cdef r1 incremented INTER8_SKIP_BAND_HITS only in decode_inter_block8's
COMPOUND early-return arm, so its gate's assert really read "a COMPOUND 8x8
leaf wrote the band". On the tree merged with main the 10-bit cq=12 arm's
leaves come through the single-ref fall-through instead, which writes the band
but did not count -- the gate failed on an instrumentation gap, not on pixels
(cdef_skipped_units passed, and all five arms are pixel-exact once past it).
Merge branch 'lane-sbrect10' (9f1f108): uv_mode reads the no-CfL alphabet when the block size excludes CfLAhmet Kaan Gümüş · b6adf58
Merge branch 'lane-sbrect10' (9f1f108): uv_mode reads the no-CfL alphabet when the block size excludes CfL

A 64x64 intra block inside an inter frame read uv_mode off the 14-symbol
CfL-allowed alphabet; libaom's is_cfl_allowed caps CfL at 32x32, so the value
matched (DC_PRED) while the interval narrowing did not and the tile desynced
from that block on (class wrong-alphabet-same-value). Gated at every uv_mode
read site (read_intra_mode, read_intra_mode_rect, intra-in-inter) with the
NOCFL_UV_MODE_HITS counter proving the shape fired, plus the compound MV
stack's global-motion tail slots. The superblock rect-strip gate's 10-bit arm
runs again.

Gate: a_real_aomenc_inter_frame_with_a_64x64_intra_block_reads_the_no_cfl_uv_alphabet
Suite: 384 passed / 0 failed / 33 ignored.
Merge branch 'main' (aa83400) into lane-intersub8Ahmet Kaan Gümüş · b198e87
Merge branch 'main' (aa83400) into lane-intersub8

Auto-merge clean in decode.rs / stream.rs / refusal_inventory.rs /
decode_probe.rs; cdf.rs is byte-identical to main's. One bsize_index and one
compound_type/wedge_idx read site survive the merge, so main's inter16ab
copy of the rect CDF-row fix and this lane's r4 copy did not duplicate.
cargo check -p ec-av1 --all-targets is clean.
feat(av1): lift the sub-8x8 inter HORZ refusal (two BLOCK_8X4 leaves)Ahmet Kaan Gümüş · 4496b6d
feat(av1): lift the sub-8x8 inter HORZ refusal (two BLOCK_8X4 leaves)

The |d|<=2 luma band that kept HORZ refused through r4 was the merged
lane-cdef defect: the 8x8 inter leaf never wrote the CDEF skip band, so
8x8 groups next to an 8x4 pair were filtered where libaom skips them.
A 56-arm sweep (7 cq x 4 sp x 2 depths, transposed source, rect on) now
has zero mismatching arms; the three that were red are pixel-exact.

The gate grows attempts 16..23 on the transposed source (aomenc picks HORZ
below 8x8 there, VERT on the untransposed one), counts the two axes apart
and asserts each fired on >=2 pixel-compared attempts, and asserts a
non-square masked-compound block (new RECT_MASKED_COMPOUND_HITS) so r4's
compound_type/wedge_idx CDF-row fix stops being unexercised.
Merge branch 'lane-cdef' (8c6065e): the 8x8 inter leaf writes the CDEF skip bandAhmet Kaan Gümüş · a2059e0
Merge branch 'lane-cdef' (8c6065e): the 8x8 inter leaf writes the CDEF skip band

lane-cdef r1 found that decode_inter_block8's leaf path never wrote the
per-8x8 skip band apply_cdef's is_8x8_block_skip reads, so an all-skip 8x8
group kept the previous frame's flags and was filtered where libaom's dlist
excludes it; it also runs cdef_find_dir on the same padded block the taps
read, and gives dump_stage/dump_stage16 a per-frame index.

Taken here because this lane's sub-8x8 HORZ residue has exactly that shape.
fix(av1): rect masked compound read the SQUARE envelope's compound_type/wedge_idx CDF rowAhmet Kaan Gümüş · f750870
fix(av1): rect masked compound read the SQUARE envelope's compound_type/wedge_idx CDF row

A 16x8 (or any non-square) compound block with comp_group_idx==1 read
BLOCK_16X16's compound_type_cdf/wedge_idx_cdf row instead of BLOCK_16X8's,
because decode_inter_block indexed those tables by its square `side` argument
rather than the block's true (write_w, write_h) footprint -- class
table-indexed-by-raw-size. The same square envelope also decided
is_any_masked_compound_used, so a 4x16/16x4 strip would read a comp_group_idx
symbol libaom never writes.

Root cause proven by range ladder on a 192x128 6-frame 8-bit AV1 stream
(transposed-structure geq source, cq14, rect partitions on): entering the 16x8
block both decoders are at rng 46505, agree through the mv (58288), and after
the fix agree at the end of mode info (61760) and at the next block (60694);
that stream now decodes pixel-exact on every decode-order frame, where before
it drifted from decode-order frame 5.

Also: a COMPOUND_WEDGE mask on a non-square block is refused by name (the
wedge codebook here is built per square side only), and EC_TRACE_MODE gains
EC_CGI / EC_CIDX / EC_IF rungs (comp_group_idx, compound_idx, interp filter:
ctx + value + range) -- the rungs that localized this.

The sub-8x8 HORZ (two BLOCK_8X4) refusal STAYS: with the fix, 3 of 28 sweep
arms still differ by |d| <= 2 in luma only, in the bottom-left corner, with an
element-exact entropy ladder -- a post-entropy filter/reconstruction defect.
EC_AV1_SUB8_HORZ=1 decodes it for that bisect.
Merge branch 'lane-inter16ab' (af7de9f): 16x16-level inter AB partitionsAhmet Kaan Gümüş · 5e512e0
Merge branch 'lane-inter16ab' (af7de9f): 16x16-level inter AB partitions

The inter path codes HORZ_A/HORZ_B/VERT_A/VERT_B at the 16x16 level through
the inter_leaf8! macro (two 8x8 inter leaves plus one 16x8/8x16 strip), so the
old refusal narrows to the 1:4 pair (HORZ_4/VERT_4), which still needs the
sub-8 inter chroma-pair path. Merged alongside lane-r14's rectangular var-tx
leaves; the only conflict was the decode_probe counter block, kept both.

Gate: a_real_aomenc_inter_sequence_with_16x16_level_ab_partitions_decodes_pixel_exact
Suite: 383 passed / 0 failed / 33 ignored.
fix(av1): rect intra strips never read use_intrabc -- every screen-content key frame desynced at its first symbolAhmet Kaan Gümüş · 0bdf223
fix(av1): rect intra strips never read use_intrabc -- every screen-content key frame desynced at its first symbol

av1_allow_intrabc is a FRAME-level test (libaom decodemv.c:892,
read_intra_frame_mode_info): on an intra frame whose header sets
allow_intrabc, every intra block reads a use_intrabc symbol right after
skip/cdef/delta_q and before mbmi->mode. There is no block-shape term, but
read_intra_mode_rect -- the reader for every HORZ/VERT/1:4 rect strip --
never read it, so the arithmetic decoder desynced at the FIRST mode symbol
of the first rect block of any --tune-content=screen key frame.

Measured on an 8-bit 256x192 aomenc key frame (cq59, cpu-used 0, rect +
1:4 partitions, tune-content=screen): the decode reported OK and all 49152
luma samples differed from ffmpeg's. Cross-decoder range ladder: entry rng
32874 identical, our y-mode read gave 62696, the oracle 58628 -- exactly
the value obtained by consuming one default intrabc symbol (rng 30694,
normalised 61388) before the kf_y_mode read.

The flag is now consumed in read_intra_mode_rect, taking allow_intrabc from
the per-frame INTRABC_MI_GRID (Some only when the header set it), so no new
plumbing. Reconstruction of an intrabc block at a rect shape is not ported,
so a firing symbol refuses by name (inventory 45 -> 46).

Gate: a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips
(3 real-aomenc 8-bit arms) -- 147 rect-strip use_intrabc symbols read,
1 named refusal, 1 frame compared pixel-exact.
test(av1): the frame-edge straddling-band gate is green -- un-ignored, with a straddling-CDEF-unit counter and multi-tile armsAhmet Kaan Gümüş · 827ee1d
test(av1): the frame-edge straddling-band gate is green -- un-ignored, with a straddling-CDEF-unit counter and multi-tile arms

The 68x192 / 192x68 straddling band (a frame axis that is not a multiple of
8) now decodes pixel-exact on Y, U and V for all 5 frames, 8- and 10-bit:
the luma half was this lane's r1 CDEF direction-search fix (libaom searches
over cdef_prepare_fb's padded buffer, CDEF_VERY_LARGE past the MI-ROUNDED
extent -- cdef.c:164-167 hsize/vsize and the frame_boundary[RIGHT] fill at
cdef.c:249-256 -- not the last real sample at the crop), the chroma half was
lane-golomb r8's crop-sized loop-restoration planes and reference-size test,
merged in this round.

* decode.rs: new CDEF_STRADDLE_UNITS counter -- a FILTERED 8x8 CDEF unit whose
  extent crosses the cropped frame edge, i.e. exactly the units for which
  clamping and CDEF_VERY_LARGE padding differ. apply_cdef takes the header's
  cropped size for it.
* stream.rs: a_frame_edge_straddling_band_decodes_pixel_exact un-ignored,
  hard-asserts that counter grew (337 units over 14 compared attempts), and
  gains a --tile-columns=1 twin of each arm. All 32 multi-tile attempts refuse
  by name today (census in the doc comment) -- that half compares nothing yet.
Merge lane-golomb 173b793 into lane-cdefAhmet Kaan Gümüş · 6f7bda6
Merge lane-golomb 173b793 into lane-cdef

Conflicts, both in decode.rs:
* dump_stage's per-decode-order-frame index: both lanes added one. Kept this
  lane's shared dump_stage_idx() helper (dump_stage16 uses it too) and dropped
  lane-golomb's duplicate thread_local counter.
* the var-tx leaf loop: took main's general (row, col, tw, th) rect leaves and
  lane-golomb's fill_lf_grid_leaf_luma writer, so a rectangular leaf still
  overrides LUMA tx dims only -- routing it through fill_lf_grid_rect would
  recompute the chroma dims from the leaf span (libaom get_transform_size
  applies the split override for AOM_PLANE_Y only).

cdf.rs byte-identical across main, lane-golomb and this tree.
feat(av1): sub-8x8 inter PARTITION_VERT (two BLOCK_4X8 leaves); HORZ twin implemented but refusedAhmet Kaan Gümüş · 60b3ba2
feat(av1): sub-8x8 inter PARTITION_VERT (two BLOCK_4X8 leaves); HORZ twin implemented but refused

decode_inter_sub8_rect2 codes both rectangular sub-8x8 inter shapes: per-sub-block mode info
in decodemv.c order (single ref only -- is_comp_ref_allowed(BLOCK_8X4) false, so no skip_mode
and no comp_mode; no interintra/motion_mode/OBMC/warp below min dim 8), one txfm_partition
symbol at max TX_8X4/TX_4X8 through r14's general read_var_tx_size, chroma coded once on the
chroma-reference (second) sub-block as one TX_4X4 per plane with sub8x8 prediction from BOTH
sub-blocks' mvs (reconinter.c build_inter_predictors_sub8x8), and per-mi neighbour/mv-grid
writes over the true w_mi x h_mi span.

New luma coefficient sets TxbSet::LumaRect8x4Inter{,Set1}: LumaRect4x8's tables (8x8
coefficient class, 32-position eob_pt) with the inter TX_4X4 tx_type row (EXT_TX_SET_ALL16).
These also close the panic risk lane-inter16ab r3 noted, where a TX_16X4 -> TX_8X4 var-tx
split reached rect_inter_luma_set's unreachable!().

Gate: a_real_aomenc_inter_sequence_with_a_sub8x8_inter_split_decodes_pixel_exact now runs 16
attempts per bit depth -- 0..7 with --enable-rect-partitions=0 (SPLIT, unchanged) and 8..15
with =1 (VERT) -- and asserts a new rect_fired >= 2 alongside fired >= 2 and
out_of_scope_mismatch == 0, comparing every decode-order frame Y/U/V at 8 and 10 bit.

The HORZ (two BLOCK_8X4) arm is refused by name rather than shipped: a 28-arm sweep on a
transposed-structure source mismatches on 4 arms at cq 12/14/16/32, outside the known CDEF
band. Range ladder on one of them localizes the divergence to the mode info of the 16x8 inter
block immediately to the group's right -- matching through its EC_MODE entry, differing by its
first coefficient TU -- i.e. a per-row neighbour band the group leaves behind. Details in
lanes/intersub8-r3.handoff.md.
Merge main 727f29a (lane-r14, lane-kf1200, lane-reelckf) into lane-cdefAhmet Kaan Gümüş · 9c20172
Merge main 727f29a (lane-r14, lane-kf1200, lane-reelckf) into lane-cdef

No conflicts; cdf.rs untouched by either side.
fix(av1): CDEF filtered 8x8 units libaom skips, and searched direction on clamped edge pixelsAhmet Kaan Gümüş · e7460a0
fix(av1): CDEF filtered 8x8 units libaom skips, and searched direction on clamped edge pixels

decode_inter_block8 (the leaf path --min-partition-size=4 picks for a 16x16
group) wrote the mi map and the loop-filter grid at both exits but never the
per-8x8 CDEF skip band, so an all-skip 8x8 group was judged by the PREVIOUS
frame's flags and got filtered where libaom's is_8x8_block_skip
(cdef.c:29-38) excludes it from av1_cdef_compute_sb_list's dlist: 3 luma
samples |d|=1 on decode-order frames 3 and 4 of a 192x128 6-frame inter
stream at cq 8 and cq 10, all in the frame's last 8x8 column.

apply_cdef's direction search also clamped to the last real sample instead of
reading the CDEF_VERY_LARGE padding libaom's cdef_prepare_fb writes past the
mi-rounded extent (cdef.c:249-256), so every 8x8 straddling an odd-mi crop
edge picked a different var, hence a different adjust_strength: a 68x192
stream goes 145 luma samples wrong on frame 1 to 0 on all five frames
(its chroma residue is a separate, still-open defect).

Gate: a_real_aomenc_stream_with_cdef_and_sub16_inter_leaves_decodes_pixel_exact,
real aomenc with --min-partition-size=4 --enable-cdef=1, every decode-order
frame on all three planes, hard-asserting both new counters (an 8x8 unit
excluded by the all-skip rule, and the leaf that now writes the band).
Also: dump_stage/dump_stage16 indexed per frame (they overwrote .f0 every
frame, which is why filter-stage bisection kept reading the LAST frame).
feat(av1): palette reconstruction on 1:4 and sub-16 rect intra stripsAhmet Kaan Gümüş · 242e934
feat(av1): palette reconstruction on 1:4 and sub-16 rect intra strips

Lifts two refusals: "a 1:4 rect strip that actually uses a palette
(reconstruction is not ported at this shape)" and "a palette block on a
HORZ/VERT intra strip below 16x16 (reconstruction not ported)".

decode_block_rect4 (32x8/8x32) and decode_rect4_16 (16x4/4x16) passed
palette: None into read_intra_mode_rect, so they read palette_y_mode off
CDF row 0 and every colour off an EMPTY cache, then refused on use. They
now pass the block's real palette mode ctx and merged above/left colour
cache and reconstruct through set_palette_pred (whole block, per split
transform unit, and the pair's chroma), as decode_block_rect already did
one aspect ratio up; decode_leaf_rect (16x8/8x16) gets the same.

Three further defects found on the way:

* the chroma colour-index map is av1_get_plane_block_size (ss_size_lookup)
  -- BLOCK_16X4 -> BLOCK_8X4, BLOCK_4X16 -> BLOCK_4X8 -- not bw/2 x bh/2,
  so a 1:4 strip's chroma palette read half its symbols;
* av1_get_palette_cache's superblock-top-row exclusion (pred_common.c:76)
  is keyed on the block's own pixel row, not the 16-px cell, so a strip
  8 px into the cell dropped its real above neighbour
  (palette_ctx_and_cache_mi / palette_uv_cache_mi);
* the coarse cell arrays alias all four strips of a HORZ_4 onto one entry,
  so record_strip_palette writes the split axis only until the closing
  strip -- stamping both handed strip i+1 strip i's colours as its left
  (above) neighbour, same bit count, wrong pixels.

Gate: stream.rs::a_real_aomenc_rect_strip_palette_decodes_pixel_exact, 3
arms x {8,10} bit. Arm 0 reproduces the r3 pinned 10-bit testsrc2 256x192
cq59 cpu0 stream byte for byte (md5 e5f033d8fe34e4418d8cca3ac9d2b595),
which stopped on the first refusal at r3 and now decodes whole-frame
pixel-exact against ffmpeg on every plane of every decode-order frame.
Hard asserts a rect-strip palette counter delta and
out_of_scope_mismatch == 0; a named "unsupported" refusal is counted and
printed, never a pass.
Merge branch 'lane-r14' (b86eb38): general sub_tx_size_map and (row,col,tw,th) var-tx leaves, plus rectangular inter leaf codingAhmet Kaan Gümüş · fcf808d
Merge branch 'lane-r14' (b86eb38): general sub_tx_size_map and (row,col,tw,th) var-tx leaves, plus rectangular inter leaf coding

Var-tx split now recurses with a general sub_tx_size_map and codes leaves by
(row, col, tx_w, tx_h) instead of a square-only shape, so a split transform on
a 1:4 inter strip with a 64-px axis decodes instead of refusing. Refusal
dropped from refusal_inventory.rs; gate_coverage drops enable-tx64 from the
never-exercised set.

Gate: real_aomenc_1to4_streams_decode_pixel_exact_and_rect_vartx_leaves_fire_before_a_named_refusal
Suite: 382 passed / 0 failed / 33 ignored.
fix(av1): a skipped 8x8 intra leaf recorded its block side, not its resolved transform, in the txfm contextAhmet Kaan Gümüş · 94961f4
fix(av1): a skipped 8x8 intra leaf recorded its block side, not its resolved transform, in the txfm context

An intra block reads tx_depth whether or not it is skipped (libaom
read_intra_frame_mode_info calls read_tx_size above the skip branch), and
set_txfm_ctxs then records the RESOLVED transform -- only a skipped INTER
block records its block size. Our 8x8 key-frame leaf fell through to a
hardcoded fill_lf_grid(.., 8, ..) whenever it was skipped, so a leaf whose
tx_depth resolved to TX_4X4 published 8. The next block's
get_tx_size_context then read 8 >= 8 for its left/above term and picked
tx_size_cdf row 2 where libaom reads row 1: same decoded value, different
range, entropy desync from that symbol on.

Cross-decoder range ladder on a 3840x1608 10-bit AV1 key frame (aomdec
EC_TRACE/EC_TRACE_MODE_STEP vs our EC_AV1_TRACE): in sync to
EC_ISTEP mi(400,46) name=tx_depth, where aomdec reads ctx=1 rng=42998 and
we read ctx=2 rng=54191. That frame went 48771 -> 0 differing bytes vs
ffmpeg's 10-bit decode.

Gates:
- new fixture gate pinning that 1-frame 3840x1608 10-bit key frame (24
  skipped TX_4X4 leaves, hard-asserted). 80 aomenc recipes (4 shapes x 2
  sources x cq 32..63 x cpu-used 0/3 x 8/10-bit, tx-size-search and
  filter-intra on) never produced one synthetically.
- a_real_aomenc_stream_whose_frame_edge_partition_bit_is_horz gains three
  partial-bottom-row shapes (2/4/6 mi) and an --enable-tx-size-search=1 arm;
  the whole recipe ran with tx-size-search OFF, so no block in it could
  carry a nonzero tx_depth at all (class tool-disabled-in-every-gate).