forge
Explore
Log in

Don't you dare go Hollow

Lane-altref2 r1 charter (make the vacuous ALTREF2 gate fire)

Browse files at this commit

8da2b4b5840c915f9c8d05888a0de7629f09bc3aAhmet Kaan GümüşParent: ae78393
  • docs
    • lane-altref2 r1 charter (make the vacuous ALTREF2 gate fire)
Show full message
docs(av1): lane-altref2 r1 charter (make the vacuous ALTREF2 gate fire)
lanes/altref2-r1.charter.mdadded+57 -0
@@ -0,0 +1,57 @@
1+# lane-altref2 r1 charter — make two vacuous gates fire
2+
3+## Where you are
4+Worktree /home/user/Documents/Code/Rust/edith_codecs-altref2, branch lane-altref2 @ main.
5+Build/test ONLY:
6+ `env CARGO_TARGET_DIR=$HOME/.cache/cargo-target-altref2 CARGO_BUILD_JOBS=4 nice -n 19 cargo test -p ec-av1 --release --lib <name> -- --nocapture`
7+FOREGROUND, EC_AV1_REQUIRE_AOMENC=1. Never push. Never touch the main checkout
8+or the sibling -gm / -screen / -recttx worktrees (three lanes are live there).
9+WIP COMMIT after every green milestone.
10+
11+## The problem
12+`a_real_aomenc_stream_with_an_altref2_reference_decodes_pixel_exact` passes
13+without ever having exercised ALTREF2: 86 attempts, zero firings. A gate that
14+cannot fire the feature it names measures nothing, and this repo has been
15+burned by exactly that (class `gate-blind-to-feature`) more than once. The
16+recipe uses `--auto-alt-ref=1 --lag-in-frames=16`, which is enough for BWDREF
17+but evidently not for ALTREF2.
18+
19+## What to do
20+1. Instrument first, guess second. Find how the gate proves a firing today
21+ (`crate::mvstack::ALTREF2_FRAME` is passed into a shared helper — read that
22+ helper and see what counter it checks). Then drive `aomenc` DIRECTLY from a
23+ shell, outside the test, and find a flag set that makes real ALTREF2
24+ references appear. The oracle's own `aomdec` at ~/.cache/aom-oracle/build is
25+ instrumented (`EC_TRACE=1`); `~/.cache/aom-oracle/build/aomenc --help` lists
26+ every knob. ALTREF2 comes from a multi-layer alt-ref pyramid, so the
27+ pyramid-height knobs (`--gf-min-pyr-height` / `--gf-max-pyr-height`), the
28+ GF group length knobs, the lag, and the frame count are the search space.
29+ A longer clip is likely required — 16 frames may simply be too few for
30+ aomenc to build a 2-level pyramid.
31+2. Report the search as a TABLE: flag set -> did ALTREF2 appear, so the next
32+ person does not repeat it. Negative rows are as valuable as the positive one.
33+3. Once a firing recipe exists, put it in the gate and make the firing
34+ HARD-ASSERTED: the test must FAIL if the count does not advance, not skip.
35+ Follow whatever the already-landed gates do (`wii_hits`, `partab_hits`,
36+ `rect_partition_hits` are precedents — grep for one and copy its shape).
37+4. If our decoder then refuses or mismatches on those streams, that is a REAL
38+ find, not a failure of this lane: pin it with
39+ `EC_AV1_GATE_DUMP=/tmp/claude-1000/altref2-flake-N.obu`, report the pin and
40+ the refusal string, and leave the gate asserting the firing with the decode
41+ part narrowed. Do NOT guess-fix a decode bug in this lane.
42+5. Bound every ffmpeg source you write with `-t <seconds>` on the OUTPUT side.
43+ A source's own `duration=` is not enough for every filter, and an unbounded
44+ lavfi source deadlocks the y4m pipe until the test times out — that has
45+ happened three times in this repo.
46+6. Second target, same treatment if budget allows: check whether
47+ `a_real_aomenc_filter_intra_stream_decodes_pixel_exact` still skips. It was
48+ eaten by the whole-frame `allow_screen_content_tools` refusal; lane-screen
49+ is narrowing that refusal in a sibling worktree, so just REPORT its status,
50+ do not fix it here.
51+
52+## Done criteria
53+The ALTREF2 gate fires and hard-asserts, or the report proves with a search
54+table that aomenc will not produce ALTREF2 under any envelope this decoder can
55+otherwise decode (and then the gate is renamed/retired rather than left lying).
56+Full lib suite stays 224 passed / 0 failed. REPORT `lanes/altref2-r1.report.md`,
57+VERDICT on the FIRST line, with the search table and the firing count.