Skip to content

perf: Add Linux and Windows RSS baseline scripts - #600

Merged
omesser merged 10 commits into
mainfrom
cursor/memory-rss-linux-windows-1a4a
Sep 12, 2026
Merged

omesser merged 10 commits into
mainfrom
cursor/memory-rss-linux-windows-1a4a

Conversation

@omesser

@omesser omesser commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

What

Linux and Windows RSS bench scripts that match the macOS contract, plus measured numbers in docs/research/memory-rss-and-multi-monitor.md.

Live short runs (5s settle / 30s sample, tip f27703b):

OS Setup Total memory
Linux (Grok Bot box) 1× bmo:One, 1 display RSS min 821 / median 823 / max 933 MB
Windows (DESKTOP-UQIE144) 1× bmo:One, 2 displays WS min 607 / median 612 / max 620 MB

macOS figures from #590 are unchanged.

Why

#424 needs cross-OS RSS baselines. #590 covered macOS only. Without Linux/Windows scripts and real numbers, you cannot compare toolkits (WebKitGTK / WebView2) to that baseline.

Defaults are short so you can stage many scenarios quickly. The long --research / -Research mode is optional when you need the same long settle/sample curve as #590 — we did not run that mode on Linux or Windows in this PR.

Also not in this PR: a multi-display Linux run, and any cross-OS figures that were not measured.

How to test

  • Linux unattended run on Grok Bot box @ f27703b — exit 0, numbers above
  • Windows unattended run on DESKTOP-UQIE144 @ f27703b — exit 0, numbers above
  • Research doc updated with those measurements only (no fabricated numbers)
  • docs/DEVELOPMENT.md lists the three scripts under the new names
  • Scripts renamed: bench-rss-macos.sh, bench-rss-linux.sh, bench-rss-windows.ps1; docs/examples updated; no leftover bench-rss.sh / bench-rss.ps1 refs

Related to #424

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

@cursor
cursor Bot force-pushed the cursor/memory-rss-linux-windows-1a4a branch from c37eb44 to 73a27c9 Compare September 11, 2026 23:20
@cursor
cursor Bot marked this pull request as ready for review September 11, 2026 23:32
@cursor
cursor Bot force-pushed the cursor/memory-rss-linux-windows-1a4a branch from db4a29b to 1bdab40 Compare September 11, 2026 23:36
cursoragent and others added 6 commits September 11, 2026 23:37
- scripts/bench-rss-linux.sh: Linux RSS measurement script
  - Uses VmHWM (peak RSS) from /proc/[pid]/status
  - Discovers WebKitGTK helpers via process tree (pgrep -P)
  - Same contract as macOS script (settle, sample, report)

- scripts/bench-rss.ps1: Windows RSS measurement script
  - Uses PeakWorkingSet from Get-Process
  - Discovers msedgewebview2.exe helpers via set difference
  - Same contract as macOS/Linux scripts

- docs/research/memory-rss-and-multi-monitor.md:
  - Restructured with clear macOS/Linux/Windows sections
  - Linux: method provided, measurements blocked (headless VM)
  - Windows: method provided, requires hardware
  - No fabricated cross-OS numbers

- docs/DEVELOPMENT.md:
  - Updated Automated Scripts section
  - Added pointers to Linux and Windows bench scripts

Linux measurements blocked by GTK display authorization on Cloud Agent VM.
Windows measurements require execution on actual hardware.

Related to #424

Co-authored-by: Oded Messer <odedmesser@gmail.com>
- shfmt formatting on bench-rss-linux.sh (space around redirections)
- Strip non-ASCII em dash from bench-rss.ps1 (line 44)
- Fix trailing whitespace in bench-rss.ps1

All pre-commit checks now pass.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
…mode

Change all three RSS bench scripts (macOS, Linux, Windows) from long research
defaults (settle 300s, sample 300s) to brief smoke-test defaults (settle ~3s,
sample ~10s). Add --research (bash) / -Research (PowerShell) flag to restore
the long soak for measurement studies.

