Repository navigation
Gate the SQL store's performance targets at ten times each - #313
Merged
Merged
Conversation
…over ten times its target The benchmark fixture now has live sessions, open questions and plans of twenty tasks. Session lists no longer read the ended attempts of finished work, and a plan's status reads its tasks' states without decoding each card. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012F3VVCcSbictsP6gsNN9g5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
A test fails when the SQL store exceeds 10× any performance target on the benchmark fixture (500 items, 1,000 attempts, 20,000 updates, 2,000 receipts):
get, anupdatespage andsession-viewat 1 ms;inbox,overviewandplan-detailat 5 ms; a write at 5 ms; opening a database at 200 ms, also with 10× the update history.Gates
./dev test(every required lane).test-ai-results/summary.md)internal/control/bench_test.go: the gate on the full-size fixture; opening with 10× history; the gate fails an operation over 10× and names it; a wrong answer is reported without timing; the fastest run is kept.internal/control/tx_order_test.go:SessionAttemptsleaves out the ended attempts of finished work;TaskStatesOfPlanreturns states only.Measured on a 16-thread machine (
go test -bench BenchmarkStore): get 0.06 ms, updates 0.14 ms, session-view 1.6 ms, inbox 0.8 ms, overview 9.9 ms, plan-detail 2.2 ms, write 0.3 ms. The gate passes with 5× or more headroom, butsession-viewandoverviewsit above their 1× targets (see Rulings).Rulings
Ruling (risk: low): the time bound is skipped under
-race(about 20× slower); there the fixture is a tenth the size and only answers are checked. Thecoveragelane (no race detector) enforces the time bound; no lane changes.Ruling (risk: low): each operation is timed by its fastest of 11 runs after a warm-up, so load pauses cannot flake it.
Ruling (risk: low): the fixture has 4 live sessions, open and answered operator questions, and plans of 20 tasks, because an idle fixture made
session-viewandoverviewlook free.Ruling (risk: low):
session-viewandoverviewlist only unended current attempts plus an unfinished task's ended one (newTx.SessionAttempts, replacingCurrentAttempts), and a plan's status reads its tasks' states without decoding their cards (Tx.TaskStatesOfPlan). Responses are unchanged. Without the first,session-viewread about 500 ended attempts and failed the gate.Ruling (risk: low): the code's schema is version 7; the card calls it v6.
Review
internal/control/bench_test.go(gate and fixture);internal/control/tx.go(SessionAttempts,TaskStatesOfPlan).Deviations
The card says the gate runs in the
unitlane; its time bound runs in thecoveragelane, because theunitlane runs under-race.overview(about 2× its 5 ms target) andsession-view(about 1.6×) are inside the 10× gate but over their 1× targets; most ofoverviewis the per-plan question lookup.🤖 Generated with Claude Code