Skip to content

tests: the resolution matrix LG asks for, a clip that is meant to end, and a proxy that can be slow - #59

Merged
GLinnik21 merged 6 commits into
mainfrom
b10-fixtures
Aug 23, 2026
Merged

GLinnik21 merged 6 commits into
mainfrom
b10-fixtures

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Aug 23, 2026 •

Copy link
Copy Markdown
Collaborator

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:

h264 / AC-3 5.1 mkv hevc / E-AC-3 5.1 mkv
SD 720×480 pipe_res_h264_sd 🆕 pipe_res_hevc_sd 🆕
HD 1280×720 pipe_res_h264_hd 🆕 pipe_res_hevc_hd 🆕
FHD 1920×1080 pipe_h264_ac3_1080p pipe_res_hevc_fhd 🆕
UHD 3840×2160 pipe_res_h264_uhd 🆕 pipe_hevc_eac3_4k_hdr10

All eight cells now grade a new expect.video_size — an exact WxH out of the ff: line's
AVCodecParameters — rather than a min_video_width, which cannot tell 720×480 from 720×576 and
is precisely how a matrix ends up answered with "at least 1900 wide". covers carries
resolution-matrix on all eight, so grepping that tag finds the lot, and ./tests/run.py --list
prints resolution as its own column.

Four decisions in the matrix look arbitrary and are argued where they live (PIPE_SHAPES' block
comment):

  • One audio codec per column, so a row-to-row difference is the raster and nothing else — and
    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 row
    expects an "AC3 PLUS" an unread declaration cannot reach.
  • Square pixels at 720×480, so the picture is 3:2 rather than the 4:3 a DVD displays. An
    anamorphic fixture would grade PAR handling — a different axis, with no assertion behind it
    anywhere in this repo.
  • CRF is not the axis and is not held constant. A constant CRF is constant quality, not
    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.
  • SDR 8-bit throughout, which makes the UHD/HEVC cell the odd one out — it is the existing
    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 rather
    than 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

fixture container video resolution frame rate (exact) pix_fmt audio dur size
pipe_h264_ac3_480p.mkv matroska h264 High 720x480 24/1 = 24.000 yuv420p ac3 6ch 60.0s 13.6 MB
pipe_h264_ac3_720p.mkv matroska h264 High 1280x720 24/1 = 24.000 yuv420p ac3 6ch 60.0s 28.7 MB
pipe_h264_ac3_2160p.mkv matroska h264 High 3840x2160 24/1 = 24.000 yuv420p ac3 6ch 60.0s 92.7 MB
pipe_hevc_eac3_480p.mkv matroska hevc Main 720x480 24/1 = 24.000 yuv420p eac3 6ch 60.0s 10.9 MB
pipe_hevc_eac3_720p.mkv matroska hevc Main 1280x720 24/1 = 24.000 yuv420p eac3 6ch 60.0s 19.3 MB
pipe_hevc_eac3_1080p.mkv matroska hevc Main 1920x1080 24/1 = 24.000 yuv420p eac3 6ch 60.0s 37.5 MB
pipe_h264_ac3_short.mkv matroska h264 High 720x480 24/1 = 24.000 yuv420p ac3 6ch 20.0s 4.5 MB

The frame rate is the rational 24/1 on every one, not a decimal lavfi rounded — the trap that
made pipe_h264_1080p5994 necessary. High profile confirms -preset veryfast (trap 6:
ultrafast silently forces Constrained Baseline) and yuv420p confirms the explicit format=
(trap 7: lavfi is rgb24 and libx264 would pick yuv444p). make_fixtures.py's own verify() read
all 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_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
that same line for a for_reload stop; the comparison form would fail such a run for its whole cap
with 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.py trap 9's second half). _resolve_fixtures therefore grew the opposite duration
bound: it skips when the clip is longer than 0.6 × the cap, so a --secs-regenerated pack skips
instead 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-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. Nothing in tests/,
tools/ or the fixtures-pipeline target can reach it — it needs rust-modules/src/app.rs, which
this lane does not own.

