perf(M-21): add interleaved A/B comparisons - #168
Merged
Conversation
joslat
marked this pull request as ready for review
July 26, 2026 02:31
This was referenced Aug 13, 2026
This was referenced Aug 27, 2026
Open
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.
M-21 — trustworthy in-process A/B measurement
Adds
perf abso two flag/DI-reachable configurations can be compared in one hermetic process anddatabase. This is a harness-only PR; it does not optimize product code.
Pre-registered prediction
Recorded in this PR before implementation:
defaultconfigurations: reads 6, writes 1, queries 9, embedding requests 1, retrieveditems 43, and access-tracked items 25 on both sides; Recall@K/MRR 1.000; elapsed ratio CI contains
1.0, so the verdict is no significant difference;
Recall.MaxEntities10 → 2: entities 10 → 2, retrieved items 43 → 35, access-tracked items25 → 17; reads/writes/queries/embedding requests unchanged; Recall@K approximately 0.982 and MRR
1.000; no timing win unless the bootstrap interval's upper bound is below 1.0.
What changed
perf ab --control <spec> --candidate <spec>parsesdefault,Recall.Max*, andRecall.MinSimilarityScoreconfigurations.AB, BA; each configuration crosses over two equivalent,owner-isolated fixture copies.
autocorrelation.
p50 timings, candidate/control ratios, and bootstrap 95% CIs together.
iteration totalis the pre-registered timing headline. Subspan intervals are explicitlyexploratory because they are not corrected for multiple comparisons.
PERF-W-02cannot be causally paired without reset/restore.Why the design changed from literal ABAB
The original strict-ABAB/shared-fixture implementation failed the required null test in both
directions.
PERF-R-04updates access timestamps, so one side changed the state the next side measured,and bootstrapping correlated adjacent ratios independently made intervals too narrow. The corrected
state-isolated, dataset-crossover, counterbalanced cluster design passed the null twice.
Results
Null experiment —
defaultvsdefaultFinal-form runs:
20260726T014053Z__ab__hermetic-S-zero20260726T021504Z__ab__hermetic-S-zeroBoth report PASS — no significant difference, identical structural-work ranges, and zero quality
delta. Latest headline:
Positive control —
Recall.MaxEntities10 → 2Run
20260726T014215Z__ab__hermetic-S-zero:items.entitiesitems.retrievedaccess_tracking.itemsThe exact counter prediction held. The timing direction was lower but not significant, so this PR
does not claim a speed win. The zero-tolerance quality report correctly flags the Recall@K tradeoff.
Validation
configuration parser, and bootstrap did not exist; focused suite now passes 13/13.
Nams.*tests fail because the configured workspace isdeprovisioned (
workspace_not_provisioned), as documented before this PR.dotnet build AgentMemory.slnx -c Release --no-restore: 0 warnings, 0 errors.perfregression run20260726T021600Z__m21-regression__hermetic-S-zero: quality 1.000throughout and every published structural counter unchanged.