Repository navigation
test(link): the Child's link WebSocket memory acceptance (design 6.3, 11.2-9), opt-in - #8686
Merged
Merged
Conversation
…esign 6.3, 11.2-9), opt-in
…hole body and counts waits from the start
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
…ceptance # Conflicts: # scripts/test-layout/layout.json
…so a dead leg can never count as a held one
…d has closed its side of every cut connection
…near-maximum input
… when a load runs
…tance; the relay, not the setter, reads ahead
… is Codex's default
…waits, and fails the run when either expires
…ports resumed, and the release check is the second guard
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
The Child's link WebSocket release gate (
linkWebsocketChildReadyinsrc/client/link-websocket-limits.ts) stays closed until two things have passed: the framer's client conformance run and the Child's memory acceptance. The Autobahn run is in #8681. Until now the Child had no memory acceptance; the Home has one (tests/e2e-style/link-websocket-rss.test.ts, with #8647's settle rule). This PR adds the Child's, shaped like the Home's, and records three settled passing runs. It changes nothing undersrc/and opens no gate.What the test does.
tests/e2e-style/link-websocket-rss-child.test.tsis opt-in withOCX_LINK_WS_RSS_CHILD_ACCEPTANCE=1. It runs the same held load twice, each time through a fresh Child process (tests/fixtures/link-ws-rss-child.ts): the real Child listener, link WebSocket relay and HTTP relay, with the Child's gate opened in that process only through the relay'sreadyseam. The Codex-side clients and a stand-in Home (tests/fixtures/link-ws-standin-home.ts) stay in the test process, so they do not count against the Child's RSS.content-lengthover HTTP. The test records each load request's size at the Home and requires all 8 to be whole on both transports.LINK_RELAY_BODY_MAX_BYTES), so both loads carry the same request; nothing is scaled down.When it counts as settled. The Child process itself announces the stall:
onDownlinkPauseseam). A paused leg that ends reports "resumed" as it finishes, which drops the count; the fixture also counts the relay's releases (onReleased, once a leg's Home connection has closed and its slot is freed) as a second guard: the idle reading waits for the warm-up socket's release (30 s at most, else the run is invalid), and a release after it and before the stall is announced makes the run invalid, so a load that lost a leg can never settle.setLinkChildRelayWaitObserverForTests(test(link): report the Child's HTTP relay waiting for its reader to a test-only observer #8680, contract as corrected in test(link): pin the Child relay wait observer across Home failures, queued aborts and cancels, and correct its comments #8683): true after a chunk is handed to a reader that has not asked for the next one; false when it asks again or cancels, or when the relay ends. The relay reads one Home chunk ahead, so "waiting" means the reader holds a chunk and the relay may hold one more.VmHWMdid not rise. A load not settled 180 s after the idle reading fails; the deadline never passes a run.Accepted when both Child processes reported their own settled stall, both peaks are the kernel's high-water mark (
VmHWM, reset after the idle reading; a sampled peak cannot pass), and the WebSocket run's peak over idle minus the HTTP run's is at most 8 reservations (8 x 32 MiB = 256 MiB).OCX_LINK_WS_RSS_CHILD_SOCKETS(the only other setting) makes the run a diagnostic that prints its numbers and asserts no budget. The test runs on Linux only (elsewhere it skips with the reason: the peak isVmHWM, and a sampled peak cannot pass).structure/remote-link.mdnames the test beside the Home's acceptance. Passing it is one of the two conditions on the Child's gate; what else the gate-opening change owes for the TypeScript Child is indevlog/_plan/261113_link_websocket_gate_opening/000_plan.md(TypeScript Child items 2 to 7). The same branch corrects that unit's item 3: 3 retries is the gate's setting (stream_max_retries = 3in the Codex provider config thatrunGateCodexintests/helpers/link-gate-codex.tswrites), and 5 is Codex's default.Results
A trial and three canonical runs on
f75a98eb9(deveb727e1bamerged, plus the review commits), Linux x86_64 (kernel 6.12.113), Bun 1.4.4, clean tree, each the only heavy job on a 4-core, 15.6 GiB VM, under a watcher that would have stopped the run if MemAvailable fell below 1.5 GiB. The trial's lowest MemAvailable (9,001 MiB) stayed above 4 GiB, so the three runs followed.Each run: exit 0, 1 pass, 8-10 s wall, both peaks
kernel-vmhwm,websocketSync: child-legs-paused,httpSync: child-relays-waiting, and every check in the test held (the warm-up socket released and no wait open at the idle reading, wait counts between 0 and 8 through the peak, no link socket released before the stall, every load request received whole by the Home, every cut connection closed by the Child before the peak was read). Per socket, the WebSocket transport added 8.2 to 13.6 MiB over the HTTP relay (66-109 MiB over 8 sockets), well inside the 32 MiB reservation. After the cut the Child returned to 100-111 MiB. Across all recordings so far (75b2f16a5,325acfccc,f75a98eb9) the difference has ranged from 66 to 113 MiB.The raw lines of each run (the two load lines and the acceptance line):
Verification
Final head
f75a98eb9: the runs above were made on it. Thedevmerge isa0b176739(deveb727e1ba, #8681); its only conflict was the last line of the explicit map inscripts/test-layout/layout.json, wherelink-websocket-rss-child.test.ts,link-websocket-child-gate.test.tsandlink-websocket-child-restart.test.tsnow appear once each (and once each intests/fixtures/test-layout-expected.json);git show --remerge-diff a0b176739touches only that line. Runs on the earlier heads are kept undersuperseded-4502be331/,superseded-c6beadb35/andsuperseded-325acfccc/and are not evidence.~/handoff/rss-child-run.sh <dir>×4 (a trial and three runs) (OCX_LINK_WS_RSS_CHILD_ACCEPTANCE=1 bun test tests/e2e-style/link-websocket-rss-child.test.tsunder the MemAvailable watcher, no otherOCX_LINK_WS_RSS_CHILD_*set): exit 0 each, 1 pass, watcher never fired; results above.f75a98eb9, each reverted (exit 1 each, no Child process left over): the budget cut to 64 MiB fails the size assertion (received 76.8 MiB); the fixture told the load has 7 stalls instead of 8 reports the run invalid ("more readers waited than the load has"); the HTTP stand-in answering before the body has arrived fails the body check; a wait left open at the idle reading fails the idle check; one WebSocket client cut after the load is in place and before the stall reports the run invalid ("a link socket was released before the stall was announced"); the close deadline at 1 ms fails the run ("the Child did not close 1 Home connections within 1 ms of the cut"); a warm-up release that never arrives reports the run invalid after the 30 s bound ("the warm-up socket was not released before the idle reading").OCX_LINK_WS_RSS_CHILD_SOCKETS=2) passed as a diagnostic; it is not evidence.bun test tests/e2e-style/link-websocket-rss-child.test.tsexit 0, 0 pass, 2 skip.tests/test-layout.test.ts,tests/test-layout-tooling.test.tsandtests/ci-workflows/structure-ssot.test.ts: exit 0, 80 pass.bun run structure:checkexit 0;bun run privacy:scanexit 0.bun check --no-script --noEmiton the two new files: no error in them. (Checking files one by one also reports dev's existing type errors intests/helpers/link-ws-child.tsandtests/fixtures/link-ws-standin-home.ts, at lines this PR does not change; the repository's typecheck uses the project configuration.)tests/fixtures/changes put this PR on the full Ubuntu lane; the full shards must pass on its head.bun run testandbun run typecheck: repo-wide runs are excluded on this VM, and there is nosrc/change;bun run test:changedand hosted CI;Checklist
structure/remote-link.md).