Repository navigation
Playback: a new play never blocks the UI on the previous player's Unload; a hung Unload fails typed after 10 s - #1116
Merged
Merged
Conversation
… release has a deadline and a typed failure, and the exit does not quit SDL under a worker in firmware WIP: machine, runner, fence, plumbing; tests being extended. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ls it Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g release Co-Authored-By: Claude Opus 5.5 <[email protected]>
…store defers instead of blocking, queued start lives only in the release machine - exit_native leaks the parked PendingRelease / AbandonedLoad (mem::forget) when a worker is still in firmware - ForegroundLoadStart::Deferred replaces the blocking wait_for_release - PlaybackSession: native_start_refused is Option<StartRefusal>; native_start_deferred and native_release_refused removed; teardown always sends CancelQueued; Resolving derives from the adapter-published SHARED.start_queued - RefusingSink in plx_platform::tv::sink (verbs written once, shared with NoSink) - a deferred preview start is admitted/settled when it runs - stale prose follows poll_release / the fence Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d a worker still in firmware ends the process with _exit Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A test that ends with its sf-unload worker still held (a leaked release, a dropped
adapter) leaves a detached thread. When it wakes, host sf_unload reads the
process-global ACTIVE_EPOCH AFTER its hold, which by then names the NEXT test's
session, and delivers UNLOADCOMPLETED into it: Active becomes Unloaded and the
next test's backdate precondition ('the epoch must still own Active') fails at
random (CI: exit_after_a_load_timeout_never_quits_the_display_under_a_hung_load).
Workers are now counted from before spawn until they end, and
reset_native_lifecycle_for_test (opened and closed by every serial test) releases
the hold and waits, bounded, for the count to reach zero.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ffi_host only exists under the hostsim feature, so the plain make test-crate build could not name it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed-open recovery settled Every rig engine's media URL answers JSON, so its source open fails and the pump flies a recovery (land_recovery_flight -> reload_transcode) before the engine settles on Error. The reload resets the session, and with it SHARED.ended. The tests stored ended right after the play landed, so when the worker's recovery landing fell in the very pump that precedes the EOS check (slow CI, 100 s vs 33 s locally), the end was cleared before it was acted on and the player stayed on top: issue_680 saw EntryId(3) instead of the detail page, and an_end_of_stream_without_up_next failed the same way. Reproduced under CPU load as ended=false with a reload_transcode backtrace out of land_recovery_flight. end_the_stream waits for the flight to land and the engine to settle before it stores the end. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 29, 2026
…uctions (#1131) Agents get a how-to for Sans-IO code at the moment they write it, placed where each tool loads instructions. Prose only: no code, CI or ledger change. docs/sans-io-guide.md is the how-to beside the design record. It covers: - which files are machine code, and which bodies in them may do IO (job bodies, `&OffFrame` functions, the runner, the Bridge, actuators, a seam only a job body calls); - what counts as IO: a principle first, then the names, including the registry readers the ledgers do not match (`server_ids()` and the `server_*` generation readers, `peek_settled()`, `current_gen()`, `tape::active()`); - six moves, each with a snippet from a merged migration: emit a store job, the Bridge reads and the step takes the value, a stepped machine returns effects, time is the `dt` it is handed, a seam instead of a `cfg(test)` branch, refuse a command that lacks its input; - where `task::beside` belongs, the ledger rule (a new line or a raised count is never the fix; a one-for-one rename like #1116's changes only a key) and an 8-item checklist. It names the Watchlist's `LiveIo` seam and `build_stream`'s registry reads as leftovers, not models. rust-modules/data/src/AGENTS.md is the store recipe: the store, runner and Bridge split, and nine rules. Beside it, data/src/CLAUDE.md imports that file and the guide: Claude Code loads a subfolder CLAUDE.md and expands `@`, OpenCode loads a subfolder AGENTS.md, and Codex reads only the root chain. Root AGENTS.md points at both new files from the "Logic never performs IO" bullet and from "Load the right context". The ui, screens and player guides each gain a short Sans-IO section that imports the guide. The ui guide's "move the work to a worker" now says: in machine code, emit an effect or store job; start a worker only in the IO layer. The doc-claim-auditor and pr-reviewer agents list the new guides, and docs/sans-io.md's Scope list gains release.rs, as ci/check-deps.sh has it. Closes #1130 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1114
What changes
player/release.rs(NativeRelease) has the statesIdle,Releasing{epoch, since, queued}andOverdue. Its events areUnloadHandedOff,StartRequested,UnloadReturned,Tick,ExitandCancelQueued. It is registered inMACHINES. The runner (poll_release/poll_release_frame, once per frame) joins thesf-unloadworker only afteris_finished().BufferfeedStartOutcome::Deferredand the screen shows Connecting. The start runs on the frame the Unload's tail retires. The foreground restore getsForegroundLoadStart::Deferred, re-polled inRecoveryPending.settle_releaseand the blocking waits are removed.RELEASE_DEADLINE(10 s) the play fails with the typedFailureKind::ReleaseTimeout(release_timeout), and Try Again is offered. The overdue object is never destroyed. A late Unload return still runs the full tail.native_start_refusedis nowOption<StartRefusal>(LoadTimeout|ReleaseTimeout).player::sink()returns the new sharedRefusingSinkfromplx_platform::tv::sink. It refuses control verbs and forwards the memoized window queries. The release tail usesraw_sink().exit_nativereturnsCleanorWorkerInFirmware.Clean, shutdown runsSDL_Quitas before.WorkerInFirmware(a pending Unload or an abandoned Load still inside the firmware), the parked objects are leaked. Shutdown finishes its flushes (scrobble drain, capture, poster, telemetry session, crash guard) and then ends the process withlibc::_exit. That way neither theAppdrop nor libc's C++ finalizers run under the hung firmware call.Tests
New tests (hostsim):
a_start_over_an_unload_that_never_returns_does_not_block_and_fails_typed_at_the_deadlinetest result: FAILED. 0 passed; 1 failedtest result: ok. 1 passed; 0 failedexit_after_a_load_timeout_never_quits_the_display_under_a_hung_loadtest result: FAILED. 0 passed; 1 faileda_foreground_start_over_a_held_unload_parks_without_blocking_then_landsa_foreground_start_over_an_overdue_unload_fails_typeda_stop_after_a_landing_replaced_the_session_still_cancels_the_queued_starta_deferred_preview_start_is_settled_when_it_runs_not_when_queueda_worker_still_in_firmware_ends_the_process_without_unwindingNativeReleaseSuite results:
2165 passed; 0 failed1943 passed; 0 failed337 passed; 0 failed1085 passed; 0 failed89 passed; 0 failed--no-default-features: cleanci/check-deps.sh: greenReviews
src/change, so start-up on every gated image is unchanged. Its exit-path finding (libcexit()running finalizers under the worker) is fixed by the_exit.player/CLAUDE.md, fixed.Not verified
plane_unload, D1 anddestroy_windoware skipped. That relies on uMS, ACB and the compositor cleaning up a dead client. On main this path never exited at all.RELEASE_DEADLINE= 10 s is not measured on a slow chassis.Gates
make checkand the ARM build were not run locally; this PR's CI is the gate.🤖 Generated with Claude Code