GeezerVison is showing github.com — perf(atlas-search): run hybrid branches concurrently (#12900 thread 1) by dezren39 · Pull Request #13039 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Refs #12900 — thread 1 of 3 (parallel branch execution in the Python CLI). The issue stays open: thread 2 is a product decision (multi-client service shape) and thread 3 is the nix-packaged binary swap.
What changed (pkgs/atlas-search/atlas_search.py)
A hybrid query's FTS and vector branches are independent and join only at RRF fusion, but run_search executed them strictly serially on every backend shape. Now:
- New
run_branches helper: with two or more branches they run concurrently on a thread pool and are collected by name — fusion order, and therefore the output envelope, is unchanged. A single branch runs inline, so fts-only / vector-only keep their exact old shape. die() in a branch is ferried back and re-raised as SystemExit on the calling thread with its exit code intact.
- Turso scan mode: one pipeline per branch instead of both statements in a single pipeline (a pipeline executes its statements sequentially server-side, so the batched shape serialized the branches). Turso index mode: the FTS pipeline and
turso_index_branch now overlap.
- Local backend:
LocalBackend.con is now a per-thread connection (property + thread-local). The TEMP views of _setup_views and the ATTACHes of load_matrix are per-connection state, so branch workers each get their own connection with the same view setup instead of sharing one.
Verification
- New
pkgs/atlas-search/tests/test_branch_concurrency.py (5 tests, all passing on the laptop with the v3-venv python): hybrid envelope concurrent == forced-serial == the committed recording in fixtures/core-expectations.json; fts-only and vector-only envelopes match their recordings; with 0.6 s sleeps injected at both branch entry points the serial shape takes ≥1.15 s and the concurrent shape <1.0 s; die() inside a branch surfaces as SystemExit with its code on both the local and turso paths.
fixtures/gen_core_fixtures.py re-run against this code: the regenerated core-expectations.json is value-identical to the committed recording (all 12 search cases, get-chunk cases, and the turso SQL fixtures) — the file itself is not in this PR.
- Existing
tools/tests suites still pass (test_disclosure 8, test_note_promotion_sweep 5).

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
The FTS and vector branches of a hybrid query are independent and
join only at RRF fusion, but run_search executed them strictly
serially on every backend shape: the local FTS query finished before
the vector scan started, the turso index path ran its FTS pipeline
to completion before the index branch, and the turso scan path sent
both statements in one pipeline, which executes sequentially
server-side.
They now run concurrently through run_branches (a thread pool,
results collected by name; a single branch still runs inline, so
fts-only and vector-only keep their exact old shape). LocalBackend
gives each thread its own sqlite connection — the TEMP views of
_setup_views and the ATTACHes of load_matrix are per-connection
state — so branch workers never share one. die() inside a branch is
ferried back and re-raised as SystemExit on the calling thread with
its exit code intact.
Output is unchanged: fixtures/gen_core_fixtures.py regenerated
against this code produces a core-expectations.json value-identical
to the committed recording, and the new tests in
tests/test_branch_concurrency.py pin serial == concurrent ==
recorded envelopes, real overlap under slowed branch entry points,
and die() propagation on both backend shapes.
Refs #12900
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 23 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
31247da2-7a8a-4343-9c41-6e3fa16a2884
Commits
-
Reviewing files that changed from the base of the PR and between bae767e and 4fa9199.
Files selected for processing: 2
-
pkgs/atlas-search/atlas_search.py
pkgs/atlas-search/tests/test_branch_concurrency.py
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-23T07:32:50.230708Z |
4fa9199 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|