Repository navigation
tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow - #59
Merged
Conversation
…, and a proxy that can be slow Three checklist items were unanswerable for three different reasons, and none of them was a defect in the app. **#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo could only answer it as "pieces are covered": every pipeline fixture was 1080p except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264 existed in neither pack — which is a fact about the maintainer's library (every 4K item there is HEVC or AV1) rather than about the player. Six new generated clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160 x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the raster and nothing else. Each of the eight cells now grades `expect.video_size`, an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480 from 720x576 and a matrix answered with "at least 1900 wide" is the answer the item is asking us to stop giving. Four decisions in the matrix look arbitrary and are argued where they live (`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture would grade PAR handling, an axis with no assertion behind it anywhere here); CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture, already device-verified; and E-AC-3 down the HEVC column, which is also the better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce "AC3". **#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos` plays a deliberately short 20 s clip to its end and asserts `EOS reached ... -> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered because every stop tears the engine down — the harness's own close included — and searched forward from the EOS rather than compared against the first teardown in the log, because `teardown` writes the same line for a `for_reload` stop, which would fail the case for its whole cap with the evidence reading "the player froze on the last frame". This is the only case in either tier that is SUPPOSED to run out, so it gets its own fixture that nothing else may name (everything else is sized so it cannot hit EOF mid-window, trap 9's second half), and `_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing as a frozen player. The SECOND half — starting the same content again — is NOT closed, and it is an app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS `finish_playback` -> `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. The manifest case carries a `_replay_note` naming the small app-side change that would close it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever `route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay half untested. **#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps -> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link was anecdote. One token bucket for the whole proxy, because `rate:` names a link and a link is shared; decimal kilobits, because that is the unit the item states its legs in; empty at the start, because a full bucket hands the first quarter-second a free burst and that is most of a short transfer; live under an open connection, so one scripted run covers all four legs instead of four launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000, 17500 -> 17518. Two pre-existing bugs surfaced in the code it touches, both fixed: * **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which discards it — so `stall@/:/timeline` really froze every open connection including the media stream, i.e. the exact opposite of what the scope exists for. Both docs claimed the working behaviour. `relay` now takes the connection's own first bytes. * **The read poll's socket timeout was also the other direction's WRITE timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)` set the timeout on the other thread's `dst`; `sendall` on a timed-out socket raises having written an unspecified number of bytes, the `except OSError` swallowed it, and the stream truncated silently — reachable in exactly the situation the proxy exists to measure. The poll moved to `select` and both sockets are put back to blocking before relaying. `--selftest` proves the shaper against a loopback transfer with no television in the room, in its own temp control file so it cannot release the mode under a live experiment. **What this costs and what it does not prove.** The pipeline pack goes from ~0.4 to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution is a property of the media, so a matrix cell cannot be a second case on an existing file. Everything here is generated, so what none of it reaches is a PMS DECISION on any of these shapes — `library_gaps` says so per entry. While correcting those entries: `8-bit-hevc` was ALREADY covered by `pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not caught up; only `4k-h264` is newly closed. Host-verified only — this lane has no television. `make check` is green (976 Rust + 47 harness tests, the harness suite now including the netcond shaper against real loopback sockets), every fixture verifies under `make_fixtures.py`'s own ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail for each new clip. The device run is the integrator's; the recipe is in the PR. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
…ases It is 19 as of this branch, and the number in that sentence was going to rot again — the same way the host test count in CLAUDE.md rotted three times — so it now points at `./tests/run.py --list` instead of restating a census. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
`doc-claim-auditor` over the branch. All five are contradictions, not omissions. **The one that matters, because it is the skill whose whole subject is this error.** `which-tier` opens by warning against "reading a bare `./tests/run.py` as the suite it used to be" — and its pasteable `sh` block still said **12 synthetic cases**. Worse, 8ede10e fixed the identical number in that file's PROSE two paragraphs above and left the two copies in the code block, i.e. the half a reader copies. The file contradicted itself inside one commit. Both counts are gone; the block now points at `--list`, which it already named two lines down, and says why a second copy of the number does not survive here. **`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.** Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while `manifest.json`, rewritten in the same commit, says 4K H.264 is closed by `pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4` landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes off to author media that already exists. Both cut, with what a generated clip still cannot close said plainly: a PMS DECISION on such an item. Same sentence, pre-existing and one word: it named **`plxnative-url`** as the trigger these are fed through. `tests/README.md` says the opposite and is right — `plxnative-playurl` is the one carrying the DECLARATION, and several remaining gaps (HLG, HDR10+) are *about* what the payload declares. **Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for it. The new shape's comment cited "trap 9's second half" as the rule it breaks; trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still said the only length constraint left was "do not hit EOF". Both now carry both bounds, and say that adding a second short clip means picking a side. **`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures carrying two cases each, and it was four of twelve on `main` too — a count that was wrong before the denominator moved. Replaced with the property (a seek case beside its play case; an audio-lane pair), which is true at any number. **`docs/lg-self-checklist.md` was dated the day before its own newest content** — "Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the line now says to bump it in the same edit as any row, since it is the only sentence in that file nothing else restates. Rejected and recorded so the next run does not re-derive them: the Makefile's "~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit "measure before budgeting", subprocess count unchanged); `README.md:176`'s "two gitignored files", false since 072a60e and not this branch's; and four notes recording the 6974 ms reporter-join measurement taken while netcond's scope was broken — they assert the park and the mechanism, not that the media stream kept flowing, so none is contradicted. Two more (`async-model-decision.md:399`, `ui/library.rs:171`) described scoping as working per-request and were FALSE until this branch fixed `relay`; they are true again. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
The replay half of LG App Self Checklist #46 was the one thing my last PR could not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic tier's only entry into the player is `plxnative-playurl`, read behind a one-shot `auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback` → `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. Everything else was already in place, which is why the change is small: `teardown` clears the URL and the `ended` flag on a real stop, and `engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is empty. So a replay is a second trip through the entry the boot already used. **A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards the `autoplay`+`playidx` arm, which does a `request_play_movie` + `load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog item on every player exit and loop a REAL playback forever. `/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file appearing mid-run can turn it into a loop), gated on `playurl` being armed, and declines when `finish_playback` handed off to Up Next instead — an auto-advance chain returns to the player, and that is exactly what the route check tells apart. An absent file is 0, so every existing boot is byte-identical. `dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`, so a release build has no replay arm at all; both feature sets type-check. `replay_budget` is split out and host-tested for `note_global_press`'s reason one step removed: the call site is inside the SDL event loop where no host test can reach, and this half touches no SDL. It matters more than it looks, because every value it can return is plausible and a misparse is invisible on the panel — 0 reads as "the replay arm is missing from this binary" and 2 reads as a loop. **The two hazards in the lanes that landed in this file since I last read it are both safe by construction, and I checked rather than assumed.** b6's unconsumed-press invariant lives in `note_global_press`, and this change is nowhere near key dispatch — it adds no press path and no global side effect. b7's recorder cannot write a bogus record for a synthetic playback either: `coldstart_place` answers `Route::Player` from `metadata::playing()`, which is installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed session has no playing item and records nothing — before this change or after it. A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh never fires between the two viewings. **The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and starts it again. `expect.replays` is one statement, not two: the harness writes it into the trigger AND `a_replayed` counts it, so the number the app is told cannot drift from the number that is graded. Three signals, each worthless alone — the `replay:` line exactly N times (counted, because more often than asked is a loop and a loop satisfies everything else); at least N+1 `load:` lines, since `start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a second line is what says the declaration was really re-read; and a media position that FALLS and then climbs, which is the only thing separating a restart from a session that carried on. `server_opens_min: 2` is the wire-side half no log line can give: the second viewing has to fetch the clip again. `_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a `--secs`-regenerated pack skips this case instead of failing it as a missing feature. `pipe_finish_eos` stays separate and grades the finish alone: "never ends" and "ends and cannot be restarted" are different failures, and one case would report either as the other. **Two prose corrections this branch's netcond findings force, both about the same sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes the progress reporter while video keeps streaming, which is what makes a clean experiment possible" — as a working feature. It was FALSE for as long as it existed, because `relay` took a scope-less `Mode.split`; it became true on 2026-08-23. Said so at the sentence rather than three sentences later. And the **6974 ms** measurement cited beside it was taken under that broken instrument, so the proxy was stalling every connection and not only the reporter's. **The number and the conclusion both survive, and the mechanism is worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline 6974ms` — `task::join` emits one NAMED line per join, so the attribution came from the instrument and not from inferring a total — and `timeline` is the only join that COULD have parked whatever else was stalled, because `engine::teardown` step 1 deliberately wakes the other two before joining them (`http_shutdown` on the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no such wake. Before and after were taken the same way, so the 14x is apples-to-apples. What CANNOT be claimed from that session is that video kept streaming while the reporter was frozen — a property of the tool today, not of that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of which carried the number. Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51 harness tests — and `--no-default-features` type-checks. No television: the device run is the integrator's. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
GLinnik21
force-pushed
the
b10-fixtures
branch
from
August 23, 2026 11:04
d70eea2 to
4e972f7
Compare
…and says so `stream_case`'s soundness note names exactly two ABSENCE checks that early exit cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed` is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines, because more than N is a loop), and an equality can pass at N and fail at N+1. What it cannot see, stated rather than left to be discovered: an app replaying forever fires its next `replay:` line only after another full viewing — ~20 s on the short clip — while the case satisfies everything else at ~28 s, so an early exit two seconds later stops before the evidence arrives. Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on every suite run to guard three lines whose bound is ALREADY gradeable by `make check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s parsing has host tests. `--no-early` is how to go looking for a loop deliberately, and the trade is worth re-taking only if that app-side bound moves. Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed as untested", which stopped being true one commit ago. It now points at the case. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
… three notes it made false `/code-review` on the replay work, five findings, all mine, all fixed. **The one that mattered: `a_replayed` was a false PASS in the ordering the field will actually produce.** It measured the post-drop climb from the GLOBAL floor — and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and PASSED with the second viewing having produced one sample and zero seconds of playback — defeating near-miss (e) in its own docstring, "restarted and then stalled at the join". Worse than a corner: the harness exits the moment every assertion passes, so that is the state it would NORMALLY have graded. My own near-miss test passed only because its series starts at 2 rather than 0 — exactly the accident a regression test is for, and there is now one carrying the counterexample verbatim. The climb is anchored at the index of the deepest DROP, which the loop computing `drop` already had in hand. Four more, each a sentence this branch itself made false: * `a_finished`'s docstring still said the replay half "is unreachable from this tier today and it is an app gap, not a test gap … exactly one playback per boot and no key path back into the player" — contradicted by the `a_replayed` fifty lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all added in the same change. It now points at them and says why the two cases stay apart. * `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to reach EOF and the only one allowed to name that fixture. Two cases do both now. The rule was never "one case" anyway — it is "a case graded through a teardown has to have declared `reaches_eos`", which is what the unit test was deliberately loosened to, so the prose was the last thing still asserting the old form. * `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23". The manifest holds 20. **That count rotted inside the branch that wrote it, one commit after that same branch corrected the previous stale copy of it.** Both are now the pointer to `--list` rather than a fourth number waiting to go stale. * `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like every other temp use in that file. Verified: no new directories after a run. `make check` green — 1069 Rust, 52 harness. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
…, and a proxy that can be slow (#59) * tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow Three checklist items were unanswerable for three different reasons, and none of them was a defect in the app. **#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo could only answer it as "pieces are covered": every pipeline fixture was 1080p except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264 existed in neither pack — which is a fact about the maintainer's library (every 4K item there is HEVC or AV1) rather than about the player. Six new generated clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160 x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the raster and nothing else. Each of the eight cells now grades `expect.video_size`, an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480 from 720x576 and a matrix answered with "at least 1900 wide" is the answer the item is asking us to stop giving. Four decisions in the matrix look arbitrary and are argued where they live (`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture would grade PAR handling, an axis with no assertion behind it anywhere here); CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture, already device-verified; and E-AC-3 down the HEVC column, which is also the better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce "AC3". **#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos` plays a deliberately short 20 s clip to its end and asserts `EOS reached ... -> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered because every stop tears the engine down — the harness's own close included — and searched forward from the EOS rather than compared against the first teardown in the log, because `teardown` writes the same line for a `for_reload` stop, which would fail the case for its whole cap with the evidence reading "the player froze on the last frame". This is the only case in either tier that is SUPPOSED to run out, so it gets its own fixture that nothing else may name (everything else is sized so it cannot hit EOF mid-window, trap 9's second half), and `_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing as a frozen player. The SECOND half — starting the same content again — is NOT closed, and it is an app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS `finish_playback` -> `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. The manifest case carries a `_replay_note` naming the small app-side change that would close it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever `route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay half untested. **#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps -> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link was anecdote. One token bucket for the whole proxy, because `rate:` names a link and a link is shared; decimal kilobits, because that is the unit the item states its legs in; empty at the start, because a full bucket hands the first quarter-second a free burst and that is most of a short transfer; live under an open connection, so one scripted run covers all four legs instead of four launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000, 17500 -> 17518. Two pre-existing bugs surfaced in the code it touches, both fixed: * **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which discards it — so `stall@/:/timeline` really froze every open connection including the media stream, i.e. the exact opposite of what the scope exists for. Both docs claimed the working behaviour. `relay` now takes the connection's own first bytes. * **The read poll's socket timeout was also the other direction's WRITE timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)` set the timeout on the other thread's `dst`; `sendall` on a timed-out socket raises having written an unspecified number of bytes, the `except OSError` swallowed it, and the stream truncated silently — reachable in exactly the situation the proxy exists to measure. The poll moved to `select` and both sockets are put back to blocking before relaying. `--selftest` proves the shaper against a loopback transfer with no television in the room, in its own temp control file so it cannot release the mode under a live experiment. **What this costs and what it does not prove.** The pipeline pack goes from ~0.4 to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution is a property of the media, so a matrix cell cannot be a second case on an existing file. Everything here is generated, so what none of it reaches is a PMS DECISION on any of these shapes — `library_gaps` says so per entry. While correcting those entries: `8-bit-hevc` was ALREADY covered by `pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not caught up; only `4k-h264` is newly closed. Host-verified only — this lane has no television. `make check` is green (976 Rust + 47 harness tests, the harness suite now including the netcond shaper against real loopback sockets), every fixture verifies under `make_fixtures.py`'s own ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail for each new clip. The device run is the integrator's; the recipe is in the PR. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: the which-tier skill still said the synthetic tier was twelve cases It is 19 as of this branch, and the number in that sentence was going to rot again — the same way the host test count in CLAUDE.md rotted three times — so it now points at `./tests/run.py --list` instead of restating a census. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: five sentences this branch made false, one of them mine twice over `doc-claim-auditor` over the branch. All five are contradictions, not omissions. **The one that matters, because it is the skill whose whole subject is this error.** `which-tier` opens by warning against "reading a bare `./tests/run.py` as the suite it used to be" — and its pasteable `sh` block still said **12 synthetic cases**. Worse, 8ede10e fixed the identical number in that file's PROSE two paragraphs above and left the two copies in the code block, i.e. the half a reader copies. The file contradicted itself inside one commit. Both counts are gone; the block now points at `--list`, which it already named two lines down, and says why a second copy of the number does not survive here. **`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.** Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while `manifest.json`, rewritten in the same commit, says 4K H.264 is closed by `pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4` landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes off to author media that already exists. Both cut, with what a generated clip still cannot close said plainly: a PMS DECISION on such an item. Same sentence, pre-existing and one word: it named **`plxnative-url`** as the trigger these are fed through. `tests/README.md` says the opposite and is right — `plxnative-playurl` is the one carrying the DECLARATION, and several remaining gaps (HLG, HDR10+) are *about* what the payload declares. **Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for it. The new shape's comment cited "trap 9's second half" as the rule it breaks; trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still said the only length constraint left was "do not hit EOF". Both now carry both bounds, and say that adding a second short clip means picking a side. **`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures carrying two cases each, and it was four of twelve on `main` too — a count that was wrong before the denominator moved. Replaced with the property (a seek case beside its play case; an audio-lane pair), which is true at any number. **`docs/lg-self-checklist.md` was dated the day before its own newest content** — "Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the line now says to bump it in the same edit as any row, since it is the only sentence in that file nothing else restates. Rejected and recorded so the next run does not re-derive them: the Makefile's "~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit "measure before budgeting", subprocess count unchanged); `README.md:176`'s "two gitignored files", false since b6b9bdb and not this branch's; and four notes recording the 6974 ms reporter-join measurement taken while netcond's scope was broken — they assert the park and the mechanism, not that the media stream kept flowing, so none is contradicted. Two more (`async-model-decision.md:399`, `ui/library.rs:171`) described scoping as working per-request and were FALSE until this branch fixed `relay`; they are true again. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * player: a finished stream can be started again, and #46 gets both halves The replay half of LG App Self Checklist #46 was the one thing my last PR could not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic tier's only entry into the player is `plxnative-playurl`, read behind a one-shot `auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback` → `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. Everything else was already in place, which is why the change is small: `teardown` clears the URL and the `ended` flag on a real stop, and `engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is empty. So a replay is a second trip through the entry the boot already used. **A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards the `autoplay`+`playidx` arm, which does a `request_play_movie` + `load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog item on every player exit and loop a REAL playback forever. `/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file appearing mid-run can turn it into a loop), gated on `playurl` being armed, and declines when `finish_playback` handed off to Up Next instead — an auto-advance chain returns to the player, and that is exactly what the route check tells apart. An absent file is 0, so every existing boot is byte-identical. `dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`, so a release build has no replay arm at all; both feature sets type-check. `replay_budget` is split out and host-tested for `note_global_press`'s reason one step removed: the call site is inside the SDL event loop where no host test can reach, and this half touches no SDL. It matters more than it looks, because every value it can return is plausible and a misparse is invisible on the panel — 0 reads as "the replay arm is missing from this binary" and 2 reads as a loop. **The two hazards in the lanes that landed in this file since I last read it are both safe by construction, and I checked rather than assumed.** b6's unconsumed-press invariant lives in `note_global_press`, and this change is nowhere near key dispatch — it adds no press path and no global side effect. b7's recorder cannot write a bogus record for a synthetic playback either: `coldstart_place` answers `Route::Player` from `metadata::playing()`, which is installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed session has no playing item and records nothing — before this change or after it. A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh never fires between the two viewings. **The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and starts it again. `expect.replays` is one statement, not two: the harness writes it into the trigger AND `a_replayed` counts it, so the number the app is told cannot drift from the number that is graded. Three signals, each worthless alone — the `replay:` line exactly N times (counted, because more often than asked is a loop and a loop satisfies everything else); at least N+1 `load:` lines, since `start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a second line is what says the declaration was really re-read; and a media position that FALLS and then climbs, which is the only thing separating a restart from a session that carried on. `server_opens_min: 2` is the wire-side half no log line can give: the second viewing has to fetch the clip again. `_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a `--secs`-regenerated pack skips this case instead of failing it as a missing feature. `pipe_finish_eos` stays separate and grades the finish alone: "never ends" and "ends and cannot be restarted" are different failures, and one case would report either as the other. **Two prose corrections this branch's netcond findings force, both about the same sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes the progress reporter while video keeps streaming, which is what makes a clean experiment possible" — as a working feature. It was FALSE for as long as it existed, because `relay` took a scope-less `Mode.split`; it became true on 2026-08-23. Said so at the sentence rather than three sentences later. And the **6974 ms** measurement cited beside it was taken under that broken instrument, so the proxy was stalling every connection and not only the reporter's. **The number and the conclusion both survive, and the mechanism is worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline 6974ms` — `task::join` emits one NAMED line per join, so the attribution came from the instrument and not from inferring a total — and `timeline` is the only join that COULD have parked whatever else was stalled, because `engine::teardown` step 1 deliberately wakes the other two before joining them (`http_shutdown` on the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no such wake. Before and after were taken the same way, so the 14x is apples-to-apples. What CANNOT be claimed from that session is that video kept streaming while the reporter was frozen — a property of the tool today, not of that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of which carried the number. Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51 harness tests — and `--no-default-features` type-checks. No television: the device run is the integrator's. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: the replay count is a third exception to the early-exit rule, and says so `stream_case`'s soundness note names exactly two ABSENCE checks that early exit cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed` is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines, because more than N is a loop), and an equality can pass at N and fail at N+1. What it cannot see, stated rather than left to be discovered: an app replaying forever fires its next `replay:` line only after another full viewing — ~20 s on the short clip — while the case satisfies everything else at ~28 s, so an early exit two seconds later stops before the evidence arrives. Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on every suite run to guard three lines whose bound is ALREADY gradeable by `make check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s parsing has host tests. `--no-early` is how to go looking for a loop deliberately, and the trade is worth re-taking only if that app-side bound moves. Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed as untested", which stopped being true one commit ago. It now points at the case. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: the replay assertion passed on a replay that never played, and three notes it made false `/code-review` on the replay work, five findings, all mine, all fixed. **The one that mattered: `a_replayed` was a false PASS in the ordering the field will actually produce.** It measured the post-drop climb from the GLOBAL floor — and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and PASSED with the second viewing having produced one sample and zero seconds of playback — defeating near-miss (e) in its own docstring, "restarted and then stalled at the join". Worse than a corner: the harness exits the moment every assertion passes, so that is the state it would NORMALLY have graded. My own near-miss test passed only because its series starts at 2 rather than 0 — exactly the accident a regression test is for, and there is now one carrying the counterexample verbatim. The climb is anchored at the index of the deepest DROP, which the loop computing `drop` already had in hand. Four more, each a sentence this branch itself made false: * `a_finished`'s docstring still said the replay half "is unreachable from this tier today and it is an app gap, not a test gap … exactly one playback per boot and no key path back into the player" — contradicted by the `a_replayed` fifty lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all added in the same change. It now points at them and says why the two cases stay apart. * `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to reach EOF and the only one allowed to name that fixture. Two cases do both now. The rule was never "one case" anyway — it is "a case graded through a teardown has to have declared `reaches_eos`", which is what the unit test was deliberately loosened to, so the prose was the last thing still asserting the old form. * `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23". The manifest holds 20. **That count rotted inside the branch that wrote it, one commit after that same branch corrected the previous stale copy of it.** Both are now the pointer to `--list` rather than a fourth number waiting to go stale. * `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like every other temp use in that file. Verified: no new directories after a run. `make check` green — 1069 Rust, 52 harness. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 27, 2026
…, and a proxy that can be slow (#59) * tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow Three checklist items were unanswerable for three different reasons, and none of them was a defect in the app. **#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo could only answer it as "pieces are covered": every pipeline fixture was 1080p except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264 existed in neither pack — which is a fact about the maintainer's library (every 4K item there is HEVC or AV1) rather than about the player. Six new generated clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160 x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the raster and nothing else. Each of the eight cells now grades `expect.video_size`, an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480 from 720x576 and a matrix answered with "at least 1900 wide" is the answer the item is asking us to stop giving. Four decisions in the matrix look arbitrary and are argued where they live (`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture would grade PAR handling, an axis with no assertion behind it anywhere here); CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture, already device-verified; and E-AC-3 down the HEVC column, which is also the better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce "AC3". **#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos` plays a deliberately short 20 s clip to its end and asserts `EOS reached ... -> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered because every stop tears the engine down — the harness's own close included — and searched forward from the EOS rather than compared against the first teardown in the log, because `teardown` writes the same line for a `for_reload` stop, which would fail the case for its whole cap with the evidence reading "the player froze on the last frame". This is the only case in either tier that is SUPPOSED to run out, so it gets its own fixture that nothing else may name (everything else is sized so it cannot hit EOF mid-window, trap 9's second half), and `_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing as a frozen player. The SECOND half — starting the same content again — is NOT closed, and it is an app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS `finish_playback` -> `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. The manifest case carries a `_replay_note` naming the small app-side change that would close it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever `route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay half untested. **#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps -> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link was anecdote. One token bucket for the whole proxy, because `rate:` names a link and a link is shared; decimal kilobits, because that is the unit the item states its legs in; empty at the start, because a full bucket hands the first quarter-second a free burst and that is most of a short transfer; live under an open connection, so one scripted run covers all four legs instead of four launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000, 17500 -> 17518. Two pre-existing bugs surfaced in the code it touches, both fixed: * **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which discards it — so `stall@/:/timeline` really froze every open connection including the media stream, i.e. the exact opposite of what the scope exists for. Both docs claimed the working behaviour. `relay` now takes the connection's own first bytes. * **The read poll's socket timeout was also the other direction's WRITE timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)` set the timeout on the other thread's `dst`; `sendall` on a timed-out socket raises having written an unspecified number of bytes, the `except OSError` swallowed it, and the stream truncated silently — reachable in exactly the situation the proxy exists to measure. The poll moved to `select` and both sockets are put back to blocking before relaying. `--selftest` proves the shaper against a loopback transfer with no television in the room, in its own temp control file so it cannot release the mode under a live experiment. **What this costs and what it does not prove.** The pipeline pack goes from ~0.4 to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution is a property of the media, so a matrix cell cannot be a second case on an existing file. Everything here is generated, so what none of it reaches is a PMS DECISION on any of these shapes — `library_gaps` says so per entry. While correcting those entries: `8-bit-hevc` was ALREADY covered by `pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not caught up; only `4k-h264` is newly closed. Host-verified only — this lane has no television. `make check` is green (976 Rust + 47 harness tests, the harness suite now including the netcond shaper against real loopback sockets), every fixture verifies under `make_fixtures.py`'s own ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail for each new clip. The device run is the integrator's; the recipe is in the PR. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: the which-tier skill still said the synthetic tier was twelve cases It is 19 as of this branch, and the number in that sentence was going to rot again — the same way the host test count in CLAUDE.md rotted three times — so it now points at `./tests/run.py --list` instead of restating a census. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: five sentences this branch made false, one of them mine twice over `doc-claim-auditor` over the branch. All five are contradictions, not omissions. **The one that matters, because it is the skill whose whole subject is this error.** `which-tier` opens by warning against "reading a bare `./tests/run.py` as the suite it used to be" — and its pasteable `sh` block still said **12 synthetic cases**. Worse, 8ede10e fixed the identical number in that file's PROSE two paragraphs above and left the two copies in the code block, i.e. the half a reader copies. The file contradicted itself inside one commit. Both counts are gone; the block now points at `--list`, which it already named two lines down, and says why a second copy of the number does not survive here. **`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.** Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while `manifest.json`, rewritten in the same commit, says 4K H.264 is closed by `pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4` landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes off to author media that already exists. Both cut, with what a generated clip still cannot close said plainly: a PMS DECISION on such an item. Same sentence, pre-existing and one word: it named **`plxnative-url`** as the trigger these are fed through. `tests/README.md` says the opposite and is right — `plxnative-playurl` is the one carrying the DECLARATION, and several remaining gaps (HLG, HDR10+) are *about* what the payload declares. **Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for it. The new shape's comment cited "trap 9's second half" as the rule it breaks; trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still said the only length constraint left was "do not hit EOF". Both now carry both bounds, and say that adding a second short clip means picking a side. **`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures carrying two cases each, and it was four of twelve on `main` too — a count that was wrong before the denominator moved. Replaced with the property (a seek case beside its play case; an audio-lane pair), which is true at any number. **`docs/lg-self-checklist.md` was dated the day before its own newest content** — "Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the line now says to bump it in the same edit as any row, since it is the only sentence in that file nothing else restates. Rejected and recorded so the next run does not re-derive them: the Makefile's "~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit "measure before budgeting", subprocess count unchanged); `README.md:176`'s "two gitignored files", false since 4f69d32 and not this branch's; and four notes recording the 6974 ms reporter-join measurement taken while netcond's scope was broken — they assert the park and the mechanism, not that the media stream kept flowing, so none is contradicted. Two more (`async-model-decision.md:399`, `ui/library.rs:171`) described scoping as working per-request and were FALSE until this branch fixed `relay`; they are true again. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * player: a finished stream can be started again, and #46 gets both halves The replay half of LG App Self Checklist #46 was the one thing my last PR could not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic tier's only entry into the player is `plxnative-playurl`, read behind a one-shot `auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback` → `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. Everything else was already in place, which is why the change is small: `teardown` clears the URL and the `ended` flag on a real stop, and `engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is empty. So a replay is a second trip through the entry the boot already used. **A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards the `autoplay`+`playidx` arm, which does a `request_play_movie` + `load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog item on every player exit and loop a REAL playback forever. `/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file appearing mid-run can turn it into a loop), gated on `playurl` being armed, and declines when `finish_playback` handed off to Up Next instead — an auto-advance chain returns to the player, and that is exactly what the route check tells apart. An absent file is 0, so every existing boot is byte-identical. `dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`, so a release build has no replay arm at all; both feature sets type-check. `replay_budget` is split out and host-tested for `note_global_press`'s reason one step removed: the call site is inside the SDL event loop where no host test can reach, and this half touches no SDL. It matters more than it looks, because every value it can return is plausible and a misparse is invisible on the panel — 0 reads as "the replay arm is missing from this binary" and 2 reads as a loop. **The two hazards in the lanes that landed in this file since I last read it are both safe by construction, and I checked rather than assumed.** b6's unconsumed-press invariant lives in `note_global_press`, and this change is nowhere near key dispatch — it adds no press path and no global side effect. b7's recorder cannot write a bogus record for a synthetic playback either: `coldstart_place` answers `Route::Player` from `metadata::playing()`, which is installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed session has no playing item and records nothing — before this change or after it. A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh never fires between the two viewings. **The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and starts it again. `expect.replays` is one statement, not two: the harness writes it into the trigger AND `a_replayed` counts it, so the number the app is told cannot drift from the number that is graded. Three signals, each worthless alone — the `replay:` line exactly N times (counted, because more often than asked is a loop and a loop satisfies everything else); at least N+1 `load:` lines, since `start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a second line is what says the declaration was really re-read; and a media position that FALLS and then climbs, which is the only thing separating a restart from a session that carried on. `server_opens_min: 2` is the wire-side half no log line can give: the second viewing has to fetch the clip again. `_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a `--secs`-regenerated pack skips this case instead of failing it as a missing feature. `pipe_finish_eos` stays separate and grades the finish alone: "never ends" and "ends and cannot be restarted" are different failures, and one case would report either as the other. **Two prose corrections this branch's netcond findings force, both about the same sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes the progress reporter while video keeps streaming, which is what makes a clean experiment possible" — as a working feature. It was FALSE for as long as it existed, because `relay` took a scope-less `Mode.split`; it became true on 2026-08-23. Said so at the sentence rather than three sentences later. And the **6974 ms** measurement cited beside it was taken under that broken instrument, so the proxy was stalling every connection and not only the reporter's. **The number and the conclusion both survive, and the mechanism is worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline 6974ms` — `task::join` emits one NAMED line per join, so the attribution came from the instrument and not from inferring a total — and `timeline` is the only join that COULD have parked whatever else was stalled, because `engine::teardown` step 1 deliberately wakes the other two before joining them (`http_shutdown` on the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no such wake. Before and after were taken the same way, so the 14x is apples-to-apples. What CANNOT be claimed from that session is that video kept streaming while the reporter was frozen — a property of the tool today, not of that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of which carried the number. Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51 harness tests — and `--no-default-features` type-checks. No television: the device run is the integrator's. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: the replay count is a third exception to the early-exit rule, and says so `stream_case`'s soundness note names exactly two ABSENCE checks that early exit cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed` is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines, because more than N is a loop), and an equality can pass at N and fail at N+1. What it cannot see, stated rather than left to be discovered: an app replaying forever fires its next `replay:` line only after another full viewing — ~20 s on the short clip — while the case satisfies everything else at ~28 s, so an early exit two seconds later stops before the evidence arrives. Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on every suite run to guard three lines whose bound is ALREADY gradeable by `make check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s parsing has host tests. `--no-early` is how to go looking for a loop deliberately, and the trade is worth re-taking only if that app-side bound moves. Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed as untested", which stopped being true one commit ago. It now points at the case. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: the replay assertion passed on a replay that never played, and three notes it made false `/code-review` on the replay work, five findings, all mine, all fixed. **The one that mattered: `a_replayed` was a false PASS in the ordering the field will actually produce.** It measured the post-drop climb from the GLOBAL floor — and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and PASSED with the second viewing having produced one sample and zero seconds of playback — defeating near-miss (e) in its own docstring, "restarted and then stalled at the join". Worse than a corner: the harness exits the moment every assertion passes, so that is the state it would NORMALLY have graded. My own near-miss test passed only because its series starts at 2 rather than 0 — exactly the accident a regression test is for, and there is now one carrying the counterexample verbatim. The climb is anchored at the index of the deepest DROP, which the loop computing `drop` already had in hand. Four more, each a sentence this branch itself made false: * `a_finished`'s docstring still said the replay half "is unreachable from this tier today and it is an app gap, not a test gap … exactly one playback per boot and no key path back into the player" — contradicted by the `a_replayed` fifty lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all added in the same change. It now points at them and says why the two cases stay apart. * `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to reach EOF and the only one allowed to name that fixture. Two cases do both now. The rule was never "one case" anyway — it is "a case graded through a teardown has to have declared `reaches_eos`", which is what the unit test was deliberately loosened to, so the prose was the last thing still asserting the old form. * `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23". The manifest holds 20. **That count rotted inside the branch that wrote it, one commit after that same branch corrected the previous stale copy of it.** Both are now the pointer to `--list` rather than a fourth number waiting to go stale. * `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like every other temp use in that file. Verified: no new directories after a run. `make check` green — 1069 Rust, 52 harness. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 28, 2026
…, and a proxy that can be slow (#59) * tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow Three checklist items were unanswerable for three different reasons, and none of them was a defect in the app. **#50/#51 — resolution x codec.** The item is graded as a MATRIX and this repo could only answer it as "pieces are covered": every pipeline fixture was 1080p except one 4K HEVC, so SD and HD had never been played AT ALL, and 4K H.264 existed in neither pack — which is a fact about the maintainer's library (every 4K item there is HEVC or AV1) rather than about the player. Six new generated clips complete the grid: SD 720x480 / HD 1280x720 / FHD 1920x1080 / UHD 3840x2160 x {h264, hevc}, with ONE audio codec per column so a row-to-row difference is the raster and nothing else. Each of the eight cells now grades `expect.video_size`, an EXACT WxH out of the `ff:` line, because `min_video_width` cannot tell 720x480 from 720x576 and a matrix answered with "at least 1900 wide" is the answer the item is asking us to stop giving. Four decisions in the matrix look arbitrary and are argued where they live (`PIPE_SHAPES`' block comment): square pixels at 720x480 (an anamorphic fixture would grade PAR handling, an axis with no assertion behind it anywhere here); CRF held constant is constant QUALITY, not bitrate, so 4K H.264 is crf 26 and not its 1080p sibling's 20 — the same CRF measures ~30 Mbit/s up there, a quarter-gigabyte clip in service of no assertion; SDR 8-bit throughout, which makes the UHD/HEVC cell the odd one out because it is the existing HDR10 fixture, already device-verified; and E-AC-3 down the HEVC column, which is also the better false-PASS defence, since `engine`'s `_ =>` arm can only ever produce "AC3". **#46 — replay after completion.** Its FIRST half now runs: `pipe_finish_eos` plays a deliberately short 20 s clip to its end and asserts `EOS reached ... -> ended` followed by `stop_bufferfeed: torn down`, in that order. Ordered because every stop tears the engine down — the harness's own close included — and searched forward from the EOS rather than compared against the first teardown in the log, because `teardown` writes the same line for a `for_reload` stop, which would fail the case for its whole cap with the evidence reading "the player froze on the last frame". This is the only case in either tier that is SUPPOSED to run out, so it gets its own fixture that nothing else may name (everything else is sized so it cannot hit EOF mid-window, trap 9's second half), and `_resolve_fixtures` grew the opposite duration bound: it SKIPS when the clip is longer than 0.6x the cap, so a `--secs`-regenerated pack skips rather than failing as a frozen player. The SECOND half — starting the same content again — is NOT closed, and it is an app gap rather than a test gap. `plxnative-playurl` is read behind `app.rs`'s one-shot `auto_tried` latch, so a boot gets exactly one playback; on EOS `finish_playback` -> `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. The manifest case carries a `_replay_note` naming the small app-side change that would close it (`engine::start_bufferfeed` already re-reads `dev::playurl()` whenever `route::url()` is empty), and `docs/lg-self-checklist.md` still marks the replay half untested. **#43 CASE1 and #14 — `tools/netcond.py` gains `rate:<kbps>`.** The proxy could make the server dead in four ways and slow in none, so CASE1's own legs (512 Kbps -> 1 Mbps -> 7 Mbps -> 17.5 Mbps) could not be PRODUCED and #14's degrading link was anecdote. One token bucket for the whole proxy, because `rate:` names a link and a link is shared; decimal kilobits, because that is the unit the item states its legs in; empty at the start, because a full bucket hands the first quarter-second a free burst and that is most of a short transfer; live under an open connection, so one scripted run covers all four legs instead of four launches. Measured through the real proxy: 512 -> 496 kbps, 2000 -> 2000, 17500 -> 17518. Two pre-existing bugs surfaced in the code it touches, both fixed: * **The mode SCOPE was honoured only at accept.** `serve_conn` consulted the scope-aware `applies()` and then handed `relay` a bare `Mode.split`, which discards it — so `stall@/:/timeline` really froze every open connection including the media stream, i.e. the exact opposite of what the scope exists for. Both docs claimed the working behaviour. `relay` now takes the connection's own first bytes. * **The read poll's socket timeout was also the other direction's WRITE timeout.** Both relay threads share one pair of sockets, so `src.settimeout(0.5)` set the timeout on the other thread's `dst`; `sendall` on a timed-out socket raises having written an unspecified number of bytes, the `except OSError` swallowed it, and the stream truncated silently — reachable in exactly the situation the proxy exists to measure. The poll moved to `select` and both sockets are put back to blocking before relaying. `--selftest` proves the shaper against a loopback transfer with no television in the room, in its own temp control file so it cannot release the mode under a live experiment. **What this costs and what it does not prove.** The pipeline pack goes from ~0.4 to ~0.7 GB (the 4K H.264 clip is 93 MB of that) and from 8 clips to 15; resolution is a property of the media, so a matrix cell cannot be a second case on an existing file. Everything here is generated, so what none of it reaches is a PMS DECISION on any of these shapes — `library_gaps` says so per entry. While correcting those entries: `8-bit-hevc` was ALREADY covered by `pipe_hevc_aac_mp4` (no `hdr` key, so Main / yuv420p) and the gap list had not caught up; only `4k-h264` is newly closed. Host-verified only — this lane has no television. `make check` is green (976 Rust + 47 harness tests, the harness suite now including the netcond shaper against real loopback sockets), every fixture verifies under `make_fixtures.py`'s own ffprobe checks, and `serve_fixtures.py` answers 206/416 with a byte-exact tail for each new clip. The device run is the integrator's; the recipe is in the PR. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: the which-tier skill still said the synthetic tier was twelve cases It is 19 as of this branch, and the number in that sentence was going to rot again — the same way the host test count in CLAUDE.md rotted three times — so it now points at `./tests/run.py --list` instead of restating a census. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * docs: five sentences this branch made false, one of them mine twice over `doc-claim-auditor` over the branch. All five are contradictions, not omissions. **The one that matters, because it is the skill whose whole subject is this error.** `which-tier` opens by warning against "reading a bare `./tests/run.py` as the suite it used to be" — and its pasteable `sh` block still said **12 synthetic cases**. Worse, 8ede10e fixed the identical number in that file's PROSE two paragraphs above and left the two copies in the code block, i.e. the half a reader copies. The file contradicted itself inside one commit. Both counts are gone; the block now points at `--list`, which it already named two lines down, and says why a second copy of the number does not survive here. **`tests/fixtures/README.md` listed two gaps as unbuilt that this script builds.** Its `library_gaps` summary still named `8-bit HEVC` and `4K H.264` — while `manifest.json`, rewritten in the same commit, says 4K H.264 is closed by `pipe_res_h264_uhd` and 8-bit HEVC has been covered since `pipe_hevc_aac_mp4` landed (no `hdr` key, so `-profile:v main` / yuv420p). A reader of that page goes off to author media that already exists. Both cut, with what a generated clip still cannot close said plainly: a PMS DECISION on such an item. Same sentence, pre-existing and one word: it named **`plxnative-url`** as the trigger these are fed through. `tests/README.md` says the opposite and is right — `plxnative-playurl` is the one carrying the DECLARATION, and several remaining gaps (HLG, HDR10+) are *about* what the payload declares. **Trap 9 was falsified by this branch's own fixture, 260 lines below it.** "Nothing is ever shorter than 60 s" is now false: `pipe_h264_ac3_short` is 20 s because ENDING is what it grades, and `_resolve_fixtures` enforces the opposite bound for it. The new shape's comment cited "trap 9's second half" as the rule it breaks; trap 9 itself was never told, and neither was `PIPE_SHAPES`' header, which still said the only length constraint left was "do not hit EOF". Both now carry both bounds, and say that adding a second short clip means picking a side. **`_probe_fixture`'s "three of the twelve" was never right.** It is four fixtures carrying two cases each, and it was four of twelve on `main` too — a count that was wrong before the denominator moved. Replaced with the property (a seek case beside its play case; an audio-lane pair), which is true at any number. **`docs/lg-self-checklist.md` was dated the day before its own newest content** — "Status taken 2026-08-22" above four entries that name 2026-08-23. Bumped, and the line now says to bump it in the same edit as any row, since it is the only sentence in that file nothing else restates. Rejected and recorded so the next run does not re-derive them: the Makefile's "~0.5s" harness-suite note (measured 1.22 s, hedged with a tilde AND an explicit "measure before budgeting", subprocess count unchanged); `README.md:176`'s "two gitignored files", false since 8a5ac95 and not this branch's; and four notes recording the 6974 ms reporter-join measurement taken while netcond's scope was broken — they assert the park and the mechanism, not that the media stream kept flowing, so none is contradicted. Two more (`async-model-decision.md:399`, `ui/library.rs:171`) described scoping as working per-request and were FALSE until this branch fixed `relay`; they are true again. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * player: a finished stream can be started again, and #46 gets both halves The replay half of LG App Self Checklist #46 was the one thing my last PR could not reach from `tests/`, and the reason was six lines in `app.rs`: the synthetic tier's only entry into the player is `plxnative-playurl`, read behind a one-shot `auto_tried` latch, so a boot got exactly one playback. On EOS `finish_playback` → `exit_player` leaves the player, and with no Plex session there is no detail page, no Play control and no key path back in. Everything else was already in place, which is why the change is small: `teardown` clears the URL and the `ended` flag on a real stop, and `engine::start_bufferfeed` re-reads `dev::playurl()` whenever `route::url()` is empty. So a replay is a second trip through the entry the boot already used. **A COUNTER re-arming the latch, not a lifted latch.** `auto_tried` also guards the `autoplay`+`playidx` arm, which does a `request_play_movie` + `load_detail_now` — an unconditionally re-armable latch would re-fetch a catalog item on every player exit and loop a REAL playback forever. `/tmp/plxnative-replay[=N]` is bounded, opt-in, read once at boot (so no file appearing mid-run can turn it into a loop), gated on `playurl` being armed, and declines when `finish_playback` handed off to Up Next instead — an auto-advance chain returns to the player, and that is exactly what the route check tells apart. An absent file is 0, so every existing boot is byte-identical. `dev::flag`/`dev::read` are `false`/`None` at COMPILE time without `devtriggers`, so a release build has no replay arm at all; both feature sets type-check. `replay_budget` is split out and host-tested for `note_global_press`'s reason one step removed: the call site is inside the SDL event loop where no host test can reach, and this half touches no SDL. It matters more than it looks, because every value it can return is plausible and a misparse is invisible on the panel — 0 reads as "the replay arm is missing from this binary" and 2 reads as a loop. **The two hazards in the lanes that landed in this file since I last read it are both safe by construction, and I checked rather than assumed.** b6's unconsumed-press invariant lives in `note_global_press`, and this change is nowhere near key dispatch — it adds no press path and no global side effect. b7's recorder cannot write a bogus record for a synthetic playback either: `coldstart_place` answers `Route::Player` from `metadata::playing()`, which is installed ONLY by `route::apply_plan` (the PMS decision path), so a URL-fed session has no playing item and records nothing — before this change or after it. A replay also re-enters on the next frame, so the 800 ms post-exit hub refresh never fires between the two viewings. **The case.** `pipe_replay_after_eos` plays the same 20 s clip, lets it end, and starts it again. `expect.replays` is one statement, not two: the harness writes it into the trigger AND `a_replayed` counts it, so the number the app is told cannot drift from the number that is graded. Three signals, each worthless alone — the `replay:` line exactly N times (counted, because more often than asked is a loop and a loop satisfies everything else); at least N+1 `load:` lines, since `start_bufferfeed` writes one per SESSION and `teardown` cleared the URL, so a second line is what says the declaration was really re-read; and a media position that FALLS and then climbs, which is the only thing separating a restart from a session that carried on. `server_opens_min: 2` is the wire-side half no log line can give: the second viewing has to fetch the clip again. `_resolve_fixtures`' EOS bound becomes per VIEWING (`dur * (1 + replays)`), so a `--secs`-regenerated pack skips this case instead of failing it as a missing feature. `pipe_finish_eos` stays separate and grades the finish alone: "never ends" and "ends and cannot be restarted" are different failures, and one case would report either as the other. **Two prose corrections this branch's netcond findings force, both about the same sentence.** The root `CLAUDE.md` describes scoping — "`stall@/:/timeline` freezes the progress reporter while video keeps streaming, which is what makes a clean experiment possible" — as a working feature. It was FALSE for as long as it existed, because `relay` took a scope-less `Mode.split`; it became true on 2026-08-23. Said so at the sentence rather than three sentences later. And the **6974 ms** measurement cited beside it was taken under that broken instrument, so the proxy was stalling every connection and not only the reporter's. **The number and the conclusion both survive, and the mechanism is worth recording rather than re-deriving:** it was logged as `THREADJOIN timeline 6974ms` — `task::join` emits one NAMED line per join, so the attribution came from the instrument and not from inferring a total — and `timeline` is the only join that COULD have parked whatever else was stalled, because `engine::teardown` step 1 deliberately wakes the other two before joining them (`http_shutdown` on the demux socket, `aq_abort` on both AU lanes) while the reporter's POST had no such wake. Before and after were taken the same way, so the 14x is apples-to-apples. What CANNOT be claimed from that session is that video kept streaming while the reporter was frozen — a property of the tool today, not of that run. Recorded in `CLAUDE.md`, `threads.rs` and `engine.rs`, all three of which carried the number. Host-verified: `make check` green — 1069 Rust tests (1066 on main + 3 new) and 51 harness tests — and `--no-default-features` type-checks. No television: the device run is the integrator's. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: the replay count is a third exception to the early-exit rule, and says so `stream_case`'s soundness note names exactly two ABSENCE checks that early exit cannot see, and asks that a third be REASONED ABOUT rather than added. `a_replayed` is a third of the same shape: it grades an EQUALITY (exactly N `replay:` lines, because more than N is a loop), and an equality can pass at N and fail at N+1. What it cannot see, stated rather than left to be discovered: an app replaying forever fires its next `replay:` line only after another full viewing — ~20 s on the short clip — while the case satisfies everything else at ~28 s, so an early exit two seconds later stops before the evidence arrives. Not closed by making this one case burn its whole 100 s cap. That is ~1.5 min on every suite run to guard three lines whose bound is ALREADY gradeable by `make check`: `replay_left` is decremented before each re-arm, and `replay_budget`'s parsing has host tests. `--no-early` is how to go looking for a loop deliberately, and the trade is worth re-taking only if that app-side bound moves. Also: `docs/ux-scenario.md`'s #46 row pointed at the checklist "where it is listed as untested", which stopped being true one commit ago. It now points at the case. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G * tests: the replay assertion passed on a replay that never played, and three notes it made false `/code-review` on the replay work, five findings, all mine, all fixed. **The one that mattered: `a_replayed` was a false PASS in the ordering the field will actually produce.** It measured the post-drop climb from the GLOBAL floor — and a floor is a VALUE, so it only lands in viewing 2 when viewing 2 happens to reach viewing 1's minimum. The `pos=` heartbeat is 1 Hz and free-running, so viewing 1 logging `pos=0s` while viewing 2's first sample lands at `pos=1s` puts the anchor back in viewing 1 and measures VIEWING 1'S OWN CLIMB. Reproduced against the real function: `[0,5,10,19,1]` read as "fell 18s then climbed 19s" and PASSED with the second viewing having produced one sample and zero seconds of playback — defeating near-miss (e) in its own docstring, "restarted and then stalled at the join". Worse than a corner: the harness exits the moment every assertion passes, so that is the state it would NORMALLY have graded. My own near-miss test passed only because its series starts at 2 rather than 0 — exactly the accident a regression test is for, and there is now one carrying the counterexample verbatim. The climb is anchored at the index of the deepest DROP, which the loop computing `drop` already had in hand. Four more, each a sentence this branch itself made false: * `a_finished`'s docstring still said the replay half "is unreachable from this tier today and it is an app gap, not a test gap … exactly one playback per boot and no key path back into the player" — contradicted by the `a_replayed` fifty lines below it, by `/tmp/plxnative-replay`, and by `pipe_replay_after_eos`, all added in the same change. It now points at them and says why the two cases stay apart. * `_eof_note`, `make_fixtures.py` trap 9, the `pipe_h264_ac3_short` shape comment and `tests/README.md` all said `pipe_finish_eos` was the ONLY case allowed to reach EOF and the only one allowed to name that fixture. Two cases do both now. The rule was never "one case" anyway — it is "a case graded through a teardown has to have declared `reaches_eos`", which is what the unit test was deliberately loosened to, so the prose was the last thing still asserting the old form. * `CLAUDE.md` and the `which-tier` skill both said "19 cases as of 2026-08-23". The manifest holds 20. **That count rotted inside the branch that wrote it, one commit after that same branch corrected the previous stale copy of it.** Both are now the pointer to `--list` rather than a fourth number waiting to go stale. * `NetcondRate.setUp` leaked a `mkdtemp` per test — six `/tmp` directories per `make check`, on the command run most often. `addCleanup(shutil.rmtree)`, like every other temp use in that file. Verified: no new directories after a run. `make check` green — 1069 Rust, 52 harness. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three LG App Self Checklist items were unanswerable, for three different reasons, and none of them
was a defect in the app. This makes them answerable. Host-verified only — this lane has no
television; the device run is the integrator's, and the recipe is at the bottom.
#50 / #51 — the resolution × codec matrix
The item is graded as a matrix, and this repo could only answer it as "pieces are covered":
every pipeline fixture was 1080p except one 4K HEVC, so SD and HD had never been played at all
and 4K H.264 existed in neither pack — which is a fact about the maintainer's library (every 4K
item there is HEVC or AV1) rather than about the player. Six new generated clips complete the grid:
pipe_res_h264_sd🆕pipe_res_hevc_sd🆕pipe_res_h264_hd🆕pipe_res_hevc_hd🆕pipe_h264_ac3_1080ppipe_res_hevc_fhd🆕pipe_res_h264_uhd🆕pipe_hevc_eac3_4k_hdr10All eight cells now grade a new
expect.video_size— an exactWxHout of theff:line'sAVCodecParameters— rather than amin_video_width, which cannot tell 720×480 from 720×576 andis precisely how a matrix ends up answered with "at least 1900 wide".
coverscarriesresolution-matrixon all eight, so grepping that tag finds the lot, and./tests/run.py --listprints resolution as its own column.
Four decisions in the matrix look arbitrary and are argued where they live (
PIPE_SHAPES' blockcomment):
each column's constant is the one the rung already in the table uses, so the two pre-existing
cells belong to the matrix rather than sitting beside it. E-AC-3 down the HEVC column is also the
better false-PASS defence:
engine's_ =>arm can only ever produce"AC3", so every HEVC rowexpects an
"AC3 PLUS"an unread declaration cannot reach.anamorphic fixture would grade PAR handling — a different axis, with no assertion behind it
anywhere in this repo.
bitrate: 4K H.264 at the 1080p rung's crf 20 measures ~30 Mbit/s, i.e. a quarter-gigabyte clip in
service of no assertion. crf 26 lands at ~11.8 Mbit/s, inside the band real 4K H.264 ships in.
HDR10 Main10 fixture, and the one already device-verified. HDR is a third axis; an SDR 4K HEVC
twin would differ only in
trc=/pri=, which nothing in the matrix grades. Written down ratherthan left for a reader to infer a uniform column that is not there.
Every rung is inside the device table's own bounds (H.264 to 4096×2304, HEVC to 4096×2176). The
4096-wide edge and any refusal above it stay uncovered — that would be grading a refusal path
nobody has specified.
ffprobe, on the finished files
pipe_h264_ac3_480p.mkv24/1= 24.000pipe_h264_ac3_720p.mkv24/1= 24.000pipe_h264_ac3_2160p.mkv24/1= 24.000pipe_hevc_eac3_480p.mkv24/1= 24.000pipe_hevc_eac3_720p.mkv24/1= 24.000pipe_hevc_eac3_1080p.mkv24/1= 24.000pipe_h264_ac3_short.mkv24/1= 24.000The frame rate is the rational
24/1on every one, not a decimal lavfi rounded — the trap thatmade
pipe_h264_1080p5994necessary.Highprofile confirms-preset veryfast(trap 6:ultrafastsilently forces Constrained Baseline) andyuv420pconfirms the explicitformat=(trap 7: lavfi is rgb24 and libx264 would pick yuv444p).
make_fixtures.py's ownverify()readall of this back and passed for all seven.
#46 — replay after completion (first half only, and the second half is an APP gap)
pipe_finish_eosplays a deliberately short 20 s clip to its end and assertsEOS reached … → endedfollowed bystop_bufferfeed: torn down, in that order. Orderedbecause every stop tears the engine down — the harness's own close included — and searched forward
from the EOS rather than compared against the first teardown in the log, because
teardownwritesthat same line for a
for_reloadstop; the comparison form would fail such a run for its whole capwith the evidence reading "the player froze on the last frame", i.e. the exact false regression
the assertion exists to avoid. (Caught by
/code-review, fixed, pinned by a test.)This is the only case in either tier that is supposed to run out, so it gets its own fixture
that nothing else may name — everything else is sized so it cannot hit EOF mid-window
(
make_fixtures.pytrap 9's second half)._resolve_fixturestherefore grew the opposite durationbound: it skips when the clip is longer than 0.6 × the cap, so a
--secs-regenerated pack skipsinstead of failing as a frozen player.
The second half — starting the same content again — is NOT closed, and it cannot be from this
lane's files.
plxnative-playurlis read behindapp.rs's one-shotauto_triedlatch, so a bootgets exactly one playback; on EOS
finish_playback→exit_playerleaves the player, and with noPlex session there is no detail page, no Play control and no key path back in. Nothing in
tests/,tools/or thefixtures-pipelinetarget can reach it — it needsrust-modules/src/app.rs, whichthis lane does not own.
The app-side change is small and
engine::start_bufferfeedis already most of the way there: itre-reads
dev::playurl()wheneverroute::url()is empty, so a re-armable entry (drop the latchwhile
playurlis armed and the route has left the player, or add aplxnative-replaytrigger) isall that is missing. The case then grows one assertion — a second
load:line and a second climbfrom ~0. Recorded in three places so it does not get lost: the case's own
_replay_notein themanifest,
tests/README.md§Playing to the END, anddocs/lg-self-checklist.md, which stillmarks #46's replay half untested.
#43 CASE1 / #14 —
tools/netcond.pygainsrate:<kbps>The proxy could make the server dead in four ways and slow in none, so CASE1's own legs could
not be produced and #14's degrading link was anecdote rather than measurement.
Four properties, each deliberate: one bucket for the whole proxy (a link is shared — the media
GET and a
/:/timelinePOST contending is what a real slow network does); decimal kilobits,because that is the unit the item states its legs in; live under an already-open connection, so
one scripted run covers all four legs instead of four launches; and the bucket starts empty,
because a full one hands the first quarter-second a free burst, which on short transfers is most of
the transfer and makes an absent throttle measure as a working one.
Measured through the real proxy (
tools/netcond.py --selftest): 512 → 496 kbps, 2000 → 2000,17500 → 17518.
Two pre-existing bugs surfaced in the code it touches, both fixed
serve_connconsulted the scope-awareapplies(), then handedrelaya bareMode.split— which throws the scope away. Sostall@/:/timelinereally froze every open connection, media stream included: the exactopposite of what the scope exists for, and of what both
CLAUDE.mdand the module docstringclaimed.
relaynow takes the connection's own first bytes. There is a test.threads share one pair of sockets, so
src.settimeout(0.5)set the timeout on the other thread'sdst.sendallon a timed-out socket raises having written an unspecified number of bytes, theexcept OSErrorswallowed it, and the stream truncated silently — reachable in exactly thesituation the proxy exists to measure (the app's
aqbackpressure parks the demux, the TV stopsreading, the window closes, a 64 KB write blocks past 0.5 s). The poll moved to
selectand bothsockets are put back to blocking before relaying.
--selftestproves the shaper against a loopback transfer with no television in the room, in itsown temp control file so it cannot release the mode under a live experiment. The macOS
application-firewall trap is now written into
netcond.py's own docstring (it was only inserve_fixtures.pyandCLAUDE.md): the "allow incoming connections?" prompt must be accepted onceper python binary, and until it is, the TV's connections are dropped with no refusal and no log
line — "netcond logs nothing" is that, not a quiet television.
Corrections to claims already in the tree
Per the fleet rule trust the file:
library_gaps.8-bit-hevcwas already stale and I nearly mis-credited it.pipe_hevc_aac_mp4carries no
hdrkey, somake_fixturespicks-profile:v main/yuv420p— 8-bit HEVC has beenplayed on this tier since that fixture landed. Only
4k-h264is newly closed. Both entries nowalso say what a generated clip cannot close: a PMS decision on such an item.
CLAUDE.md's netcond bullet and the scoping paragraph in the module docstring both describedscoping as working end to end. Corrected, with the date and the mechanism.
Cost, and what this does not prove
The pipeline pack goes ~0.4 GB → ~0.7 GB and 8 clips → 15 (the 4K H.264 one is 93 MB of
that); the synthetic tier goes 12 cases → 19. Resolution is a property of the media, so a matrix
cell cannot be a second case on an existing file — that is why this is disk rather than manifest.
make fixtures-pipelinegrew from ~1.5 min to ~4 min cold, and--only <shape>rebuilds one.Everything here is generated, so what none of it reaches is a PMS decision on any of these
shapes. It also still cannot prove that the declaration it feeds is the one a real item would
produce. Never ship on the default tier alone.
Verification done (host only)
The harness suite gained three classes —
ResolutionMatrix(all eight cells present, each gradingvideo_sizeexactly, no cell reusing another's fixture,a_codecrejecting the wrong raster),CompletionCase(a_finished's three near-misses, including the reload-teardown one, and thetoo-long-pack skip), and
NetcondRate(bucket arithmetic, a shaped loopback transfer, scoping,malformed-mode tolerance, live switching). The netcond tests drive real loopback sockets through the
real
serve_conn/relayrather than a private mini-proxy, cost 0.46 s, and every timing boundsits on the slow side of what it grades; they were stressed 40 runs 8-up with no failure (one
flake found that way and fixed: a fresh bucket accrues a few bytes of scheduling drift, so it is
graded against what a full bucket would grant, not against zero).
Also verified by hand:
already correcton a secondmake fixtures-pipeline(i.e.verify()reads every claimed property back out of the finished files).tests/serve_fixtures.pyanswers 206 with the rightContent-Length/Content-Rangeand abyte-exact tail for each new clip, and 416 past EOF — never a 200 with a
Range, which isthe silent corruption this tier's server exists to prevent.
./tests/run.py --listresolves all 19 cases against the 15 fixtures with no skips and no orphansin either direction.
Device run recipe (for the integrator)
Nothing below needs a Plex account, a token or
manifest.local.json— that is the point of thistier. It does need the television's lock.
Three things to watch on the first device run, all of them shapes I could not settle from the
host:
video_sizeis a new EXACT assertion, and the raster it reads isAVCodecParameters::width/height— the cropped dimensions, so 1080 should be 1080 and not thecoded 1088. If a cell fails with e.g.
codec=h264 1920x1088 (want h264 1920x1080), that is theassertion being too strict rather than a player bug; say so and we relax that cell to a range.
pipe_finish_eosruns its clip to EOF, which every other case is built to avoid. Itsno_playing_errorexpectation is the honest one, but nothing has ever graded this app througha teardown before, so if it fails on
no_errorrather than onfinished, read the lines afterEOS reachedbefore assuming a regression.pipe_res_h264_uhdis 4K H.264 at ~11.8 Mbit/s, a combination this app has demonstrablynever played. The device table claims H.264 to 4096×2304@60, so it should be inside the envelope;
if it is not, that is a real and interesting finding for browse: a source's reachability becomes a STATE (the contract two lanes will share) #50/stream: the transport learns to resolve, and to dial an address of either family #51 rather than a fixture problem.
For #43 CASE1 itself (not automated, and not claimed here): point the app at netcond by editing
PMS_PORTin the gitignoredsrc/config.local.h,make deploy, starttools/netcond.py --listen <port> --target 127.0.0.1:32400, begin playback, and walk/tmp/netcond.modethroughrate:512→rate:1000→rate:7000→rate:17500withoutrestarting anything — the mode applies to the open connection. Pick a port Plex is not already on
(it binds
127.0.0.1:32401itself and the more specific bind wins, silently bypassing the proxy).🤖 Generated with Claude Code
https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
Doc audit (added after the first push)
doc-claim-auditorover the branch found five sentences this change made false — allcontradictions, not omissions — fixed in
d70eea2e:.claude/skills/which-tier/SKILL.md's pasteableshblock still said "12 synthetic cases",two paragraphs below prose I had already corrected in
8ede10e5. The skill whose subject is"reading a bare
./tests/run.pyas the suite it used to be" contradicted itself inside onecommit, in the half a reader copies. Both counts removed; the block points at
--list.tests/fixtures/README.mdlisted8-bit HEVCand4K H.264as gaps this script does notbuild — it builds both now, and
manifest.jsonsaid so in the same commit. Also on that line,pre-existing: it named
plxnative-urlwhereplxnative-playurlis right, which is a dead endprecisely because the former carries no declaration.
branch's own 20 s clip; so was
PIPE_SHAPES' "the only length constraint left is do not hitEOF". Both now carry both bounds.
_probe_fixture's "three of the twelve" was wrong onmaintoo (four of twelve, now four ofnineteen). Replaced with the property rather than a fresh census.
docs/lg-self-checklist.mdwas dated the day before its own newest content.Rejected and recorded so a later run does not re-derive them: the Makefile's hedged "~0.5s" harness
note (1.22 s measured, same five subprocesses);
README.md:176, false since072a60e8and not thisbranch's; and the four notes citing the 6974 ms reporter-join measured while netcond's scope was
broken — they assert the park and the mechanism, not that the media stream kept flowing.
Symmetrically,
docs/async-model-decision.md:399andui/library.rs:171described per-requestscoping as working and were false until this branch fixed
relay; they are true again.Update — rebased onto
b6c7909b, and #46's replay half now landsRebased clean (three commits, no conflicts). Baseline re-taken on the new tip before writing
anything: 1066 Rust tests + 47 harness. After this work: 1069 + 51, both feature sets
type-check.
The app change — six lines, and why it is a counter rather than a lifted latch
plxnative-playurlis read behindapp.rs's one-shotauto_triedlatch, so a synthetic boot gotexactly one playback. Everything needed for a second one was already there —
teardownclears theURL and the
endedflag on a real stop, andengine::start_bufferfeedre-readsdev::playurl()whenever
route::url()is empty — so a replay is a second trip through the entry the boot used./tmp/plxnative-replay[=N]re-arms the latch N times, rather than the latch being lifted:auto_triedalso guards theautoplay+playidxarm, which does arequest_play_movie+load_detail_now, so an unconditionally re-armable latch would re-fetch a catalog item on everyplayer exit and loop a real playback forever. The counter is read once at boot (no file
appearing mid-run can make a loop), gated on
playurl, and declines whenfinish_playbackhandedoff to Up Next — an auto-advance chain returns to the player, which is exactly what the route
check tells apart. Absent file → 0 → every existing boot byte-identical. Compiled out with
devtriggers.replay_budgetis split out and host-tested, fornote_global_press's reason one step removed:the call site is inside the SDL event loop where no host test can reach, and this half touches no
SDL. Worth it because every value it returns is plausible and a misparse is invisible on the panel
— 0 reads as "the replay arm is missing from this binary", 2 reads as a loop.
The two hazards you flagged — checked, not assumed
note_global_press, which returns early for anunbound key. This change adds no key arm, no press path and no global side effect; it sits at the
EOS site and at a
letbeside the other boot latches.coldstart_placeanswersRoute::Playerfrommetadata::playing(), andinstall_playinghas exactly one caller —route::apply_plan, the PMSdecision path. A URL-fed session therefore has no playing item and records nothing, before
this change or after it. A replay also re-enters on the next frame, so the 800 ms post-exit hub
refresh never fires between viewings.
The case
pipe_replay_after_eos— same 20 s clip, played to its end, then started again.expect.replaysis one statement, not two: the harness writes it into the trigger and
a_replayedcounts it,so the number the app is told cannot drift from the number graded. Three signals, each worthless
alone:
replay:line exactly N timesload:linesteardowncleared the URL — so a second line is what proves the declaration was re-readplus
server_opens_min: 2— the wire-side half no log line can give: the second viewing must fetchthe clip again.
_resolve_fixtures' EOS bound is now per viewing (dur × (1 + replays)), so a--secs-regenerated pack skips this case rather than failing it as a missing feature.pipe_finish_eosstays separate: "never ends" and "ends and cannot be restarted" are differentfailures, and one case would report either as the other.
Still uncovered, deliberately: a user-driven replay (a Play control on a detail page is
server-tier by construction) and replay of a transcode (a server session a synthetic clip has
no equivalent for).
docs/lg-self-checklist.md#46 says both.Prose handover — the two shared-file items
1. The netcond scope claim in the root
CLAUDE.mdYou are right that it was false for as long as it existed. I have applied this on the branch
(the bullet was already in my diff), so it needs applying elsewhere only if a copy has diverged.
Exact wording — inserted immediately after "…which is what makes a clean experiment possible.":
2. The 6974 ms measurement — the number stands, the mechanism description does not
Verdict: the number and the conclusion both survive; what does not survive is the claim that the
experiment was clean. Three pieces of evidence, all in the tree:
THREADJOIN timeline 6974ms(engine.rs's own comment quotes that line), andtask::join(what, h)emits one named line per join. So even with everything stalled, the logsaid which of the three joins parked the main thread.
timelineis the only join that could have parked, whatever else was stalled.engine::teardownstep 1 deliberately wakes the other two before joining them —http_shutdownon the demux socket,aq_aborton both AU lanes — while the reporter's POST hadno such wake, because
stream's one-shot wrappers box their socket privately. That isstructural and independent of which connections the proxy froze.
apples-to-apples, and the fix (moving the join onto the scrobble worker) removes a blocking join
from the main thread regardless of the instrument.
What cannot be claimed from that session is the thing the scope sentence promises — that video
kept streaming while the reporter was frozen. If anything the teardown was worse than reported,
since demux/media were being starved too; the reporter join is simply the one that could not be
woken. Re-running it scoped, and seeing
demux/mediaat 0 besidetimeline, is a device jobnobody has done.
Exact wording — replacing the sentence that ends "…BACK→teardown is 0.5 s.", applied on the
branch in
CLAUDE.mdand, in shorter form, inplayer/threads.rsandplayer/engine.rs, all threeof which carried the number:
Device recipe — one addition
The synthetic tier is now 20 cases. The replay case alone:
tools/tv-lock.sh with --why "b10 #46 replay" -- ./tests/run.py --filter pipe_replay_after_eos --verboseA fourth thing to watch, beside the three already listed above:
pipe_replay_after_eosis theonly case that plays the same media twice in one boot, and its failure messages are written to tell
the two interesting outcomes apart — "the app never re-entered the player" means the binary
predates the replay arm (or the trigger was not written), whereas "the position never fell" means
the re-entry fired and the pipeline resumed instead of restarting. The second would be a real
finding.
Review round on the replay work — one real false PASS, four stale sentences
/code-review high, five findings, all mine, all fixed ina1e11315.The one that mattered:
a_replayedpassed on a replay that never playedIt measured the post-drop climb from the global floor — and a floor is a value, so it only
lands in viewing 2 when viewing 2 happens to reach viewing 1's minimum. The
pos=heartbeat is1 Hz and free-running, so viewing 1 logging
pos=0swhile viewing 2's first sample lands atpos=1sputs the anchor back in viewing 1 and measures viewing 1's own climb. Reproducedagainst the real function before fixing:
It passed with the second viewing having produced one sample and zero seconds of playback,
defeating near-miss (e) in its own docstring. And it is not a corner: the harness exits the moment
every assertion passes, so that is the state it would normally have graded. My own near-miss test
passed only because its series starts at 2 rather than 0 — precisely the accident a regression test
is for, and there is now one carrying the counterexample verbatim.
The climb is now anchored at the index of the deepest drop, which the loop computing
dropalready had in hand. Same input after the fix:
Four sentences this branch itself made false
a_finished's docstring still said the replay half "is unreachable from this tier today and it isan app gap, not a test gap" — contradicted by
a_replayedfifty lines below it, added in the samechange.
_eof_note,make_fixtures.pytrap 9, thepipe_h264_ac3_shortshape comment andtests/README.mdall saidpipe_finish_eoswas the only case allowed to reach EOF and namethat fixture. Two do now — and the rule was never "one case", it is "a case graded through a
teardown must have declared
reaches_eos", which is what the unit test was loosened to. The prosewas the last thing asserting the old form.
CLAUDE.mdand thewhich-tierskill both said "19 cases". The manifest holds 20. That countrotted inside the branch that wrote it, one commit after the same branch corrected the previous
stale copy of it. Both now point at
--listrather than becoming a fourth number waiting to gostale.
NetcondRate.setUpleaked amkdtempper test — six/tmpdirs permake check, on the commandrun most often.
addCleanup(shutil.rmtree); verified no new directories after a run.The reviewer separately vouched for the
replay_left/auto_triedordering,reset_sessionclearing
ended,replay_budget, the per-viewing EOS bound, the early-exit soundness note, and allthree netcond changes (scope, single refund,
select-over-settimeout) — I have not re-verifiedthose.
Final state:
make checkgreen — 1069 Rust, 52 harness. Synthetic tier is 20 cases.