Lane-intertx charter -- inter tx-type search on film
Browse files at this commit8921cb1bc7c53319d274c378cbe1f696373aed2eParent: 8fbaba4- docs
- lane-intertx charter -- inter tx-type search on film
1 changed file +104 -0
- lanes/intertx.charter.md +104 -0
lanes/intertx.charter.mdadded+104 -0
| @@ -0,0 +1,104 @@ | ||
| 1 | +# lane-intertx — inter tx-type search on film (TX_TYPE_SEARCH_INTER past screen-only) | |
| 2 | + | |
| 3 | +GOAL: the inter tx-type search (`inter_tx_type_search`, encode.rs ~L450) | |
| 4 | +runs only on screen content at the preset lever | |
| 5 | +(`crate::speed::TX_TYPE_SEARCH_INTER` → `InterTxSearch::Screen`). | |
| 6 | +`EC_AV1_TXSET_INTER=all` exists but has never been measured on film, and | |
| 7 | +the `inter_luma_set` doc (encode.rs ~L475) records a deferred CHROMA | |
| 8 | +inheritance desync: (a) `FrameCtx::reduced_tx_set_inter` never set while | |
| 9 | +`recode_inter_chroma` reduces against the reduced allowance, and (b) | |
| 10 | +`tile::write_block_planes` codes every chroma plane `DCT_DCT`, so an | |
| 11 | +inherited 1-D luma type desyncs chroma. This lane makes inter tx-type | |
| 12 | +search correct and measured on film, then ships or parks by the keep | |
| 13 | +rule. | |
| 14 | + | |
| 15 | +Work ONLY in this worktree (`lane-intertx`, | |
| 16 | +`/home/user/Documents/Code/Rust/edith_codecs-intertx`). Absolute paths | |
| 17 | +only. Never touch main's checkout or the rectres worktree, never push, | |
| 18 | +never `git checkout <file>`, never repo-wide `cargo fmt` (rustfmt only | |
| 19 | +files you edited). Local builds: `export | |
| 20 | +CARGO_TARGET_DIR=$HOME/.cache/cargo-target-intertx`. Local logs under | |
| 21 | +`~/.cache/intertx/`. Media files read-only. Pins 8291 / 33227. Keep | |
| 22 | +rule: one film row ≥0.5 BD down on a column, the other flat within | |
| 23 | +±0.3, screen not worse by 0.3, wall ≤+15%. BD-rate, lower better. | |
| 24 | + | |
| 25 | +## 1. Correctness first (witnesses BEFORE any BD gate) | |
| 26 | + | |
| 27 | +- Determine whether the chroma inheritance desync is LIVE when the | |
| 28 | + search offers non-`DCT_DCT` types on inter blocks: build a witness in | |
| 29 | + the standing pattern (process-global `set_inter_tx_search` override + | |
| 30 | + `crate::speed::knob_write`, like the existing inter-tx witness) on | |
| 31 | + NON-screen content where the search picks a 1-D type, decoded | |
| 32 | + sample-exact through ffmpeg AND `decode_stream` (all planes — the | |
| 33 | + desync is chroma). If it desyncs: fix (a) and (b) — the decoder's | |
| 34 | + `decode::reduce_inherited_chroma_tx_type` is the spec behavior; the | |
| 35 | + encoder must set `reduced_tx_set_inter` honestly and code chroma with | |
| 36 | + the inherited reduced type, not unconditional `DCT_DCT`. | |
| 37 | +- Witness must assert the search actually WON a non-`DCT_DCT` inter | |
| 38 | + type (a `coded > 0`-style counter guard — class | |
| 39 | + `gate-blind-to-feature`), on a frame the detector calls non-screen. | |
| 40 | + | |
| 41 | +## 2. Measure (control = Screen, arm = All) | |
| 42 | + | |
| 43 | +Both on the SAME server (see §3), same HEAD: | |
| 44 | + | |
| 45 | +- `encode::tests::bd_rate_film_long_gop` (deciding, both films): | |
| 46 | + control = default; arm = `EC_AV1_TXSET_INTER=all`. | |
| 47 | +- `encode::tests::bd_rate_screen_native` (all five rows), control and | |
| 48 | + arm. The screen row must not regress (arm should equal control there | |
| 49 | + — screen already searches; if it moves, find out why). | |
| 50 | +- Census: non-`DCT_DCT` inter tx-type picks per clip (search won / | |
| 51 | + coded), printed per run; report per-frame rates like lane-b128res §4. | |
| 52 | + | |
| 53 | +Keep rule met → make the lever `All` at the presets where it measured | |
| 54 | +(a speed.rs preset-table change), pins at default and `EC_AV1_SPEED=6`, | |
| 55 | +three-lane lib suite LOCALLY (`--skip stream::` / `stream:: --skip | |
| 56 | +10bit` / `10bit`), `timeout 900 cargo check --workspace --all-targets | |
| 57 | +-j4` (0 ec-av1 warnings). Not met → leave `Screen`, document. | |
| 58 | + | |
| 59 | +## 3. Gates run on server-1 (the box stays free for lane-rectres) | |
| 60 | + | |
| 61 | +server-1 = `user@host-e` (Fedora 44, 4 vCPU, 7G RAM, rust 1.98.1, | |
| 62 | +ffmpeg with libaom-av1+librav1e). Provisioned layout: | |
| 63 | +`/home/user/gates/library/fixtures/` (bars fixtures + rewritten | |
| 64 | +real-library-manifest.tsv), `/home/user/gates/library/Films/ | |
| 65 | +filmA-gate.mkv` + `filmB-gate.mkv` (windowed substitutes, sha256-verified | |
| 66 | +pixel-identical to the originals at the pinned seeks — 48 frames each), | |
| 67 | +`/home/user/gates/library/OBS/…mkv` (screen row), | |
| 68 | +`/home/user/gates/bin/ffmpeg` (shim that rewrites the pinned `-ss` | |
| 69 | +values onto the windows; all other invocations exec `/usr/bin/ffmpeg` | |
| 70 | +untouched). | |
| 71 | + | |
| 72 | +Gate recipe per run (control and arm alike): | |
| 73 | + | |
| 74 | +``` | |
| 75 | +rsync -a --delete --exclude /fixtures/ --exclude /target/ \ | |
| 76 | + --exclude /.git/ \ | |
| 77 | + /home/user/Documents/Code/Rust/edith_codecs-intertx/ \ | |
| 78 | + user@host-e:/home/user/gates/repo-intertx/ | |
| 79 | +ssh -o BatchMode=yes user@host-e 'ln -sfn \ | |
| 80 | + /home/user/gates/library/fixtures \ | |
| 81 | + /home/user/gates/repo-intertx/fixtures' | |
| 82 | +ssh -o BatchMode=yes user@host-e 'cat /proc/loadavg; cd | |
| 83 | + /home/user/gates/repo-intertx && PATH=/home/user/gates/bin:$PATH \ | |
| 84 | + CARGO_TARGET_DIR=/home/user/gates/target-intertx \ | |
| 85 | + [EC_AV1_TXSET_INTER=all] \ | |
| 86 | + systemd-run --user -p MemoryMax=5G --wait --unit=intertx-<name> \ | |
| 87 | + --pipe cargo test -p ec-av1 --release --lib -- --ignored --exact \ | |
| 88 | + --nocapture encode::tests::bd_rate_film_long_gop; cat /proc/loadavg' \ | |
| 89 | + | tee ~/.cache/intertx/<name>.log | |
| 90 | +``` | |
| 91 | + | |
| 92 | +If `systemd-run --user` is unavailable on the server (no user session | |
| 93 | +bus), run bare and note it. First run compiles (~15 min on 4 vCPU) — | |
| 94 | +that is normal. ONE gate at a time on the server. LOADAVG before AND | |
| 95 | +after, recorded. `--ignored --exact` is load-bearing (the tests are | |
| 96 | +`#[ignore]`). TMPDIR never on any cargo line. | |
| 97 | + | |
| 98 | +## DONE | |
| 99 | + | |
| 100 | +Commits on `lane-intertx` + `lanes/intertx.report.md` with EVIDENCE | |
| 101 | +lines (`EVIDENCE: <artifact> | <steps> | <measurement>`), witness | |
| 102 | +results, BD tables control vs arm on both gates, tx-type census, wall | |
| 103 | +deltas, LOADAVG pairs, pins line, disposition `ships-on | stays-off | | |
| 104 | +stopped`. Never merge or push. |