# WSL-only desktop startup measurement

Source base: [d5726cb88c](https://github.com/pingdotgg/t3code/commit/d5726cb88c3e80548de5d4e2f4cec0ebaa224760) (merge-base with main).
Source head: [231ac320fd](https://github.com/pingdotgg/t3code/commit/231ac320fd0183af67eea31725de100cb18770c4).

On Linux, use a separate worktree for each commit, run `vp i`, and run `vp pack` from `apps/desktop`. The desktop JavaScript bundle is cross-platform; the Windows-only native dependencies come from the official packaged Windows application.

Install nightly 0.1.10-nightly.20261114.4709 with its silent NSIS installer into a template directory. Run `package.cjs <dependency-checkout> <template-directory> <commit's-dist-electron-directory> <separate-output-directory>` for each commit. This replaces the desktop bundle in app.asar, preserving the official Electron/native/server/web/WSL payload. The native ASAR unpack pattern matches the repository's Windows packaging pattern. The packaged executable is run from each commit's own worktree.

Copy `measure.cjs` and `screen.ps1` into one directory. From the logged-in Windows desktop, run:

```
node measure.cjs "<base-output>/T3 Code (Nightly).exe" "<head-output>/T3 Code (Nightly).exe" "<new-timestamped-output-directory>"
```

The output directory must be fresh. The script makes isolated synthetic desktop profiles, enables `wslBackendEnabled` and `wslOnly`, selects Ubuntu, disables updates, and keeps WSL running. It completes onboarding through "Start without an agent" on each excluded warm-up launch. It then runs seven alternating measurements per commit. There is no agent turn and no copied user data.

Each measurement starts the real packaged Electron app and reads that process's Windows StartTime. CDP polls every 50 ms for the "What should we work on?" page and a visible, enabled "Add project" button whose centre is not covered. After the timing stops, the driver waits for two equal screenshots 500 ms apart and opens the Add project dialog to verify the screen works, then closes it and quits with Browser.close. Both builds must pass the same condition and functional check.

Two additional recorded launches are excluded from the sample statistics. `screen.ps1` records the real 1920x1080 desktop; the driver also saves CDP screenshots. Frame timestamps use the same Windows wall clock as the process StartTime. Generate the report with `report.py` after copying the final run directory to `captures/`. The supplied video renderer adds the commit and elapsed time; videos do not supply the medians.

Initial setup attempts that caught the first-run onboarding redirect were discarded in full. Only the final prepared-profile series is included in the measurement output.

Unverified: rebuilding the Windows installer and native dependencies from source. The pool image lacks Rust/Cargo, Python for node-gyp, and Visual Studio C++ Build Tools. The unchanged official nightly binaries were held constant instead.

Videos use the same central 1440x900 crop of the native desktop, retain real frame timestamps, stop at the usable screen, and hold the final frame for two seconds. Recorded launches took 12.250 s and 10.360 s with capture overhead; neither contributes to the medians.
