Commit be5c4c2
perf(stark): skip fixed 0/1 muls in LogUp fingerprint accumulation (#696)
* perf(stark): skip fixed 0/1 muls in LogUp fingerprint accumulation
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.
* docs(stark): align fingerprint comments with the α⁰=1 optimization
- compute_fingerprint_from_step: drop the vestigial *α^0 from the doc
formula so it mirrors the code (and matches docs/cryptography/lookup.md
and spec/logup.typ).
- accumulate_fingerprint{,_from_step}: the zero-skip also covers variable
elements that are zero on a row, not just the constant(0) padding —
reword the inline comments to say so.
---------
Co-authored-by: Mauro Toscano <12560266+MauroToscano@users.noreply.github.com>
Co-authored-by: MauroFab <maurotoscano2@gmail.com>1 parent 3bb9107 commit be5c4c2
1 file changed
Lines changed: 18 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
672 | 678 | | |
673 | 679 | | |
674 | 680 | | |
| |||
778 | 784 | | |
779 | 785 | | |
780 | 786 | | |
781 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
782 | 793 | | |
783 | 794 | | |
784 | 795 | | |
| |||
1483 | 1494 | | |
1484 | 1495 | | |
1485 | 1496 | | |
| 1497 | + | |
| 1498 | + | |
1486 | 1499 | | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
| 1500 | + | |
1491 | 1501 | | |
1492 | 1502 | | |
1493 | 1503 | | |
| |||
1675 | 1685 | | |
1676 | 1686 | | |
1677 | 1687 | | |
1678 | | - | |
| 1688 | + | |
1679 | 1689 | | |
1680 | 1690 | | |
1681 | 1691 | | |
1682 | 1692 | | |
1683 | 1693 | | |
1684 | 1694 | | |
1685 | 1695 | | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
| 1696 | + | |
1689 | 1697 | | |
1690 | 1698 | | |
1691 | 1699 | | |
| |||
0 commit comments