Verification/benches must be brief so tens/hundreds of scenarios can
stage/test/verify quickly. The 300s+300s (~10 min) default was cargo-cult from
macOS #590 research soak; inappropriate for everyday verification.

Changes:
- scripts/bench-rss.sh: settle 3s, seconds 10s, interval 2s by default
- scripts/bench-rss-linux.sh: same brief defaults
- scripts/bench-rss.ps1: same brief defaults
- All three scripts: add optional research mode flag for 300s+300s soak
- docs: Updated to document both modes, default is brief smoke test
- DEVELOPMENT.md: Note brief defaults, research mode available

Short defaults enable fast scenario matrices; optional research mode preserves
bathtub curve analysis capability when needed.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
…iable

Two bugs found during Windows smoke test on DESKTOP-UQIE144:

1. Overlay signal is on stderr, not stdout. Script redirected stderr to
   separate file ($log.err), so it never found 'overlay: N display' and
   timed out. Fix: merge stderr into stdout by passing same path to both
   -RedirectStandardOutput and -RedirectStandardError.

2. PowerShell reserves $PID as automatic variable (current process ID).
   Using $pid as loop variable wrote zeros during sampling. Fix: rename
   all $pid to $procId throughout the script.

Brief defaults (settle 3s, sample 10s) + optional -Research preserved.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
Co-authored-by: Oded Messer <odedmesser@gmail.com>
@omesser
omesser force-pushed the cursor/memory-rss-linux-windows-1a4a branch from 1bdab40 to 2b57ce9 Compare September 11, 2026 23:38
@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown

Rebased onto latest main, resolved DEVELOPMENT.md conflict, fixed PowerShell ASCII-only pre-commit issue.

Tip: 2b57ce9 (fix(bench-rss.ps1): Replace non-ASCII em dash for pre-commit)

CI green: ubuntu ✓ / macos ✓ / windows ✓ + Pages ✓ (run 34658823789)

Changes preserved:

  • Brief defaults (settle ~3s, sample ~10s) + optional --research/-Research mode
  • stderr merged into stdout so overlay signal detection works
  • $PID renamed to $procId to avoid PowerShell reserved variable

Ready for review; not merged.

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

- Windows fails when both stdout and stderr redirect to same file
- Now uses separate $errLog for stderr, watches both logs
- Fixed per-pid median: access TSV columns by pid directly, not by array index
- Changed trap to use 'break' instead of 'throw' after cleanup

Co-authored-by: Oded Messer <odedmesser@gmail.com>
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Windows unattended re-run PASS @ f27703b (tip).

Configuration: 1 Instance bmo:One, 2 displays, Settle 5s / Sample 30s

Results:

  • Total: min 607 MB / median 612 MB / max 620 MB
  • Exit code: 0

The fix separates stdout and stderr logs (Windows fails when both redirect to the same file) and corrects the per-pid median calculation to access TSV columns by pid directly instead of by array index.

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

cursoragent and others added 2 commits September 12, 2026 01:23
…QIE144

- Add Windows results: 607-620 MB total working set (1 Instance, 2 displays)
- Fix settling defaults: scripts use brief defaults (~3s / ~10s), not 300s
- Keep Linux unmeasured (GTK auth failure on headless VM)
- Update Windows section: method → measured, expected → behavior

Co-authored-by: Oded Messer <odedmesser@gmail.com>
- Linux: 821-933 MB total RSS (1 Instance, 1 display, 4 processes)
- Both Linux and Windows now measured at commit f27703b
- Update Linux section: blocked → measured with live results

Co-authored-by: Oded Messer <odedmesser@gmail.com>
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Both Linux and Windows measurements are now in:

  • Linux (Grok Bot box): 821–933 MB total RSS (1 Instance, 1 display, 4 processes)
  • Windows (DESKTOP-UQIE144): 607–620 MB total working set (1 Instance, 2 displays)

Both runs at commit f27703b with 5s settle / 30s sample, exit 0.

Research doc and PR description updated.

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

Co-authored-by: Oded Messer <odedmesser@gmail.com>
@omesser
omesser merged commit 443a2ca into main Sep 12, 2026
5 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.

2 participants