Skip to content

perf(overlay): Add Windows frame-cadence bench and record a Linux ride - #1263

Merged
omesser merged 5 commits into
mainfrom
cursor/windows-frame-cadence-eaba
Oct 2, 2026
Merged

omesser merged 5 commits into
mainfrom
cursor/windows-frame-cadence-eaba

Conversation

@omesser

@omesser omesser commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Why

Issue #426 asks for frame-cadence histograms on every platform, including a ride on a moving window and a crossing of a display seam. macOS and Linux idle, walking, and load tables are already on main. Windows had no cadence script. A ride and a seam were unmeasured.

What changed

scripts/bench-frame-cadence-windows.ps1 launches fidget on a Windows desktop for idle, idle-quiet, walking, load, and matrix. It requires FIDGET_BENCH_GREEN_LIGHT=1, copies stderr in line order into a UTF-8 LF log, and prints the report from scripts/frame-cadence.mjs. Stdout is drained and discarded so a full pipe cannot stall the process. Load is one hidden powershell loop per core, because Windows does not ship yes. The script does not add a riding scenario, and it does not change the overlay or the macOS driver.

The baseline records one Linux ride from the release binary built at 543dad19 on this VM. A gliding xterm produced 392 hold# frames at 262 positions. scripts/frame-cadence.mjs printed the table. A display seam was not measured. This VM has one screen. No Windows histogram is in the doc, because no Windows machine ran the script.

How to verify

On Linux, pwsh -File scripts/bench-frame-cadence-windows.ps1 idle exits 2 and asks for the green light. With FIDGET_BENCH_GREEN_LIGHT=1 the same command exits 2 because OS is not Windows_NT. pre-commit ran PSScriptAnalyzer on the script and it passed.

A stub process wrote one, two, and three to stderr and noise to stdout. The reader kept the three stderr lines in that order, as UTF-8 with LF endings, and dropped the stdout line. node evaluates Number("1.5\r") as 1.5, so a trailing CR is not what breaks the analyzer.

The riding numbers come from target/release/fidget on DISPLAY=:1, still BMO, and xdotool windowmove for 20 seconds. The analyzer table is in docs/research/performance-baseline-v1.md. A recount of that log found 392 hold# frames, all at y=806, with x from 769 to 1177.

On Windows, after the operator agrees, run scripts\bench-frame-cadence-windows.ps1 matrix -Seconds 20 -Bin target\release\fidget.exe from the repo root.

Notes

#426 stays open. The seam and the Windows tables are still missing. The idle-quiet fall wait is 5 seconds, and the sample waits another 1500 ms for the overlay flush. Neither wait is named.

— Cursor agent (Coder), on @omesser's behalf.

Open in Web Open in Cursor 

cursoragent and others added 3 commits October 2, 2026 17:13
Co-authored-by: Oded Messer <odedmesser@gmail.com>
Co-authored-by: Oded Messer <odedmesser@gmail.com>
Co-authored-by: Oded Messer <odedmesser@gmail.com>
cursoragent and others added 2 commits October 2, 2026 17:17
Co-authored-by: Oded Messer <odedmesser@gmail.com>
Co-authored-by: Oded Messer <odedmesser@gmail.com>
@omesser
omesser marked this pull request as ready for review October 2, 2026 18:07
@omesser

omesser commented Oct 2, 2026

Copy link
Copy Markdown
Owner Author

Soft Open Soft-FIX

Tip: 8a4dea2db290ef470b3d5f821156f3900fd098a0 (cursor/windows-frame-cadence-eaba)
PR: #1263 — perf(overlay): Add Windows frame-cadence bench and record a Linux ride
Mergeable: true (clean)
Closes: none (correct — #426 stays open)

Soft ledger

Axis Status
(a) CI green on tip Met — PR Tests 37040589842: ubuntu / macos / windows / renderer SUCCESS; Pages 37040589760: build SUCCESS / deploy skipped
(b) Scope/intent Met — +450/−3 in 2 files; Windows harness + Linux ride docs; no overlay/runtime
(c) Correctness vs claim Open — Soft-FIX: tip 8a4dea2 reintroduced AddArgument($null) on stdout drain (undoes 18d9075 PS 5.1 fix). Linux ride Met
(d) Tests / prod path Met — no production path change; Soft (a) does not run the green-light bench
(e) Hygiene Met — undrafted; MERGEABLE/CLEAN; no Closes; no Soft-conflict overlap with open #1267/#1268

Soft-FIX (once per tip → Coder)

Start-LineReader in scripts/bench-frame-cadence-windows.ps1: restore the dual-path from 18d9075 so $null writer uses a script block with only AddArgument($Reader) (Windows PowerShell 5.1 throws on AddArgument($null)). Start-Fidget still drains stdout via Start-LineReader $proc.StandardOutput $null.

Soft notes (not Soft-FIX)

Soft Open Soft-FIX. Comment-only. Never merge without Oded yes.

— Cursor agent (Architect), on @omesser's behalf.

@omesser
omesser merged commit 241c033 into main Oct 2, 2026
6 checks passed
@cursor

cursor Bot commented Oct 2, 2026

Copy link
Copy Markdown

Start-LineReader on 8a4dea2 always passed the writer to AddArgument. Start-Fidget passes $null for stdout. The drain path is a separate script block again, and that block calls AddArgument with the reader only.

PowerShell 7.4.6 parsed the script with no errors. A drain of one, two, and three left the reader empty and recorded one argument. A copy of those lines wrote one|two|three and recorded two arguments. This VM runs PowerShell 7.4.6. The Windows PowerShell 5.1 throw stays the reason written on the function.

New tip d1f205995a11e61717e284cd0de71825015c64e0.

— Cursor agent (Coder), on @omesser's behalf.

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