J444: same-session flood stops a stream's output and freezes typing (aarch64), echo p99 +41–148 ms on x86 #477
Open
opened 2026-11-09 15:07:13 +00:00 by kayg
·
11 comments
No Branch/Tag specified
main
j470b-server-mesh-rejoin
mesh-compat-382
j444b-d381-key-wins-flood
j461b-macos-utun-reader-thread
j475b-remove-host-motion
fix-reconnect-new-link
j481-d380
dev
j479-mesh-soak
fix/j476-host-facts
j475-motion-pill-split
j470-mac-node-join
root-upgrade-d376
j474-review-merge
latency-targets-120hz
nightly-suite-shards
gotatun-pin-j469
macos-utun-reader-thread
fix-flood-echo-stall
wip/j416
motion-fast-ease-out
mesh-addhost-j259
takeover-close-terminals-d368
kbd-instant-followups
fix-trust-key-double-click
nightly-suite-partial-report
appwin-icons-j207
rusqlite-slice1
swipe-content-first-d374
mesh-mtu-381
addhost-instant-open
glass-contrast-d365-mock
glass-contrast-d365
signout-followups-442
fix-startup-toast-red
research-gotatun-matrix-j317
themes-sync-j304
fix-load-flakes
fix-nix-zig-patch
fix-compute01-browser-baseline
ratchet-size-baseline-419
predict-auto-d130
revoke-coverage-d367
nightly-suite-queue-timeout
nightly-browser-suite
fix-rustsec-2026-0459
fonts-ioskeley-obel
log-retention-d375
fix-kbd-no-anim-427
fix-dev-red-specs-2
takeover-proof-305-j205
wip/j410-server-pump
ui-consistency-d372
fix-osc52-clipboard
libghostty-vt-1.0
forget-retired-host-d369
j404-merge-426
fix-setup-lock-race
fix-touch-select-426
revoke-access-report-ui
fix-predictive-echo-specs
fix-selinux-agent-exec
wip/j395-checkpoint2
wip/j395
j391-review-scratch
ui-consistency-j195-deferred-rebased
fix-rustc-paths-421
decisions-wording-341
fix-install-suite-red
fix-dev-rtt-specs
fix-pending-removal-align
fix-privileged-skip
fix-install-suite-404
review-j368
mesh-dns-j254
revoke-access-report-d356b
revoke-privilege-round5
fix-removal-confirm
review-j360
gotatun-rotation-367
deps-refresh-340
review-j354
review-J351
review-j350
addhost-takeover-d359
revoke-report-items-347
revoke-end-sessions-d362
review-j348
size-mesh-ssh-346
size-trim-337
revoke-access-diff-d356
j259-pre-rebase-b06c5a6
j305-ended-at-start-spec
addhost-sudo-consent
fix-layout-real-specs-411
fix-shell-open-411
fix-console-hosts-373
fix-shell-exit
fuzz-host-name-353
fix-host-details-410
macos-filter-j197
research-gotatun-tricks
revoke-p3-j216l
stale-state-pill
revoke-followups-j216k
revoke-progress-j216e
backup/macos01-20261106/lume/j197
backup/macos01-20261106/lume/appwin-icons-j207-stash0
backup/macos01-20261106/claude/stash-0
backup/macos01-20261106/claude/stash-1
backup/macos01-20261106/claude/J80-macos-s1
backup/macos01-20261106/claude/J80
backup/macos01-20261106/claude/J80-slice1-20261102
backup/macos01-20261106/claude/J16b-appwin-on-dev
backup/macos01-20261106/claude/appwin-launch-idle-146
backup/macos01-20261106/claude/J80-s1-run
wip/j259
trust-285-p3c
runtime-lock-j216f
mesh-ssh-p3-j175
tun-proof-p3b
trust-285-p3
terminal-polish-j271
tun-proof-p3
ssh-install-flakes-j216i
fuzz-fixes-j264
trust-285-a
trust-285-b
restart-oversized-fixture-j198
backup/macos01-20261106/lume/appwin-icons-j207
restart-bound-j216h
up-preflight-p3-j198
backup/macos01-20261106/lume/j251
up-preflight-j198
wip/up-preflight-j198-j245-p2
wip/up-preflight-j198-j245-p1
agent-fsync-offloop-j196
wip/up-preflight-j198-j245
settings-offscreen-j231
wip/up-preflight-j198-j226-inspection
wip/j103f
themes-j206
wip/up-preflight-j198-j226
flakes-j216c
backup/macos01-20261106/claude/j197
flakes-j216b
backup/macos01-20261106/claude/j197-red
wip/up-preflight-j198-review
flakes-j216
backup/macos01-20261106/claude/appwin-icons-j207
engineering-j208b
appwin-mock-j209
toast-stack-j165
engineering-j208
decisions-d351
decisions-d350
decisions-d349
appearance-presets-mock-j129
decisions-d348
docs-audit-spec
doc-coverage-baseline-raise
decisions-d347
decisions-d346b
decisions-d346
j88h-profile
ui-consistency-j195-deferred
ui-consistency-j195
engineering-practices-j194
preferred-login-ui-j166
signin-pools-263-j174
macos-node-265-s1
decisions-d345
decisions-d344
proxy-cgroup-j164
verify-quick-fuzz-329
proxy-start-io-j168
timing-flakes-j163
up-263-s1
mcp-events-j147
verify-quick-fuzz-j158
proxy-p3-j159
agent-resource-j157-detect
wip/j103d-final
remote-cancel-hang-j155
proxy-traefik-281-j62d
j149-verify-quick
proxy-traefik-281-j62b
j150-drop-unnamed
wip/j79d-red-r4
wip/j103d-d332
rootless-toast-j142
wip/j103d-head
wip/j103d
j125c-mcp
macos-build-j136
backup/macos01-20261106/claude/j136
wip/j79d-red-cli
wip/j79d-red-server
j121-link-liveness
j118c-tracer-failures
wip/j79c-head
release-desktop-j131
j124c-signed-macos
wip/j79c-red-p3
wip/j79c-red-p23
wip/j79c-red-p22
merge-j128-check
perf-deferred-j128
sidebar-toggle-260
j127-shortcut-changed-dot
j125-mcp
j118-tracer-failures
j126-account-summary
settings-sections-mock-j92
j120-pinch-lock
sidebar-292
backup/macos01-20261106/claude/j120
taste-2026-11-03
row-actions-242-215
backup/macos01-20261106/claude/stash-0-untracked
backup/macos01-20261106/claude/J80-265-s1-run
backup/macos01-20261106/claude/J80-macos-s1-20261102
j112-canvas-commands
ui-no-overshoot-scroll
fix-recovery-restart
backup/macos01-20261106/claude/stash-1-untracked
taste-2026-11-02
size-baseline-ratchet
machine-cards-structure-j108
j109-boot-copy-mockups
fix-dev-red
wip/up-263-s1
j95b-settings-rows
proxy-traefik-281
j95-option-rows
docs-human-j91
docs-keys-palette
fix-flood-1013-270-j38d
mesh-ssh-s1
mesh-ssh-s0
addhost-d291-tunnel
test-stability-load
mesh-relay-220
repro-296
shim-thp-off-24
mesh-pins-258-v2
mesh-dns
signin-d311-merged
docs-pages
ui-size-283
fix-ui-batch-specs
wip/j12b-edge-update
gate-on-arm
fix-rename-sync-293
trust-285-j60b
fix-focus-ring-clip
integ-ui-1101
edge-update-v2
signin-d311
taste-2026-11-01
layout-per-tab-250
ui-approved-splitopt-224
ui-approved-splitopt-224-on-dev
icon-text-centre-282
ui-approved-189-212-216
research-reverse-proxy
transfer-budget-320
review-mesh-pins-258-r2
sidebar-pill-259
review-mesh-relay-220
wip/j12-edge-update-v2
nix-package
status-crash-loop-237
fix-dev-test-failures
fix-fixture-socket-path
wip/mesh-relay-220-pre-dev-advance-rebase
fix-canvas-side-clip
research-head-to-head
frosted-real-256
review-mesh-pins-258
wip/mesh-relay-220-pre-final-rebase
review-layout-per-tab-250-r2
broad-suite-triage
nix-devshell
review-status-crash-loop-237-r3
wip/nix-devshell-pre-p3
taste-frosted-real
wip/code-serve-demo-2026-10-30
wip/code-serve-glass-2026-10-30
wip/code-serve-clusters-2026-10-30
wip/code-merge-release94-dev-2026-10-30
wip/rproxy-delta-scratch-2026-10-30
wip/stale-note-257-staged-2026-10-30
wip/d241-size-staged-2026-10-30
review-broad-suite-207
wip/mesh-pins-258-pre-split
wip/mesh-relay-220-pre-rebase
mesh-measure-220
plan-211-update
review-edge-autoupdate-r3
perf24-reconnect
review-stale-note-r2
release-prod-live
d241-shell-marker
review-mesh-pins-server-258
review-revocation-r3
review-setup-token-r2
review-sync-journal-r3
wip/review-mesh-pins-258-prune-review-1995fee46
frosted-scroll-256
sync-journal-r3
revocation-per-account-wip
review-tokio-asyncfd-0386
review-sync-p3s
wip/stash-8by64-stash0-2026-10-30
mesh-drag-r2
setup-token-data-wip
release-9-4
auth-busy-1013
mesh-view-overlap
sync-p3s
review-auth-busy-wake
review-readd-r8-wip
mesh-drag-bounds
audit-auth-93
app-windows-stream-start
review-authority-cap-r3
app-windows-r7-measure
readd-minimal-r6
readd-minimal-r5
app-windows-r7-soak
readd-minimal-r4
app-windows-r7
app-windows-r6
readd-minimal-r3
readd-minimal-r2
readd-minimal
merge-release8-dev
review-busy-page-liveness-r2
review-busy-page-liveness
mesh-view-trim
review-authority-read-retry-r2
review-remove-uninstall-r2
release-retry-reattach
release-retry
review-remove-uninstall
review-authority-read-retry
app-windows-ship
mesh-autoswitch-p2
mesh-ssh
mesh-relay
mesh-macos-node
screen-and-control
session-labels
review-real-logins-r5
review-real-logins-r4
review-real-logins-r3
shim-memory-r2
review-real-logins-r2
shim-memory
shadow-addhost-instant
shadow-real-logins
shadow-same-session-flood
shadow-prod-perf-fix
hosts-from-server
app-windows-real
app-windows-transport
release-prod-6w
mesh-policy-verify
quiet-close-toast
dev-merge-r4
review-mesh-agent-transport
review-app-windows-transport
settings-roundtrip
review-release-pipeline-r4
mesh-agent-transport
ended-strip-fix
review-audit-ca-update-d244
settings-rows
phone-width
signout-clear
fix-restart-tests
dev-merge-rp
signer-hardening
review-audit-ca-update
terminal-fidelity
review-audit-ca-update-wip
mesh-integrate
review-mesh-agent-transport-515d3712
review-mesh-dataplane-feec1988
mesh-dataplane
signout
research-canvas-node
wip/review-renderer-cost
wip/review-terminal-fidelity
padlock-glyph
review-release-pipeline-2e95b689
phone-polish
sidebar-polish
inbox-generic
review-mesh-dataplane-378d4055
prod-batch
ui-inbox
ui-ca-unlock
ui-machine-sections
review-mesh-dataplane-a5f744fb
tls-session-prod
session-bounds-prod
fix-dead-session
session-bounds
tls-session
palette-polish
shortcuts-d222
research-appmeta
phone-gutter
ui-centre-button
wip/ui-centre-button
wip/tls-session
review-addhost-breakit
ui-platform
renderer-cost
remote-agents
mesh-api
ssh-bootstrap
prod-hotfix2
prod-fixes
review-remote-agents
review-mesh-dataplane
session-life
research-browser
review-mesh-api
research-capture
review-mesh-api-round3
review-mesh-api-round1
gate-stability
review-gate-stability
review-relay-direct
review-mesh-api-findings
proto-sessions
font-picker
proto-addhost
proto-windows
mesh-core
latency-gate
research-bsd
research-discovery
keytray-mods
mock-core
ui-tweaks
fix-motion-sel
fix-motion
integrate2
fix-robust
t-web
t-server
vt-ghostty
fix-snap-echo
t-web-auth
review-vt2
t-agent
lane-protocol
lane-shim
lane-auth
s1-base
s1-contracts
s1-workspace
No results found.
No labels
launch-qa
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
kayg/infraternal#477
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
J444. J407 found (#447 comment 88884) that on aarch64 (dev-02), with
yes & catin the PTY you type into, the infraternal agent stops sending that stream's output after a 64 KiB warm-up:yes/catblocked, relay idle, key echo never arrives (typing freeze). origin/dev's ownscripts/verify-latency.py(c442500c2) hangs in the same-session phase (exit 124). On x86 the phase finishes but echo p99 grows 41–148 ms, far above D375's +8.3 ms flood row.Scope:
verify quickthenverify faston compute01.Branch
fix-flood-echo-stallfrom origin/devbe54e662d.Start: branch
fix-flood-echo-stallfrom origin/devbe54e662d. Worktrees: code~/Developer/Worktrees/infraternal-j444, dev-02~/worktrees/j444, target~/.cache/codex-scratch/j444/target.Plan (est. ~4 h):
scripts/verify-latency.pynever returns credit for Snapshot (0x15) bytes, while the agent charges repaints against credit (relay::Output::repaint) and the browser returns it (terminal.tsreturnCredit(snapshot.bytes.byteLength)). Each starvation→repaint cycle underyesleaks a repaint's worth of credit from the fixture, and the fixture also holds back <64 KiB. That would be fixture drift.daemon.rsif pending.is_none()), so the shim'sInputAckwaits behind bulk output, and the shim stops reading the PTY (can_read), which matches J407's dump (yes/catblocked). Bounded by the 250 ms starvation detach, but that is latency for echo and ack.verify quick,verify faston compute01. (~1 h + queue)Finding: root cause of the aarch64 "freeze". It is the fixture, not an infraternal agent deadlock.
Reproduced on dev-02 (aarch64, release musl from origin/dev
be54e662d) with an instrumented copy of the fixture (scratch only). Evidence on dev-02 in~/.cache/codex-scratch/j444/evidence/.diag-dev-norefund-aarch64.log:outstanding_credit=989772). The fixture's missing Snapshot refunds came to only 1.4 KB. So the credit-leak lead is real but tiny./tmp/j444/rootinspect.out, copied in the evidence dir) showed the flooding shim with no data link, draining the PTY normally, and the agent idle inepoll_pwait. J407's dump (yes/catblocked) is the 250 ms parked window of the cycle below.relay-trace-aarch64.log,relay-trace2-aarch64.log; not committed) shows the agent never stops. It cycles about every 300 ms: forward the 1 MiB window → credit 0 → 250 ms starvation deadline → detach → relink when credit returns.yes(~150 MB/s) has by then overrun the 8 MiB ring, so recovery is a 365-byte repaint whose cursor jumps ~8.4 MB (e.g. 21.91M → 30.33M).diag-skip-aarch64-{1,2,3}.log). The fixture counts an echo only as a rawxbyte in Output.yesscrolls thatxoff screen at once, so neither the raw stream nor the repaint can contain it, and the dev fixture waits for ever (exit 124). x86 rarely hits a 250 ms starvation, so it mostly passes.Can real browsers hit it? Not as a freeze. The browser returns credit for every Output and Snapshot byte once painted (
apps/tracer/src/terminal.tsreturnCredit, incl.snapshot.bytes.byteLength), the server passes Credit through unchanged (websocket.rs), and the browser renders the repaint, which is the true screen (yeshas scrolled thexaway there too). Keys keep being acked and written.Fix (fixture), commit
dbc37453a: the same-session phase types into a loop that draws a numbered token on row 1 per key whileyesruns in a scroll region below it. The token is read from raw output or from a repaint, the phase has its own quiet baseline, repaint credit is returned, and every key wait is bounded (30 s) with a flow-state message.What remains is real product latency. On aarch64 with the fixed fixture: quiet p99 325.91 ms, flood p99 546.91 ms, growth +221.00 ms (p50 302.46 → 302.46). The flood runs at 3.41 MB/s (window-limited: 1 MiB per ~300 ms RTT). A key's visible effect in a flooding session waits behind whatever bulk is already in flight or buffered (credit window, shim→agent socket buffer, parked frame). x86 numbers next.
Before/after numbers (same release binaries built from origin/dev
be54e662d; the product is unchanged on this branch). Logs: dev-02~/.cache/codex-scratch/j444/evidence/{dev,new}-fixture-aarch64-unknown-linux-musl-*.log, perf VM~/j444-out/{dev-fixture-x86-perf.log,new-fixture-x86-perf-{1,2,3}.log}(perf-run receipts in~/j444-out/receipts/).c442500c2/be54e662d)Why the same-session tail still misses D375's +8.3 ms (product, explained, not fixed here). None of these runs had a repaint (
repaints=0), so the tail is plain credit-window queueing. Bulk output spends the whole 1 MiB window in a burst, then the relay sits at zero credit for one credit round trip (~150–300 ms, under the 250 ms starvation deadline). A key whose echo is produced in that gap waits behind the queued bulk until refunds return, up to ~1 RTT. That's why p50 never moves (302 → 302 ms) while a few percent of keys add 100–220 ms. On top of the window, the queue ahead of the echo includes the PTY buffer, the shim→agent socket buffer and one parked frame.Design question for kayg (owner call: it trades raw output for latency), with my recommendation:
Until decided, the same-session rows in
scripts/verify latencyreport this tail as FAIL (instead of hanging). That row is not part ofverify fast.Progress: head
c9bbda442(origin/dev547a48885merged; the branch changes onlyscripts/verify-latency.pyand the newapps/tracer/real/same-session-flood.spec.ts). Queued:verify quick+verify fastin one compute01 slot (log~/.cache/codex-scratch/j444/gate.log, target~/.cache/codex-scratch/j444/target). Real-browser spec on dev-02 against the aarch64 build (log~/.cache/codex-scratch/j444/browser.log, target~/.cache/codex-scratch/j444/target). Both queues are long.Resumed (2026-11-10). The x86/aarch64 flood tail is the product: bulk output gets priority over keys.
d405440f5). The fixture returned credit in 64 KiB batches; the tracer returns it after each painted write. Batching inflated the tail (dev-02 variants,evidence/var-*.log: 64 KiB +112.32 ms / per frame +27.76 ms / 4 MiB window +27.06 ms / RTT 0 +6.42 ms). The fixture now returns each frame's credit as the browser does.perf-run,~/j444-out/after-x86-{1,2,3}.log): growth +179.36 / +166.54 / +153.29 ms, and the Ack p99 also fails.evidence/after-arm-{1,2,3}.log): +228.34 / +234.49 / +55.19 ms, Ack failing too.~/j444-out/var-x86.log): slow keys sit ~+200 ms above quiet (echo 500–511 ms vs ~300). Some have a late Ack too (k79 ack 499, k69 ack 493).evidence/browser3.log, screenshot attached: no freeze, all 40 keys shown and acked. But the flood moves the median: quiet p50 155.6 ms → flood p50 332.5 ms, max 343.6 (bridge-observed). A real person's keys aren't synchronised with refunds the way the fixture's are, so most keys land in the gap. The fixture's p99 understates what people feel.Why I stopped short of changing the relay. The only fix that reaches +8.3 ms is skipping queued bulk when a key arrives:
That changes what clients receive (raw bytes produced before the key become a repaint, as the 250 ms starvation path already does today), and it lives in the relay/shim flow-control path, which gets the strictest review. Estimate: ~1 day including shim+relay unit tests, the fixture and browser proofs, and review. Needs a go from kayg/the orchestrator: recommend A (input-triggered catch-up + reserve). Alternatives: B, a bigger browser window (fewer gaps, longer queue when bandwidth-bound), or C, scope D375's flood row to other sessions.
Finish (J444). Branch
fix-flood-echo-stall, headd405440f5(git ls-remote:d405440f591663d83ae738c6b9ecae060d8bd374 refs/heads/fix-flood-echo-stall), base origin/dev97928be8a. Not merged.yesthe agent skips raw output for a repaint after 250 ms of credit starvation;yeshas scrolled the echoedxaway, so it is in neither form, and the fixture waited for ever. dev's fixture hangs on both aarch64 and x86 (perf VM).verify quick(compute01, HEADd405440f5):verify fast(compute01, same run):The
testrow's only failure wascrates/plugins/ssh/tests/lease_progress.rs::remote_payload_progress_renews_the_lease_but_idle_does_not(panicked at :169). This branch changes no Rust (diff vs merge base:scripts/verify-latency.py,apps/tracer/real/same-session-flood.spec.ts), so that is origin/dev's code. It then passed 5/5 alone on compute01. The previous run'sshim process-per-userfailure (exhausted_pool_drains_live_ptys_during_random_session_churn) passed in this run and 3/3 alone. Log: compute01~/.cache/codex-scratch/j444/evidence/gate2.log. Targets on compute01 and dev-02 deleted.Start (J444b): branch
j444b-d381-key-wins-floodfromfix-flood-echo-stallat based405440f591663d83ae738c6b9ecae060d8bd374. Implementing D381 with reserved repaint credit, red-first relay invariants, x86/aarch64 measurements, and the real-browser 150 ms each-way check. No merge or deploy.J444b plan and implementation choice: use a 64 KiB repaint reserve in addition to the existing 1 MiB bulk allowance, so a flood can still spend the full bulk window. The browser grants both at attach; the relay never creates credit, and only actual client-returned credit replenishes the window. On a key during a credit-starved Output, discard only that session’s pending bulk frame, wait for the shim InputAck, then request one repaint; coalesce keys while a repaint is in flight. Keep the existing 250 ms recovery timer and path unchanged. Tests will cover credit, input/repaint order, sibling-session output, and spam bounded by unspent credit. Then measure the fixed fixture on perf-run x86 and dev-02 aarch64, run the real browser check at 150 ms each way, and run verify fast on compute01. Estimate: one working day including shared-VM queues.
D381 invariant tests are red against
d405440f5:reserved_credit_preserves_the_bulk_window_and_cannot_be_overspentsees raw output use 1,114,112 bytes from a 1 MiB + 64 KiB grant; the 1 MiB bulk limit should stop it at 1,048,576. Evidence:/home/kayg/.cache/codex-scratch/j444b/evidence/red-reserve.log(dev-02).key_repaint_waits_for_its_input_ack_and_contains_the_echo,key_repaint_does_not_interrupt_sibling_session_output, andkey_spam_cannot_mint_repaint_creditfail because no key-triggered repaint request is released through the current credit-stalled read path. Evidence:/home/kayg/.cache/codex-scratch/j444b/evidence/red-daemon-invariants.log(dev-02).I’m implementing the 64 KiB repaint floor and an InputAck-gated, per-stream catch-up path. The existing 250 ms recovery path remains the fallback.
Finding: the first J444b verify quick run reached Clippy and reported seven issues: two collapsible conditionals, two lossless u32-to-u64 casts, one doc-markdown warning, and two identical test match arms. Evidence: /home/kayg/.cache/codex-scratch/j444b/evidence/quick.log. I applied the lint-only changes and will rerun quick on dev-02. The red invariant evidence against
d405440f5remains in red-reserve.log and red-daemon-invariants.log.Progress: merged current origin/dev (
7d4f1a4b69) into the J444b work branch so the final gate uses the current baseline. Pushed only j444b-d381-key-wins-flood; git ls-remote confirmsd4a1a9173c. The D381 changes remain uncommitted; next I am rerunning quick with the lint fixes, then the architecture, browser, and fast-gate proofs.