# Issue 19220 runtime evidence

Isolated Electron main-process CPU-operation benchmark, NOT full app e2e. Synthetic pixels only; no screenshots or recordings are required for this nonvisual change. No visible UI comparison was performed. The diff changes DesktopSnapShot sizing and its regression test; renderer code is unchanged.

Issue: [#19220](https://git.cafe/pingdotgg/t3code/issues/19220).
Original: [70e5e384da](https://git.cafe/pingdotgg/t3code/commit/70e5e384da).
Fixed: [b8955af5cf](https://git.cafe/pingdotgg/t3code/commit/b8955af5cf9e6bb785baab9ad2161dd642b56063).
Red regression: [3177e331d9](https://git.cafe/pingdotgg/t3code/commit/3177e331d9e2f1a7f83430597f66f0ba47d8c16c).

## Artifacts

- [Runtime script](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1e1cc8e47ff5b05b/issue-19220-runtime.cjs)
- [Runtime transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/32cc9ab743a3b601/issue-19220-runtime.log)
- [Red reproduction script](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/050d8f130fcedaf5/issue-19220-red.sh)
- [Red transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/447de46ffbdd15d0/issue-19220-red.log)
- [Green transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/cf9c085d28c0bf9a/issue-19220-green.log)

## Runtime and method

Electron 44.4.5, embedded Node 24.21.0, Linux x64, Xvfb. Exact original/fixed snapShotImageSize declarations are extracted using the TypeScript AST from git objects and transpiled with TypeScript 6.0.3. The actual shared imageDimensions.ts source from the fixed git object is transpiled and evaluated, not replaced by a fake reader. No production capture is simulated. Native decode calls are counted through a forwarding wrapper.

Each size uses the same generated PNG bytes for both function bodies. Complete IHDR/IDAT/IEND chunks and Electron nonempty native decoding are asserted. For each size, assertions require native result == shared reader == original helper == fixed helper == expected dimensions. Logical bounds are half the pixel dimensions. Fixed helper makes zero native sizing decode calls.

- 1440x900, logical 720x450, 353859 PNG bytes: all equality assertions PASS. Original median 8.874190 ms; fixed median 0.000072937 ms per call.
- 2560x1600, logical 1280x800, 1080621 PNG bytes: all equality assertions PASS. Original median 27.826698 ms; fixed median 0.000077524 ms per call.
- Unreadable empty buffer, logical 700.6x519.4: reader null; original and fixed both 701x519 PASS; fixed zero native sizing decodes.
- Unreadable empty buffer, logical 0x-2: original and fixed both 1x1 PASS; fixed zero native sizing decodes.
- Accessibility disabled / identity absent: exact source assertion proves unchanged caller gate bypasses helper and accessibility pool read. This row is source proof, not capture e2e.

Timing: 3 warmup rounds, 15 sample rounds; original batch 1, fixed batch 10000, median of per-call samples. Raw samples are in the transcript. Observations on one loaded VM are not universal speedups or total latency. The earlier 134.5 ms observation belongs to a different run and is not included in these results. Zero redundant sizing decodes does not mean zero decodes throughout capture. Header parsing is not arbitrary-corrupt-image validation.

## Regression

Red exact commit uses temporary copied module and test with only its module import redirected. Cleanup trap removes both; review source is untouched. Result: 49 passed, 1 failed; regression fails because createFromBuffer calls are 1 versus expected 0. Green exact fixed checkout: 50 passed out of 50.

## Commands

```sh
NODE_PATH=/home/ubuntu/t3code/apps/desktop/node_modules xvfb-run -a /home/ubuntu/t3code/apps/desktop/node_modules/electron/dist/electron --no-sandbox /tmp/issue-19220-runtime.cjs /home/ubuntu/wt/issue-19220
bash /tmp/issue-19220-red.sh
cd /home/ubuntu/wt/issue-19220
./node_modules/.bin/vp test run apps/desktop/src/snapShot/DesktopSnapShot.test.ts
```

Runtime script supports TS_COMPILER for the TypeScript compiler JS path and takes the checkout as its final argument. Local dependency paths can be adjusted for another machine. Uploaded script omits one unused variable from the executed reporter; executable assertions and measured functions are identical. Transcripts have terminal ANSI escapes removed only. Artifacts were inspected for tokens, credentials and user data before upload.

## Limits and state

All minimum matrix rows are covered. Real desktop shortcut/accessibility e2e remains UNVERIFIED on macOS, Windows, Linux compositors and generic desktop fallback. Native capture, permissions, scaling integration and perceived responsiveness are not established by this benchmark. Per task authorization, those integration checks are routed to Julius. No browser/dev server/remote machine was started. No tracked edits, push, PR or forge writes. Temporary test copies were removed; worktree remained clean at the fixed head. Every spawned command completed or was interrupted through its captured session; no owned runtime was left running.

## FRICTION

- Runtime setup | Electron argv includes launcher switches, so fixed index selected the script instead of checkout | use final argument for checkout.
- Compiler compatibility | installed TypeScript 7 package does not expose the legacy compiler API | explicitly load existing TypeScript 6.0.3 compiler JS; allow TS_COMPILER override.
- Evidence fidelity | earlier scripts lacked exact-helper and reader equality assertions | extract exact git declarations and assert native/original/fixed/reader/expected equality.
- Attribution | loaded-VM decode timing can be mistaken for shortcut latency | label CPU operation, sample protocol and e2e exclusions.
