Skip to content

tests: the sessions write bench's real-file test runs 40 half-size requests, not 150 - #3347

Merged
ashhart merged 2 commits into
mainfrom
lead/sessions-test-fast
Nov 14, 2026
Merged

ashhart merged 2 commits into
mainfrom
lead/sessions-test-fast

Conversation

@ashhart

@ashhart ashhart commented Nov 14, 2026

Copy link
Copy Markdown
Owner

tests: the sessions write bench's real-file test runs 40 half-size requests, not 150

The host test "sessions writes: on real files the tier writes and reads back exactly what the bench accounts" timed out
at its 20-minute limit on a loaded hosted runner and turned #3038's checks red. It passes on a quiet runner.

Where its time went: disk. The test runs the mixed load twice (without and with SKIP_COVERED), each time on real
files and on the accounted tier. With 150 requests the real-file runs wrote 576 MiB and read back 382 MiB, with
O_DIRECT, behind 237 fdatasync calls (one per parked file). That costs little on an idle disk, and a lot on a busy
shared one.

What changes: the test only.

  • 40 requests instead of 150.
  • Every token size halved: the pool and slot capacity (16,384), the system prompt, first prompt, turn and reply ranges,
    and the conversation cap (8,192).
  • A 512 KiB chunk.

What it still proves:

  • Real files and the accounted tier agree on every count and on peak pool use, as before.
  • Both runs still spill, park, read back and drop; with SKIP_COVERED they still write deltas and drop covered entries.
  • The test now also asserts the plain drops, the covered drops, and that the average file is larger than one chunk, so
    a restore still reads across chunks.
  • The two other tests in the file are unchanged.
On this box (-Dfixed-cpu, -j2) Before After
The step's test run 5 s 0.6 s
Written to real files 576 MiB 46.6 MiB
Read back 382 MiB 21.4 MiB
fdatasync calls 237 46

No change to the code under test. The one fdatasync a file is the tier's own durability step, so the test keeps it.
Nothing I measured points to a slowness bug in the tier: the time scales with the bytes written.

Checks: zig build -Dfixed-cpu test-sessions-writes-host passes (3 of 3), zig fmt --check is clean, and lean is
341, the same as main.

🤖 Generated with Claude Code

…quests, not 150

"sessions writes: on real files the tier writes and reads back exactly what the bench accounts"
timed out at its 20-minute limit on a loaded hosted runner. Its time goes to disk: two runs of
150 mixed requests on real files wrote 576 MiB and read back 382 MiB with O_DIRECT, behind 237
fdatasync calls, one a parked file.

The test now runs 40 requests with every token size halved (pool, slot capacity, prompts,
turns, replies and the conversation cap) and a 512 KiB chunk. That still spills, parks, drops,
reads back and, with SKIP_COVERED, writes deltas and drops covered entries; it now also asserts
the plain drops, the covered drops, and that files average over one chunk, so a restore still
reads across chunks. Real files and the accounted tier must still agree on every count and on
peak use. On this box: 46.6 MiB written, 21.4 MiB read, 46 fdatasync calls; the run takes
0.6 s instead of 5 s.

No change to the code under test.
@ashhart
ashhart force-pushed the lead/sessions-test-fast branch from ee77357 to dd698e4 Compare November 14, 2026 17:04
@ashhart
ashhart merged commit 13e2341 into main Nov 14, 2026
2 of 10 checks passed
@ashhart
ashhart deleted the lead/sessions-test-fast branch November 14, 2026 17:04
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