Repository navigation
Replies: 1 comment
|
Supporting this direction with numbers from a smaller install: T3 Code 0.1.8 nightly, Linux, ext4 on a DRAM-less SATA SSD, 5 to 15 agent threads. Measured per server thread, child processes excluded.
I'd vote for making it the default rather than opt-in. 25 ms is invisible in use, and the people on slow disks who need it most are the least likely to find a setting. How the freezes track disk load on this machine is in my comment on #30067. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Note
Drafted by Claude Opus 5.5 in Hermes (via T3 Code) from our own runs; posted at @kvnloo's request. Measured Nov 2–3 2026 on one Linux install. The code, harness and estimator script are linked below.
TL;DR
#24003 tracks the part of #19105 that is still open: the server commits once per event, and each commit rewrites about 29 pages. Its first suggested fix is to group a streamed turn's events into one commit. #24145 tried batching queued snapshots and was closed under the one-problem rule. In review, @simasrazinskas found that queued-snapshot batching rarely applies to live traffic, because commits arrive one event at a time (4/s across 3 threads). He suggested grouping commits across threads in
EventSinkinstead.That's what we tried, with a time window as the trigger. Plain
node.updated,message.updated,turn_item.updatedandplan.updatedwrites wait up to 25 ms and then commit together. Any other write commits the queue first.1. Why one commit per event costs so much (simulated turn)
We counted write syscalls and parsed WAL frame headers with an
LD_PRELOADshim (bench/poh/iotap.c). The counts cover the server process only, so they exclude the reaped-child I/O that the #24003 correction warns about. Turns are driven by the repo'sdevReplayACP agent through the real adapter, orchestration, projections and checkpoints. Medians are over 10 turns, on a 618.8 MiB compacted (t3 doctor) copy of a real database (4 KiB pages, before #23211):This matches #24003 (29 pages per commit) and @bompus's numbers in #6897 (~106 KB of WAL per ~1 KB event). Tuning the checkpoint doesn't help, because the cost is paid on every commit.
2. The change
Fork branch
exp/poh/04-commit-batching, based onmain5b9731c (2026-11-03, before #23211). The feature is one commit: +597 lines across 6 files, 392 of them tests. It is behindT3CODE_EXPERIMENTAL_COMMIT_WINDOW_MS, off by default.How it works:
Failure modes, which we want your view on:
3. A/B on simulated turns
Every arm runs at the same measurement code: pilot slots 1–3 at fc7cfbe, slots 4–8 at be02c34. The diff between those two SHAs touches only the pooling script. Each slot is one boot with 2 tapped turns. Arms are interleaved in the order A B C / C B A. Δ is the shift in median vs off, with a bootstrap 95% CI.
How to read it:
4. Live-traffic estimate
Read-only estimator (Python, standard library)
commit_window_estimate.pyreplaysorchestration_eventsin sequence order using the ingestion timestamps (occurred_at), and counts commits under the window rule above. Today's baseline is one commit per event.python3 commit_window_estimate.py ~/.t3/userdata/statev2.sqlite 2It opens the database with
mode=ro. A copy made withVACUUM INTOworks too.Our install, 2026-11-03 03:30–05:28 UTC, 9,292 events, no rows removed by compaction yet in that range:
This is an estimate. It assumes one commit per event today and treats ingestion time as commit time. It doesn't model the extra flushes forced when a pending entity is compared against. It would be useful to see the same numbers from the higher-concurrency installs in #24003 (@justinehler's ~30 threads, @simasrazinskas's Claude threads).
Questions
Caveats
devReplayturns. The live number is a replay estimate, not a measured A/B.Background: we started from "could the provider own the transcript, with T3 keeping a cache?" Byte accounting showed that's the small lever. Tool output is 6% of this file and no adapter can re-serve the full transcript today. Meanwhile #29806 handles the event log. The write cost above was what remained. Full write-up with every table and figure: https://kvnloo.github.io/z0evals/t3code-storage-write-amplification/
cc @juliusmarminge @Yash-Singh1 (EventSink and SQLite writer work), @Zheruel (#24145)
All reactions