Skip to content

The embedding ceiling test measures overlap rather than database write overhead on a slow machine - #1459

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Aschenbath:test/embedding-gate-timing
Oct 29, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Aschenbath:test/embedding-gate-timing

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Split out of #1131 at review.

the_embedding_gate_is_never_held_beyond_its_ceiling sends twelve batches through a fake embedding server that answers each one after a fixed delay. It makes three assertions: the peak number of batches in flight is at most EMBED_JOBS (4), at least two batches overlap, and total time is under three quarters of fully serial. With a 150 ms delay that bound is 1.35 s, and the fixed cost of writing 192 chunk vectors to PostgreSQL takes a large share of it. In #1131's local full run (Linux x86_64, 2 CPUs, PostgreSQL 16/pgvector under proot), the test took 1.51 s and failed even though peak and overlap were both correct. The gate was fine; the database was slow.

The delay is now 400 ms, so waiting on the fake network accounts for most of the elapsed time. The bound is still three quarters of serial (3.6 s against 4.8 s): an ideal run is three rounds of four, about 1.2 s, so a regression that serializes the gate still fails. The peak and overlap assertions, which are what actually check the ceiling, are unchanged. The test now takes about 0.75 s longer.

Not run locally on this branch: I don't build Rust on this machine, so CI's cargo test --workspace is the check.

…e overhead on a slow machine

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aschenbath <Aschenbath@users.noreply.github.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — the peak and overlap assertions are unchanged and a serialized gate still fails. Merging.

@WaylandYang
WaylandYang merged commit e4b8a4e into deeplethe:dev Oct 29, 2026
6 checks passed
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.

2 participants