test: CPU occlusion-throttle measurement harness - #266
Merged
Conversation
Measures app CPU cost with N busy terminal panes hidden vs visible, to establish a baseline for the occluded-render throttle (ghostty fork 08bac45e9, PR #265). Socket-driven external harness, zero shipped code -- not added to the curated CI subset, run manually or via workflow_dispatch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds the first CPU measurement harness for the "lean and speedy" workstream. It answers one question: how much CPU does the app burn with N busy terminal panes the user cannot see, compared to the same panes when they're visible. This is the baseline we need to actually prove the occluded-render throttle (ghostty fork
08bac45e9, PR #265, ~4Hz redraw cap for hidden surfaces) helps.Zero shipped code. It's an external harness that drives an already-built, tagged app through the existing socket CLI and samples CPU from outside — nothing touches
Sources/or anything that ends up in the app bundle.Summary
tests_v2/test_cpu_occlusion_throttle.py: three scenarios built from existing socket commands (workspace.create/select,surface.split,surface.send_text,workspace.close):hidden-busy— N workspaces each with one busy pane, occluded behind a different selected workspace (the throttle's actual target scenario)visible-busy— the same N busy panes as splits in one visible workspace (control, capped at 6 panes)idle— N hidden, non-busy panes (baseline)ps -o time=at the start and end of the window (notps -o %cpu, which is a decayed average on macOS and misleads over a short window).cpu_percent = (cpu_time_delta / wall_time_delta) * 100. Reports the app process alone and app + PTY/shell descendants.tests_v2/ci_subset.txt(the curated PR-gating subset) — manual/dispatch-run only, same as the existing lag harnesses.docs/cpu-harness.md: how to run it against a tagged build, scenario descriptions, and the cumulative-CPU-time methodology note (including "compare medians of 3+ runs, one run is noisy"). Small pointer update indocs/testing-layout.md.Test Plan
python3 -m py_compile tests_v2/test_cpu_occlusion_throttle.py— passesgit diff --statagainst main — onlytests_v2/anddocs/, nothing underSources/