Skip to content

ci: the deploy gate measures what a cache hit still costs - #398

Merged
chrishayuk merged 1 commit into
mainfrom
ci/witness-repeat-cost
Sep 2, 2026
Merged

ci: the deploy gate measures what a cache hit still costs#398
chrishayuk merged 1 commit into
mainfrom
ci/witness-repeat-cost

Conversation

@chrishayuk

Copy link
Copy Markdown
Owner

Follow-through on the cache-before-work fix (#392): turn the observed separation into a gate.

A hit being fast never showed the cache was working. Before the lookup moved ahead of the
work, a repeat already answered in 0.85–1.90s because hf-hub's disk cache had removed the
network while the 39 MB header parse still ran. Any wall-clock assertion would have passed on
the broken path.

So the gate measures the round trip to a route that does nothing (/v1/health) and subtracts
it. What remains is server-side time:

total minus floor
/v1/health 0.083–0.101s
hit, post-fix (GLM-5.3-Flash) 0.322–0.389s ~0.25s
hit, post-fix (Qwen3-0.6B) 0.26s 0.15s
hit, pre-fix 0.85–1.90s 0.76–1.81s

Ceiling at 0.50s, between them with margin either side.

Control

The same logic against real timings from both paths:

pre-fix warm, slow      work=1.71s  FAIL
pre-fix warm, fast      work=0.86s  FAIL
post-fix, GLM           work=0.25s  PASS
post-fix, Qwen3-0.6B    work=0.15s  PASS

What it is and is not

A deployment signature, not a performance budget. The semantics are proven in CI by
a_cache_hit_stages_nothing_and_plans_nothing, which counts commit probes, staging passes and
planner invocations directly and fails when the old order is restored. This only answers
whether the binary serving traffic is the one that does that — which VmHWM cannot, since it
is cumulative and a retained arena can absorb a reparse without moving the high-water mark.

Verified against the live deployment: the full gate passes end to end.

A hit being fast never showed the cache was doing its job. Before the
lookup moved ahead of the work, a repeat already answered in 0.85-1.90 s
because hf-hub's disk cache had removed the network while the 39 MB
header parse still ran. Any wall-clock assertion would have passed on
the broken path.

So measure the round trip to a route that does nothing and subtract it.
What remains is server-side time, and the two paths are far apart there:

  pre-fix hit    0.76-1.81 s   a full header reparse
  post-fix hit   0.15-0.25 s   one ranged GET for the commit

Measured on the box today, five samples each, against a 0.09-0.11 s
floor read from /v1/health. The ceiling sits at 0.50 s, between them
with room on both sides, and the pre-fix timings fail it while the
post-fix ones pass.

It is a deployment signature rather than a performance budget: the
semantics are proven in CI, which counts probes, staging passes and
planner invocations directly. This only answers whether the binary
serving traffic is the one that does that.
@chrishayuk
chrishayuk merged commit 67afdea into main Sep 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant