Repository navigation
Conversation
The event log used SQLite's default auto-checkpoint of 1,000 pages. Every commit rewrites the same hot pages, so each checkpoint cycle copied them back into the database again. Checkpointing every 4,000 pages copies them back a quarter as often, and 4,000 pages of 4 KiB still fit within the 16 MiB journal_size_limit set in apache#7115. With 16 concurrent sessions running scripted repair work, storage writes fell from about 27.0 MiB to 24.0 MiB per tool call. Wall time did not regress. Generated-by: Claude Code
This branch has not been deployed
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.
Supersedes #6700, which GitHub closed when
rust-previewwas deleted after the switch tomain. Rebased ontomain(73f2333), wherecargo nextest run -p maka-event-logpasses (47 tests). The measurement below was taken onrust-preview19e6a11, whichmainnow contains.Summary
The event log used SQLite's default auto-checkpoint of 1,000 pages. Every commit rewrites the same hot pages, such as the right edge of
event_log,sqlite_sequenceand the per-session index leaves, so each checkpoint cycle copied them back into the database again.This sets
PRAGMA wal_autocheckpoint = 4000on the writer connection. Hot pages are copied back a quarter as often. The PR originally used 10,000 pages; #7115 has since capped the runtime WAL withjournal_size_limit = 16777216. 4,000 pages of 4 KiB (about 15.6 MiB) stay under that limit. At 10,000 pages, the WAL would reach about 40 MiB before every checkpoint and then be truncated back to 16 MiB, undoing that cap.This only addresses the checkpoint share of #6699. The rest comes from how many pages each event touches, which needs a design decision.
Refs #6699
Verification
Re-measured on
rust-preview19e6a11 (macOS 27.0.1, arm64), with one release build that reads the checkpoint interval from an environment variable for the comparison only. A productionmaka host serveran scripted repair work against a loopback OpenAI-compatible model: eachmaka runsession ran 24 cycles ofRead,Shell(grep),Shell(a small Python check),Edit,Shell, each call in its ownexeccell. Writes come fromproc_pid_rusageon the Host process. Every run finished all 1,920 tool calls without a tool failure, and every edited file reached the expected value.16 concurrent sessions, 1,920 tool calls per run, runs alternated:
wal_autocheckpointjournal_size_limittruncates the WAL only when it resets, and concurrent readers can keep it growing until then. That's unchanged here.execcell throughmaka run, and perf(agent,event-log): fix Scenario M O(1) scaling, cell/catalog leaks, history indexes, and RequestComposition dedup #7115 has changed the tables since. I haven't broken down where the additional writes go.cargo nextest run -p maka-event-log: 47 passed.node scripts/ci.mjs check formatpasses.Not run: the full root suite and the Windows and Linux suites.
AI use
Select exactly one:
Tool(s) and scope: Claude Code built the measurement harness, ran the comparison and the checks above, and wrote the change. The commit carries
Generated-by: Claude Code.Checklist
There's no new test. This changes a storage tuning value, not behavior, and a test asserting the pragma would only restate the code. The measurement above is the evidence.
Does this PR entail a change in behavior?