The app-side change is small and engine::start_bufferfeed is already most of the way there: it
re-reads dev::playurl() whenever route::url() is empty, so a re-armable entry (drop the latch
while playurl is armed and the route has left the player, or add a plxnative-replay trigger) is
all that is missing. The case then grows one assertion — a second load: line and a second climb
from ~0. Recorded in three places so it does not get lost: the case's own _replay_note in the
manifest, tests/README.md §Playing to the END, and docs/lg-self-checklist.md, which still
marks #46's replay half untested.

#43 CASE1 / #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 could
not be produced and #14's degrading link was anecdote rather than measurement.

echo rate:512   > /tmp/netcond.mode      # 512 Kbps  — CASE1 leg 1
echo rate:1000  > /tmp/netcond.mode      # 1 Mbps    — leg 2
echo rate:7000  > /tmp/netcond.mode      # 7 Mbps    — leg 3
echo rate:17500 > /tmp/netcond.mode      # 17.5 Mbps — leg 4
echo 'rate:512@/library/parts' > /tmp/netcond.mode   # only the media stream
echo pass       > /tmp/netcond.mode      # off

Four properties, each deliberate: one bucket for the whole proxy (a link is shared — the media
GET and a /:/timeline POST 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

  1. The mode SCOPE was honoured only at accept. serve_conn consulted the scope-aware
    applies(), then handed relay a bare Mode.split — which throws the scope away. So
    stall@/:/timeline really froze every open connection, media stream included: the exact
    opposite of what the scope exists for, and of what both CLAUDE.md and the module docstring
    claimed. relay now takes the connection's own first bytes. There is a test.
  2. 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 app's aq backpressure parks the demux, the TV stops
    reading, the window closes, a 64 KB write blocks past 0.5 s). 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. The macOS
application-firewall trap is now written into netcond.py's own docstring
(it was only in
serve_fixtures.py and CLAUDE.md): the "allow incoming connections?" prompt must be accepted once
per 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-hevc was already stale and I nearly mis-credited it. pipe_hevc_aac_mp4
    carries no hdr key, so make_fixtures picks -profile:v main / yuv420p — 8-bit HEVC has been
    played on this tier since that fixture landed. Only 4k-h264 is newly closed. Both entries now
    also 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 described
    scoping 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-pipeline grew 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)

make check                            # 976 Rust tests + flavour selftest + 47 harness tests, green
python3 tests/test_harness.py         # 47 tests, 1.1 s
python3 tools/netcond.py --selftest   # 2000 kbps requested, 2000 measured; live release works

