Skip to content

fix(core): drop the fixed 10ms trailing-output drain when exit arrives via event#212

Merged
NathanFlurry merged 1 commit into
mainfrom
stack/fix-core-drop-the-fixed-10ms-trailing-output-drain-when-exit-arrives-via-event-qtwvlzny
Jul 2, 2026
Merged

fix(core): drop the fixed 10ms trailing-output drain when exit arrives via event#212
NathanFlurry merged 1 commit into
mainfrom
stack/fix-core-drop-the-fixed-10ms-trailing-output-drain-when-exit-arrives-via-event-qtwvlzny

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Jul 2, 2026

Copy link
Copy Markdown
Member

The sidecar drains process output before emitting process_exited and the
frame stream + event pump are FIFO, so once the exit event is observed no
trailing output can follow it; the host-side quiet-turn drain (2 turns at
10ms) only remains for the snapshot-poll fallback exit path. Also stop
awaiting signal-state refreshes on the exec critical path (start + first
output) — kill paths await the in-flight refresh instead — and clean up
the parked refresh in finishProcess so fallback exits release it too.

Warm host-driven exec p50: node -e '' 30ms -> ~17ms, wasm true 52ms ->
39ms; whole wasm-command-floor lane down ~13ms/row; bench:gate green.
New regression test: 10 sequential fast-exit 64KiB stdout captures.

…s via event

The sidecar drains process output before emitting process_exited and the
frame stream + event pump are FIFO, so once the exit event is observed no
trailing output can follow it; the host-side quiet-turn drain (2 turns at
10ms) only remains for the snapshot-poll fallback exit path. Also stop
awaiting signal-state refreshes on the exec critical path (start + first
output) — kill paths await the in-flight refresh instead — and clean up
the parked refresh in finishProcess so fallback exits release it too.

Warm host-driven exec p50: node -e '' 30ms -> ~17ms, wasm true 52ms ->
39ms; whole wasm-command-floor lane down ~13ms/row; bench:gate green.
New regression test: 10 sequential fast-exit 64KiB stdout captures.
@NathanFlurry

NathanFlurry commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Stack for rivet-dev/secure-exec

Get stack: forklift get 212
Push local edits: forklift submit
Merge when ready: forklift merge 212

@railway-app railway-app Bot temporarily deployed to secure-exec / secure-exec-pr-212 July 2, 2026 17:46 Destroyed
@railway-app

railway-app Bot commented Jul 2, 2026

Copy link
Copy Markdown

🚅 Environment secure-exec-pr-212 in rivet-frontend has no services deployed.


🚅 Deployed to the secure-exec-pr-212 environment in secure-exec

Service Status Web Updated (UTC)
secure-exec 😴 Sleeping (View Logs) Web Jul 2, 2026 at 11:24 pm

@NathanFlurry NathanFlurry merged commit e0e334c into main Jul 2, 2026
3 of 5 checks passed
@NathanFlurry NathanFlurry deleted the stack/fix-core-drop-the-fixed-10ms-trailing-output-drain-when-exit-arrives-via-event-qtwvlzny branch July 2, 2026 23:42
shaneholloman pushed a commit to shaneholloman/secure-exec that referenced this pull request Jul 7, 2026
Bake the constant wasm runner + wasi shim (~300KB of JS previously
recompiled per exec) into the per-process V8 userland snapshot via
guest_runtime.snapshot_userland_code, keyed and cached process-wide.
Mode env AGENTOS_WASM_SNAPSHOT_RUNNER=auto|block|off: auto probes the
snapshot cache without blocking (async warm kicked once per process)
and falls back to the byte-identical inline runner until ready, so the
cold path is unchanged. The sync-RPC glue is re-evaluated per exec (the
snapshot-baked copy cannot bind session bridge fns). Module bytes are
now base64-encoded once per module in a bounded, fingerprint-validated
cache (64 entries, warn on evict, debug log reports per-entry and
cumulative cache bytes) instead of fs::read+encode per exec. Adds
AGENTOS_V8_SESSION_PHASES timers (snapshot_get / blob_clone /
isolate_new / user_code_execute) and a measured NOTE against
EagerCompile at snapshot build (moves cost to isolate deserialize).

Warm wasm floor p50: true 39->33ms, pwd 48->43ms, ls-empty 81->75ms,
date-version 127->115ms (52/62/96/140 before PR rivet-dev#212); cold first-exec
improved; wasm suite green; bench:gate green. Remaining floor is
isolate-per-exec + module decode — pooling tracked as Stage C.
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