Repository navigation
fix(perf): measure the HNSW recall curve and stabilise two perf canaries - #545
Merged
Merged
Conversation
Z4 of QuickZvecTest measured recall at the shipped default EfSearch only, and
docs/benchmarks/SHARPCOREDB_VS_ZVEC_COMPARISON.md published that single point
(65.5%, "needs ef_search tuning") as the engine's accuracy, while
BENCHMARK_METHOD.md §Z4 specifies a curve over ef {10, 50, 100, 200, 500}. The
harness now runs that curve -- 25.8% @ 10, 66.1% @ 50, 85.2% @ 100, 96.0% @ 200
(0.634 ms p50), 99.8% @ 500 -- and the document, its matrix row and takeaway 5
carry it instead of a single parameter value.
FsmBenchmarks.Benchmark_PageAllocation_UnderOneMicrosecond timed ONE call in a
fresh process (tier-0 JIT and first-touch included) and failed its 1000 us bound
3/3 at 1.060-1.283 ms although the allocator is an O(n) scan over 100 extents;
HashIndex_SELECT_WHERE_Performance_5to10xFaster decided a >= 0.8x guard from one
unstabilised round and failed once at exactly 0.80x. Both now warm up (200
iterations / 200 queries) and publish a median of several rounds. Thresholds
unchanged -- nothing was weakened to make them pass.
Verification: core Category=Performance 99 / 0 / 16; core suite 3071 / 0 / 1;
DocumentationConsistencyTests 9 / 0; write-path gate PASSED (8/8 capability
metrics inside x1.50); the fixed canaries green 3/3 and 2/2 in isolation.
Full session record: docs/performance/WORKLOG.md, session 92.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…epair the harnesses
ExecuteSQL("SELECT ...") executed the query and then printed every row to
stdout, skipped only when CI/TF_BUILD/GITHUB_ACTIONS was set. Running
SharpCoreDB.Benchmarks showed what that means for a caller: 10 GB of log from a
single 100k-row insert phase, and 49 MB per minute still arriving in the read
phase. ExecuteQuery returns rows; the dump is gone. Pinned by
ExecuteSelectConsoleSilenceTests (red before, green after, rows still readable
through ExecuteQuery). Core suite 3077 / 0 / 1.
QuickZvecTest's Z4 takes the scale and the ef points as arguments now
(--recall-only, --recall-1m, --recall-scale=N, --recall-ef=a,b, --recall-m,
--recall-efc) and prints M/efc with every point, because the 1M point
BENCHMARK_METHOD.md asks for costs one rebuild per ef. Measured: 10k 96.0% at
ef=200, 100k 60.5% at M=16 vs 85.7% at M=32, 1M 19.7% at M=16 -- the M=32
control shows this is the HNSW M/ef trade-off on a uniform-random corpus, not a
broken search path.
Harness repairs, each found by running it:
- SharpCoreDB.CQRS.Benchmarks did not compile: the dispatch API moved to the
SharpDispatch package in 2.1.0 and the project never got the reference.
- DataGenerator interpolated Score with the current culture (88,5 on nl-NL),
which the parser correctly read as a tuple separator, and it produced 100
distinct e-mails for 100k rows against email TEXT UNIQUE.
- The BLite scenarios ran the SQL validator inside the measurement; they open
with SqlValidationMode.Disabled through one shared configuration.
- docs/cqrs README + QUICKSTART documented the pre-2.1.0 namespace and the
Success/Failure member names that never existed; both now import SharpDispatch
and use Ok/Fail.
JsonLiteralInsertTests (5 cases) pins that a double quote inside a single-quoted
literal is an ordinary character -- the rule the first BLite failure looked like
it violated, and does not.
Verification: core 3077/0/1; Server.IntegrationTests 208/0/0; the write-path gate
still PASSED; --pk profiling arms measured (INSERT 162k ops/s at 6.17 us/row
with index-maint at 24.3%; DELETE 185k ops/s with parse at 50.9%). Session 92,
addendum 2 in docs/performance/WORKLOG.md.
|
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
Three measurement defects found while running every suite and every benchmark after the M2–M5 merge, fixed with evidence. No product behaviour changes; no threshold was lowered.
1. The published HNSW recall figure was one
ef_searchvalue presented as the engine's accuracyQuickZvecTest's Z4 measured recall at the shipped default (EfSearch = 50) only, anddocs/benchmarks/SHARPCOREDB_VS_ZVEC_COMPARISON.mdpublished that point —Recall@10 = 65.5% (needs ef_search tuning)— as the engine's accuracy, whileBENCHMARK_METHOD.md§Z4 specifies a curve over ef ∈ {10, 50, 100, 200, 500}.The harness now runs that curve (20-query warm-up per point, 100 queries, recall + p50/p99) and it retires the claim:
The document's Z4 section, comparison-matrix row and takeaway 5 now carry the curve.
2.
FsmBenchmarks.Benchmark_PageAllocation_UnderOneMicrosecondcould never pass in a fresh processOne
Stopwatcharound ONEAllocate(10)call: the first call pays tier-0 JIT plus first-touch, so it measured 1.060 / 1.283 / 1.124 ms in three isolated runs and failed its 1000 µs bound 3/3 — although the allocator is an O(n) scan over 100 extents. Fixed: 200 discarded warm-ups, then the median of 5 rounds × 200 allocate+free pairs. Threshold unchanged.3.
HashIndex_SELECT_WHERE_Performance_5to10xFasterwas decided by one unstabilised roundGreen 3/3 in isolation, but it failed inside the full Performance run at exactly
0.80xagainst a>= 0.8guard — a single GC/disk stall. Fixed: 200-query warm-up, then the median of 3 rounds × 1000 queries per side. Threshold unchanged.Verification
Category=Performance: 99 total / 0 failed / 16 not executedDocumentationConsistencyTests: 9 / 0artifacts/s93-gate-run1.txt)Session record with all suite counts, gate/dual-mode/
--pk/four-engine numbers:docs/performance/WORKLOG.md, session 92.Merging to
masterstays an owner action.