forge
Explore
Log in

Don't you dare go Hollow

lane-av1rawhelper: report r2 -- arity strand, merged-tree compile proof, E0061 red-before

Browse files at this commit

d8498b6da9699c4b520549aae0ba977620384910Ahmet Kaan GümüşParent: 2e1da96
lanes/av1rawhelper.report.mdmodified+128 -0
@@ -142,3 +142,131 @@ and neither is a false green):
142 fixing here.142 fixing here.
143 - `ffmpeg_decode_sequence*` all hard-code their own pix_fmt and size-assert before unpacking,143 - `ffmpeg_decode_sequence*` all hard-code their own pix_fmt and size-assert before unpacking,
144 so a depth mismatch is a loud failure there too.144 so a depth mismatch is a loud failure there too.
145+
146+---
147+
148+# r2 — rebase onto main and fix the stranded call site
149+
150+**Rework reason (Main, from an independent review):** the 4-arg → 5-arg signature change
151+stranded a call site this branch never saw. `git merge-tree` reported the merge CLEAN and the
152+merged tree then failed to compile with E0061.
153+
154+**The trap, stated once: a signature change must be validated by COMPILING the merged result,
155+not by `git merge-tree`'s conflict report.** `merge-tree` reasons about content overlap, not
156+about arity — a call site on lines the signature diff never touches is a non-conflict to it and
157+an E0061 to rustc.
158+
159+## 1. Rebase and the full call-site set
160+
161+Rebased `lane-av1rawhelper` onto current main `9b2f6c9ddb5c704e7649900c704b911e6822cd43`
162+(clean rebase, 1 commit replayed → `8bf6c4fe`). The call-site set was then re-established from
163+the CURRENT tree with `grep -rn "assert_rawvideo_matches(" crates/`, not from the branch's
164+pre-rebase view.
165+
166+| | count | sites (rebased tree) |
167+|---|---|---|
168+| before r2 | 2 real call sites, 1 of them 4-arg stranded | `stream.rs:7071` (updated), `stream.rs:7165` (**stranded**, 4-arg) |
169+| after r2 | 2 real call sites, both 5-arg | `stream.rs:7071`, `stream.rs:7165` |
170+
171+(The r1 gate contributes 2 more call sites of its own — `stream.rs:5232` and `:5247` — which
172+are the deliberate wrong-label and correct-label arms.)
173+
174+**Depth of the stranded site, from the bytes.** `stream.rs:7165` belongs to
175+`a_lossless_block_clips_its_transform_grid_at_the_frame_edge`, added by `7b9f46fa`, which the
176+r1 base `7f8817cb` predates. Its depth is **not** taken from the gate's doc prose, which says
177+"128x96 yuv444p 4:4:4 lossless" without naming a depth. It is read off the pin's own parsed
178+sequence header via the crate's own parser:
179+
180+```
181+$ cargo run -p ec-av1 --example decode_probe -- fixtures/ll444_128root_lossless.obu
182+SEQ: use_128x128_superblock=true bit_depth=10 mono_chrome=false max_frame=128x96
183+$ cargo run -p ec-av1 --example decode_probe -- fixtures/ll444_minp64_128root_control.obu
184+SEQ: use_128x128_superblock=true bit_depth=10 mono_chrome=false max_frame=128x96
185+```
186+
187+Both pins are genuinely 10-bit, so both sites take `10` — and the new in-helper assert
188+independently re-derives and confirms that at runtime, so a wrong label here could not pass
189+silently.
190+
191+## 2. Both gates green (tails)
192+
193+```
194+$ cargo test -p ec-av1 --lib the_rawvideo_helper_compares_real_samples -- --nocapture
195+the_rawvideo_helper_compares_real_samples_at_the_streams_own_bit_depth:
196+ 6 8-bit frame(s) byte-identical to aomdec --rawvideo
197+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 742 filtered out
198+```
199+
200+```
201+$ cargo test -p ec-av1 --lib a_lossless_block_clips_its_transform_grid_at_the_frame_edge -- --nocapture
202+running 1 test
203+test stream::tests::a_lossless_block_clips_its_transform_grid_at_the_frame_edge ... ok
204+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 742 filtered out
205+```
206+
207+The second tail is the one that matters: `a_lossless_block_clips_its_transform_grid_at_the_frame_edge`
208+is the gate that owns the stranded site, so its green is the proof that the site the branch
209+never saw is now correct — and it is a real 6-frame `aomdec --rawvideo` compare at 10-bit, not
210+a compile-only pass.
211+
212+## 3. `cargo check -p ec-av1 --all-targets`
213+
214+**CLEAN.** No errors, no warnings:
215+
216+```
217+$ touch crates/ec-av1/src/stream.rs && cargo check -p ec-av1 --all-targets
218+ Checking ec-av1 v0.1.0 (/home/user/.cache/wt/av1rawhelper/crates/ec-av1)
219+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.36s
220+```
221+
222+(The `touch` is load-bearing: an earlier run reported `Finished in 0.01s` off a cached binary,
223+which is not evidence of anything.)
224+
225+## 4. The merged result itself, compiled
226+
227+Checking the branch alone is not the check — the defect only exists in the MERGED tree. So the
228+merge was materialised and compiled:
229+
230+```
231+$ git merge-tree --write-tree main HEAD # tree 7125a2a3
232+$ git commit-tree 7125a2a3 -p main -p HEAD -m "merge-sim" # 72954a27
233+$ git worktree add --detach ~/.cache/wt/av1rawhelper-merge 72954a27
234+$ cargo check -p ec-av1 --all-targets
235+ Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.81s
236+```
237+
238+**The merged result compiles clean.** Its call sites are the ones the branch intended:
239+
240+```
241+5079: fn assert_rawvideo_matches(
242+5232: assert_rawvideo_matches(&obu, &stream, NAME, frames, 10);
243+5247: assert_rawvideo_matches(&obu, &stream, NAME, frames, 8);
244+7071: assert_rawvideo_matches(&ctrl, &ctrl_stream, NAME, FRAMES, 10);
245+7165: assert_rawvideo_matches(&obu, &stream, NAME, FRAMES, 10);
246+```
247+
248+### Red-before for the rework
249+
250+With `stream.rs:7165` reverted to its 4-arg form inside the merged tree, the merged result
251+fails at exactly the line and error the review reported:
252+
253+```
254+error[E0061]: this function takes 5 arguments but 4 arguments were supplied
255+ --> crates/ec-av1/src/stream.rs:7165:13
256+ |
257+7165 | assert_rawvideo_matches(&obu, &stream, NAME, FRAMES);
258+ | ^^^^^^^^^^^^^^^^^^^^^^^------------------------ argument #5 of type `u8` is missing
259+error: could not compile `ec-av1` (lib test) due to 1 previous error
260+```
261+
262+The line and the error match the review's finding, and `git merge-tree` had called this same
263+merge CLEAN. Restored to the 5-arg form it compiles clean again; the scratch merge worktree and
264+its target dir were removed.
265+
266+## 5. Process note
267+
268+Any lane that changes a function signature in this crate should, before reporting done:
269+establish the call-site set from the current tree, and then compile a materialised merge
270+(`git merge-tree --write-tree` + `git commit-tree` + worktree + `cargo check`) rather than
271+trusting the conflict report. Signature churn during a multi-lane merge wave is the exact
272+condition under which `merge-tree` is confidently wrong.