# Snapshot performance proof

This measures the real T3 server's HTTP MCP preview_snapshot tool, using the server's own Chromium, on Linux x86_64. No unit tests or mocked screenshot implementation are involved. Both checkouts use fresh isolated T3 state, T3CODE_DEV_SEED=0, Chromium 157.0.8103.78, 1280x800 CSS pixels at device scale factor 2, and the same white/light synthetic pages.

## Reproduce

1. Install dependencies with `vp i` in two worktrees, one at the base and one at the head. Start each with `T3CODE_DEV_SEED=0 vp run dev` and keep its terminal session.
2. Run `node setup.mjs <checkout> <scratch-dir> base` and the same command for head. This configures approval-required mode and the free approval replay provider, creates a scratch project through `t3 project add`, starts a real thread through `t3 thread start`, and captures its HTTP MCP configuration privately from the replay agent's session/new input. The tap forwards all input unchanged. Never publish the resulting *-private.json files.
3. Run `node measure.mjs base <scratch-dir>/base-private.json <output-dir>`, then the identical command with `head`. Only one driver can use port 19305 at once. FFmpeg and DejaVu Sans Mono must be installed.
4. Each run writes a timestamped output directory with measurement.json, a live recording of measurement output, page HTML, includeImage PNGs and saved PNGs. The driver is the page seed too; no external page assets are required.

## Measurement

Each page has 120 short text article cards, three columns, fixed card heights. The styled page adds per-card gradients/shadows and a sticky translucent header using backdrop-filter: blur(20px) saturate(180%). This is a reconstruction of the described synthetic workload; the original triage HTML was not supplied. Its short card labels keep all 125 refs below the server's text cap, allowing exact semantic comparison.

For seven batches per page, alternate plain/fancy and fancy/plain, navigate, warm up once, then time 20 awaited sequential preview_snapshot calls with an empty argument object. Each recorded duration includes HTTP transport and response parsing. Batch medians average the two middle observations; the overall number is the median of the seven batch medians. Full raw timings are retained. FFmpeg is paced in real time (-re) and uses two encoding threads. It records the actual output as it is updated by the driver; it is a measurement console recording, not a recording of the T3 client.

Compare returned URL, title, loading, visibleText, screenshot metadata, interactiveElements and accessibilityTree on every timed call. Snapshot ref scope IDs intentionally change each call; only that generated scope/frame prefix is normalized, preserving the node ordinal, tree text and boxes. No image content part is permitted on a text-only call. The output's SHA-256 permits the same comparison across commits. Diagnostics and navigation history are not part of the semantic comparison.

After timing, request includeImage twice 500ms apart and require identical PNG bytes before retaining each still. Request save separately and read its actual saved file to verify PNG signature and dimensions. The saved full-resolution PNG is 2560x1600, while the image response is 1280x800. Private save paths are omitted from measurement.json.

The recording, JSON and captures contain synthetic page data only. The scenario runner was intentionally not used: its documentation explicitly says it cannot prove timing.

Earlier exploratory timing runs and failed unpaced recorder attempts are not the final comparison. The supplied final driver was run unchanged on base and head, including recording and output checks.
