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

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Verifier benchmark — ca58d945fc vs main (20 pairs, monolithic + continuations)

ethrex 20-tx block · monolithic · blowup=2, 219 queries

Metric main PR Δ
Verify time (ABBA, 20 pairs, per-side) 2.849s 4.228s +48.40% 🔴
Proof size (exact, 1 reading) 156.30 MiB 239.03 MiB +52.93% 🔴

Per-side (PR can't deserialize the baseline's proof — proof-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.228s   mean B (main): 2.849s
  [parametric] paired-t   mean +48.40%   sd 1.82%   se 0.41%
               95% CI: [+47.55%, +49.25%]   (t df=19 = 2.093)
  [robust]     median +48.64%   Wilcoxon W+=210 W-=0  p(exact)=1.9e-06  (z=+3.90)

  run-to-run jitter:    A CV 1.27%   B CV 0.53%        (lower = steadier)
  within-session drift: +0.37% over the run, 1st->2nd half +0.15%

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

ethrex 20-tx block · continuations, epoch 2^20 (9 epochs) · blowup=2, 219 queries

Metric main PR Δ
Verify time (ABBA, 8 pairs, per-side) 7.926s 8.137s +2.67% 🔴
Proof size (exact, 1 reading) 479.35 MiB 494.26 MiB +3.11% 🔴

Per-side (PR can't deserialize the baseline's proof — proof-format change): A/B/B/A cancels machine drift but not proof-specific variance — read the Verify-time Δ as approximate.

  pairs: 8   mean A (PR): 8.137s   mean B (main): 7.926s
  [parametric] paired-t   mean +2.67%   sd 0.45%   se 0.16%
               95% CI: [+2.29%, +3.05%]   (t df=7 = 2.365)
  [robust]     median +2.54%   Wilcoxon W+=36 W-=0  p(exact)=0.0078  (z=+2.45)

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

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

Verify-time rows only: drift-free interleaved A/B/B/A, with paired-t and exact Wilcoxon — trust the verdict when the two agree. Proof sizes are single exact readings (no averaging). - = PR faster.


Recursion guest cycles — verifier running INSIDE the VM (main vs PR)

empty program · monolithic · blowup=2, 1 query (diagnostic — NOT a real verifier cost)

Single exact reading per ref — no ABBA: guest cycles are deterministic for a fixed
(guest ELF, input blob), so there is no machine drift to cancel.

Metric main PR Δ
Guest cycles 39.8M 41.2M +1.3M (+3.34%)
Keccak calls 3025 2959 -66
  baseline  origin/main  fcc4848fef  guest=recursion-min.elf
  PR        ca58d945fc2a02a26e41fa98d6b40ef64042d2d1  ca58d945fc  guest=recursion-min.elf
  note: cycles reproduce to ~±100k (build codegen + proof nondeterminism);
        treat sub-100k deltas as noise, not signal.
raw (exact integer counts)
ref_b_sha=fcc4848fefca60d38a9cb7d20311d89016c3f17d ref_b_elf=recursion-min.elf ref_b_cycles=39833310 ref_b_keccak=3025 ref_b_execute_wall_s=2
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=1330089 delta_keccak=-66

ethrex 20-tx block · continuations, epoch 2^21 (5 epochs) · blowup=2, 219 queries (128-bit)

Single exact reading per ref — no ABBA: guest cycles are deterministic for a fixed
(guest ELF, input blob), so there is no machine drift to cancel.

Metric main PR Δ
Guest cycles 4548.3M 4811.6M +263.3M (+5.79%)
Keccak calls 6944771 7609088 +664317
  baseline  origin/main  fcc4848fef  guest=recursion-cont-blowup2.elf
  PR        ca58d945fc2a02a26e41fa98d6b40ef64042d2d1  ca58d945fc  guest=recursion-cont-blowup2.elf
  note: cycles reproduce to ~±100k (build codegen + proof nondeterminism);
        treat sub-100k deltas as noise, not signal.
raw (exact integer counts)
ref_b_sha=fcc4848fefca60d38a9cb7d20311d89016c3f17d ref_b_elf=recursion-cont-blowup2.elf ref_b_cycles=4548337489 ref_b_keccak=6944771 ref_b_execute_wall_s=72
ref_a_sha=ca58d945fc2a02a26e41fa98d6b40ef64042d2d1 ref_a_elf=recursion-cont-blowup2.elf ref_a_cycles=4811598498 ref_a_keccak=7609088 ref_a_execute_wall_s=78
delta_cycles=263261009 delta_keccak=664317

@nicole-graus

Copy link
Copy Markdown
Collaborator Author

/bench-verify

@github-actions

Copy link
Copy Markdown

Benchmark started on the bench server. Two verifier arms (monolithic + continuations over an ethrex 20-tx block), then the recursion-guest cycle comparison, which adds guest builds on top — longer on a cold runner. The bench server is occupied until it finishes.

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