Skip to content

Use ChosenBAA30 and reduce PSI lookup and allocation overhead - #15

Merged
ladnir merged 9 commits into
mainfrom
codex/chosen-baa-vole
Nov 15, 2026
Merged

ladnir merged 9 commits into
mainfrom
codex/chosen-baa-vole

Conversation

@ladnir

@ladnir ladnir commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Use ChosenBAA30 as the default GF(2^128) PSI VOLE encoder and reduce repeated-call lookup/allocation overhead. At 2^20 items per party on Peach, measured warm latency is now 377 ms (598 ms before the lookup/allocation changes) with one core per party and the default allocator.

Depends on osu-crypto/libOTe#199 and pins c14ddaff424ec636823162a30b82435a8754ca78; merge that implementation first. Both peers must upgrade together. Each call jointly samples its code seed with three messages and 64 payload bytes, including reduced-round mode.

ChosenBAA30 has rate one half, uses RS[16,8,9] with 256 nonzero scan coefficients and uniform shuffles, and retains the optimized GF128 backends. Its length-2^21 ideal-uniform-setup distance certificate is >30.524%. Other lengths use pseudo-distance 0.30 and the independent half-rate noise floor, selecting 128 noise positions at the default security setting. These calibrations are not a complete VOLE security proof. The standalone encoder remains field-generic; this adapter uses GF(2^128). BinaryBAA is binary-only and is rejected by Silent VOLE; legacy ChosenBaa16x8 and ChosenBaa16x4 remain selectable.

PSI keeps its existing sparsehash table and OKVS. Lookup uses bounded 16-byte loads plus masking, with a bounded-copy tail, in both single-thread and multi-thread modes. Non-coroutine helpers keep SIMD insertion scratch off the coroutine frame. Hash buffers and per-worker tables retain their allocations; the sender awaits the hash send before its storage can be reused. releaseHashBuffers() releases that storage between runs without resetting OPRF/VOLE state. The dependency also retains VOLE outputs and BAA scratch/metadata, while generating fresh code randomness each call. Retained capacity increases memory held between calls.

The latest dependency update batches BAA setup and shortens fully unrolled x86 GF128 scan batches while preserving the exact seed-to-code map. At the actual PSI codeword length 2,823,424, setup improves from 14.59 to 11.38 ms, forward from 24.37 to 21.74 ms, and transpose from 24.60 to 22.55 ms. Distance, noise parameters, and fresh per-call code randomness are unchanged.

Latest sequential end-to-end A/B comparison, allocation fixes already present in both versions:

Receiver completion, one core per party Before BAA optimization After
Warm median 392.8 ms 377.3 ms
First run 542.6 ms 530.0 ms

These measurements use six trials, CPU 2 for the receiver and CPU 3 for the sender, with the default allocator and fresh BAA setup every trial. All 56 PSI tests pass again at this dependency revision. BAA reproduction details.

Historical lookup/allocation comparison, before the latest BAA optimization:

Sequential Peach measurements: Ryzen 7950X, 4.5 GHz, GCC 15.2 Release with AVX-512/VPCLMUL/GFNI, SSP40, normal rounds, six trials. Warm medians exclude the first trial; base OTs are generated in the first trial and retained thereafter. Encoder setup is included in every trial. No allocator environment overrides are used.

Measurement Before After
Receiver completion, one core per party 598 ms 391 ms
First receiver completion, one core per party 654 ms 546 ms
Both parties sharing one core 564 ms 365 ms

The earlier separate phase profile measures table initialization/insertion/lookup at 47 ms total versus 183 ms before; lookup alone falls from 120 to 23 ms. Per-party CPU work (user plus system, excluding blocked waiting) falls from 453 to 272 ms on the receiver and from 151 to 117 ms on the sender.

The separate-party measurement uses two pinned processes and BufferingSocket over a local AF_UNIX stream, including IPC/buffering overhead; it is not a TCP network benchmark. The combined-core case uses the existing LocalAsyncSocket frontend. The 190 ms historical Silver target has not been reached.

Validation: all 56 volePSI tests pass, including repeated calls with growing/shrinking sizes, five serialized hash widths, changed worker counts, disjoint/known intersections, final-hash tail matches, and release/reuse. Twelve PSI/CPSI checks also pass with the changed PSI implementation and its test translation unit instrumented by GCC AddressSanitizer and UBSan (dependencies remain Release). The dependency passes focused BAA code/seed/VOLE checks and all 28 enabled Silent protocol regressions (one optional test disabled). The sequential performance controls also complete in semi-honest single-thread/four-thread and malicious single-thread modes. CI is tracked on the current PR heads.

@ladnir ladnir changed the title Use large-field chosen-block BAA for PSI VOLE Use ChosenBaa30 by default for GF128 PSI VOLE Nov 14, 2026
@ladnir ladnir changed the title Use ChosenBaa30 by default for GF128 PSI VOLE Use ChosenBAA30 by default for GF128 PSI VOLE Nov 15, 2026
@ladnir ladnir changed the title Use ChosenBAA30 by default for GF128 PSI VOLE Use ChosenBAA30 and reduce PSI lookup and allocation overhead Nov 15, 2026
@ladnir
ladnir merged commit f46d8bb into main Nov 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant