# macOS update asset reuse measurement

Run on macOS. Prepare a workspace with `base/` at [9789e3a85f](https://github.com/pingdotgg/t3code/commit/9789e3a85fa2ef16e9fc581ea3a296d12c2f1daf) and `head/` at [9ef88a6f14](https://github.com/pingdotgg/t3code/commit/9ef88a6f14f6344250c15e814dbb971f0888132b); run `vp i` in each. Put the published release ZIPs in `downloads/`, named `old-arm64.zip`, `new-arm64.zip`, `old-x64.zip`, `new-x64.zip` (old = [v0.1.12](https://github.com/pingdotgg/t3code/releases/tag/v0.1.12), new = [v0.1.13](https://github.com/pingdotgg/t3code/releases/tag/v0.1.13)). Download their public `.zip.blockmap` files with the same local names plus `.blockmap` for the untouched-release reference.

```sh
node prove.mjs "$workspace" arm64 "" 10000000
node prove.mjs "$workspace" x64 "" 10000000
node replay-published.mjs "$workspace" arm64
node replay-published.mjs "$workspace" x64
```

`prove.mjs` imports `createBuildConfig` from each checkout. It applies that commit's real macOS `asarUnpack` rules to both published versions, preserving original unpacked files, ASAR order, app symlinks and all logical payload hashes. Both sides use `/usr/bin/zip` with the same options and fixed timestamps. This is a counterfactual packaging comparison of actual published app payloads, not a rebuild of every source bundle at those commits. Recompression means absolute download sizes differ from the signed release ZIPs and the PR author's repack.

The real electron-updater `GenericDifferentialDownloader` reconstructs the entire new ZIP from a cached old ZIP and a local HTTP 206 server serving actual archive bytes. The server counts all response-body bytes. Seven runs per side alternate order on the same Mac. A 10,000,000 bytes/s response-stream limit makes download cost measurable; it is a controlled transfer experiment, not a live CDN timing claim. Every reconstructed ZIP is verified with SHA-512. Per-run bytes, ranges, elapsed time and updater logs are in the JSON and stdout captures.

`replay-published.mjs` replays untouched official ZIPs and their official blockmaps five times per architecture as a reference. It does not apply the head layout.

`read-assets.cjs`, run with each repacked arm64 app's own executable and `ELECTRON_RUN_AS_NODE=1`, reads all 87 fonts/models through their original `app.asar/apps/server/dist/client/assets/<filename>` paths and checks their SHA-512 hashes. The app is also opened with a fresh, isolated `T3CODE_HOME` for each side.

Production signing, notarization, an actual installed-app update/relaunch through a CDN, and native x64 app execution are outside this capture. No production user data is used.

App screenshots are 1100×780, light theme, fresh T3CODE_HOME on each side, and pixel-identical after visibly redacting the machine name. Each was captured only after two screenshots 500 ms apart matched. `inspect-app.mjs` fetches all 87 assets from the running app renderer and verifies SHA-512. Chromium uses the packaged app’s standard profile location; the feature data and server state are isolated with T3CODE_HOME.

`open-app.sh` records the packaged-app launch command used for the UI pass (screen lease required). It chooses a checked free port, a fresh state directory and disables automatic updates during the asset checks. Run `inspect-app.mjs` after the backend is ready. The measurements used a 12-core Apple silicon Mac with 12 GiB RAM, macOS 26.6.2, Node 26.13.1 and electron-updater 6.8.9; the packaged Electron runtime is 44.10.1.

The same packaged-Electron asset-read command also passed for both x64 layouts through Rosetta on the same Apple silicon Mac (87 assets, 63,741,156 bytes, all hashes matching). Native Intel hardware was not used.
