Make MutableBQVectors safe for concurrent inserts #851
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.36) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 193 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #851"
general
weight: 0.35
MarkWolters
MutableBQVectorscould lose data when several threads calledencodeAndSetorsetZeroat once:intupdated withMath.max, so updates could be lost.This change follows
MutablePQVectors: encoding stays outside the lock, then growth and the store happen together in one synchronized method, and the count is anAtomicInteger.It also fixes
setZero, which made the zero code 8× too long (it used the byte size as a count of longs). It now matchesBinaryQuantization.encodeAll.Invalid ordinals (negative or
Integer.MAX_VALUE) now throwIllegalArgumentException, as inMutablePQVectors, instead ofArrayIndexOutOfBoundsException.Testing
New
TestBinaryQuantization.testConcurrentEncodeAndSet: 16 threads insert 20,000 interleaved ordinals (some zeroed), then the test checks the count and every code.New
TestBinaryQuantization.testInvalidOrdinalchecks the new exception.Performance
On ada002-1M (982,790 × 1,536) on Ice Lake (8 cores), JDK 22: