Merge lane-av1gates444 @ 555c83f3 — three new measured-EXACT 4:4:4 lossy gates (66x66 / 130x122 / 256x128)
Browse files at this commit2 changed files +403 -0
- crates/ec-av1/src/stream.rs +230 -0
- lanes/av1gates444.report.md +173 -0
crates/ec-av1/src/stream.rsmodified+230 -0
| @@ -7407,7 +7407,237 @@ pub(crate) mod tests { | |||
| 7407 | } | 7407 | } |
| 7408 | eprintln!("{NAME}: 4:2:0 control {h4} HORZ_4 / {v4} VERT_4 strips, 0 own-extent gathers"); | 7408 | eprintln!("{NAME}: 4:2:0 control {h4} HORZ_4 / {v4} VERT_4 strips, 0 own-extent gathers"); |
| 7409 | } | 7409 | } |
| 7410 | + /// lane-av1gates444: the live 4:4:4 LOSSY cell the chroma-format sweep | ||
| 7411 | + /// measured EXACT 4/4 and left unpinned. The recipe is the sweep's own | ||
| 7412 | + /// §6.2 encode, reproduced LIVE against the oracle `aomenc` rather than | ||
| 7413 | + /// from a pin, because the claim these three gates carry is a property | ||
| 7414 | + /// of the *decoder* at a geometry, not of a blob: | ||
| 7415 | + /// ```text | ||
| 7416 | + /// ffmpeg -f lavfi -i "testsrc2=size=<W>x<H>:rate=25" -frames:v 4 \ | ||
| 7417 | + /// -pix_fmt yuv444p -f yuv4mpegpipe - | \ | ||
| 7418 | + /// aomenc --codec=av1 --profile=1 --passes=1 --end-usage=q --cq-level=20 \ | ||
| 7419 | + /// --cpu-used=2 --threads=1 --row-mt=0 --lag-in-frames=0 \ | ||
| 7420 | + /// --kf-max-dist=100 --limit=4 --obu -o - - | ||
| 7421 | + /// ``` | ||
| 7422 | + /// `rate=25` is load-bearing (testsrc2's pattern is time-parameterised) | ||
| 7423 | + /// and `--limit=4` is the sweep's frame count: at `--limit=6` the same | ||
| 7424 | + /// recipe emits 7674 / 11465 / 19121 bytes instead of the sweep's | ||
| 7425 | + /// 5938 / 8945 / 15239, i.e. a different stream than the one measured. | ||
| 7426 | + /// `--profile=1` is what makes the source 4:4:4 at all. | ||
| 7427 | + /// | ||
| 7428 | + /// Every assertion here is a non-vacuity assertion first and a pixel | ||
| 7429 | + /// compare second. The frame count, the per-frame geometry and the | ||
| 7430 | + /// FULL-RESOLUTION chroma plane length are asserted because a truncated | ||
| 7431 | + /// or 4:2:0-shaped decode can pass a lenient compare; the | ||
| 7432 | + /// `rect4_inter_own_chroma444_hits()` reach assert is there because the | ||
| 7433 | + /// class these cells belong to is the 4:4:4-only own-chroma-extent route | ||
| 7434 | + /// in [`decode_inter_block`]'s `around_c` (a 4:2:0 stream of the same | ||
| 7435 | + /// content leaves it at 0), and a counter at 0 would mean the gate | ||
| 7436 | + /// measured a different route than it names. | ||
| 7437 | + fn encode_444_lossy_live(name: &str, w: usize, h: usize) -> Vec<u8> { | ||
| 7438 | + if !have_aomenc() { | ||
| 7439 | + eprintln!( | ||
| 7440 | + "SKIP {name}: no aomenc oracle at {} -- run scripts/build-aom-oracle.sh", | ||
| 7441 | + aomenc_path().display() | ||
| 7442 | + ); | ||
| 7443 | + return Vec::new(); | ||
| 7444 | + } | ||
| 7445 | + let source = format!("testsrc2=size={w}x{h}:rate=25"); | ||
| 7446 | + let y4m = Command::new("ffmpeg") | ||
| 7447 | + .args([ | ||
| 7448 | + "-v", | ||
| 7449 | + "error", | ||
| 7450 | + "-f", | ||
| 7451 | + "lavfi", | ||
| 7452 | + "-i", | ||
| 7453 | + &source, | ||
| 7454 | + "-frames:v", | ||
| 7455 | + "4", | ||
| 7456 | + "-pix_fmt", | ||
| 7457 | + "yuv444p", | ||
| 7458 | + "-f", | ||
| 7459 | + "yuv4mpegpipe", | ||
| 7460 | + "-", | ||
| 7461 | + ]) | ||
| 7462 | + .stdin(Stdio::null()) | ||
| 7463 | + .stdout(Stdio::piped()) | ||
| 7464 | + .stderr(Stdio::piped()) | ||
| 7465 | + .output() | ||
| 7466 | + .expect("ffmpeg failed to run"); | ||
| 7467 | + assert!( | ||
| 7468 | + y4m.status.success(), | ||
| 7469 | + "{name}: ffmpeg refused the {w}x{h} 4:4:4 source: {}", | ||
| 7470 | + String::from_utf8_lossy(&y4m.stderr) | ||
| 7471 | + ); | ||
| 7472 | + let out = run_with_stdin( | ||
| 7473 | + Command::new(aomenc_path()).args([ | ||
| 7474 | + "--codec=av1", | ||
| 7475 | + "--profile=1", | ||
| 7476 | + "--passes=1", | ||
| 7477 | + "--end-usage=q", | ||
| 7478 | + "--cq-level=20", | ||
| 7479 | + "--cpu-used=2", | ||
| 7480 | + "--threads=1", | ||
| 7481 | + "--row-mt=0", | ||
| 7482 | + "--lag-in-frames=0", | ||
| 7483 | + "--kf-max-dist=100", | ||
| 7484 | + "--limit=4", | ||
| 7485 | + "--obu", | ||
| 7486 | + "-o", | ||
| 7487 | + "-", | ||
| 7488 | + "-", | ||
| 7489 | + ]), | ||
| 7490 | + &y4m.stdout, | ||
| 7491 | + ); | ||
| 7492 | + assert!( | ||
| 7493 | + out.status.success(), | ||
| 7494 | + "{name}: aomenc refused the {w}x{h} 4:4:4 lossy recipe: {}", | ||
| 7495 | + String::from_utf8_lossy(&out.stderr) | ||
| 7496 | + ); | ||
| 7497 | + assert!( | ||
| 7498 | + !out.stdout.is_empty(), | ||
| 7499 | + "{name}: aomenc produced no OBU for {w}x{h} -- a zero-length stream would \ | ||
| 7500 | + decode to nothing and the compare below would compare nothing" | ||
| 7501 | + ); | ||
| 7502 | + out.stdout | ||
| 7503 | + } | ||
| 7504 | + | ||
| 7505 | + /// The body every 4:4:4 lossy live gate runs: assert the oracle compare | ||
| 7506 | + /// CANNOT be skipped, assert the decode really is the cell it claims | ||
| 7507 | + /// (frame count, geometry, full-resolution chroma), assert the 4:4:4-only | ||
| 7508 | + /// own-extent route really ran, then compare every frame in decode order | ||
| 7509 | + /// against the oracle aomdec with the length asserted first. | ||
| 7510 | + /// | ||
| 7511 | + /// The aomdec assert is deliberately a HARD failure, not the | ||
| 7512 | + /// `if aomdec_path().is_file()` skip the older gates use: a gate that | ||
| 7513 | + /// measures exactness and then quietly skips the compare reports green | ||
| 7514 | + /// for a decoder it never looked at (class gate-blind-to-the-arm). It | ||
| 7515 | + /// fires only when the gate is actually running, i.e. the oracle aomenc | ||
| 7516 | + /// resolved -- and aomenc and aomdec ship in the same build directory, | ||
| 7517 | + /// so an aomdec that is missing while aomenc is present is a broken | ||
| 7518 | + /// oracle, not a checkout without one. | ||
| 7519 | + fn gate_444_lossy_live_exact(name: &str, w: usize, h: usize) { | ||
| 7520 | + let stream = encode_444_lossy_live(name, w, h); | ||
| 7521 | + if stream.is_empty() { | ||
| 7522 | + return; // no oracle at all: the SKIP above already said so | ||
| 7523 | + } | ||
| 7524 | + assert!( | ||
| 7525 | + aomdec_path().is_file(), | ||
| 7526 | + "{name}: the oracle aomenc resolved to {} but no aomdec sits beside it at {} -- \ | ||
| 7527 | + the pixel compare would silently skip, which this gate treats as a failure", | ||
| 7528 | + aomenc_path().display(), | ||
| 7529 | + aomdec_path().display() | ||
| 7530 | + ); | ||
| 7531 | + | ||
| 7532 | + let _guard = lock_gate_counters(); | ||
| 7533 | + crate::decode::reset_rect4_inter_own_chroma444_hits(); | ||
| 7534 | + let frames = decode_stream(&stream).unwrap_or_else(|e| { | ||
| 7535 | + panic!("{name}: the live {w}x{h} 4:4:4 lossy stream was refused: {e}") | ||
| 7536 | + }); | ||
| 7537 | + let own = crate::decode::rect4_inter_own_chroma444_hits(); | ||
| 7538 | + assert!( | ||
| 7539 | + own > 0, | ||
| 7540 | + "{name}: no 4:4:4 1:4 inter strip read its chroma context over its own extent -- \ | ||
| 7541 | + the route this cell is a witness for never ran (measured: 13 at 66x66, 12 at \ | ||
| 7542 | + 130x122, 24 at 256x128)" | ||
| 7543 | + ); | ||
| 7544 | + assert_eq!( | ||
| 7545 | + frames.len(), | ||
| 7546 | + 4, | ||
| 7547 | + "{name}: decoded {} frame(s), the recipe encodes 4 -- a short decode would make the \ | ||
| 7548 | + oracle compare cover a prefix of the cell", | ||
| 7549 | + frames.len() | ||
| 7550 | + ); | ||
| 7551 | + for (i, f) in frames.iter().enumerate() { | ||
| 7552 | + assert_eq!( | ||
| 7553 | + (f.width, f.height), | ||
| 7554 | + (w, h), | ||
| 7555 | + "{name}: frame {i} is {}x{}, the cell is {w}x{h}", | ||
| 7556 | + f.width, | ||
| 7557 | + f.height | ||
| 7558 | + ); | ||
| 7559 | + // At 4:4:4 both chroma planes are full resolution. A decoder that | ||
| 7560 | + // kept a subsampled extent would hand quarter-size planes to the | ||
| 7561 | + // byte compare; say so here instead of letting the compare | ||
| 7562 | + // stand in for the shape claim. | ||
| 7563 | + assert_eq!( | ||
| 7564 | + f.u.len(), | ||
| 7565 | + w * h, | ||
| 7566 | + "{name}: frame {i} U plane is {} samples; at 4:4:4 it must be full resolution \ | ||
| 7567 | + ({w}x{h})", | ||
| 7568 | + f.u.len() | ||
| 7569 | + ); | ||
| 7570 | + assert_eq!( | ||
| 7571 | + f.v.len(), | ||
| 7572 | + w * h, | ||
| 7573 | + "{name}: frame {i} V plane is {} samples; at 4:4:4 it must be full resolution \ | ||
| 7574 | + ({w}x{h})", | ||
| 7575 | + f.v.len() | ||
| 7576 | + ); | ||
| 7577 | + assert_eq!( | ||
| 7578 | + f.y.len(), | ||
| 7579 | + w * h, | ||
| 7580 | + "{name}: frame {i} luma plane is {} samples, expected {w}x{h}", | ||
| 7581 | + f.y.len() | ||
| 7582 | + ); | ||
| 7583 | + } | ||
| 7584 | + let (decoded, hidden) = decode_all_frames_vs_oracle(&stream, name); | ||
| 7585 | + assert_eq!( | ||
| 7586 | + decoded, 4, | ||
| 7587 | + "{name}: the oracle decoded {decoded} frame(s) in decode order, the recipe carries 4 \ | ||
| 7588 | + (so far {hidden} hidden)" | ||
| 7589 | + ); | ||
| 7590 | + eprintln!( | ||
| 7591 | + "{name}: {w}x{h} 4:4:4 lossy, {decoded} decode-order frame(s) byte-exact vs aomdec \ | ||
| 7592 | + ({hidden} hidden), {own} own-extent 1:4 chroma gather(s)" | ||
| 7593 | + ); | ||
| 7594 | + } | ||
| 7410 | 7595 | ||
| 7596 | + /// lane-av1gates444 cell 1: **odd coded dims, 66x66** -- the partial-frame | ||
| 7597 | + /// walk in BOTH axes (66 is not a multiple of 8, so the frame is a | ||
| 7598 | + /// partial superblock column AND a partial row). Measured EXACT 4/4 by | ||
| 7599 | + /// the chroma-format sweep (§6.2, 5938 bytes) and unpinned: nothing in | ||
| 7600 | + /// the crate would go red if the odd-dimension 4:4:4 walk regressed, | ||
| 7601 | + /// and the only red-before evidence was a lane report nobody re-runs. | ||
| 7602 | + #[test] | ||
| 7603 | + fn a_444_lossy_odd_66x66_stream_decodes_pixel_exact() { | ||
| 7604 | + gate_444_lossy_live_exact("a_444_lossy_odd_66x66_stream_decodes_pixel_exact", 66, 66); | ||
| 7605 | + } | ||
| 7606 | + | ||
| 7607 | + /// lane-av1gates444 cell 2: **odd coded dims, 130x122** -- the | ||
| 7608 | + /// partial-frame RIGHT edge that the sweep found DIVERGENT (first wrong | ||
| 7609 | + /// sample Y(128,16), 11521 samples on frame 3) until lane-av1444rect's | ||
| 7610 | + /// 4:4:4 own-chroma-extent fix landed. It measures EXACT 4/4 on this | ||
| 7611 | + /// tree and is the discriminating geometry: 66x66 was exact at the same | ||
| 7612 | + /// settings while this was not, so the pair is what keeps "the 4:4:4 | ||
| 7613 | + /// partial-frame walk is right" from being a one-geometry accident. | ||
| 7614 | + #[test] | ||
| 7615 | + fn a_444_lossy_odd_130x122_stream_decodes_pixel_exact() { | ||
| 7616 | + gate_444_lossy_live_exact( | ||
| 7617 | + "a_444_lossy_odd_130x122_stream_decodes_pixel_exact", | ||
| 7618 | + 130, | ||
| 7619 | + 122, | ||
| 7620 | + ); | ||
| 7621 | + } | ||
| 7622 | + | ||
| 7623 | + /// lane-av1gates444 cell 3: **256x128**, the sweep's cell recorded as | ||
| 7624 | + /// "4:4:4 superres 256x128 (`--superres-mode=1`)". | ||
| 7625 | + /// | ||
| 7626 | + /// IT IS NOT A SUPERRES CELL, and this gate is named for what it is | ||
| 7627 | + /// instead. Measured here, live: encoding 256x128 with and without | ||
| 7628 | + /// `--superres-mode=1` produces BYTE-IDENTICAL OBU (15239 bytes, | ||
| 7629 | + /// sha256 06621606…, both), so the flag is a no-op on this aomenc build | ||
| 7630 | + /// and the sweep's cell was a plain 4:4:4 lossy cq-20 stream that | ||
| 7631 | + /// happened to carry the flag. The cell's actual value is the geometry | ||
| 7632 | + /// plus the filter stages: 256x128 is two full 128 superblock columns, | ||
| 7633 | + /// and the strip walk runs there with the post-deblock/CDEF/LR chain | ||
| 7634 | + /// live on the later frames -- so this is the third witness for the | ||
| 7635 | + /// 4:4:4 lossy strip class at a geometry the 128x96 rect4 gate does not | ||
| 7636 | + /// cover. | ||
| 7637 | + #[test] | ||
| 7638 | + fn a_444_lossy_256x128_stream_decodes_pixel_exact() { | ||
| 7639 | + gate_444_lossy_live_exact("a_444_lossy_256x128_stream_decodes_pixel_exact", 256, 128); | ||
| 7640 | + } | ||
| 7411 | /// lane-av1444rect r2 — the SAME class as the gate above, second | 7641 | /// lane-av1444rect r2 — the SAME class as the gate above, second |
| 7412 | /// instance: `decode_rect4_16_intrabc` applied the 4:2:0 pair geometry at | 7642 | /// instance: `decode_rect4_16_intrabc` applied the 4:2:0 pair geometry at |
| 7413 | /// ss (0,0), where `is_chroma_reference` makes an intra-BC 1:4 strip its | 7643 | /// ss (0,0), where `is_chroma_reference` makes an intra-BC 1:4 strip its |
lanes/av1gates444.report.mdadded+173 -0
| @@ -0,0 +1,173 @@ | |||
| 1 | +# lane-av1gates444 — three measured-EXACT 4:4:4 lossy cells, pinned | ||
| 2 | + | ||
| 3 | +## 1. What this lane is | ||
| 4 | + | ||
| 5 | +Tests only. `crates/ec-av1/src/decode.rs` is **not** edited in the committed | ||
| 6 | +tree (`git diff --stat` on the lane commit: `crates/ec-av1/src/stream.rs | 225 | ||
| 7 | +insertions(+), 0 deletions`). No new `#[ignore]`. No new `tests/*.rs` file — | ||
| 8 | +all three gates live in the existing `ec-av1` lib test binary | ||
| 9 | +(`crates/ec-av1/src/stream.rs`, `pub(crate) mod tests`). | ||
| 10 | + | ||
| 11 | +Branch `lane-av1gates444`, one commit `81f88fd1` on top of `a21f3680`. | ||
| 12 | + | ||
| 13 | +## 2. The cells, and the recipe that reproduces them | ||
| 14 | + | ||
| 15 | +The three cells come from `lanes/av1formatsweep.report.md` §6.2 and | ||
| 16 | +`lanes/av1444rect.report.md` §8. All three were **EXACT 4/4 with no committed | ||
| 17 | +gate**; only the lane report carried the evidence. | ||
| 18 | + | ||
| 19 | +The sweep's encode is reproduced byte-for-byte. The stream sizes and sha256 | ||
| 20 | +prefixes below match the sweep's table exactly, which is how the recipe is | ||
| 21 | +confirmed rather than approximated: | ||
| 22 | + | ||
| 23 | +```text | ||
| 24 | +ffmpeg -f lavfi -i "testsrc2=size=<W>x<H>:rate=25" -frames:v 4 \ | ||
| 25 | + -pix_fmt yuv444p -f yuv4mpegpipe - | \ | ||
| 26 | +aomenc --codec=av1 --profile=1 --passes=1 --end-usage=q --cq-level=20 \ | ||
| 27 | + --cpu-used=2 --threads=1 --row-mt=0 --lag-in-frames=0 \ | ||
| 28 | + --kf-max-dist=100 --limit=4 --obu -o - - | ||
| 29 | +``` | ||
| 30 | + | ||
| 31 | +| cell | gate | bytes | sha256 | sweep said | | ||
| 32 | +|---|---|---|---|---| | ||
| 33 | +| odd 66x66 | `a_444_lossy_odd_66x66_stream_decodes_pixel_exact` | 5938 | `973eddf4…` | 5938 / `973eddf4…` | | ||
| 34 | +| odd 130x122 | `a_444_lossy_odd_130x122_stream_decodes_pixel_exact` | 8945 | `c87ac65b…` | 8945 / `c87ac65b…` | | ||
| 35 | +| 256x128 | `a_444_lossy_256x128_stream_decodes_pixel_exact` | 15239 | `06621606…` | 15239 / `06621606…` | | ||
| 36 | + | ||
| 37 | +Two flags are load-bearing and both are documented in the gate's doc comment: | ||
| 38 | + | ||
| 39 | +- `rate=25` — testsrc2's pattern is time-parameterised, so `rate=1` is a | ||
| 40 | + different stream. | ||
| 41 | +- `--limit=4` — the sweep's frame count. At `--limit=6` the same recipe emits | ||
| 42 | + 7674 / 11465 / 19121 bytes, i.e. a *different* stream than the one measured. | ||
| 43 | + Measured, not assumed. | ||
| 44 | +- `--profile=1` is what makes the source 4:4:4 at all. | ||
| 45 | + | ||
| 46 | +### 2.1 The third cell is NOT a superres cell | ||
| 47 | + | ||
| 48 | +The sweep recorded it as "4:4:4 **superres** 256x128 (`--superres-mode=1`)" and | ||
| 49 | +`av1444rect` §8 corrected that. Measured here to settle it independently: | ||
| 50 | + | ||
| 51 | +| encode | bytes | sha256 | | ||
| 52 | +|---|---|---| | ||
| 53 | +| 256x128 without `--superres-mode=1` | 15239 | `881ab784…` at limit=6 / `06621606…` at limit=4 | | ||
| 54 | +| 256x128 **with** `--superres-mode=1` | 15239 | identical | | ||
| 55 | + | ||
| 56 | +The flag is a no-op on this aomenc build. The gate is therefore named | ||
| 57 | +`a_444_lossy_256x128_stream_decodes_pixel_exact` — for its geometry — and the | ||
| 58 | +doc comment says so explicitly, so the next lane does not re-derive a superres | ||
| 59 | +claim from the sweep's table. | ||
| 60 | + | ||
| 61 | +## 3. The three gates | ||
| 62 | + | ||
| 63 | +All three share two helpers in the same file: `encode_444_lossy_live` (ffmpeg | ||
| 64 | +y4m → live aomenc, `run_with_stdin` deadline, non-empty-OBU assert) and | ||
| 65 | +`gate_444_lossy_live_exact` (the body). Modelled on | ||
| 66 | +`a_444_lossy_rect4_inter_stream_decodes_pixel_exact` (stream.rs:7240), with | ||
| 67 | +three deliberate differences: | ||
| 68 | + | ||
| 69 | +1. **No pin.** The stream is encoded live against the oracle aomenc, because | ||
| 70 | + the claim is a property of the decoder at a geometry, not of a blob. The | ||
| 71 | + sweep's byte counts live in the doc comment as the recipe's provenance. | ||
| 72 | +2. **The pixel compare cannot be skipped.** The old gate guards it with | ||
| 73 | + `if aomdec_path().is_file()`; these three assert. If aomenc resolved but | ||
| 74 | + no aomdec sits beside it, the gate FAILS rather than reporting green for a | ||
| 75 | + decoder it never looked at (class `gate-blind-to-the-arm`). It still SKIPs | ||
| 76 | + when there is no oracle at all, which `have_aomenc()` turns into a hard | ||
| 77 | + failure under `EC_AV1_REQUIRE_AOMENC=1` — the crate's existing convention. | ||
| 78 | +3. **Per-cell geometry, asserted before the compare.** Frame count 4, and per | ||
| 79 | + frame `(f.width, f.height) == (W, H)` plus `f.u.len() == f.v.len() == | ||
| 80 | + f.y.len() == W*H`. At 4:4:4 a decoder keeping a subsampled extent would | ||
| 81 | + hand quarter-size planes to the byte compare; the gate says which invariant | ||
| 82 | + broke instead of letting the compare stand in for the shape claim. | ||
| 83 | + | ||
| 84 | +Non-vacuity, per cell: `decode::rect4_inter_own_chroma444_hits() > 0` after a | ||
| 85 | +reset — the 4:4:4-only own-chroma-extent route in `decode_inter_block`'s | ||
| 86 | +`around_c` that this class is about. A 4:2:0 stream of the same content reads | ||
| 87 | +0. Measured **13 / 12 / 24** own-extent gathers at 66x66 / 130x122 / 256x128. | ||
| 88 | + | ||
| 89 | +## 4. Green (this tree, oracle aomenc + aomdec present) | ||
| 90 | + | ||
| 91 | +``` | ||
| 92 | +$ ec_av1 a_444_lossy_odd_66x66_stream_decodes_pixel_exact --nocapture | ||
| 93 | +a_444_lossy_odd_66x66_stream_decodes_pixel_exact: 66x66 4:4:4 lossy, 4 decode-order frame(s) | ||
| 94 | + byte-exact vs aomdec (0 hidden), 13 own-extent 1:4 chroma gather(s) | ||
| 95 | +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 714 filtered out | ||
| 96 | + | ||
| 97 | +$ ec_av1 a_444_lossy_odd_130x122_stream_decodes_pixel_exact --nocapture | ||
| 98 | +a_444_lossy_odd_130x122_stream_decodes_pixel_exact: 130x122 4:4:4 lossy, 4 decode-order frame(s) | ||
| 99 | + byte-exact vs aomdec (0 hidden), 12 own-extent 1:4 chroma gather(s) | ||
| 100 | +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 714 filtered out | ||
| 101 | + | ||
| 102 | +$ ec_av1 a_444_lossy_256x128_stream_decodes_pixel_exact --nocapture | ||
| 103 | +a_444_lossy_256x128_stream_decodes_pixel_exact: 256x128 4:4:4 lossy, 4 decode-order frame(s) | ||
| 104 | + byte-exact vs aomdec (0 hidden), 24 own-extent 1:4 chroma gather(s) | ||
| 105 | +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 714 filtered out | ||
| 106 | +``` | ||
| 107 | + | ||
| 108 | +Untouched-and-still-green, same binary: | ||
| 109 | + | ||
| 110 | +``` | ||
| 111 | +$ ec_av1 a_444_lossy_rect4_inter --test-threads=1 → ok | ||
| 112 | +$ ec_av1 unrefreshed_primary_ref_slot --test-threads=1 → ok (the stream.rs source-scan guard) | ||
| 113 | +``` | ||
| 114 | + | ||
| 115 | +## 5. Red-before, measured (both mutations reverted, neither committed) | ||
| 116 | + | ||
| 117 | +### 5.1 `decode.rs` `around_c` own-extent arm → the 4:2:0 pair extent | ||
| 118 | + | ||
| 119 | +`Some(_) if ss_x(fctx) == 0 => { hit!(…); around }` replaced with the pair | ||
| 120 | +gather `neighbours.around_mi_rect(s.pair_mi, pw, ph)` at `(16,8)` HORZ / | ||
| 121 | +`(8,16)` VERT. The `hit!` stayed, so the reach assert still fires and the red | ||
| 122 | +lands on the pixel arm rather than the counter — the lesson from | ||
| 123 | +skill://ec-av1-pipeline-gate-counters. | ||
| 124 | + | ||
| 125 | +| gate | result | | ||
| 126 | +|---|---| | ||
| 127 | +| 66x66 | **green** — expected, see 5.3 | | ||
| 128 | +| 130x122 | **RED**: decode-order frame 3 of 4, byte 2208 (ours 134 vs oracle 170), **11521 bytes differ** | | ||
| 129 | +| 256x128 | **RED**: decode-order frame 2 of 4, byte 192 (ours 92 vs oracle 106), **25296 bytes differ** | | ||
| 130 | + | ||
| 131 | +The 130x122 number is the sweep's, to the byte: sweep §6.2 said "DIVERGENT | ||
| 132 | +from f3, 11521 samples, first (f3, s2208) = Y(128,16)". The 256x128 numbers are | ||
| 133 | +`av1444rect` §8's base row ("DIVERGENT f2 25296"). | ||
| 134 | + | ||
| 135 | +### 5.2 `ec-av1-syntax` `compute_image_size` — the mi-grid ceil floored | ||
| 136 | + | ||
| 137 | +`h.mi_cols = 2 * ((h.frame_width + 7) >> 3)` → | ||
| 138 | +`2 * (h.frame_width >> 3)` (and the row line likewise). | ||
| 139 | + | ||
| 140 | +| gate | result | | ||
| 141 | +|---|---| | ||
| 142 | +| 66x66 | **RED**: `restoration.rs:783` — "range end index 4098 out of range for slice of length 4096" | | ||
| 143 | +| 130x122 | **RED**: decode-order frame 0 of 4, byte 128 (ours 74 vs oracle 170), 22724 bytes differ | | ||
| 144 | +| 256x128 | **green**, correctly — 256x128 is a multiple of 8 in both axes, so the ceil and the floor agree and the cell is not supposed to see this mutation | | ||
| 145 | + | ||
| 146 | +### 5.3 What 66x66 is, stated honestly | ||
| 147 | + | ||
| 148 | +`odd444_66x66` is a **coverage pin, not a witness for the strip fix**. The | ||
| 149 | +sweep measured it EXACT 4/4 on the *pre-fix* base, so mutation 5.1 cannot | ||
| 150 | +make it red and no mutation of the strip route ever will. Its | ||
| 151 | +load-bearingness is mutation 5.2: it is the only gate here whose geometry is | ||
| 152 | +partial in **both** axes, and dropping the mode-info grid's ceil breaks it on | ||
| 153 | +the first decode. 130x122 and 256x128 are witnesses for the 4:4:4 lossy | ||
| 154 | +strip-own-extent class; 66x66 is the pin for the odd-in-both-axes 4:4:4 lossy | ||
| 155 | +walk. Both roles are load-bearing and neither is invented. | ||
| 156 | + | ||
| 157 | +## 6. Invariants held | ||
| 158 | + | ||
| 159 | +- `crates/ec-av1/src/decode.rs`: not edited in the committed tree. | ||
| 160 | +- Existing gates: not edited — the commit is 225 insertions, 0 deletions, one | ||
| 161 | + file. | ||
| 162 | +- Same test binary: `crates/ec-av1/src/stream.rs`, `pub(crate) mod tests`. | ||
| 163 | +- No new `#[ignore]`. | ||
| 164 | +- Commit message carries the mechanism and the measurements, no host paths. | ||
| 165 | + | ||
| 166 | +## 7. Not done, stated | ||
| 167 | + | ||
| 168 | +- The three gates encode on every run, so each costs one ffmpeg + one aomenc | ||
| 169 | + (~0.6 s measured, all three together). If a future lane finds that too | ||
| 170 | + expensive for a loop run, the pin migration is mechanical: the byte counts | ||
| 171 | + and sha256 prefixes are in §2. | ||
| 172 | +- Only 8-bit lossy cq-20 is covered. 4:4:4 lossy at 10/12 bits and the tile | ||
| 173 | + cells stay the sweep's open list; nothing here narrows that gap. | ||