Repository navigation
Conversation
There was a problem hiding this comment.
I reviewed the one-file change at 3e24b44880a4af48d12dac1fea58eab7223c1353 and traced execution-mode writer opening into schema::initialize_connection. The patch changes the connection's automatic WAL checkpoint threshold from SQLite's default 1,000 pages to 10,000 after migrations; it preserves synchronous=FULL and does not change a database schema, migration, or wire format.
No confirmed P0–P2 finding. I executed the exact old/new initialization PRAGMA strings against real SQLite 3.45.1 in a controlled comparison with 1,500 commits repeatedly updating 16 rows. The main database file's modification timestamp changed at a checkpoint once with the old threshold and zero times with the new one; the WAL files were about 4.12 MB and 6.32 MB respectively. Both retained the same rows, passed integrity checks and closed cleanly. A separate abrupt writer exit retained all 100 committed rows on reopening. This corroborates delayed checkpointing and basic recovery, not production Host byte savings or latency. The macOS Host benchmark and 392-test result in the description remain the author's measurements.
The threshold should not be interpreted as a hard bound on WAL allocation or recovery work: transaction size and readers can affect that. I did not reproduce the author's concurrent Host benchmark or measure physical storage writes.
This head merges without conflicts into current rust-preview 6fd77053. CI 42448490923 fails in the macOS desktop's first text-entry case (observed: Null, 67.497s); the earlier base run 42447608116 fails the same case before this tuning change. I have not attributed that existing failure to this PR, and this is not an all-green CI result.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
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
3e24b44 to
a8ac3c9
Compare
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?