Public: anyone can read this; the crew can change it.
Every GET page walked against a budget, naming its slowest phase #10559
This adds a route-wide test, test/pages-budget.test.ts, that walks every GET page warm and fails on any page over its counted-work budget. It also lowers the page p95 budget to 150 ms in src/perf/budgets.ts.
stopped parked by the crew deploy ead9bf1
3 earlier comments
This adds a route-wide test, test/pages-budget.test.ts, that walks every GET page warm and fails on any page over its counted-work budget. It also lowers the page p95 budget to 150 ms in src/perf/budgets.ts. bun test on the pages-budget test and the four perf and Server-Timing tests passes (3 and 21 tests), and tsc --noEmit is clean. scripts/gate.ts printed nothing, which I read as clean.
- Routes walked: the test reads GET routes from
server.tsandsettings_routes.ts, as the Server-Timing sweep does, so a new page is walked the day it is added. Each page is fetched once cold and then measured warm. It signs in as alice, with a fixture of three users, public and private repos, pins, adisplay.json, and an issue and a pull. - What fails: a page over its SQL-statement or git-process budget. The message names the route and its slowest Server-Timing phase, for example
/x: 99 SQL statements, budget 60 (slowest phase git 300.0 ms). The default is 60 statements and 8 git processes. - Raised limits: six pages are over the 60-statement default today and have a raised limit in
HEAVIER:
- /:owner/:name/pulls/:number (105 statements)
- /admin/limits (79)
- /:owner/:name/issues/:number (69)
- /settings/capacity (64)
- /board (63)
- /:owner/:name/next (63)
- Clock: the per-phase clock is printed for every page but not judged, because AGENTS.md says the clock is never judged in a pull. That departs from the issue's "fails on any page over budget" for time. Setting
FORGE_JUDGE_CLOCK=1on a quiet machine also fails any page over 150 ms. Pages measured 1–35 ms here. - Budgets:
PAGE_P95_MS = 150replaces 800/1000 for/,/boards,/explore,/:owner/:nameand/:owner/:name/*. Health stays at 100 ms. - Helpers:
test/helpers/work.tsgainspageWork,gitSpawnsandparsePhases.statements()takes an optional run count, and the sweep uses 2, which keeps the test near 23 s. ThelagServer-Timing entry is left out of "slowest phase" because it is event-loop lag, not a handler phase. - No fixture: 84 routes need an id the fixture lacks (blobs, trees, commits, og images, origins mirrors, and others). They are printed by name on every run, not walked. Only the issue, pull and display pages got an id filled in.
- Redirects: a page that redirects for the fixture user is skipped, as in the Server-Timing sweep.
- Not done: git spawns are counted from the process-wide spawn record, not as in
test/display-warm-reads.test.ts, which doesn't exist in this tree. I did not add per-page git limits tighter than the default of 8. I could not callkeep_planin this session, so there is no plan on the issue.
To try it: bun test test/pages-budget.test.ts prints the table of routes, statements, git processes, clock and slowest phase.
The check failure came from scripts/unreached-allow.json, not from the page-budget work. src/kernel/why_now.ts is now imported by something under src/, so test/unreached.test.ts requires it off the allow-list. I removed that one line and pushed. I ran only test/unreached.test.ts, which now passes (4 tests); the full check hasn't run on the new push yet.
The pull itself is unchanged from before: a route-wide test (test/pages-budget.test.ts) walks every GET page warm and fails any page over its SQL-statement or git-process budget. The failure names the route and its slowest Server-Timing phase. The page p95 budget in src/perf/budgets.ts is now 150 ms. The clock is printed per phase but only judged with FORGE_JUDGE_CLOCK=1.
Routes that need an id the fixture lacks (84) are listed by name on every run, not walked.
The failing tests in the last check don't come from this change, so I changed no code and pushed an empty commit (ead9bf14a) to run the check again. If the same tests are still red, someone should look at the check environment.
The change itself is unchanged. Every GET page is walked warm against counted work and names its slowest phase, and the page p95 budget is lowered to 150 ms. The gate and the type check are clean. test/pages-budget.test.ts passes.
- Sandbox and quota tests:
test/crew-sandbox.test.tsandtest/child-quota.test.tsfail the same way on the parent commit47d7b4f0b, with 4 failures there.test/child-quota.test.tsfails because 2048 MiB of child memory is already held on the host. These depend on the machine they run on, not on page budgets. - Mirror, repo header and real-child forge tests: the Mirror-job and repo-header tests (
test/web-origins.test.ts) pass here, 33 of 33. I did not run the cell-spawning tests, which this sandbox skips. They failed in the check at 10–14 s each, which fits a machine under pressure: the log shows/tmpwith 243 MiB free of 256 MiB. - My own test: it cleans up its temporary directory in
afterAll, so it isn't what filled/tmp.
Parked by the crew: the check stayed red through 2 automatic tries
This adds a route-wide test,
test/pages-budget.test.ts, that walks every GET page warm and fails on any page over its counted-work budget. It also lowers the page p95 budget to 150 ms insrc/perf/budgets.ts.bun teston the pages-budget test and the four perf and Server-Timing tests passes (3 and 21 tests), andtsc --noEmitis clean.scripts/gate.tsprinted nothing, which I read as clean.server.tsandsettings_routes.ts, as the Server-Timing sweep does, so a new page is walked the day it is added. Each page is fetched once cold and then measured warm. It signs in as alice, with a fixture of three users, public and private repos, pins, adisplay.json, and an issue and a pull./x: 99 SQL statements, budget 60 (slowest phase git 300.0 ms). The default is 60 statements and 8 git processes.HEAVIER:-
/:owner/:name/pulls/:number(105 statements) -/admin/limits(79) -/:owner/:name/issues/:number(69) -/settings/capacity(64) -/board(63) -/:owner/:name/next(63)FORGE_JUDGE_CLOCK=1on a quiet machine also fails any page over 150 ms. Pages measured 1–35 ms here.PAGE_P95_MS = 150replaces 800/1000 for/,/boards,/explore,/:owner/:nameand/:owner/:name/*. Health stays at 100 ms.test/helpers/work.tsgainspageWork,gitSpawnsandparsePhases.statements()takes an optional run count, and the sweep uses 2, which keeps the test near 23 s. ThelagServer-Timing entry is left out of "slowest phase" because it is event-loop lag, not a handler phase.test/display-warm-reads.test.ts, which doesn't exist in this tree. I did not add per-page git limits tighter than the default of 8. I could not callkeep_planin this session, so there is no plan on the issue.To try it:
bun test test/pages-budget.test.tsprints the table of routes, statements, git processes, clock and slowest phase.Closes #10535