Skip to content

Move TMP/TEMP to the workspace disk on Windows CI runners#265

Merged
cboos merged 1 commit into
mainfrom
dev/ci-windows-temp
Jul 4, 2026
Merged

Move TMP/TEMP to the workspace disk on Windows CI runners#265
cboos merged 1 commit into
mainfrom
dev/ci-windows-temp

Conversation

@cboos

@cboos cboos commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Part of #248; follow-up to #264.

Problem

Even with coverage scoped to the primary job (#264), Windows unit-test steps still ran ~3.5x slower than ubuntu (~555s mean vs ~161s for the same selection). An A/B experiment on real windows-latest runners (run 28715118956, 5 variants x 2 reps, full evidence in work/win-io.md) isolated the cause: TMP/TEMP default to the throttled C: OS disk, and this tmp_path-heavy suite pays its I/O prices.

variant mean (s) verdict
baseline 554.5 control
defender-off 557.7 no-op — real-time protection is already off on current images
defender-excl 672.7 no-op + VM variance
ReFS dev drive 296.4 helps, but dominated
TMP/TEMP → RUNNER_TEMP 150.2 ubuntu parity

Change

One early, Windows-gated step writing TMP/TEMP = RUNNER_TEMP (the workspace disk) to GITHUB_ENV, so every later step benefits (unit, TUI, browser, and dependency installs). Plus work/win-io.md recording the experiment so the step isn't "simplified away" later.

Side benefit: tmp dirs and the checkout now live on the same drive, removing the cross-drive layout that can break os.path.relpath between tmp_path and repo paths on Windows.

Expected effect

Windows unit step ~735s (pre-#264) → ~150s; Windows jobs should drop off the CI critical path. This PR's own CI run is the end-to-end verification.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows CI reliability and performance by routing temporary files to a faster temporary location before install and test steps run.
  • Documentation
    • Added a write-up summarizing the Windows CI performance experiment, findings, and the recommended configuration change.

On windows-latest, TMP/TEMP default to the throttled C: OS disk, and
this tmp_path-heavy suite pays its I/O prices: the unit selection ran
555s mean vs ~161s on ubuntu. An A/B experiment on real runners (run
28715118956, 5 variants x 2 reps, evidence in work/win-io.md) showed
redirecting TMP/TEMP to RUNNER_TEMP (the workspace disk) alone reaches
ubuntu parity at 150s mean, while the plausible alternatives lose:
Defender real-time protection is already off on current images (both
Defender variants measured as no-ops) and a ReFS dev drive (296s) is
dominated by this redirect.

The redirect is written to GITHUB_ENV early in the job so unit, TUI,
and browser steps all benefit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4769c74e-5411-4704-ba41-3a12f85f6b8c

📥 Commits

Reviewing files that changed from the base of the PR and between 52da5c9 and 3990b3b.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • work/win-io.md

📝 Walkthrough

Walkthrough

This PR adds a Windows-only CI step in ci.yml that redirects TMP and TEMP environment variables to RUNNER_TEMP via GITHUB_ENV to improve Windows test runtime, and adds work/win-io.md documenting the A/B experiment and findings supporting this change.

Changes

Windows CI Temp Redirect

Layer / File(s) Summary
CI workflow env redirect
.github/workflows/ci.yml
Adds a Windows-only step that sets TMP and TEMP to RUNNER_TEMP via GITHUB_ENV before install/test/lint/type-check steps.
Experiment write-up
work/win-io.md
Documents the Windows timing problem, A/B test variants and results, findings on Defender/ReFS/temp redirect impact, the resulting CI change, and future experiment notes.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: redirecting TMP/TEMP on Windows CI runners for performance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/ci-windows-temp

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.

@cboos cboos merged commit 42e54d4 into main Jul 4, 2026
17 checks passed
@daaain

daaain commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Oh wow, this was unexpected!

@cboos

cboos commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Oh wow, this was unexpected!

Well, that was Fable continuing where Opus dropped the gauntlet ;-)

@cboos

cboos commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

For the record, the builds for this commit on main:

image

We're still slower on Windows (4-5 min) vs. Linux (2-3 min), but both are indeed in the same league now.

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.

2 participants