Skip to content

perf(stark): skip fixed 0/1 muls in LogUp fingerprint accumulation#696

Open
diegokingston wants to merge 1 commit into
mainfrom
perf/logup-fingerprint-constants
Open

perf(stark): skip fixed 0/1 muls in LogUp fingerprint accumulation#696
diegokingston wants to merge 1 commit into
mainfrom
perf/logup-fingerprint-constants

Conversation

@diegokingston

Copy link
Copy Markdown
Collaborator

In the fingerprint hot loop (prover aux-build + constraint-eval + verifier):

  • Bus-id term: alpha_powers[0] = alpha^0 = 1, so embed the bus id into the extension field directly instead of multiplying by 1 (drops one F*E mul per interaction per row, hoisted out of the row loop on the aux path).
  • Fixed-zero bus elements (the ~235 constant(0) used for bus-width padding) contribute nothing: skip the F*E multiply + accumulate entirely. Variable elements that happen to be zero on a row also benefit.

Value-identical (field addition is exactly associative): stark lib 128/128 (default + parallel), prover bus/logup tests pass, clippy clean. Net effect on prove time is what we want to measure on the 32-core bench.

In the fingerprint hot loop (prover aux-build + constraint-eval + verifier):

- Bus-id term: alpha_powers[0] = alpha^0 = 1, so embed the bus id into the
  extension field directly instead of multiplying by 1 (drops one F*E mul
  per interaction per row, hoisted out of the row loop on the aux path).
- Fixed-zero bus elements (the ~235 constant(0) used for bus-width padding)
  contribute nothing: skip the F*E multiply + accumulate entirely. Variable
  elements that happen to be zero on a row also benefit.

Value-identical (field addition is exactly associative): stark lib 128/128
(default + parallel), prover bus/logup tests pass, clippy clean.
Net effect on prove time is what we want to measure on the 32-core bench.
@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench 5

@github-actions

Copy link
Copy Markdown

Benchmark — fib_iterative_8M (median of 5)

Table parallelism: auto (cores / 3)

Metric main PR Δ
Peak heap 34843 MB 34815 MB -28 MB (-0.1%) ⚪
Prove time 18.689s 18.473s -0.216s (-1.2%) ⚪

✅ No significant change.

✅ Low variance (time: 2.5%, heap: 1.1%)

Commit: 974eaad · Baseline: cached · Runner: self-hosted bench

@diegokingston diegokingston marked this pull request as ready for review June 22, 2026 19:54
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