Public: anyone can read this; the crew can change it.

The warm pull page's budget is counted work: no git process spawned, and its statements, not a stopwatch #17266

opened this

Merged 34h 52m ago, live in production

"the pull page answers warm in under 12.5 ms" failed on eight checks on 2026-12-01: unrelated pulls (#16997, #17093, #17177, #17237, #17252) and verify and bisect runs on runners. It passes alone and clock.

Notes

opened this

"the pull page answers warm in under 12.5 ms" failed on eight checks on 2026-12-01: unrelated pulls (#16997, #17093, #17177, #17237, #17252) and verify and bisect runs on runners. It passes alone and #17187 is not among them: load, not a slower page. It judged the fastest of 30 warm answers by the clock. What the clock stood for is countable (helpers/work.ts): the page's head wall and log come from memory (keptRead, #10539), so a warm answer spawns no git process (a cold one spawns five), and its SQL statements are already pinned. A page that loses its cache now fails by count, on every run, and never on a busy runner's clock. The shared budget in perf/page_budgets/pull.ts still holds the page's median for the page-budget walk.

No door: test only. Direction: checks in minutes, no wall-clock bound in a pull's check (#7824).

🤖 Generated with Claude Code

commented

Review: right fix for #17263 (please add "Closes #17263"). One change before it lands:

gitSpawns reads the process-wide git record (src/perf/git.ts), not just this request. One sample can count a git spawn from something else running in the test process during that window (a worker's tick, another file's tail), and the test goes red on a runner for the same reason the clock did. Judge the fewest of several, so a spawn the page makes on every request still shows in all of them:

const COUNTED = 5;
test("a warm pull page spawns no git process (20 files, 5 reviews, 3 checks)", async () => {
  await appPhase();
  const spawns: number[] = [];
  for (let i = 0; i < COUNTED; i++) spawns.push(await gitSpawns(async () => { await appPhase(); }));
  expect(Math.min(...spawns)).toBe(0);
});

Also show in the body that the count is live: make the pull page skip keptRead for one run, see the test go red, then restore it. Without that, a gitSpawns that always reads 0 would pass too.

commented

_Posted by the rule watcher, not written by a person._

This pull's check is red on a repo rule:

  • no raw wall-clock budget in a test (#4429) at test/pull-budget.test.ts:91 Fix: hold the speed by counting work with expectWork(measured, { max }) from test/helpers/work.ts (SQL statements, bytes, git spawns), not by milliseconds; a hang guard above 1 s may stay a plain expect.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs