Memory access optimised NTT for BN254 #174
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 173 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.309
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #174"
general
weight: 0.35
recmo
The main addition in this PR is the BN254 NTT which is 1.5x to 2x times faster and uses half the space for the roots vector compared to the implementation in WHIR for the range 2ˆ20 to 2ˆ24. The performance increase is mainly due not fetching roots from memory during the hot loop. By storing the roots in reverse bit order the access pattern for the roots is linear.
The NTT is split into three phases all using the same general strategy (DIT NR). In the last phase the problem size fits within cache and in a future PR it will switch to an optimised strategy.
Other additions in this PR:
Follow ups to this PRs will deal with:
Measurements
On macOS the improvement is 2.25x. When looking at the CPU resource graph there seem to be some unnecessary idles. Moving to a custom schedular instead of Rayon might allow for some extra performance improvment.
On Raspberry Pi there is a 1.5x-2x improvement. Caveat both WHIR and this ran into thermal throttling on my Raspberry Pi as it doesn't have any heatsink or any cooling.