feat(sumcheck): complete y-first cutover and recover perf#46
feat(sumcheck): complete y-first cutover and recover perf#46
Conversation
Switch Stage 2 to the y-first witness layout and compute ring-switch m(x) on demand so the verifier no longer materializes m_evals_x. Keep Stage 1 x-first behind compatibility shims, including compact witness transposes, two-round-prefix updates, and wiring-layer challenge reordering, so recursive proofs continue to chain correctly during the Phase 1 transition. Made-with: Cursor
PR SummaryHigh Risk Overview The compact witness layout is switched to x-outer/y-inner throughout, updating Stage 1/2 folding, prefix fast-paths, and the Stage1 tree backend accordingly; a new Stage 1 sparse x/y fusion path is added to regain performance after the ordering change. Verifier-side Stage 2 now takes an explicit Reviewed by Cursor Bugbot for commit 7350955. Bugbot is set up for automated code reviews on this repo. Configure here. |
Benchmark Report
Single Polynomial x 32 Variables
Per-level parameters
Per-level proof-size breakdown
4 Polynomials x 30 Variables
Per-level proof-size breakdown
|
Restore the fused stage-2 round-2 handoff so y-first prefix proofs stop rescanning the compact witness after the two-round-prefix transition, and clear the prefix state once that handoff completes to avoid stale-path reentry. Also narrow the temporary dead-code allowances introduced during the phase-1 y-first cutover by routing the verifier through the shared shifted-eq dispatcher and dropping now-unused test helpers. Made-with: Cursor
Make stage 1 bind y-first and move the only coordinate reorder to stage-1 input so stage 2 consumes r_stage1 directly. Preserve the compact two-round prefix path and sparse-x handling while removing the old stage1-to-stage2 compatibility bridge. Made-with: Cursor
Remove the dead planner option builder so PlannerOptions only exposes configuration toggles that are still wired into the search flow. Made-with: Cursor
Remove the unused shifted-eq evaluation helpers and the stale test that only exercised them so CI can keep treating dead code as an error. Made-with: Cursor
After the y-first cutover, recursive stage transitions can carry the sumcheck challenges directly as the next opening point. Remove the identity helper and the dead width bookkeeping it forced the prover and verifier to carry. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 54be014. Configure here.
Fuse the sparse y-stage full-table fold with next-round polynomial generation so the y-first Stage 1 cutover recovers the onehot regression without reverting semantics. Made-with: Cursor
Now that y-first is the only ordering, remove the _y_first suffix from reorder_stage1_coords, build_compact_s_table, and all related variable names. Deduplicate pad_compact_witness, advance_stage1_claim, and reorder helpers that were copy-pasted across three test modules. Delete the unused shifted_eq module. Made-with: Cursor
Made-with: Cursor

Motivation
Technique 2's y-first cutover is now complete across both Stage 1 and Stage 2. We need to preserve the semantic switch to y-first ordering, keep the compact prefix fast paths, and recover the profiling regressions that showed up during the migration.
Summary
Key changes
m(x)sourcing explicit viaStage2MEvalSourceand y-first ring-switch outputsmainwithout reverting semanticsPerformance
Benchmarks on the local profiling machine, using warmed reruns against a clean
mainworktree:onehot nv32: commit0.290s -> 0.190s, prove0.833s -> 0.748s, verify0.105s -> 0.095sdense nv26: commit8.640s -> 5.672s, prove2.258s -> 1.830s, verify0.0420s -> 0.0341sTest coverage
cargo fmt -qcargo clippy --all --message-format=short -q -- -D warningscargo testFiles/components impacted
src/algebra/shifted_eq.rssrc/protocol/commitment_scheme.rssrc/protocol/hachi_poly_ops/onehot.rssrc/protocol/ring_switch.rssrc/protocol/sumcheck/hachi_stage1.rssrc/protocol/sumcheck/hachi_stage1_tree.rssrc/protocol/sumcheck/hachi_stage2.rssrc/protocol/sumcheck/two_round_prefix.rsPosted by Cursor assistant (model: GPT-5.4) on behalf of the user (Quang Dao) with approval.
Made with Cursor