# Model picker performance evidence

The measurement runs the actual web development app from the two unmodified commits:
base b2387ca1037894232fee82d4854ae56fb1cf90e1 and head 266227ad3e51f27e40bda373fa372459da3f47d8.

Environment: Linux x86_64, AMD EPYC / 8 KVM vCPUs, Chromium 158, 1280x800, dark.
Each checkout ran `T3CODE_DEV_SEED=0 vp run dev` against its own fresh .t3 state.
No production credentials or databases were copied. The scenario runner's documentation
excludes timing/performance regressions, so this is manual real-app proof.

## Reproduce
1. Install dependencies in both worktrees with `vp i`; start each with the command above.
2. Create an empty synthetic Git project. In each checkout:
   `node apps/server/src/bin.ts project add <synthetic-project> --title "Model picker proof" --base-dir .t3`
   `node apps/server/src/bin.ts thread start <synthetic-project> "Show the model picker" --title "Model picker measurement" --provider devReplay --model multi-turn --wait --json --base-dir .t3`
3. Pair two T3 preview browser tabs using each server's one-time pairing URL.
   Open each synthetic thread directly. Open the composer model picker.
4. In the page run `installProbe()` from driver.js. The hook observes React commits;
   it does not change React components or application source.
5. Call `measure(tools, tabId, count)` from driver.js for count 4, 11, 31 on each side.
   Here `tools` is T3 Code's preview-tool bridge, and tabId is that side's paired tab.
   The real pointer input uses preview_act hover and generates trusted mouse events.
   The focus sweep calls native HTMLElement.focus(), awaiting two animation frames.
6. Each configuration has 3 runs, 1 warm-up pass per run, then 5 timed passes over
   every rail button. The counts include Favorites. There are 3, 10 and 30 provider
   instances; additional instances are Codex instances with synthetic names and
   default configuration. No model request is made to Codex.
7. Save each returned sample list. measurements.json contains those samples and
   recalculated summaries. report.py reads this file and writes the charts:
   `python3 report.py <artifact-directory>`.
   Only samples with captured input equal to the phase action enter summaries.
   Scrolling can add hover commits. Favorites has no hover state of its own.
8. After timing, mark Provider 27 unavailable using a synthetic missing executable
   (binaryPath /missing-proof-provider). Run captureFlow(tools, tabId) from
   capture-driver.js to record identical behavioral checks. It checks provider
   selection, ArrowDown / Enter, ArrowRight to search, disabled selection, actual
   model selection, and Escape. The recordings anonymize only the host label to
   "Test environment" after timing, without changing picker components.

The final 31-button measurement was repeated after removing the automatically
created default project, so both sides had one identical synthetic project and
replay thread. The earlier 4/11-button runs had identical picker entries; base
also had an unused default project outside the measured subtree.

## Reading the numbers
latency: pointerout/pointerover or focusin capture to onCommitFiberRoot, in ms.
It measures React commit latency, not paint latency.
duration: ModelPickerSidebar fiber actualDuration in the dev React build.
renders: component fibers with PerformedWork, pruning bailed-out subtrees,
using the same rule as the repository's client metrics probe.
Triplets in each chart are the three run medians. Compare the median of those
medians with the max-minus-min spread between run medians.
The 4-button result does not establish a timing gain beyond noise.
Focus still renders all ToolbarButton components on head, while much less of
their tooltip subtree renders.

Tooltip popups did not visibly open on either side during hover attempts; their
preservation is unverified. Disabled state, explanatory aria-label and unchanged
selection were verified. This evidence concerns the dev web client; production,
desktop shell and native mobile were not measured.

Prepared with gpt-6.1-sol in the Codex harness.

