Benchmark budgets before each major release instead of on every change
CI / core (push) Successful in 1m10s

Every change is still written to be light (rule #1), but agents no longer
run the probes per change: a full benchmark on the reference machine checks
the budgets before each major release, and a release over budget does not
ship. AGENTS.md links to CLAUDE.md so other agents read the same rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-11-17 23:47:57 +01:00
1 parent 3edfa629d4
commit 28319fc133
3 files changed
+6 -5

No files matched your search

Symlink
+1
View File
@@ -0,0 +1 @@
CLAUDE.md
+3 -3
View File
@@ -2,10 +2,10 @@
The app must stay as fluid and light as possible: it never feels slow and never makes the computer feel slow. This comes before features. Budgets, reference machine and how to measure: `docs/performance.md`.
- Any change that touches rendering, background work or memory measures before and after with the probes, on a release build (`scripts/prod`) on the reference machine, and records the numbers on its ticket. Debug numbers never count.
- A change that exceeds a budget is not done. When a budget is beaten durably, lower it in `docs/performance.md` (ratchet); never raise it.
- Write every change to be light: no avoidable work per frame, per hover or while idle, no polling where an event exists, background work at low priority, memory in proportion to what is shown. Do not run the probes or benchmarks for a change unless the user asks.
- Budgets are checked by a full benchmark before each major release: every probe, on a release build (`scripts/prod`), on the reference machine, numbers recorded in `docs/performance.md`. Debug numbers never count. A release over a budget does not ship. When a budget is beaten durably, lower it (ratchet); never raise it.
- Do not modify GPUI or gpui-component to meet a budget: reduce the app's own rendering cost (ADR-0004).
- A part of the page gets its own view for a reason: it owns state that changes on its own (the champion table: sort, selection, scroll, hover), or it is a cached view with a measured gain and a structural test (`docs/performance.md`). Other parts render as functions in their parent's render.
- A part of the page gets its own view for a reason: it owns state that changes on its own (the champion table: sort, selection, scroll, hover), or it is a cached view with a structural test (`docs/performance.md`), its gain checked at the next release benchmark. Other parts render as functions in their parent's render.
## Agent skills
+2 -2
View File
@@ -2,7 +2,7 @@
Arena Tracker must stay as fluid and as light as possible for its user: the app must never feel slow, and it must never make the computer feel slow. Nothing it does, in the foreground or in the background, may be excessive in CPU, memory or rendering.
This rule comes before features. A change that breaks a budget below is not done, however useful it is.
This rule comes before features. Every change is written to be light; a release that breaks a budget below does not ship, however useful its features are.
## Budgets
@@ -31,7 +31,7 @@ A measurement means something only with its machine and build: the probes print
## Measuring
Every change that touches rendering, background work or memory measures before and after, with the same scenario, on the reference machine, and records the numbers on its ticket.
Budgets are checked by a **full benchmark before each major release**: every probe below, on a release build, on the reference machine, with the results recorded in the budgets table above. Single changes are not measured, unless the user asks; a release that fails a budget is fixed before it ships, and the probes below (with `--features profile`) find the cause.
- **Window moves and idle CPU**: `powershell.exe -ExecutionPolicy Bypass -File scripts/move-probe.ps1 -Title "Arena Tracker"` from WSL, with the app open. It moves the window 240 times per second without touching the mouse, after an idle phase. `MOVE block` is the time each move holds the UI thread, close to the cost of the frame it causes; `IDLE cpu` is budget 2. Compare with File Explorer with `-Class CabinetWClass`. A real title-bar drag (Windows' modal move loop) is not covered: check it by hand.
- **Champion table hover**: `powershell.exe -ExecutionPolicy Bypass -File scripts/hover-probe.ps1 -Title "Arena Tracker"` from WSL, with the statistics page showing the table under the default band (adjust `-Top` and `-Bottom` otherwise). After an idle phase, it posts synthetic mouse moves across table rows 240 times per second without touching the real cursor. Compare `HOVER cpu` with `IDLE cpu`; `HOVER ping` shows how long input waits behind the UI thread while hovering (budget 1). The default band is `-X 0.25 -Top 0.62 -Bottom 0.95 -Step 0.04` (fractions of the client area, about one row per move in a window at least 800 px tall). Leave the real cursor still over the window, outside the table: when it is outside the window, GPUI sees each synthetic move as the mouse entering then leaving, and refreshes the whole window, bypassing cached views.