forge
Explore
Log in

Don't you dare go Hollow

lane-av1422warp: report -- the two reads are decodeframe.c:1722 wiener_restore_cdf

Browse files at this commit

68a69e2f3706d7215d813a1cf8a408eb456dcb74Ahmet Kaan GümüşParent: f5f4abf
Records the instrument that worked (a macro capturing __FILE__/__LINE__ at
the expansion, after rejecting __builtin_return_address and addr2line
without -g on evidence) and what it named: the oracle reads
wiener_restore_cdf three times at mi(30,62) where this decoder reads it
once, so the divergence is two missing loop-restoration unit reads.

Records two candidates ruled out against libaom rather than assumed:
the chroma LR unit size uses MIN(ss_x, ss_y) and our code already
matches (a subsampling_x + subsampling_y 'fix' would break 4:2:0 and
4:4:4), and count_units is character-for-character av1_lr_count_units.

Records what is left: the per-superblock unit range at
restoration.rs:519-524, whose mi_size is the only 4:2:2-sensitive term.
lanes/av1422warp.report.mdmodified+75 -0
@@ -1808,6 +1808,81 @@ tag now one-shot, the two extra reads name themselves on the next pass.
1808 1808
1809 Not pinned, no gate, refusal untouched.1809 Not pinned, no gate, refusal untouched.
1810 1810
1811+## Round 31 — the two reads are NAMED: `decodeframe.c:1722`, `wiener_restore_cdf`
1812+
1813+`37656c2f` (round 30's instrument, still current) and oracle snapshots
1814+`662b6f0` / `9bb526a`. No behaviour change; identity re-proved.
1815+
1816+### The instrument that finally worked
1817+
1818+Two candidates were tried and **rejected on evidence**:
1819+`__builtin_return_address(0)` is defeated by inlining and identical-code
1820+folding — five distinct reads resolved to ONE address, and rebuilding
1821+with `-fno-ipa-icf` did **not** separate them — and `addr2line` without
1822+`-g` has no line info at all.
1823+
1824+What works is a **macro capturing `__FILE__`/`__LINE__` at the expansion**,
1825+which is exact by construction and survives both. `aom_read_symbol` now
1826+reports `site=file:line` for every read. This is the instrument nine
1827+rounds of pairing needed and did not have.
1828+
1829+### The named reads
1830+
1831+```
1832+decodemv.c:1031 n=4 mv_fr
1833+decodemv.c:1642 n=2 (interintra follow-up)
1834+decodemv.c:172 n=4
1835+decodemv.c:1654 n=2 wedge_interintra
1836+decodemv.c:1232 n=3
1837+decodemv.c:1232 n=3
1838+decodeframe.c:1722 n=2 s=1 pairs
1839+decodeframe.c:1722 n=2 s=1 <-- MISSING
1840+decodeframe.c:1722 n=2 s=1 <-- MISSING
1841+decodeframe.c:1268 n=8 / n=10 the next block's modes
1842+```
1843+
1844+`decodeframe.c:1722` is `wiener_restore_cdf` inside `read_restoration_type`
1845+— the per-plane loop-restoration read-back. **The oracle reads it three
1846+times at this superblock; this decoder reads it once.** That is the whole
1847+divergence: this decoder is missing two loop-restoration unit reads.
1848+
1849+### Two candidates checked and RULED OUT against libaom
1850+
1851+1. **Chroma LR unit size.** `decodeframe.c:1584-1593` uses
1852+ `s = AOMMIN(subsampling_x, subsampling_y)` and shifts by
1853+ `aom_rb_read_bit(rb) * s` only when `s && !chroma_none`. At 4:2:2
1854+ `s == 0`, so chroma takes the luma size unshifted — which is exactly
1855+ what `ec-av1-syntax/src/frame.rs:1636` does. **Our code matches.** A
1856+ plausible-looking "fix" here (`>> (subsampling_x + subsampling_y)`,
1857+ the reading I started from) would break 4:2:0 and 4:4:4.
1858+2. **`count_units`.** `restoration.rs:467` is character-for-character
1859+ `av1_lr_count_units` (`restoration.c:63`): same half-up rounding, same
1860+ `.max(1)`. **Matches.**
1861+
1862+### What is left, and it is small
1863+
1864+`restoration.rs:519-524` — the per-superblock unit range:
1865+
1866+```rust
1867+let mi_size = if plane == 0 { 4 } else { 4 >> ss_x(fctx) };
1868+let rcol0 = ceil_div(mi_col * num_x, denom_x);
1869+let rrow0 = ceil_div(mi_row * mi_size, unit_size);
1870+```
1871+
1872+`mi_size` is the only 4:2:2-sensitive term (2 at 4:2:2, 2 at 4:2:0, 4 at
1873+4:4:4), and this range is what decides how many `read_lr_unit` calls a
1874+superblock makes per plane. libaom's equivalent bounds come from
1875+`av1_loop_restoration_corners_in_sb`, which mixes the superres `denom_x`
1876+path differently for the row axis than this does. **That is the next
1877+thing to check, and it is a read, not a rewrite.**
1878+
1879+**Handoff:** compare `restoration.rs:519-524` line by line against
1880+`av1_loop_restoration_corners_in_sb` (`restoration.c`), with the 4:2:2
1881+`ss_y == 0` case in view. The oracle now names every read, so a correct
1882+fix is provable in one run: the sequence diff must go flat.
1883+
1884+Not pinned, no gate, refusal untouched.
1885+
1811 ## Two refuted hypotheses — do not re-chase1886 ## Two refuted hypotheses — do not re-chase
1812 1887
1813 1. **"libaom ORs the block's OWN `uv_mode` into the edge-filter type."** False.1888 1. **"libaom ORs the block's OWN `uv_mode` into the edge-filter type."** False.