Skip to content

Reduce the default page size from 256 KB to 32 KB - #868

Draft
nicole-graus wants to merge 2 commits into
mainfrom
perf/default-page-size-32kb
Draft

Reduce the default page size from 256 KB to 32 KB#868
nicole-graus wants to merge 2 commits into
mainfrom
perf/default-page-size-32kb

Conversation

@nicole-graus

Copy link
Copy Markdown
Collaborator

Description

Lowers the DEFAULT_PAGE_SIZE to 32 KB (1<<15). Regenerates the static zero-init page commitments (blowups 2/4/8) for the new size and updates the page-count and page-boundary tests accordingly.

20-tx ethrex block

Recursion cycles

Page size Recursion cycles vs 256 KB Keccak calls Inner blob
4 KB 5.594 B -15.3% 7.57 M 294 MB
8 KB 4.989 B -24.5% 6.69 M 263 MB
16 KB 4.680 B -29.2% 6.19 M 244 MB
32 KB 4.608 B -30.3% 5.95 M 232 MB
64 KB 4.731 B -28.4% 5.81 M 221 MB
256 KB 6.607 B 6.64 M 209 MB
512 KB 9.442 B +42.9% 8.08 M 205 MB
1 MB 15.305 B +131.6% 11.16 M 203 MB

Prove Time

Page size log2 Prove mean vs 256KB Verify Peak RSS
4 KB 12 88.39 s +2.7% 5.51 s 41.6 GB
8 KB 13 86.21 s +0.2% 5.02 s 41.6 GB
16 KB 14 85.65 s -0.5% 4.74 s 41.6 GB
32 KB 15 84.2 s -2.2% 4.7 s 41.8 GB
64 KB 16 84.59 s -1.7% 4.41 s 41.6 GB
256 KB 18 86.05 s 4.56 s 41.8 GB
512 KB 19 87.20 s +1.3% 4.81 s 41.7 GB
1 MB 20 88.74 s +3.1% 5.29 s 41.6 GB
4 MB 22 100.65 s +17.0% 7.83 s 41.7 GB

@nicole-graus

Copy link
Copy Markdown
Collaborator Author

/bench-verify

@github-actions

Copy link
Copy Markdown

Benchmark started on the bench server. The recursion-guest cycle comparison adds guest builds on top of the verifier bench, longer on a cold runner. The bench server is occupied until it finishes.

@github-actions

Copy link
Copy Markdown

Verifier benchmark — ca58d945fc vs main (20 pairs)

=== Verify ABBA result ===

Metric main PR Δ
Verify time (per-side) 2.852s 4.223s +48.06% 🔴
Proof size 152.60 MiB 239.03 MiB +56.64% 🔴

Per-side (⚠️ PR REJECTS the baseline's valid proof — likely a VERIFY REGRESSION, not a format change): A/B/B/A cancels machine drift but not proof-specific variance — read the Verify-time Δ as approximate.

  pairs: 20   mean A (PR): 4.223s   mean B (main): 2.852s
  [parametric] paired-t   mean +48.06%   sd 2.42%   se 0.54%
               95% CI: [+46.93%, +49.19%]   (t df=19 = 2.093)
  [robust]     median +48.42%   Wilcoxon W+=210 W-=0  p(exact)=1.9e-06  (z=+3.90)

  run-to-run jitter:    A CV 1.40%   B CV 0.58%        (lower = steadier)
  within-session drift: +0.42% over the run, 1st->2nd half +0.20%

🔴 REAL REGRESSION — PR verifies ~48.06% slower (paired-t and Wilcoxon agree).

Drift-free interleaved A/B/B/A measurement. - = PR faster. Trust the verdict when paired-t and Wilcoxon agree.


Recursion guest cycles (main vs PR)

=== Recursion-guest cycle comparison — single query (blowup=2, 1 query) — deterministic to ~±100k cycles ===
REF_B (baseline) origin/main 0893b6b guest=recursion-min.elf
REF_A (PR) ca58d94 ca58d94 guest=recursion-min.elf

Metric REF_B (baseline) REF_A (PR) Δ (A-B)
Guest cycles 41.4M 41.2M -0.2M (-0.53%)
Keccak calls 3025 2959 -66

note: cycles reproduce to ~±100k (build codegen + proof nondeterminism); treat sub-100k deltas as noise, not signal.

raw (exact integer counts)
ref_b_sha=0893b6b5598800c02fae2d0f5eb5104b74937068 ref_b_elf=recursion-min.elf ref_b_cycles=41381557 ref_b_keccak=3025 ref_b_execute_wall_s=1
ref_a_sha=ca58d945fc2a02a26e41fa98d6b40ef64042d2d1 ref_a_elf=recursion-min.elf ref_a_cycles=41163399 ref_a_keccak=2959 ref_a_execute_wall_s=1
delta_cycles=-218158 delta_keccak=-66

(blowup2 regime unavailable for these refs — see the workflow log.)

(blowup4 regime unavailable for these refs — see the workflow log.)

=== Recursion-guest cycle comparison — 128-bit (blowup=4, 110 queries) — real ethrex block, 4 transfers — deterministic to ~±100k cycles ===
REF_B (baseline) origin/main 0893b6b guest=recursion-cont-blowup4.elf
REF_A (PR) ca58d94 ca58d94 guest=recursion-cont-blowup4.elf

Metric REF_B (baseline) REF_A (PR) Δ (A-B)
Guest cycles 1025.2M 1099.9M +74.7M (+7.29%)
Keccak calls 1506942 1711085 +204143

note: cycles reproduce to ~±100k (build codegen + proof nondeterminism); treat sub-100k deltas as noise, not signal.

raw (exact integer counts)
ref_b_sha=0893b6b5598800c02fae2d0f5eb5104b74937068 ref_b_elf=recursion-cont-blowup4.elf ref_b_cycles=1025165414 ref_b_keccak=1506942 ref_b_execute_wall_s=17
ref_a_sha=ca58d945fc2a02a26e41fa98d6b40ef64042d2d1 ref_a_elf=recursion-cont-blowup4.elf ref_a_cycles=1099881618 ref_a_keccak=1711085 ref_a_execute_wall_s=18
delta_cycles=74716204 delta_keccak=204143

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