Skip to content

perf/cleanup(stark): tidy LogUp accumulated column + absorbed-1 const…#686

Open
diegokingston wants to merge 3 commits into
mainfrom
cleanup/lookup-quality
Open

perf/cleanup(stark): tidy LogUp accumulated column + absorbed-1 const…#686
diegokingston wants to merge 3 commits into
mainfrom
cleanup/lookup-quality

Conversation

@diegokingston

Copy link
Copy Markdown
Collaborator

…raint

lookup.rs, three byte-identical improvements:

  • build_accumulated_column_from_terms: invert N in the BASE field (a base inversion vs a cubic-extension inversion) and multiply base x extension with the base operand on the left. Cleaner; trivial (once per table).
  • build_accumulated_column_from_terms: cache each row's column-sum in a single pass and reuse it for the accumulated column, instead of summing every term column twice (drops one full pass over all term columns during trace build).
  • LookupAccumulatedConstraint, absorbed.len()==1 arm: conditionally negate the multiplicity in the base field (signed_m + deltaf) instead of an E x E sign multiply that also promotes m base->ext. Removes a per-row extension multiply in the hot constraint-eval / composition-poly path, matching the 2-interaction arm. Identical value: deltaf - m (sender) / delta*f + m (receiver).

stark lib 128/128 (prove+verify; covers absorbed.len()==1 and ==2 arms).

…raint

lookup.rs, three byte-identical improvements:

- build_accumulated_column_from_terms: invert N in the BASE field (a base
  inversion vs a cubic-extension inversion) and multiply base x extension with
  the base operand on the left. Cleaner; trivial (once per table).
- build_accumulated_column_from_terms: cache each row's column-sum in a single
  pass and reuse it for the accumulated column, instead of summing every term
  column twice (drops one full pass over all term columns during trace build).
- LookupAccumulatedConstraint, absorbed.len()==1 arm: conditionally negate the
  multiplicity in the base field (signed_m + delta*f) instead of an E x E sign
  multiply that also promotes m base->ext. Removes a per-row extension multiply
  in the hot constraint-eval / composition-poly path, matching the 2-interaction
  arm. Identical value: delta*f - m (sender) / delta*f + m (receiver).

stark lib 128/128 (prove+verify; covers absorbed.len()==1 and ==2 arms).
@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench 5

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Benchmark — fib_iterative_8M (median of 5)

Table parallelism: auto (cores / 3)

Metric main PR Δ
Peak heap 34843 MB 34864 MB +21 MB (+0.1%) ⚪
Prove time 18.689s 18.661s -0.028s (-0.1%) ⚪

✅ No significant change.

✅ Low variance (time: 1.4%, heap: 0.8%)

Commit: fb187cf · Baseline: cached · Runner: self-hosted bench

@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench 5

compute_deep_composition_poly_evaluations: in the per-row H-terms loop the
denominator inverse inv_h[i] is constant across composition-poly parts, but it
was multiplied in once per part. Sum the parts first (Σⱼ γⱼ·(Hⱼ-Hⱼ(z))) and
multiply by inv_h[i] once. Distributivity makes it exact → byte-identical proof;
saves (num_parts-1) extension mults per row over the whole LDE. The trace-terms
loop just below already does sum-then-multiply-once.
@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench 5

1 similar comment
@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench 5

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