The harness suite gained three classes — ResolutionMatrix (all eight cells present, each grading
video_size exactly, no cell reusing another's fixture, a_codec rejecting the wrong raster),
CompletionCase (a_finished's three near-misses, including the reload-teardown one, and the
too-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/relay rather than a private mini-proxy, cost 0.46 s, and every timing bound
sits 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:

  • All 15 fixtures re-verify as already correct on a second make fixtures-pipeline (i.e.
    verify() reads every claimed property back out of the finished files).
  • tests/serve_fixtures.py answers 206 with the right Content-Length/Content-Range and a
    byte-exact tail for each new clip, and 416 past EOF — never a 200 with a Range, which is
    the silent corruption this tier's server exists to prevent.
  • ./tests/run.py --list resolves all 19 cases against the 15 fixtures with no skips and no orphans
    in 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 this
tier. It does need the television's lock.

# 1. Build the pack (host, no TV). ~4 min cold, ~0.7 GB into $FIXTURES_OUT/pipeline.
make fixtures-pipeline
#    …or just the new shapes, if you already have the old pack:
python3 tests/fixtures/make_fixtures.py --tier pipeline --out "$FIXTURES_OUT/pipeline" \
  --only pipe_h264_ac3_480p --only pipe_h264_ac3_720p --only pipe_h264_ac3_2160p \
  --only pipe_hevc_eac3_480p --only pipe_hevc_eac3_720p --only pipe_hevc_eac3_1080p \
  --only pipe_h264_ac3_short

# 2. ONCE, with a human at the keyboard: accept the macOS firewall prompt for this python,
#    or every case fails as "no line found" and reads like a total regression.
python3 tests/serve_fixtures.py --root "$FIXTURES_OUT/pipeline" --selftest

# 3. Take the set, then run the whole synthetic tier (19 cases).
tools/tv-lock.sh with --why "b10 resolution matrix + finish" -- ./tests/run.py

#    …or the new cases alone:
tools/tv-lock.sh with --why "b10" -- ./tests/run.py --filter pipe_res
tools/tv-lock.sh with --why "b10" -- ./tests/run.py --filter pipe_finish_eos --verbose

Three things to watch on the first device run, all of them shapes I could not settle from the
host:

  1. video_size is a new EXACT assertion, and the raster it reads is
    AVCodecParameters::width/height — the cropped dimensions, so 1080 should be 1080 and not the
    coded 1088. If a cell fails with e.g. codec=h264 1920x1088 (want h264 1920x1080), that is the
    assertion being too strict rather than a player bug; say so and we relax that cell to a range.
  2. pipe_finish_eos runs its clip to EOF, which every other case is built to avoid. Its
    no_playing_error expectation is the honest one, but nothing has ever graded this app through
    a teardown before, so if it fails on no_error rather than on finished, read the lines after
    EOS reached before assuming a regression.
  3. pipe_res_h264_uhd is 4K H.264 at ~11.8 Mbit/s, a combination this app has demonstrably
    never 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_PORT in the gitignored src/config.local.h, make deploy, start
tools/netcond.py --listen <port> --target 127.0.0.1:32400, begin playback, and walk
/tmp/netcond.mode through rate:512 → rate:1000 → rate:7000 → rate:17500 without
restarting anything
— the mode applies to the open connection. Pick a port Plex is not already on
(it binds 127.0.0.1:32401 itself 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-auditor over the branch found five sentences this change made false — all
contradictions, not omissions — fixed in d70eea2e:

  1. .claude/skills/which-tier/SKILL.md's pasteable sh block 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.py as the suite it used to be" contradicted itself inside one
    commit, in the half a reader copies. Both counts removed; the block points at --list.
  2. tests/fixtures/README.md listed 8-bit HEVC and 4K H.264 as gaps this script does not
    build
    — it builds both now, and manifest.json said so in the same commit. Also on that line,
    pre-existing: it named plxnative-url where plxnative-playurl is right, which is a dead end
    precisely because the former carries no declaration.
  3. Trap 9 ("nothing is ever shorter than 60 s") was falsified 260 lines below itself by this
    branch's own 20 s clip; so was PIPE_SHAPES' "the only length constraint left is do not hit
    EOF". Both now carry both bounds.
  4. _probe_fixture's "three of the twelve" was wrong on main too (four of twelve, now four of
    nineteen). Replaced with the property rather than a fresh census.
  5. docs/lg-self-checklist.md was 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 since 072a60e8 and not this
branch'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:399 and ui/library.rs:171 described per-request
scoping as working and were false until this branch fixed relay; they are true again.


Update — rebased onto b6c7909b, and #46's replay half now lands

Rebased 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.

Note main moved twice while I worked — the coordinator named 9a57e264, but b6c7909b
(overscan, #61) landed during the first rebase because worktrees share an object store. This is
on b6c7909b.

The app change — six lines, and why it is a counter rather than a lifted latch

plxnative-playurl is read behind app.rs's one-shot auto_tried latch, so a synthetic boot got
exactly one playback. Everything needed for a second one was already there — 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 used.

/tmp/plxnative-replay[=N] re-arms the latch N times, rather than the latch being lifted:
auto_tried also guards the autoplay+playidx arm, which does a request_play_movie +
load_detail_now, so an unconditionally re-armable latch would re-fetch a catalog item on every
player 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 when finish_playback handed
off 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_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. 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

  • b6 (unconsumed press). The invariant lives in note_global_press, which returns early for an
    unbound key. This change adds no key arm, no press path and no global side effect; it sits at the
    EOS site and at a let beside the other boot latches.
  • b7 (bogus coldstart record). coldstart_place answers Route::Player from
    metadata::playing(), and install_playing has exactly one caller — route::apply_plan, the PMS
    decision 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.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 graded. Three signals, each worthless
alone:

signal why it alone is not enough
replay: line exactly N times counted — firing more often than asked is a loop, and a loop satisfies everything else here
≥ N+1 load: lines one per session, and teardown cleared the URL — so a second line is what proves the declaration was re-read
position falls then climbs a replay that resumed where the first run stopped would produce both rows above and no second viewing

plus server_opens_min: 2 — the wire-side half no log line can give: the second viewing must fetch
the 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_eos stays separate: "never ends" and "ends and cannot be restarted" are different
failures, 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.md

You 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.":

That sentence was FALSE for as long as it existed and became true on 2026-08-23:
serve_conn consulted the scope-aware applies() to decide reject/blackhole, then handed
relay a bare Mode.split, which throws the scope away — so a scoped mode really applied to
every open connection, media stream included, which is the exact opposite of what a scope is for.
Both halves are scope-aware now and tests/test_harness.py pins it.

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:

  1. The attribution came from the instrument, not from inference. It was recorded as
    THREADJOIN timeline 6974ms (engine.rs's own comment quotes that line), and
    task::join(what, h) emits one named line per join. So even with everything stalled, the log
    said which of the three joins parked the main thread.
  2. timeline is the only join that could have parked, whatever else was stalled.
    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, because stream's one-shot wrappers box their socket privately. That is
    structural and independent of which connections the proxy froze.
  3. Before and after were taken the same way, so the 6974 ms → 0.5 s comparison is
    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/media at 0 beside timeline, is a device job
nobody has done.

Exact wording — replacing the sentence that ends "…BACK→teardown is 0.5 s.", applied on the
branch in CLAUDE.md and, in shorter form, in player/threads.rs and player/engine.rs, all three
of which carried the number:

That run was taken while the scope bug above was live, so the proxy was stalling EVERY
connection and not only the reporter's — and the number and the conclusion both survive it, for a
reason worth writing down rather than re-deriving.
The finding was recorded 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's 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, stream's one-shot wrappers boxing their
socket privately. The before and after were taken the same way, so the 14x is apples-to-apples.
What CANNOT be claimed from that session is the thing the scope sentence promises — that video
kept streaming while the reporter was frozen. It is a property of the tool today and was not a
property of that run; re-running it scoped (and seeing demux/media at 0 beside it) is a device
job nobody has done.

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 --verbose

A fourth thing to watch, beside the three already listed above: pipe_replay_after_eos is the
only 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 in a1e11315.

The one that mattered: a_replayed passed on a replay that never played

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 before fixing:

[load, pos(0), pos(5), pos(10), pos(19), replay, load, pos(1)]
→ (True, '1 replay(s), 2 `load:` line(s), position fell 18s then climbed 19s over 5 samples')

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 drop
already had in hand. Same input after the fix:

→ (False, 'the position fell 18s but only climbed 0s afterwards — the replay restarted and then did not play')

Four sentences 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" — contradicted by a_replayed fifty lines below it, added in the same
    change.
  • _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 name
    that 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 prose
    was the last thing asserting the old form.
  • CLAUDE.md and the which-tier skill both said "19 cases". The manifest holds 20. That count
    rotted inside the branch that wrote it, one commit after the same branch corrected the previous
    stale copy of it.
    Both now point at --list rather than becoming a fourth number waiting to go
    stale.
  • NetcondRate.setUp leaked a mkdtemp per test — six /tmp dirs per make check, on the command
    run most often. addCleanup(shutil.rmtree); verified no new directories after a run.

The reviewer separately vouched for the replay_left/auto_tried ordering, reset_session
clearing ended, replay_budget, the per-viewing EOS bound, the early-exit soundness note, and all
three netcond changes (scope, single refund, select-over-settimeout) — I have not re-verified
those.

Final state: make check green — 1069 Rust, 52 harness. Synthetic tier is 20 cases.

GLinnik21 and others added 4 commits August 23, 2026 13:49
…, 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 and others added 2 commits August 23, 2026 14:12
…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
GLinnik21 merged commit dd8fc4a into main Aug 23, 2026
2 checks passed
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]>
@GLinnik21
GLinnik21 deleted the b10-fixtures branch September 3, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant