Extract-eob-class1.py checks the 2D eob_pt rows too -- rectsplit r4's EOB_PT_512_CHROMA suspicion disproved, 88/112 consts bit-exact
Browse files at this commitcef1dedc4731a8f629e65ad2ba61b53b1fd44a55Parent: abd0a08- test
- extract-eob-class1.py checks the 2D eob_pt rows too -- rectsplit r4's EOB_PT_512_CHROMA suspicion disproved, 88/112 consts bit-exact
2 changed files +55 -3
lanes/eobc1-r1.report.mdadded+49 -0
| @@ -0,0 +1,49 @@ | ||
| 1 | +# lane-eobc1 r1 — eob_pt class-1 rows at every size | |
| 2 | + | |
| 3 | +Branch `lane-eobc1`, rebased onto main `df5d630` (was off `06d856d`). Two commits: | |
| 4 | +`b3b18b3` (the killed agent's work, rebased) + the checker widening below. | |
| 5 | + | |
| 6 | +## What changed | |
| 7 | + | |
| 8 | +- `crates/ec-av1/src/cdf.rs` — 5 remaining class-1 tables ported from libaom | |
| 9 | + (`EOB_PT_128_CHROMA_CLASS1*`, `512_LUMA/CHROMA_CLASS1*`, `1024_LUMA/CHROMA_CLASS1*`, | |
| 10 | + 4 q-contexts each); `cdf::tests::eob_pt_class1_rows_cover_every_size` pins the | |
| 11 | + trained-vs-uniform split (8 trained rows differ from their 2D sibling; the four | |
| 12 | + 32-point rows are libaom's untouched uniform initialiser, because | |
| 13 | + `av1_get_ext_tx_set_type` gives DCT_IDTX/DCTONLY at `tx_size_sqr_up >= TX_32X32`). | |
| 14 | +- `crates/ec-av1/src/cdf_state.rs` — 11 class-1 fields, 11 `pick(q_ctx, ...)` sites, | |
| 15 | + 11 `reset1` entries in the per-frame reset; **`eob_pt_class1: None` count is 0 across | |
| 16 | + all 21 `TxbSet` arms** (`grep -c "eob_pt_class1: None"` → 0, `Some` → 21). | |
| 17 | +- `crates/ec-av1/src/decode.rs` — `chroma_eob_class1_hits()` counter, bumped from | |
| 18 | + `read_plane` + `read_inter_plane` when an inherited 1D `tx_type` puts a chroma block | |
| 19 | + on the class-1 row. | |
| 20 | +- `crates/ec-av1/src/stream.rs` — gate `chroma_class1_eob_gate` in 8-bit and 10-bit arms. | |
| 21 | +- `scripts/extract-eob-class1.py` — **widened this round to check BOTH classes** (was | |
| 22 | + class-1 only), i.e. the enumerate-table-domain check now also covers the 2D rows. | |
| 23 | + | |
| 24 | +## Verification | |
| 25 | + | |
| 26 | +`python3 scripts/extract-eob-class1.py ~/.cache/aom-oracle/src/av1/common/token_cdfs.h --check crates/ec-av1/src/cdf.rs` | |
| 27 | +→ `checked 88/112 consts, 0 mismatched`. | |
| 28 | + | |
| 29 | +EVIDENCE: $HOME/.cache/eobc1-suite.log | EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib | 301 passed, 1 failed, 27 ignored (1252s); `a_real_aomenc_inter_sequence_with_a_class1_chroma_eob_decodes_pixel_exact` ok (line 949) and `a_real_aomenc_10bit_..._class1_chroma_eob_...` ok (line 936) | |
| 30 | +EVIDENCE: script stdout above | extract-eob-class1.py --check against ~/.cache/aom-oracle token_cdfs.h | 88/112 consts bit-exact, 0 mismatched; 24 absent consts are whole tables the crate has no TxbSet for (32-coeff, 128-luma) | |
| 31 | +EVIDENCE: $HOME/.cache/eobc1-mainbase.log | same single test at detached main df5d630, own target dir | `nz_map_ctx_offset_tables_match_the_rect_rule` FAILED at main too — the suite's one red is inherited, not this lane's | |
| 32 | + | |
| 33 | +Siblings re-run green in the same suite: `tx_select` (3 gates), `an_8x8_leaf_split`, | |
| 34 | +`tiny_frame_size_sweep`, all `inter_sequence` gates, whole-superblock 8/10-bit, | |
| 35 | +`refusal_inventory` (3), `gate_coverage` (9). | |
| 36 | + | |
| 37 | +## Charter notes / residue | |
| 38 | + | |
| 39 | +- rectsplit r4's suspicion that main's `EOB_PT_512_CHROMA` was transcribed from the | |
| 40 | + class-1 row is **disproved**: with the checker widened to class 0, all 44 2D consts | |
| 41 | + match libaom bit-exact. accepted. | |
| 42 | +- No refusal string lifted this round (the fix is a table wiring defect, not a | |
| 43 | + capability), so `refusal_inventory.rs` / `gate_coverage.rs` are unchanged. | |
| 44 | +- deferred(a TxbSet for 32-coefficient transforms i.e. TX_4X8/8X4, and for 128-coeff | |
| 45 | + luma TX_8X16/16X8): the 24 consts the checker reports missing are those two absent | |
| 46 | + table families — both classes missing, so this is not a class-1 gap. Unblocked by | |
| 47 | + lane tx4x8 / a 128-luma TxbSet; the checker will flag them the moment they land. | |
| 48 | +- fix-now-for-another-lane: `decode::tests::nz_map_ctx_offset_tables_match_the_rect_rule` | |
| 49 | + is red on main df5d630 (`32x64 nz_map offset at display (row 0, col 2): left 6, right 11`). |
scripts/extract-eob-class1.pymodified+6 -3
| @@ -5,7 +5,9 @@ | ||
| 5 | 5 | `[TOKEN_CDF_Q_CTXS][PLANE_TYPES][2][CDF_SIZE(n)]`; the third index is |
| 6 | 6 | `eob_multi_ctx = (tx_class == TX_CLASS_2D) ? 0 : 1`. This prints the |
| 7 | 7 | class-1 (index 1) rows as `EOB_PT_<n>_<PLANE>_CLASS1[_Qk]` consts and, with |
| 8 | -`--check <cdf.rs>`, diffs every const that file already defines. | |
| 8 | +`--check <cdf.rs>`, diffs every const that file already defines -- BOTH classes, | |
| 9 | +so a 2D const accidentally transcribed from the class-1 row is caught too | |
| 10 | +(rectsplit r4 suspected exactly that of `EOB_PT_512_CHROMA`). | |
| 9 | 11 | |
| 10 | 12 | Usage: extract-eob-class1.py <token_cdfs.h> [--check <cdf.rs>] |
| 11 | 13 | """ |
| @@ -37,8 +39,9 @@ def consts(src): | ||
| 37 | 39 | rows = parse(src, size) |
| 38 | 40 | for q in range(4): |
| 39 | 41 | for p, plane in enumerate(("LUMA", "CHROMA")): |
| 40 | - row = rows[q * 4 + p * 2 + 1] | |
| 41 | - out[f"EOB_PT_{size}_{plane}_CLASS1{QSUF[q]}"] = row + [32768, 0] | |
| 42 | + for cls, suf in ((0, ""), (1, "_CLASS1")): | |
| 43 | + row = rows[q * 4 + p * 2 + cls] | |
| 44 | + out[f"EOB_PT_{size}_{plane}{suf}{QSUF[q]}"] = row + [32768, 0] | |
| 42 | 45 | return out |
| 43 | 46 | |
| 44 | 47 |