Round 3 report -- partition-context fix, range-ladder trace, still red
Browse files at this commit915be452d6e64330dafadc32dda66c7457660e12Parent: 1d65b2d- docs
- round 3 report -- partition-context fix, range-ladder trace, still red
1 changed file +99 -1
- lanes/sub8-r1.report.md +99 -1
lanes/sub8-r1.report.mdmodified+99 -1
| @@ -96,7 +96,105 @@ lines ~5346-5369) is wrong. | |||
| 96 | this round (turn budget spent on the above investigation). Deferred to | 96 | this round (turn budget spent on the above investigation). Deferred to |
| 97 | round 3. | 97 | round 3. |
| 98 | 98 | ||
| 99 | -## Open (round 3 charter should start here) | 99 | +## Round 3 (05b20f9) |
| 100 | + | ||
| 101 | +### Fixed: the partition-context bug the round-2 finding pointed at | ||
| 102 | +libaom's `update_ext_partition_context` (`av1_common_int.h:1500`) only | ||
| 103 | +writes anything when `bsize >= BLOCK_8X8`; the four recursive | ||
| 104 | +`decode_partition(BLOCK_4X4)` calls a real `PARTITION_SPLIT` at 8x8 | ||
| 105 | +produces are no-ops for context purposes. The *one* write that happens is | ||
| 106 | +at the 8x8 level itself, with `subsize = BLOCK_4X4`: | ||
| 107 | +`partition_context_lookup[BLOCK_4X4] = {31, 31}` (bit0 = 1), vs | ||
| 108 | +`partition_context_lookup[BLOCK_8X8] = {30, 30}` (bit0 = 0) for a plain | ||
| 109 | +`PARTITION_NONE` 8x8. `decode_leaf_split4`'s chroma-tail (the block that | ||
| 110 | +sets `left_side_mi`/`above_side_mi` for the whole 8x8 group, `decode.rs` | ||
| 111 | +~5350-5354) had copied `decode_leaf8`'s own TX4-branch value (`8`, | ||
| 112 | +correct there -- that block is still one whole `BLOCK_8X8`, just with a | ||
| 113 | +split *transform*) instead of the value that makes | ||
| 114 | +`partition_ctx_mi`'s `left_side_mi[mi_r]*2 <= side` bit read as 1, which | ||
| 115 | +needs `<= 4`. Changed both writes to `4`. Verified directly against the | ||
| 116 | +libaom source at `~/.cache/aom-oracle/src/av1/common/av1_common_int.h:1441-1552` | ||
| 117 | +(`update_partition_context`/`update_ext_partition_context`/ | ||
| 118 | +`partition_plane_context`), not by re-deriving it by hand. | ||
| 119 | + | ||
| 120 | +**Effect measured**: before the fix, every attempt that hit a real SPLIT | ||
| 121 | +crashed the very next sibling 8x8's `partition_w8` read (round 2's | ||
| 122 | +finding). After the fix, `EC_AV1_TRACE=1` on the dumped stream that | ||
| 123 | +previously crashed shows the sibling reads land on the *correct* context | ||
| 124 | +(cross-checked bit-for-bit against instrumented aomdec's `EC_PART` trace | ||
| 125 | +at the equivalent block, ctx encodes the same left/above bits both sides) | ||
| 126 | +and the whole stream decodes to completion with `Ok`, no error, no panic. | ||
| 127 | +This is real, but not sufficient -- see below. | ||
| 128 | + | ||
| 129 | +### Range-ladder result: gate still RED, and the divergence is UPSTREAM of any sub8 code | ||
| 130 | +Ran the decisive check the charter asked for: rebuilt | ||
| 131 | +`~/.cache/aom-oracle` (rungs 2/5/10 already present in the source, | ||
| 132 | +`EC_PART`/`EC_PART_VAL`/`EC_ISTEP` per-symbol range ladder), decoded the | ||
| 133 | +one dumped failing stream (seed=139, cq=12, 64x64, | ||
| 134 | +`--enable-rect-partitions=0 --min-partition-size=4 --max-partition-size=8`) | ||
| 135 | +through instrumented `aomdec` and compared trace order against our own | ||
| 136 | +`EC_AV1_TRACE` output block by block. | ||
| 137 | + | ||
| 138 | +**First divergence**: the 16x16-level partition read at SUB-unit | ||
| 139 | +`at16=(0,1)` (mi=(0,4)), the *second* 16x16 quadrant of the first 32x32 | ||
| 140 | +block -- i.e. it fires before our decoder has executed one single line of | ||
| 141 | +`decode_leaf_split4`/`read_intra_mode_sub8` (the actual sub8x8-SPLIT in | ||
| 142 | +this stream is at mi=(2,6), inside quadrant (0,1)'s own subtree, per | ||
| 143 | +aomdec's `EC_PART_VAL mi_row=2 mi_col=6 bsize=3 value=3`). aomdec reads | ||
| 144 | +`PARTITION_SPLIT` (value=3) there; ours reads `PARTITION_NONE` (value=0). | ||
| 145 | +The context bits agree (both decode to left=1, above=0, aomdec's combined | ||
| 146 | +`ctx=6` and ours `ctx=2` are the same left/above pair under different | ||
| 147 | +context-array encodings) -- so this is not a context bug, it is either a | ||
| 148 | +CDF-adaptation drift carried in from the *first* 16x16 quadrant's own | ||
| 149 | +four 8x8 leaves (all plain `decode_leaf8`, zero sub8 code touched) or a | ||
| 150 | +genuine range/probability desync from something even earlier that this | ||
| 151 | +round did not get to trace symbol-by-symbol (no per-symbol trace exists | ||
| 152 | +in our decoder for `decode_leaf8`'s own mode-info reads, only for the | ||
| 153 | +`read_intra_mode_sub8` leaves added in round 1 -- that instrumentation | ||
| 154 | +gap is why the ladder stops here this round). | ||
| 155 | + | ||
| 156 | +**This changes the round-2 hypothesis**: the failure is very likely NOT | ||
| 157 | +inside `decode_leaf_split4`/`read_intra_mode_sub8` at all. It reproduces | ||
| 158 | +on this stream before any of that code has run. Whatever the true root | ||
| 159 | +cause is, it sits in code shared by every 8x8/16x16 intra block in this | ||
| 160 | +recipe (`decode_leaf8`, `partition_w16`/`partition_w32` context, or CDF | ||
| 161 | +adaptation for `kf_y_mode`/`uv_mode`/`skip`), and `--min-partition-size=4` | ||
| 162 | +is what surfaces it (this exact recipe may not be exercised by any other | ||
| 163 | +gate). Round 4 should NOT keep assuming the bug is sub8-owned code -- | ||
| 164 | +start by adding the same per-symbol trace (`skip`/`mode`/`uv_mode`/ | ||
| 165 | +`angle_delta`) to `decode_leaf8` itself and ladder the *first* 16x16 | ||
| 166 | +quadrant's four 8x8 leaves symbol-by-symbol against aomdec's `EC_ISTEP` | ||
| 167 | +trace before looking at sub8 code again. | ||
| 168 | + | ||
| 169 | +### Suite / build state at HEAD (05b20f9) | ||
| 170 | +- `cargo check --workspace --all-targets`: clean. | ||
| 171 | +- Gate `a_real_aomenc_stream_with_a_sub8_split_decodes_pixel_exact`: | ||
| 172 | + still FAILS, now for a different, better-localized reason (see above). | ||
| 173 | + Only 1/40 attempts this round both fired a real SPLIT and reached the | ||
| 174 | + pixel comparison at all (39/40 either fired no SPLIT -- most now decode | ||
| 175 | + clean with `PARTITION_NONE` chosen throughout the min-partition-size=4 | ||
| 176 | + region, itself now consistent with correct decoding since they don't | ||
| 177 | + panic -- or the run's own aomenc/decode plumbing skipped). The one that | ||
| 178 | + did fire failed pixel-exact per the finding above. | ||
| 179 | +- `cargo test -p ec-av1 --lib`: not completed this round (turn budget | ||
| 180 | + spent on the range-ladder trace above); deferred to round 4, run it | ||
| 181 | + first thing. | ||
| 182 | +- Debug-only instrumentation (`EC_AV1_DUMP_SUB8` stream dump in | ||
| 183 | + `stream.rs`, temp `dec.rng()` trace print attempt in `decode.rs`) was | ||
| 184 | + added, used, and **reverted** this round -- not left in the tree. | ||
| 185 | + | ||
| 186 | +## Open (round 4 charter should start here) | ||
| 187 | +- fix-now candidate: root cause is upstream of sub8's own code (see | ||
| 188 | + "changes the round-2 hypothesis" above) -- add per-symbol trace to | ||
| 189 | + `decode_leaf8` and ladder against aomdec `EC_ISTEP` on the first 16x16 | ||
| 190 | + quadrant before touching `decode_leaf_split4` again. | ||
| 191 | +- `cargo test -p ec-av1 --lib` full run: not done this round, do it first. | ||
| 192 | +- ReelB extract probe (charter step 4): not reached this round -- | ||
| 193 | + the gate is still red and the 10-bit wall in this branch (main merged | ||
| 194 | + 10-bit at 5636fd2, this branch has not) makes it low-value until the | ||
| 195 | + above is fixed. | ||
| 196 | + | ||
| 197 | +## Open (carried from round 2, unchanged) | ||
| 100 | - fix-now candidate: the desync in `decode_leaf_split4`/ | 198 | - fix-now candidate: the desync in `decode_leaf_split4`/ |
| 101 | `read_intra_mode_sub8` (see "the actual finding" above) -- root cause, | 199 | `read_intra_mode_sub8` (see "the actual finding" above) -- root cause, |
| 102 | not yet found. | 200 | not yet found. |