update(idemix): hardening - #2136
Conversation
📊 Token Validation BenchmarkComparison of this PR against the base branch. 🟢 improvement · 🔴 regression · ➖ within ±1.0% noise.
|
2155586 to
8405f48
Compare
|
waiting for IBM/idemix#89 to get merged |
8405f48 to
f00ff77
Compare
f00ff77 to
b1e982a
Compare
📊 Token Validation BenchmarkComparison of this PR against the base branch. 🟢 improvement · 🔴 regression · ➖ within ±1.0% noise.
|
See:
|
|
Hi @adecaro, Please see the full benchmarking results (Both CSP/IPA Client-Server Token Validation) What do you think? How do you want to proceed? |
|
"Token Validation Benchmark" also shows a performance degradation, so unless the new mathlib fixes some bugs - then why would we want to take it? I also recall when working on the proof optimization that Claud claimed that mathlib (I guess that would be the current version) computed addition with 0 just like any other addition, rather than a trivial nop. This was one of the reasons why the optimization could exploit the 0-padded witness and field values. Now that the optimization is committed, I'm not sure there are many other places that would benefit from a trivial add-0, but may be worth an investigation. |
816050c to
0949ba1
Compare
0949ba1 to
7818044
Compare
This comment was marked as outdated.
This comment was marked as outdated.
7818044 to
a17ac97
Compare
📊 Token Validation BenchmarkComparison of this PR against the base branch. 🟢 improvement · 🔴 regression · ➖ within ±1.0% noise.
|
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Picks up the restored always-pairwise sumOfG1Products in IBM/idemix and the removal of the small-n dispatch threshold from IBM/mathlib's gurvy MultiScalarMul. Both thresholds were tuned on single-threaded microbenchmarks, where gnark's bucket-method MultiExp loses to a pairwise Mul2+Add loop for a handful of bases. Under concurrent validation the reasoning inverts: MultiExp's wall-clock win comes from fanning out over runtime.NumCPU() goroutines, which buys nothing on a saturated process and costs the bucket allocations anyway. Measured with TestParallelBenchmarkValidatorTransfer (10 workers, 20s, Apple M1 Max, BLS12_381_BBS_GURVY, 2 reps), allocated bytes per verification drop ~11-12%: bulletproof 618KB -> 546KB, CSP 541KB -> 477KB. CSP throughput improves ~7% (426 -> 438 ops/s) with p50 down ~1ms; bulletproof throughput is a wash. The single-worker latency win the thresholds bought (~4%) is given up. Removing mathlib's threshold also stops it overriding this repo's own crossover decision: csp.smallMSM special-cases n=1 and n=2 and hands everything from n=3 up to MultiScalarMul, but the threshold of 7 was quietly rerouting n=3..6 back to a pairwise loop. Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
5c8fb1d to
66fc495
Compare



This PR introduces idemix hardening.