Skip to content

Lower the checkpoint shadow budget default from 5 s to 1 s - #55

Merged
zachyking merged 1 commit into
mainfrom
fix/shadow-budget-1s
Oct 27, 2026
Merged

zachyking merged 1 commit into
mainfrom
fix/shadow-budget-1s

Conversation

@zachyking

Copy link
Copy Markdown
Member

Why

Release-1 soak (0.5 calls/s, fresh history): the scheduled shadow check recomputes the full checkpoint body under the project write lock inside the budget. From about 5 h of history it stopped fitting 5 s reliably. Near the boundary a success (which resets the backoff) alternates with failures, so attempts stay about hourly and each is a 3.5 to 5 s write stall (metered calls of 3.3 to 5.1 s at 07:25, 08:26, 09:27, 10:28, 11:50, 12:51Z). At lighter load this zone lasts days.

Change

DefaultCheckpointShadowBudget 5 s -> 1 s, so one attempt holds the write lock for about 1 s. Backoff, min interval (#52) and refusal semantics are unchanged; a mismatch still refuses.

Trade (stated in LIMITATIONS, CONFIGURATION, claims)

The cross-check covers less history: an estimate scaled from the measurement (about 5 s at about 5 h on the soak host) is that it stops fitting after roughly an hour of history at 0.5 calls/s, later at lighter load. It was already ineffective beyond a few hours. The differential tests remain the primary assurance.

Verification

  • make test-server, go vet, gofmt: clean (taskset -c 0-7)
  • New assertion that the default is 1 s in TestCheckpointCutShadowBudgetIsClamped
  • check_claims (kit) 753 checks, 0 failures; no cover drift, so no relock; FORMAL.md re-rendered
  • All 9 shadow mutants still killed

🤖 Generated with Claude Code

Evidence (release-1 soak, 0.5 calls/s, fresh history): the scheduled shadow
check recomputes the full checkpoint body under the project write lock inside
the budget. From about 5 h of history it stopped fitting 5 s reliably. Near
that boundary a success (which resets the backoff) alternates with failures,
so attempts stay about hourly and EACH is a 3.5 to 5 s write stall (metered
calls of 3.3 to 5.1 s at six consecutive attempts). At lighter load this
zone lasts days.

With a 1 s default one shadow attempt holds the write lock for about 1 s.
The trade: the cross-check covers less history. Estimated (scaled from the
measurement, about 5 s at about 5 h on the soak host) it stops fitting after
roughly an hour of history at 0.5 calls/s, later at lighter load. It was
already ineffective beyond a few hours. The differential tests remain the
primary assurance.

Backoff, min interval and refusal semantics are unchanged: a mismatch still
refuses. Adds a test pinning the default at 1 s, updates LIMITATIONS,
CONFIGURATION, the claims text and the rendered FORMAL.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zachyking
zachyking merged commit 09c5414 into main Oct 27, 2026
36 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