Skip to content

feat: add reshape step to jagged PCS#48

Merged
kunxian-xia merged 3 commits intofeat/jagged_pcsfrom
feat/reshape-pcs
Apr 30, 2026
Merged

feat: add reshape step to jagged PCS#48
kunxian-xia merged 3 commits intofeat/jagged_pcsfrom
feat/reshape-pcs

Conversation

@kunxian-xia
Copy link
Copy Markdown
Collaborator

Summary

  • Add optional reshape step inside the jagged PCS: reinterpret the giga polynomial q' as a multi-column matrix with fixed power-of-two height h = 2^reshape_log_height before passing to the inner PCS
  • Smaller proof / faster verifier: the inner PCS operates on column MLEs of height h instead of the full 2^m, saving m - log_h FRI layers
  • Less padding waste (prover): without reshape, the giga polynomial pads to the next power of two (~50% waste); with reshape, padding is at most h - 1 entries

Benchmark results (10 matrices × 8 cols, heights 2^14–2^18)

log_h w (cols) Commit Open Verify Proof Size
23 (baseline) 1 4.49s 4.80s 31.2ms 1,024,617 B
21 4 1.13s 1.31s 26.6ms 871,721 B
19 14 737ms 489ms 22.7ms 737,257 B
17 56 567ms 291ms 19.7ms 641,785 B

When reshape_log_height = num_giga_vars, behavior is identical to before (single column, no reshape overhead).

Test plan

  • All 20 existing jagged tests pass with reshape_log_height = num_giga_vars (backward compat)
  • New test_jagged_reshape_single_poly — 1 poly, log_h=6, w=16
  • New test_jagged_reshape_multiple_polys — 3 polys with different heights, log_h=8

🤖 Generated with Claude Code

kunxian-xia and others added 3 commits April 30, 2026 23:54
…over

Reinterpret the giga polynomial q' as a multi-column matrix with fixed
power-of-two height h = 2^reshape_log_height before passing to the inner
PCS. This saves (num_giga_vars - log_h) FRI layers and reduces padding
waste from ~50% to at most h-1 entries.

Key changes:
- jagged_commit accepts reshape_log_height, transposes to row-major when w>1
- jagged_batch_open splits ρ into (ρ_row, ρ_col), opens inner PCS at ρ_row
- jagged_batch_verify reconstructs q'(ρ) from col_evals via eq(ρ_col, i)
- Benchmark sweeps log_h values to show the tradeoff curve
- When reshape_log_height = num_giga_vars (w=1), behavior is identical to before

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kunxian-xia kunxian-xia merged commit 41d40f7 into feat/jagged_pcs Apr 30, 2026
2 checks passed
@kunxian-xia kunxian-xia deleted the feat/reshape-pcs branch April 30, 2026 17:08
@kunxian-xia kunxian-xia mentioned this pull request May 1, 2026
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