Repository navigation
Idle footprint (O17): the wire fingerprint at build time and zod's locales on first use, about 2.1 MiB off mawsd and the engine host; the measured harness records activity and pressure - #519
Merged
Conversation
… holds fingerprintOf over the live registry and every process reads it, rather than running z.toJSONSchema over the engine-host commands at its start (about 340 KiB of cached schema state each in mawsd and the engine host); wire-fingerprint.test.ts holds it equal and pnpm wire:manifest rewrites it; the value is unchanged, 659d7538a26c8a3f Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…h (patches/[email protected], pnpm-workspace.yaml's patchedDependencies) makes the locales export of zod's CommonJS core, classic and mini entries a non-configurable getter, so mawsd and the engine host no longer load the 62 non-English locales with zod (about 1.1 MiB of heap each); English messages are unchanged; test/zod-locales.test.ts holds the installed zod to it and the packaged supervisor check holds app.asar's copy, through one script (e2e/support/zod-locales.ts) Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…O17 footprint, recording only): the footprint reader's same proc_pid_rusage call also gives each process's CPU ticks (user and system, with the mach timebase), idle and interrupt wakeups and pageins, and the call reads kern.memorystatus_vm_pressure_level, all kept per sample in the measured JSON; vm_stat's Swapouts and Pageouts from a window's first sample to its last go beside them; one window activity line per window prints them; no validity or bound rule changes Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…iB of heap per process (703 KiB in the engine host, 779 KiB in mawsd, in the running processes under Electron 44.4.5), not the estimated 1.1 MiB Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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. |
SSFSKIM
added a commit
that referenced
this pull request
Nov 8, 2026
…d the engine host drop about 1.1 MiB of heap each; CI-opt's measured runs decide the render bound; the mini's Chrome closed at the owner's word; the lane-a packaged flake filed Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Nov 8, 2026
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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.
What this fixes
CI-opt's measured runs on 6f89f9d put the daemon shape (mawsd plus the engine host,
maws-supervisor) after a render at 100,979, 101,170 and 105,347 KiB. The bound,DAEMON_IDLE_BOUND, is 99,145 KiB. The investigation found two causes:It also found two older costs that both processes pay. This PR removes them and adds recording-only fields to the measurement harness.
Change 1: the wire fingerprint is computed at build time
Before, each process computed the fingerprint at startup:
z.toJSONSchemaran over every engine-host command and left cached state on each schema it visited. Spreading the identity into the status (supervision.ts) rules out a lazy getter.Now:
src/shared/ipc/wire-fingerprint.jsonholdsfingerprintOfover the live registry.wireFingerprint()returns that value.wire-fingerprint.test.tsrecomputes the value from the live schemas and fails if they differ. Its failure message says to runpnpm wire:manifest, which now runs the fingerprint test besidewire.test.ts. Either of its modes (=1,=rebase) rewrites the file.The value is unchanged:
659d7538a26c8a3f.Peers of other builds see the same fingerprint.
Change 2: zod's locales load on first use
zod 4.6.5's CommonJS entries load all 62 non-English locales together with zod. The MCP SDK is an external that loads
zoditself, so bundling zod would not help.The fix is a pnpm patch,
patches/[email protected]:v4/core/index.cjs,v4/classic/external.cjsandv4/mini/external.cjs, thelocalesexport becomes a non-configurable getter. Being non-configurable, it is skipped by each file's seal block, which would otherwise evaluate it.v4/mini/external.cjsis a third file beyond the two named in the investigation. The SDK requireszod/v4-mini, which would load the locales again.pnpm 11 records
patchedDependenciesinpnpm-workspace.yaml, not in package.json.The patch is held in two places, both through one script,
e2e/support/zod-locales.ts:test/zod-locales.test.tsruns the script in a child Node. After requiring zod's entries and failing a parse, no non-English locale module may be inrequire.cache, and the English messages must match zod 4.6.5's. Readinglocalesmust still load them. With an unpatched zod the test fails, naming the patch and what to do on an upgrade.e2e/supervisor-packaged.spec.ts(e2e:supervisor:packaged) runs the same script under the packaged binary as Node. It asserts that zod resolves insideapp.asarand passes the same checks.Before and after heap
Method: the built engine host (detached) and mawsd (private, no hosts woken) each ran under Electron 44.4.5 as Node on a scratch profile. Each process ran three times per tree. 20 s after start, six full collections, then V8's used heap was read.
Modules loaded: 249 → 186 in the engine host and 103 → 40 in mawsd. The 63 removed are the 62 locales and their index. No head process loaded a locale.
Each change measured alone, in the same processes, two runs each:
The investigator's probes agree:
fp-probe.js: the fingerprint retains 345 KiB at base and 1 KiB at head.zod-probe.jsandzod-nolocales.js: zod alone takes 2,784 → 1,874 KiB.The saving is about −2.1 MiB, not the expected −3 MiB. The locales measure about 0.7–0.9 MiB per process under this Electron's Node, not 1,158 KiB. This is V8 heap. How much of it the physical footprint gives back is for the measured runs to show.
Change 3: new harness fields (recording only)
FOOTPRINT_READER's singleproc_pid_rusagecall now also records, for every sample:kern.memorystatus_vm_pressure_level, read in the same Python callFor each window, the record also keeps:
All of this goes in each test's measured JSON. Each window prints one
[daemon-idle] window activity (recorded only)line beside the case's own line, which is unchanged. No validity or bound rule changes.Gates
--gates all --runner macos --lane hosted): run 42424132100. Attempt 1: 53 jobs green, 1 red, the 2 matrix placeholders skipped, 0 flaky lines. The red was packaged 1/2 ate2e/lane-a.spec.ts:387(line 406): after Escape and a switch to sonnet, the Model chip did not reopen on its second click. The renderer and preload bundles are byte-identical to 6f89f9d's, the same test passed in the same run'se2e:lane-a, and it passed in every packaged and lane-a job since 11-01, so this change did not cause it. It is filed in the tech-debt tracker with the landing's records. Attempt 2 of packaged 1/2: 98 passed, 0 flaky.Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)