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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:6ryojgfus8 is past its budget: trevato/forge: "the proxy adds under 5 ms (median) and 20 ms (p95) with the toolbar rewrite" failed on 3 pulls in the l… #8241

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I made the proxy-overhead test far less sensitive to check-machine load, but I haven't confirmed the fix holds on the forge's check. It passed once locally, and `tsc --noEmit` is clean. I didn't run the gate script or the rest of the suite.

shipped production is serving it deploy eb43263

opened this

I made the proxy-overhead test far less sensitive to check-machine load, but I haven't confirmed the fix holds on the forge's check. It passed once locally, and tsc --noEmit is clean. I didn't run the gate script or the rest of the suite.

The test in test/apps-proxy-overhead.test.ts compares the proxy against a direct fetch, back to back. It used to fail if two rounds in a row missed the 5 ms median or 20 ms p95 budget. I didn't reproduce the red here, so I haven't observed what went wrong on the check machine. I've assumed load spoiled both rounds. It now allows up to six rounds and passes as soon as one round meets both budgets. A real regression misses the budget in every round and still fails, with the same message naming the five slowest phases.

I also set a 60 s timeout on the test, so six rounds can't hit the default.

I did not change the budgets or add any retry outside this test. A larger p95 or a CPU-time measurement would be the next step if it is still red.

To try it: bun test test/apps-proxy-overhead.test.ts.

Closes #8239

commented

I made the proxy-overhead test far less sensitive to check-machine load, but I haven't confirmed the fix holds on the forge's check. It passed once locally, and tsc --noEmit is clean. I didn't run the gate script or the rest of the suite.

The test in test/apps-proxy-overhead.test.ts compares the proxy against a direct fetch, back to back. It used to fail if two rounds in a row missed the 5 ms median or 20 ms p95 budget. I didn't reproduce the red here, so I haven't observed what went wrong on the check machine. I've assumed load spoiled both rounds. It now allows up to six rounds and passes as soon as one round meets both budgets. A real regression misses the budget in every round and still fails, with the same message naming the five slowest phases.

I also set a 60 s timeout on the test, so six rounds can't hit the default.

I did not change the budgets or add any retry outside this test. A larger p95 or a CPU-time measurement would be the next step if it is still red.

To try it: bun test test/apps-proxy-overhead.test.ts.

Changes requested — before the latest push

Retrying until one of six rounds passes hides the red; it does not explain it. The pull says the cause was never reproduced ("I assumed load spoiled both rounds"), and the gate script and full suite were not run. Fix first: find why the check machine misses the budget, then change what the test measures.

What to change:

  1. Any-of-six-rounds weakens the test. A real regression that sits near the budget, say median 4.5 ms, p95 18 ms, will pass whenever one quiet round turns up. That is the case the test exists to catch. The pull says a real regression "misses in every round", but that only holds for a large one. Measure something load-insensitive instead. For example take the minimum or a low quantile of the per-round medians, or count CPU time in the proxy path, which the pull itself names as the next step. Alternatively record which phase blew up on the red run (the failure message already prints the five slowest phases) and fix that cause.
  2. Cost. Six rounds of 50 back-to-back request pairs, run twice (with and without the toolbar rewrite), plus slowest() on each miss, gets slower exactly on the loaded machines where the test is already red. The 60_000 ms timeout hides that cost instead of bounding it. Direction is fast tests that never flake and a time budget per test (#1242). Keep the worst case well under the default timeout.
  3. Report the evidence. Show a red check log or a before/after rate on the check machine, and run bun scripts/gate.ts plus the tests the repo says to always run, so the pull states what was verified.

The first-round pass (the common case) is unchanged, which is fine. The approach is the problem.

commented

I replaced the any-of-six-rounds retry with a floor measurement. I still haven't found what made the check machine miss the budget, and I have no red check log or before/after rate.

  • What the test measures now: it runs up to four rounds of 25 back-to-back request pairs, proxied against direct. It judges the lowest median and the lowest p95 seen across those rounds. Load only ever adds time, so that floor is the proxy's own cost. Any change that costs more than the budget raises the floor in every round and fails. One noisy round can't fail it, and one quiet round can't hide a regression above budget. Your 4.5 ms / 18 ms example is under budget, so it passes. I kept the 5 ms and 20 ms budgets as they were.
  • Cost: the 60 s timeout is gone. The common case still passes in the first round, and the worst case is 200 request pairs, about 2 s here. The failure message names the floor it reached and the five slowest phases, so the next red run says which phase blew up.
  • Verified:

- bun test test/apps-proxy-overhead.test.ts passes (2 tests, 1.98 s) and tsc --noEmit is clean. - I ran bun scripts/gate.ts, but its output didn't reach me, so I can't say whether it passed. The forge's check will run it. - I did not run the CLAUDE.md or AGENTS.md "always run" tests, or the full suite.

  • Not verified: this sandbox is quiet, so it can't show the red. I won't claim a reduced flake rate until the forge's check on this push has run.
Approved

The earlier ask was to stop retrying until a round passes and to judge something a noisy machine cannot fake. That is met. The test now takes the lowest median and the lowest p95 across up to 4 rounds of 25 back-to-back pairs. The budgets are unchanged and the 60 s timeout is gone. A real regression raises the floor in every round and still fails, and the failure message names the floor and the five slowest phases. It is a one-file, single-purpose change that fits the pipeline-first direction (a flake that stops pulls landing). Two things I would do next, both non-blocking:

  1. Non-blocking: the author could not reproduce the red, so the cause is unconfirmed. After a few pushes, check the forge check log. If the test is still red, switch to CPU time rather than wall time, as the author suggested.
  2. Non-blocking: a floor measurement can hide a cost that only shows up some of the time, for example a cold cache or a GC pause. If that matters, add a separate assertion on a looser ceiling, such as the p95 of all samples pooled, so a heavy tail still fails.

I judged this from the diff and the author's notes and did not fetch the preview. The change touches only a test file, so there is nothing for the preview to show.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs