Repository navigation
Log per-arm timings for every hybrid fusion - #286
Closed
samuelvkwong wants to merge 1 commit into
Closed
samuelvkwong wants to merge 1 commit into
samuelvkwong wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
One INFO line per fusion attributes the cost to its arms - the FTS ranking query, the query embedding (or its cache hit), the HNSW beam pass, and the in-process RRF - plus row counts and a degraded flag, so production logs answer "where does a slow search spend its time" without extra tooling. The query is identified by a short hash: search text can contain patient identifiers, so the log correlates repeated searches without recording what was searched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDei6anDxfR5eoHhFfXBGs (cherry picked from commit 75c73c4)
samuelvkwong
force-pushed
the
hybrid-fusion-timings
branch
from
August 27, 2026 11:43
75c73c4 to
f381f9a
Compare
samuelvkwong
marked this pull request as draft
August 27, 2026 14:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
One INFO line per hybrid fusion, attributing the cost to its arms:
fts_ms— the FTS arm: rank every match, sort, keep the windowembed_ms— the query embedding (gateway call, or ~0 on its cache) — separated from the scan so gateway load and ranking cost can never be confusedvec_ms/vec_rows— one HNSW beam pass and what it emittedfuse_ms— the in-process RRFquery— a short hash, never the search text: queries can contain patient identifiers, so the log correlates repeats without recording what was searcheddegraded=True— the embedding service failed and this result is FTS-onlyWhy
"Search is slow" had two competing explanations in the team — the ranking pipeline vs. embedding-gateway contention — and no way to attribute a given slow search to either. With this line, production logs answer it per search. Measured on staging (1.7M reports), the attribution is unambiguous and stable across configurations:
fts_msfor "Fraktur" (414,572 matches)EMBEDDINGS_MODEL=)A rare term ("Krebs", 26 matches) runs the identical code in 62–150 ms. The FTS ranking cost is invariant across every configuration and tracks only the match count — the motivating evidence for the BM25 work (#285).
Test plan
New test asserts the line is emitted with all arm fields and that the query text never appears in it. Full
radis/pgsearch+radis/searchsuites: 240 passed; lint clean. Running on staging now — any UI search logs the line (docker service logs radis_staging_web | grep "hybrid fusion"). Independent of the other open search PRs: based directly onmain; thevec_rowsvalues in the staging evidence above were measured with #282's ef_search fix deployed (without it, the beam emits ~51 candidates — the bug that PR fixes — whilefts_msis unaffected).🤖 Generated with Claude Code
https://claude.ai/code/session_01VDei6anDxfR5eoHhFfXBGs