Repository navigation
perf(orcad): skip the node-pty probe child for a slot qualified on an unchanged host - #35484
Conversation
… unchanged host A slot whose startup qualification marker matches (same artifacts, runtime, libc, kernel and launch env, last launch reached readiness) now also skips the synchronous node-pty load probe child (~0.1 s on the WSL lane). The marker is now recorded only when that launch's probe passed cleanly; schema 2 so earlier markers, which did not promise that, re-qualify once.
|
STATUS: ready for two reviewers. Head 6642469. Checks run: pnpm tc, typecheck:ci, code-quality:changed, anti-slop, oxlint, ast-grep. Run per file: native-preflight 8/8, profile-preflight 30/30, main-preflight-order 16/16, startup-qualification 13/13. The lane re-measure will be posted here when this PR's WSL2 run finishes. |
[Medium impact] The PR appears safe to merge, with no blocking issues found. SummaryThe PR skips the node-pty probe child when a managed slot has startup proof for the same files and host.
No actionable new issues were found. The previous-review merge bases differed, so this review covered the full PR.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
No actionable comments were generated in the recent review.
|
ELI5
Before orcad starts, it launches a small separate Node process to check that the terminal library (node-pty) loads. That costs about 0.1 s on every start. #35064 already lets a slot skip its other startup self-check after a clean start on an unchanged host. This lets the same proof skip the node-pty check too.
What Changed
preflightBundledOrcadStartupnow returns whether the slot was qualified from its marker: same artifact bytes, runtime, glibc, kernel and launch env, and the last launch reached readiness.runOrcadNativePreflightVerdict({ qualified })skips the probe child for a qualified slot. It clears any stale terminal degradation, exactly as a passing probe does, and returns'ok'. Otherwise it runs the probe as before and returns its verdict.runOrcadNativePreflightkeeps its boolean API.main.ts: if the verdict isn't'ok'(degraded or unverifiable),forgetBundledOrcadStartupQualification()drops the pending qualification. So a marker is recorded only by a launch whose node-pty probe passed cleanly, and a launch that skips the probe always does so on that proof.Why
This is option (d) from the cold-start memo. The full startup profile on lane run 40766470551 shows the node-pty probe as a synchronous
spawnSyncof a Node child, ≈70–100 ms of blocked main thread before startup. The probe exists because a native loader crash can't be caught in-process. On a slot qualified as unchanged, the same bytes, runtime, libc and kernel already loaded node-pty cleanly on the last launch.SSH effect: the same saving on Linux and macOS SSH-managed slots. Windows slots always run the full preflight (#35064), so they're unchanged.
Flag-off: this applies whether or not
ORCA_INTERNAL_WSL_HOSTSis set; this is orcad-wide qualification code.User-risk: low. The first launch of a slot on a host, and any launch after a changed byte, runtime, libc, kernel or launch env, still runs the probe. A host where the probe is degraded never skips it. If node-pty broke without any of those changing (bit rot), terminals fail at first use instead of at startup, the same trade-off #35064 accepted for the startup preflight.
Linked Issue
Internal WSL-via-orcad tracker, D3 cold start, option (d).
Visual Proof
N/A: no UI.
Testing
orcad-native-preflight.test.ts: a qualified slot skipscheckand clears degradation; a degraded probe reportsdegraded.orcad-profile-preflight.test.ts: the qualified/not-qualified return value; a forgotten qualification records nothing.main-preflight-order.test.ts: a qualified slot passesqualifiedto the native preflight; a non-ok verdict forgets the qualification beforemain(); the existing ordering cases still pass.pnpm tc,typecheck:ci, code-quality, anti-slop and ast-grep pass.cli-launchershould disappear from the restart runs. I'll post it here.Status
Ready for two reviewers (startup order). Waiting for the lane re-measure.
Checklist
N/Afor visuals with reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (CI runs the rest)