Repository navigation
Use ChosenBAA30 and reduce PSI lookup and allocation overhead - #15
Merged
Merged
Conversation
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.
Use
ChosenBAA30as 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:
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.
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.