perf: parallel finite validation and scratch-based rank encode#279
perf: parallel finite validation and scratch-based rank encode#279Nelson Spence (Fieldnote-Echo) wants to merge 1 commit into
Conversation
assert_all_finite paid a full serial pass per add/search batch — measured ~0.1s per GiB, twice per ingest batch counting the caller layer. Scans of 1M+ floats now split across the rayon pool (4.4x measured). RankQuant::add's per-row closure allocated a fresh ranks Vec per vector inside the parallel loop; for_each_init now reuses a per-worker scratch via rank_transform_into. Measured on the 1.26M x 1024 corpus slice: encode-path attribution 0.097s serial scan -> 0.022s parallel; alloc churn removed from the hot loop.
|
Codex (@codex) review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
/agentic_review |
|
Merged to main via #283's squash ( |
Summary
assert_all_finitepaid a full serial pass per add/search batch — measured 0.097s per GiB. Inputs ≥1M floats now split the sweep across the rayon pool (0.097s → 0.022s measured on a real-corpus GiB slice); the panic message is unchanged.RankQuant::add's parallel closure allocated a freshranksVec per row;for_each_initnow reuses per-worker scratch viarank_transform_into.Measured (262,144 × 1024 real-corpus slice, best-of-3)
RankQuant::addSignBitmap::addOrdinalIndex::add_2d(downstream)Companion to ordinaldb
perf/parallel-input-validation(same fix at the caller layer, preserving exact first-offender panics). Independent of #277/#278 — branches off main, touches onlyutil.rs/quant.rs.Full gate: 250 tests + no-default-features + clippy -D warnings green.
Part of the 1M-row release train (encode lane).