Skip to content

test(wsl): measure the old bridge's ConPTY terminal after a distro restart - #35662

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-conpty-bridge-baseline
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-conpty-bridge-baseline

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​51 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​49
Prod 0 0 0 0

ELI5

The real-WSL test already measures how long a terminal takes to answer after a WSL distro restart: once for the new WSL host and once for a bare wsl.exe command, which undercounts the old way. This adds the old way as Orca actually runs it, a real terminal (ConPTY) running wsl.exe. That gives the new host a fair number to beat.

What Changed

distroRestartBaseline in the phase-3 lane gains a third arm, restartThroughBridgeConpty:

  1. wsl --terminate the lane's own distro;
  2. spawn wsl.exe in a ConPTY (node-pty, built for Node in this job) with the same setup command the bridge's WSL terminals use: cd, then buildWslInteractiveLoginShellCommand, the distro's interactive login shell;
  3. type the same printf probe ahead, and record firstPaintMs (first byte from the terminal) and firstOutputMs (the probe's output).

The arms alternate (host, exec, ConPTY), and the receipt adds bridgeConpty, medianBridgeConptyFirstPaintMs and medianBridgeConptyFirstOutputMs.

Why

The host's cold-start budget should be set against the bridge terminal users actually get. The exec lower bound skips the ConPTY start and the interactive shell's paint.

Flag-off: this is test-only; nothing ships.

Linked Issue

Internal WSL-via-orcad tracker D3 bars (reboot → prompt), following #34864.

Visual Proof

N/A: this adds a test only.

Testing

typecheck:ci, oxlint, the changed-code gate and the flaky-test ratchet pass. The numbers come from this PR's WSL2 lane run.

  • Automated tests added/updated

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A for visuals with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (CI runs them)

…start

The restart baseline only had a non-PTY wsl.exe exec as the old bridge's lower bound. The lane
now also runs the bridge as the app does: wsl.exe in a ConPTY with the bridge's WSL terminal
setup command and the probe typed ahead, recording first paint and first command output, median
of 3, alongside the host and exec runs. Test-only.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26eabac8-1b1a-40c0-90db-d8f6743759ef
Commits

Reviewing files that changed from the base of the PR and between d334119 and fd67c7b.

Files selected for processing: 1
  • src/main/wsl/wsl-orcad-real-distro-idle-release-lane.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change only affects a gated real-WSL test lane.

Match the bridge's actual terminal launch before merging this benchmark.

Findings

  1. P1 Baseline measures a different launch ▶

Summary

Adds a third distro-restart benchmark arm using node-pty to launch wsl.exe.

  • The restart lane measures the old bridge through a real terminal.

Reviews (1) · Last reviewed commit: "test(wsl): measure the old bridge's ConP..." · Reviewed by Greptile

Comment on lines +461 to +470
const setup = ['cd "$HOME"', buildWslInteractiveLoginShellCommand()].join(' && ')
const started = performance.now()
const terminal = pty.spawn(
resolveWslExecutablePath(),
buildWslExecArgs(PLAIN, ['sh', '-c', setup]),
{
cols: 120,
rows: 30,
cwd: resolveWslInteropSpawnCwd(),
env: { ...process.env }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Baseline measures a different launch

This arm skips setup that the bridge uses: useConptyDll: true, shell wrapper creation, and passing ORCA_SHELL_READY_ROOT through WSLENV. On a fresh lane runner, buildWslInteractiveLoginShellCommand() therefore starts a plain login shell instead of loading the bridge's Bash wrapper. The recorded timings compare different terminal and shell startup paths, so they cannot serve as the intended bridge baseline.

Reuse the bridge's launch setup, environment, and ConPTY options before recording these numbers.

@nwparker
nwparker merged commit 074fc36 into main Oct 29, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant