Repository navigation
perf(wsl): skip re-hashing unchanged orcad artifacts and guest Node runtime on the WSL wake path (C4c) - #27941
Conversation
fa0b90e to
a17d5b1
Compare
7b788be to
c745dd1
Compare
a17d5b1 to
fbc7021
Compare
a0524da to
cd98e85
Compare
b852950 to
8eddaf4
Compare
cd98e85 to
5881524
Compare
|
Merge-train review (blast radius outside WSL): the stat-signature verification record ( |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 Commits
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
…de runtime on the wake path materializeOrcadArtifact now reads each template file once (manifest check and slot identity in one pass) and remembers the digests in <cacheRoot>/<target>/.verified-sources.json keyed by each file's device, inode, size, mtime and ctime; any change re-hashes. WSL deploys probe the guest runtime against a recorded stat signature beside .verified, hashing only on mismatch. SSH probe commands are unchanged.
…ke path SSH deploy and local serve hashed every launch before; a record anyone with userData access could edit must not let them skip that. Only the WSL deploy opts in, and untrusted callers neither read nor write it.
…when untrusted A browser digest keyed like orcad.js replaced the common digest it must also match; callers that keep no record no longer stat every source.
5881524 to
c6338e9
Compare
Stacked on #27923 (C4b). Do not merge.
ELI5
Each time Orca starts its server inside a WSL distro, it re-checked about 20 MB of its own files and a 110 MB Node program by reading every byte. Those files almost never change. Orca now writes down each file's size and timestamps when it checks the file. On the next start it reads every byte again only if one of those details changed. A warm restart now takes about 2.8 s instead of 3.9 s.
What Changed
orcad-artifact-materializer.ts, neworcad-artifact-source-verification.tsandorcad-artifact-verification-record.ts).<cacheRoot>/<target>/.verified-sources.json. It lists each source file's path, digest and stat signature (device, inode, size, mtime and ctime in ns), and the cached slot's file signatures.orcad-remote-node-runtime-recorded-probe.ts).recordedNodeRuntimeProbe: trueindeployAndLaunchWslOrcad).statsignature with.verified-statnext to.verified. That file records<pin sha>:<signature>.sha256sumas before, and records the signature only when the hash matches the pin.ensureRemoteOrcadNodeRuntimesends the sameprobeRemoteNodeRuntimeCommandtext as before. Tests check both that the command is byte-identical and that SSH never sets the flag.Why
The C4b profile blamed about 1.3 s on the materializer and 0.3 s on the guest runtime hash. Each one re-read files that had already been verified.
orcad startup is left as it was.
Linked Issue
Internal WSL-via-orcad tracker, step C4 follow-up (C4c).
Visual Proof
N/A: no UI change.
Testing
win-lowspec (Windows 11). I created a throwaway Ubuntu 24.04 distro
orca-c4c-probewithsystemd=false. The template was the CIorcad-templateartifact with the C4b orcad build layered on top. I randeployAndLaunchWslOrcadunder the installedOrca.exewithELECTRON_RUN_AS_NODE, a fresh process for each run, after killing orcad. Before = C4b; after = this branch.materializeOrcadArtifactalone (3 runs)unverifiable. With the app's native addon on the module path it takes 26 ms.Automated:
sha256sumthat counts its calls. They cover:.verified;src/main/{ssh,wsl,orcad}pass.orcad-activation-fence-generationfailed once under full parallel load and passes alone.pnpm tc, oxlint, the anti-slop pass, process-host imports,check:code-quality:changed, the max-lines / ts-nocheck / runtime-electron ratchets, reliability gates, the node pin, compat-boundary imports,audit:code-quality:{native,type-aware}andsmoke:orcad-terminalall pass.AI Disclosure
Review
Agent skill upstream boundary
Notes
stat. On Windows that gives the volume serial, the file index and the change time.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)