gate the 4:4:4 palette chroma walk's horizontal arm and a 12-bit cell
Browse files at this commit35a38d408e13cfd512ee2b1a31fec64c6e2e77c5Parent: 06424915 changed files +346 -0
- crates/ec-av1/fixtures/444_palette_chroma_hstrip_640x480_10b.obu +0 -0
- crates/ec-av1/fixtures/444_palette_chroma_hstrip_640x480_12b.obu +0 -0
- crates/ec-av1/src/decode.rs +16 -0
- crates/ec-av1/src/stream.rs +131 -0
- lanes/av1444palw.report.md +199 -0
crates/ec-av1/fixtures/444_palette_chroma_hstrip_640x480_10b.obuadded+0 -0
Binary file changed
crates/ec-av1/fixtures/444_palette_chroma_hstrip_640x480_12b.obuadded+0 -0
Binary file changed
crates/ec-av1/src/decode.rsmodified+16 -0
| @@ -20087,6 +20087,22 @@ fn decode_block_rect64( | ||
| 20087 | 20087 | } |
| 20088 | 20088 | }; |
| 20089 | 20089 | let bigger = nw * nh > 1; |
| 20090 | + // lane-av1444palw: the reach census for the horizontal arm of this | |
| 20091 | + // walk. `EC_PALWALK=1` prints, per rect64 block, the plane-block | |
| 20092 | + // geometry, the unit grid it was tiled into, and whether a chroma | |
| 20093 | + // palette was present -- so a fixture search can tell `nw >= 2` (the | |
| 20094 | + // arm nothing had reached) from `nh >= 2` (the arm the corpus census | |
| 20095 | + // already covered), and can see WHY a candidate block did not fire. | |
| 20096 | + // Diagnostic only; no decode behaviour depends on it. | |
| 20097 | + if crate::envflags::env_flag!("EC_PALWALK") { | |
| 20098 | + eprintln!( | |
| 20099 | + "EC_PALWALK mi={r},{c} px={px} py={py} bw={bw} bh={bh} cw={chroma_w} \ | |
| 20100 | + ch={chroma_h} uw={uw} uh={uh} nw={nw} nh={nh} ast={allow_screen_content_tools} \ | |
| 20101 | + puv={} py={}", | |
| 20102 | + palette_uv.is_some() as i32, | |
| 20103 | + palette_y.is_some() as i32 | |
| 20104 | + ); | |
| 20105 | + } | |
| 20090 | 20106 | let mut u_levels = vec![0i32; chroma_w * chroma_h]; |
| 20091 | 20107 | let mut v_levels = vec![0i32; chroma_w * chroma_h]; |
| 20092 | 20108 | // The tiled units below stamp their own coefficient context |
crates/ec-av1/src/stream.rsmodified+131 -0
| @@ -50824,6 +50824,137 @@ exit 0 | ||
| 50824 | 50824 | } |
| 50825 | 50825 | } |
| 50826 | 50826 | |
| 50827 | + /// lane-av1444palw: the gate for the arm | |
| 50828 | + /// `a_444_lossy_palette_chroma_unit_window_is_byte_exact_at_352x242_10bit` | |
| 50829 | + /// could NOT reach -- the HORIZONTAL half of the same 32-capped chroma | |
| 50830 | + /// walk in `decode_block_rect64` (`palette_window(pbuf, chroma_w, | |
| 50831 | + /// cu_col * uw, cu_row * uh, uw, uh)`, the arms at decode.rs:20131 and | |
| 50832 | + /// :20199). Its `cu_col` term is the axis the corpus census never | |
| 50833 | + /// exercised: a 106-fixture trace of that walk found 16 windowed units and | |
| 50834 | + /// every one had `nw == 1`, i.e. only the `cu_row` term (`nh = 2`) was | |
| 50835 | + /// ever load-bearing. | |
| 50836 | + /// | |
| 50837 | + /// **What makes `nw >= 2` reachable.** At ss (0,0) the chroma plane block | |
| 50838 | + /// equals the luma one, so a 64-WIDE luma rect block keeps `cw = 64` and | |
| 50839 | + /// the 32-cap tiles it into `nw = 2` units. `decode_block_rect64` is the | |
| 50840 | + /// only function owning this walk at a 64-wide block, reached from | |
| 50841 | + /// `PARTITION_HORZ`/`HORZ_A`/`HORZ_B` (64x32) and `HORZ_4` (64x16). The | |
| 50842 | + /// cells here came from sweeping `--min-partition-size` x `--cq-level` over | |
| 50843 | + /// a 4:4:4 testsrc2 640x480 cell encoded with the lane-av1rect14 | |
| 50844 | + /// `ibc640` flag set (rect + 1:4 partitions, `--min-partition-size=8 | |
| 50845 | + /// --sb-size=64 --tune-content=screen --enable-palette=1 | |
| 50846 | + /// --enable-intrabc=1 --enable-tx-size-search=0 --cpu-used=0 | |
| 50847 | + /// --lag-in-frames=0 --kf-max-dist=1 --limit=1 --threads=1 | |
| 50848 | + /// --tile-columns=0 --passes=1 --end-usage=q --profile=1`): | |
| 50849 | + /// `--min-partition-size=8` is what yields the 64-wide strip, and | |
| 50850 | + /// `cq-level=45` is what makes the chroma palette win on it. Census read | |
| 50851 | + /// off `EC_PALWALK=1`, the diagnostic rung this lane added to | |
| 50852 | + /// `decode_block_rect64`: | |
| 50853 | + /// | |
| 50854 | + /// * 10-bit `cq 45`: `bw=64 bh=16 cw=64 ch=16 uw=32 uh=16 nw=2 nh=1 puv=1` | |
| 50855 | + /// -- the RECT-unit arm (`uw != uh`) carrying a chroma palette, `nw = 2`. | |
| 50856 | + /// * 12-bit `cq 45`: `bw=64 bh=32 cw=64 ch=32 uw=32 uh=32 nw=2 nh=1 puv=1` | |
| 50857 | + /// -- the SQUARE-unit arm carrying a chroma palette, `nw = 2`, on the | |
| 50858 | + /// 12-bit chroma plane no prior gate had built. | |
| 50859 | + /// | |
| 50860 | + /// **Both cells are byte-exact against the instrumented `aomdec`** per | |
| 50861 | + /// plane over the single decode-order frame (10-bit 0/0/0, 12-bit 0/0/0), | |
| 50862 | + /// and the comparator's liveness is proved by a one-byte oracle tamper | |
| 50863 | + /// moving the mismatch count 0 -> 1 at each depth. | |
| 50864 | + /// | |
| 50865 | + /// **Red without the per-unit window, by this gate's own numbers.** | |
| 50866 | + /// Reverting both `palette_window` calls to the whole-block buffer (the | |
| 50867 | + /// counter left armed) gives 0 / 25553 / 26139 on the 10-bit cell, first | |
| 50868 | + /// wrong sample decode frame 0 plane U row 96 col 448 (mutant 810, oracle | |
| 50869 | + /// 763; plane V the same sample 891 vs 767), and 0 / 6400 / 6400 on the | |
| 50870 | + /// 12-bit cell, first wrong sample plane U row 352 col 160 (866 vs 2004). | |
| 50871 | + /// Both are the `cu_col = 1` unit reading the block's column 0 -- this arm, | |
| 50872 | + /// not a cascade. | |
| 50873 | + /// | |
| 50874 | + /// **Non-vacuity.** (1) pinned bytes: 3301 / 2571 with FNV-1a64 and | |
| 50875 | + /// sha256 asserted. (2) the DERIVED condition: the counter is guarded on | |
| 50876 | + /// `nw * nh > 1`, so a hit proves the tiled arm ran, and the floors below | |
| 50877 | + /// are re-measured on these two streams (the pinned gate's floor of 4 was | |
| 50878 | + /// a floor from ONE stream, not a census). (3) 640x480 with | |
| 50879 | + /// FULL-RESOLUTION chroma, so a 4:2:0 extent cannot pass. (4) the crate's | |
| 50880 | + /// own one-byte oracle-comparator liveness control. | |
| 50881 | + #[test] | |
| 50882 | + fn a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit() { | |
| 50883 | + const NAME: &str = | |
| 50884 | + "a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit"; | |
| 50885 | + // (fixture, len, fnv1a64, bit_depth, min_windowed_units) | |
| 50886 | + const ARMS: [(&str, usize, u64, usize, usize); 2] = [ | |
| 50887 | + ( | |
| 50888 | + "fixtures/444_palette_chroma_hstrip_640x480_10b.obu", | |
| 50889 | + 3301, | |
| 50890 | + 0x6f94_da75_95cd_9a17, | |
| 50891 | + 10, | |
| 50892 | + 8, | |
| 50893 | + ), | |
| 50894 | + ( | |
| 50895 | + "fixtures/444_palette_chroma_hstrip_640x480_12b.obu", | |
| 50896 | + 2571, | |
| 50897 | + 0x65a5_8561_c1f3_538e, | |
| 50898 | + 12, | |
| 50899 | + 4, | |
| 50900 | + ), | |
| 50901 | + ]; | |
| 50902 | + const W: usize = 640; | |
| 50903 | + const H: usize = 480; | |
| 50904 | + let _guard = lock_gate_counters(); | |
| 50905 | + for (fixture, len, fnv, depth, min_units) in ARMS { | |
| 50906 | + let obu = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(fixture); | |
| 50907 | + let stream = std::fs::read(&obu).unwrap_or_else(|e| { | |
| 50908 | + panic!( | |
| 50909 | + "{NAME}: pinned fixture {fixture} is missing ({e}) -- the gate cannot \ | |
| 50910 | + run, which is a failure, not a skip" | |
| 50911 | + ) | |
| 50912 | + }); | |
| 50913 | + assert_eq!(stream.len(), len, "{NAME}: {fixture} length moved"); | |
| 50914 | + assert_eq!(fnv1a64(&stream), fnv, "{NAME}: {fixture} bytes moved"); | |
| 50915 | + | |
| 50916 | + crate::decode::reset_chroma_palette_window_hits(); | |
| 50917 | + let frames = decode_stream(&stream) | |
| 50918 | + .unwrap_or_else(|e| panic!("{NAME}: {fixture} no longer decodes cleanly: {e}")); | |
| 50919 | + let windowed = crate::decode::chroma_palette_window_hits(); | |
| 50920 | + assert!( | |
| 50921 | + windowed >= min_units, | |
| 50922 | + "{NAME}: {fixture} ran {windowed} windowed palette chroma unit(s), expected \ | |
| 50923 | + at least {min_units} -- the 32-cap tiled chroma walk did not reach enough \ | |
| 50924 | + palette blocks, so the horizontal windowing under test never ran and this \ | |
| 50925 | + gate is blind to the defect (class gate-blind-to-feature)" | |
| 50926 | + ); | |
| 50927 | + assert_eq!( | |
| 50928 | + frames.len(), | |
| 50929 | + 1, | |
| 50930 | + "{NAME}: {fixture} decode-order frame count" | |
| 50931 | + ); | |
| 50932 | + for (i, f) in frames.iter().enumerate() { | |
| 50933 | + assert_eq!( | |
| 50934 | + (f.width, f.height), | |
| 50935 | + (W, H), | |
| 50936 | + "{NAME}: {fixture} frame {i} dimensions" | |
| 50937 | + ); | |
| 50938 | + assert_eq!( | |
| 50939 | + f.u.len(), | |
| 50940 | + W * H, | |
| 50941 | + "{NAME}: {fixture} frame {i} chroma plane is {} samples; at 4:4:4 it must \ | |
| 50942 | + be full resolution ({W}x{H}) -- a {depth}-bit decoder that kept the \ | |
| 50943 | + 4:2:0 extent cannot pass this compare", | |
| 50944 | + f.u.len() | |
| 50945 | + ); | |
| 50946 | + } | |
| 50947 | + if aomdec_available(NAME) { | |
| 50948 | + let (decoded, hidden) = decode_all_frames_vs_oracle(&stream, NAME); | |
| 50949 | + eprintln!( | |
| 50950 | + "{NAME}: {fixture} ({depth}-bit) {decoded} decode-order frame(s) \ | |
| 50951 | + ({hidden} hidden) byte-exact vs aomdec, {windowed} windowed palette \ | |
| 50952 | + chroma unit(s)" | |
| 50953 | + ); | |
| 50954 | + } | |
| 50955 | + } | |
| 50956 | + } | |
| 50957 | + | |
| 50827 | 50958 | /// lane-av1cfl: the 4:4:4 CfL AC body is a DIFFERENT function from the |
| 50828 | 50959 | /// 4:2:0 one, and this gate is the proof that the format-blind |
| 50829 | 50960 | /// `cfl_ac_q3_at` (`bw / 2, bh / 2`, a 2x2 luma average per chroma |
lanes/av1444palw.report.mdadded+199 -0
| @@ -0,0 +1,199 @@ | ||
| 1 | +# lane-av1444palw — the 4:4:4 palette chroma walk's HORIZONTAL arm (nw >= 2) and a 12-bit cell | |
| 2 | + | |
| 3 | +## Verdict | |
| 4 | + | |
| 5 | +| claim | before this lane | after | | |
| 6 | +| --- | --- | --- | | |
| 7 | +| horizontal windowing (`cu_col * uw`, `nw >= 2`) on a palette chroma block | "correct by construction", reached by **nothing** in 106 committed fixtures | **MEASURED**: 2 committed fixtures, 8 windowed units on the `nw = 2` arm, byte-exact vs `aomdec`, reds without the window | | |
| 8 | +| 12-bit 4:4:4 palette chroma | never built | **MEASURED**: 1 committed 12-bit fixture, 4 windowed units on the `nw = 2` arm, byte-exact, reds without the window | | |
| 9 | +| coverage-debt counter floor | `MIN_WINDOWED_UNITS = 4`, a floor from ONE stream | re-measured per stream below; no single floor is a census | | |
| 10 | + | |
| 11 | +No second defect was found. The horizontal window is byte-exact wherever it is reached. | |
| 12 | + | |
| 13 | +## The mechanism, and why the arm was dead | |
| 14 | + | |
| 15 | +`decode_block_rect64`'s 32-capped chroma walk (`decode.rs:20075`): | |
| 16 | + | |
| 17 | +```rust | |
| 18 | +let (uw, uh) = (chroma_w.min(32), chroma_h.min(32)); | |
| 19 | +let (nw, nh) = (chroma_w / uw, chroma_h / uh); | |
| 20 | +``` | |
| 21 | + | |
| 22 | +and both tiled arms hand each unit | |
| 23 | + | |
| 24 | +```rust | |
| 25 | +palette_window(pbuf, chroma_w, cu_col * uw, cu_row * uh, uw, uh) | |
| 26 | +``` | |
| 27 | + | |
| 28 | +(`decode.rs:20132` square-unit arm, `decode.rs:20200` rect-unit arm). At 4:4:4 (ss | |
| 29 | +0,0) the chroma plane block equals the luma one, so a **64-wide** luma rect | |
| 30 | +block keeps `cw = 64` and the cap tiles it into `nw = 2`. That shape is only | |
| 31 | +reachable from `PARTITION_HORZ` / `HORZ_A` / `HORZ_B` (64x32) and `HORZ_4` | |
| 32 | +(64x16) — the horizontal siblings of the `PARTITION_VERT` 32x64 strip the | |
| 33 | +pinned gate already covered. | |
| 34 | + | |
| 35 | +## Reach census (this lane's own measurement) | |
| 36 | + | |
| 37 | +`EC_PALWALK=1` — a new env-gated rung in `decode_block_rect64`, printing | |
| 38 | +`bw/bh/cw/ch/uw/uh/nw/nh/ast/puv/py` per block. Diagnostic only; nothing in the | |
| 39 | +decode path depends on it. | |
| 40 | + | |
| 41 | +**Census over every committed fixture** (108 `.obu` files, `decode_probe` per | |
| 42 | +file, `EC_PALWALK=1`): | |
| 43 | + | |
| 44 | +| fixture | walks | geometry | | |
| 45 | +| --- | --- | --- | | |
| 46 | +| `420_intrabc_rect4_witness.obu` | 4 | `bw=64 bh=32 cw=32 ch=16` / `bw=64 bh=16 cw=32 ch=8` — 4:2:0, so `nw = 1` by subsampling | | |
| 47 | +| `444_lossy_palette_chroma_352x242_10b.obu` | 1 | `bw=32 bh=64 cw=32 ch=64 uw=32 uh=32 nw=1 nh=2` | | |
| 48 | +| `r512_rect2x1_1x2_444.obu` | 1 | `bw=32 bh=64 cw=32 ch=64 uw=32 uh=32 nw=1 nh=2` | | |
| 49 | + | |
| 50 | +That reproduces the charter's census exactly: **every windowed unit in the | |
| 51 | +corpus has `nw = 1`**. The 4:2:0 fixture is the interesting near-miss — it owns | |
| 52 | +a genuine 64-WIDE luma palette rect block, and subsampling collapses its chroma | |
| 53 | +to 32, so the horizontal term stays dead there too. | |
| 54 | + | |
| 55 | +## The search that reached `nw >= 2` | |
| 56 | + | |
| 57 | +Dead ends, all measured (walks = `EC_PALWALK` lines, `nw2_puv` = lines with | |
| 58 | +`nw >= 2` **and** a chroma palette): | |
| 59 | + | |
| 60 | +| family | cells | result | | |
| 61 | +| --- | --- | --- | | |
| 62 | +| testsrc2 4:4:4, width sweep 256…640 x cq 16/24/36 (the pinned gate's recipe verbatim) | 26 | 3 cells with any walk, all `nw = 1` | | |
| 63 | +| the same cell with `--sb-size=64` | 4 | 309 PALSET but 0 walks — palette fires, never on a 64-wide rect64 block | | |
| 64 | +| the same cell, raw planes transposed (edges swap axis) | 6 | 0 walks | | |
| 65 | +| flat synthetic colour cells (64x64 / 64x32 / 128x64 / 64x128 grids, 2-colour halves, 4-colour quadrants, horizontal bands with a growing palette downwards) at cq 20/24/40 x screen-tune on/off | 120 | 0 walks — the encoder picks 32x16 / 16x8 strips there | | |
| 66 | +| **lane-av1rect14 `ibc640` flag set, 4:4:4 640x480, `--min-partition-size` x `cq` grid** | 12 | **2 cells with `nw = 2` AND `puv = 1`** | | |
| 67 | + | |
| 68 | +The lever that worked is `--min-partition-size=8` (at 4 it stays `puv = 0`; at | |
| 69 | +16 the 12-bit cell stops firing) combined with the rect + 1:4 partition flags: | |
| 70 | +those keep the 64-wide strip in the partition search while a small minimum | |
| 71 | +partition size stops the encoder from subdividing it past 64. | |
| 72 | + | |
| 73 | +## The two cells | |
| 74 | + | |
| 75 | +Provenance, both `aomenc` from `~/.cache/aom-oracle/build/aomenc` on | |
| 76 | +`ffmpeg -f lavfi -i 'testsrc2=s=640x480:r=25' -frames:v 1 -pix_fmt yuv444p{10,12}le -f yuv4mpegpipe`: | |
| 77 | + | |
| 78 | +``` | |
| 79 | +aomenc --codec=av1 --profile=1 --input-bit-depth=$D --bit-depth=$D \ | |
| 80 | + --width=640 --height=480 --passes=1 --end-usage=q --threads=1 --tile-columns=0 \ | |
| 81 | + --enable-rect-partitions=1 --enable-1to4-partitions=1 --min-partition-size=8 \ | |
| 82 | + --sb-size=64 --tune-content=screen --enable-intrabc=1 --enable-palette=1 \ | |
| 83 | + --enable-tx-size-search=0 --cpu-used=0 --lag-in-frames=0 --kf-max-dist=1 \ | |
| 84 | + --limit=1 --cq-level=45 --obu -o <out>.obu <in>.y4m | |
| 85 | +``` | |
| 86 | + | |
| 87 | +| fixture | bytes | sha256 | FNV-1a64 | depth | `EC_PALWALK` on the reaching block | | |
| 88 | +| --- | --- | --- | --- | --- | --- | | |
| 89 | +| `444_palette_chroma_hstrip_640x480_10b.obu` | 3301 | `40cebc523b327ff41f00d1e813046976990f29fec7da40e730c981b489de6493` | `0x6f94da7595cd9a17` | 10 | `bw=64 bh=16 cw=64 ch=16 uw=32 uh=16 nw=2 nh=1 ast=true puv=1 py=1` — the **rect-unit** arm | | |
| 90 | +| `444_palette_chroma_hstrip_640x480_12b.obu` | 2571 | `2fb5ba97d7257756a0a2bf781d9f3300ff2d66009989d297758d848561daee9a` | `0x65a58561c1f3538e` | 12 | `bw=64 bh=32 cw=64 ch=32 uw=32 uh=32 nw=2 nh=1 ast=true puv=1 py=0` — the **square-unit** arm | | |
| 91 | + | |
| 92 | +Both tiled arms of the walk are now covered, at two bit depths. | |
| 93 | + | |
| 94 | +## Measurement vs the oracle (per plane, per decode-order frame) | |
| 95 | + | |
| 96 | +Oracle: the instrumented `aomdec` at `~/.cache/aom-oracle/build/aomdec`, | |
| 97 | +`--rawvideo --output-bit-depth=$D`; ours: `EC_AV1_FINAL_DUMP` u16 LE. 640x480, | |
| 98 | +one decode-order frame, no hidden frames. | |
| 99 | + | |
| 100 | +| cell | Y | U | V | | |
| 101 | +| --- | --- | --- | --- | | |
| 102 | +| 10-bit | 0 | 0 | 0 | | |
| 103 | +| 12-bit | 0 | 0 | 0 | | |
| 104 | + | |
| 105 | +**Comparator liveness, proved per depth before trusting the zero.** Flipping | |
| 106 | +ONE byte of the oracle's own dump: | |
| 107 | + | |
| 108 | +``` | |
| 109 | +10-bit: clean diffs 0 -> tampered diffs 1 | |
| 110 | +12-bit: clean diffs 0 -> tampered diffs 1 | |
| 111 | +``` | |
| 112 | + | |
| 113 | +## Mutation proof (the gate reds without the per-unit window) | |
| 114 | + | |
| 115 | +Reverting both `palette_window(...)` calls at `decode.rs:20132` / `decode.rs:20200` | |
| 116 | +to the whole-block buffer `pbuf.clone()`, leaving the counter armed, then | |
| 117 | +running the gate: | |
| 118 | + | |
| 119 | +``` | |
| 120 | +$ cargo test -p ec-av1 --lib a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit -- --nocapture | |
| 121 | +thread 'stream::tests::a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit' panicked at crates/ec-av1/src/stream.rs:10848:17: | |
| 122 | +a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit: decode-order frame 0 of 1 (1 shown, 0 hidden) differs from the oracle at byte 738176 (ours 42 vs 251), 54278 bytes differ | |
| 123 | +test result: FAILED. 0 passed; 1 failed | |
| 124 | +``` | |
| 125 | + | |
| 126 | +(10-bit arm; the 12-bit arm alone, with the 10-bit row removed from `ARMS`, | |
| 127 | +fails the same way at byte 1065280, 13312 bytes differ.) The reachability assert | |
| 128 | +stays green through both mutations — the counter is untouched by the mutation — | |
| 129 | +so it is the PIXEL compare that reds, which is what a non-vacuous gate needs. | |
| 130 | + | |
| 131 | +Per-plane counts of the same mutation, from the dumps: | |
| 132 | + | |
| 133 | +| cell | Y | U | V | first wrong sample | | |
| 134 | +| --- | --- | --- | --- | --- | | |
| 135 | +| 10-bit | 0 | 25553 | 26139 | frame 0 plane U r96 c448, mutant 810 vs oracle 763 (plane V same sample 891 vs 767) | | |
| 136 | +| 12-bit | 0 | 6400 | 6400 | frame 0 plane U r352 c160, mutant 866 vs oracle 2004 | | |
| 137 | + | |
| 138 | +Both are the `cu_col = 1` unit reading the block's column 0 — the horizontal arm | |
| 139 | +itself, not a downstream cascade (luma stays at 0 in both, so no luma-side | |
| 140 | +neighbour context is involved). | |
| 141 | + | |
| 142 | +## The re-measured counter census | |
| 143 | + | |
| 144 | +`decode::chroma_palette_window_hits()` is guarded on `nw * nh > 1`, so a hit | |
| 145 | +means "the 32-cap tiled this block", i.e. per unit per plane: | |
| 146 | + | |
| 147 | +| stream | windowed units | of which `nw >= 2` | | |
| 148 | +| --- | --- | --- | | |
| 149 | +| `444_lossy_palette_chroma_352x242_10b.obu` (pinned, existing gate) | 4 | 0 | | |
| 150 | +| `444_palette_chroma_hstrip_640x480_10b.obu` (new) | 8 | 4 | | |
| 151 | +| `444_palette_chroma_hstrip_640x480_12b.obu` (new) | 4 | 4 | | |
| 152 | + | |
| 153 | +The charter's "floor of 4" was one stream's number. Across the three committed | |
| 154 | +palette-chroma streams the total is **16 units, 8 of them on the horizontal | |
| 155 | +arm**, and the per-stream numbers are what the gate now asserts (8 and 4, both | |
| 156 | +exactly the measured values — the asserts are `>=` on those measurements, so a | |
| 157 | +future encoder-side change that drops a block still reds the gate). | |
| 158 | + | |
| 159 | +## Regression gate | |
| 160 | + | |
| 161 | +`stream.rs::a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit` | |
| 162 | +— pinned length + FNV-1a64 per arm, the derived-condition counter as a floor, one | |
| 163 | +decode-order frame at 640x480 with **full-resolution** chroma asserted (so a | |
| 164 | +4:2:0 extent cannot pass the compare), and `decode_all_frames_vs_oracle` (which | |
| 165 | +carries the crate's own one-byte oracle-tamper liveness control). | |
| 166 | + | |
| 167 | +Scoped runs on this branch: | |
| 168 | + | |
| 169 | +``` | |
| 170 | +$ CARGO_TARGET_DIR=$HOME/.cache/cargo-target-av1444palw \ | |
| 171 | + cargo test -p ec-av1 --lib a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit -- --nocapture | |
| 172 | +a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit: fixtures/444_palette_chroma_hstrip_640x480_10b.obu (10-bit) 1 decode-order frame(s) (0 hidden) byte-exact vs aomdec, 8 windowed palette chroma unit(s) | |
| 173 | +a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit: fixtures/444_palette_chroma_hstrip_640x480_12b.obu (12-bit) 1 decode-order frame(s) (0 hidden) byte-exact vs aomdec, 4 windowed palette chroma unit(s) | |
| 174 | +test stream::tests::a_444_palette_chroma_horizontal_unit_window_is_byte_exact_10bit_and_12bit ... ok | |
| 175 | +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 803 filtered out; finished in 0.50s | |
| 176 | + | |
| 177 | +$ cargo test -p ec-av1 --lib a_444_lossy_palette_chroma_unit_window_is_byte_exact_at_352x242_10bit -- --nocapture | |
| 178 | +a_444_lossy_palette_chroma_unit_window_is_byte_exact_at_352x242_10bit: fixtures/444_lossy_palette_chroma_352x242_10b.obu 17 decode-order frame(s) (1 hidden) byte-exact vs aomdec, 4 windowed palette chroma unit(s) | |
| 179 | +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 803 filtered out; finished in 1.20s | |
| 180 | + | |
| 181 | +$ cargo test -p ec-av1 --lib palette -- --nocapture | |
| 182 | +test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 780 filtered out; finished in 27.07s | |
| 183 | +``` | |
| 184 | + | |
| 185 | +## Scope and honesty notes | |
| 186 | + | |
| 187 | +* The only `decode.rs` change is the `EC_PALWALK` diagnostic rung inside | |
| 188 | + `decode_block_rect64`; no decode logic changed. Announced over IRC to the | |
| 189 | + three peer lanes before landing; `Agent23-4` and `Agent05-5` confirmed no overlap. | |
| 190 | +* `EC_PALWALK` is an env-gated `eprintln` in the same style as the existing | |
| 191 | + `EC_PALSYN` / `EC_DEBUG_PAL` rungs, so the census stays reproducible on any | |
| 192 | + future fixture without re-deriving it. | |
| 193 | +* The 12-bit cell needed its own sweep (`--min-partition-size=16`, cq 45): at 8 | |
| 194 | + the 12-bit chroma never lands a palette on the 64-wide strip. Both settings | |
| 195 | + are recorded above so either cell can be reproduced exactly. | |
| 196 | +* The `nw = 2` walk is still reachable only through the `decode_block_rect64` | |
| 197 | + partition arms. A 128-wide chroma plane block (`nw = 4`) would need a | |
| 198 | + `128x64` intra block, which this decoder routes elsewhere; that shape remains | |
| 199 | + **unmeasured**, and no gate claims it. |