Repository navigation
test(recall): tighten the prepare_context statement ceiling to the current measurement - #2133
Merged
hidb4ai merged 1 commit intoOct 21, 2026
Merged
Conversation
The ceiling was pinned to 48 against a measurement of 47. The recall path has since dropped to 40, so 48 no longer rejects anything until a regression of eight statements. Pin it to the current measurement plus one. Refs oceanbase#2087
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.
Which issue or RFC does this PR close?
Refs #2087, the PR that introduced this ceiling.
Rationale for this change
#2087 pinned
_PREPARE_STATEMENT_CEILINGto 48 against a measurement of 47 on the default text-recallpath.
masterhas since moved: oneprepare_contextnow issues 40 statements once the candidatepool is saturated (32 with no memories recalled, 19 for a single-entry Scope). At 48 the assertion no
longer rejects anything until a regression of eight statements, so the guard is currently looser than the
thing it was written to protect.
This sets it to the current measurement plus one statement of slack, matching how the constant was
originally derived.
What changes are included in this PR?
One constant, no production code:
Measured with the in-repo
before_cursor_executecounter on in-memory SQLite, one Scope, no embeddingmodel, no reranker:
0da4436dAre there any user-facing changes?
No. Test-only.
How was this change tested?
The point of a tightened ceiling is that it rejects what the looser one allowed, so the constant was run
against three trees:
counted(8)vscounted(40)b388a18(where the amplification was measured)assert pool == beyonde4efb39b(the value 48 was pinned against)assert beyond <= _PREPARE_STATEMENT_CEILING0da4436d(this PR's base)pytest tests/builtin/runtime/test_statistics.pyon the base tree — 10 passed.ruff checkandruff format --checkwith the lockedruff==0.15.20— clean.SQLite-path number, as stated where it was introduced.
An earlier note said this would be tightened to 20 once #2079 lands. #2079 has not merged; what changed
instead is #2095, which took the path from 47 to 40. When #2079 does merge the measured value should drop
again and this constant should follow it down.