Regenerating the study’s numbers
Every number on the PCS frontier page and in the two notes comes from one of three places: a
constant in pareto-model.py typed from a paper or a
specification; a constant computed by a script in scripts/ from an
external checkout; or the model’s own arithmetic. This file says how to redo the first two kinds.
Paths are relative to ragu-pcs/.
The page’s figures and guards
python pareto-model.py writes pareto.html, the standalone page, and the same page for the book
in four files that the book’s chapter includes and serves: pareto-book.html (the text),
pareto.css (scoped to the page and coloured from mdbook’s theme, with the plot and controls kept
dark), pareto.js and pareto-data.js. Every figure that the text quotes sits between markers in
pareto-template.html, in the two notes,
pasta-proof-size.md and
zk-fiat-shamir-with-aborts.md, and in the
hardware wallets page, hardware-wallets.md, as
<!--fig:NAME-->value<!--/fig-->, and the model fills them when it writes the page. A qualitative
statement that the model can check is a named guard(name, text, holds) in define_figures(), and
the sentence it guards sits between <!--guard:NAME:HASH--> and <!--/guard-->, the hash the first
six hex digits of SHA-256 over the guard’s text; a sentence that carries several guards names them
with commas. The run fails, and so does the book build, which runs the model, when any of these
holds:
- a figure’s value in a tracked file differs from the model’s;
- a guard no longer holds;
- a guard’s hash in a marker differs from its text’s, which means the guard was reworded and the sentence must be read again;
- a guard has no marker in any file, or a marker names no guard.
Commands:
python pareto-model.py # write pareto.html; fail on a stale figure or marker, or a failed guard
python pareto-model.py --fill # also write the current values and hashes back into the tracked files
python pareto-model.py --figures # list every figure and every guard
--figures also lists the candidates behind two choices that the model makes: the mask’s width
that minimises each of Kishu’s zero-knowledge transactions, and, for the hardware wallet’s vector at
each floor, every base tried for its masking coefficients, with the vector’s digits, the bound on
its randomness’s squared norm, its matrix’s rows, and its response’s size.
A new number in the text gets a fig() in define_figures() and a marker where it is quoted; a
qualitative statement that the model can check gets a guard() and a marker around its sentence.
--fill prints each changed figure as old → new and each changed guard with its new text, which is
the list of sentences to read before committing. A constant that a script computes goes in the model
with a comment naming the script and its inputs, as MODULE_RANK_SUMS_147, WIDTH_SHRINK_147 and
WHIR_147 do.
External checkouts
The scripts expect the checkouts and their outputs under work/, which git ignores, or under the
directory that RAGU_PCS_WORK names. The tracked outputs are under
estimates/. The local changes are patches under
scripts/patches/, one directory per repository, numbered in
the order they apply as git format-patch names them, and applied with git am.
scripts/akita-checkout.sh makes the four Akita
checkouts: it clones the pinned revision, initialises the lattice-estimator submodule, and applies
0001, 0006, and 0007 in the clone; 0001, 0002, 0004, and 0005 in the first worktree;
0001 to 0003 in the second; and those three with 0008 in the third.
| Directory | Source | Local changes |
|---|---|---|
work/akita-src | LayerZero-Labs/akita at 60b82bc30f4f8f1130ccd71fe10b0b9bed909ab9, branch pasta-widths | scripts/patches/akita/0001-*: estimator-only Pallas and Goldilocks moduli, the pasta_rank and catalog_reprice examples, the pricing-width override; and scripts/patches/akita/0006-*: a group of the matrix-vector benchmark for narrow digits at the 64-bit modulus; and scripts/patches/akita/0007-*: a benchmark of the opening of a batch of equal groups |
work/akita-src-150 | a worktree of the same clone, branch pasta-widths-147 | 0001-* and scripts/patches/akita/0002-*: the 147-bit policy and the re-sized compression cells; its width tables are regenerated by the pipeline, not patched; and 0004-* and 0005-*: harnesses that time Akita’s range check |
work/akita-src-165 | a worktree of the same clone, branch level3-165 | 0001-*, 0002-*, and scripts/patches/akita/0003-*: the 165-bit policy and the three-map compression chain of the 165-bit level, for planning only (the prover and the verifier are not adapted); its width tables are regenerated by the pipeline, not patched |
work/akita-src-170 | a worktree of the same clone, branch level3-170 | 0001-* to 0003-*, and scripts/patches/akita/0008-*: the policy at 170 bits in place of 165, for planning only |
work/whir-src | WizardOfMenlo/whir at afec1fa, cargo build --release | scripts/patches/whir/0001-*, for the configurations derived from BEEP only |
work/bitz-poc | albert-garreta/BitZ-PoC at 8ced3b985 | scripts/patches/bitz/0001-*, for the configurations derived from BEEP only; built by scripts/bitz-rerun.sh build |
work/plonky3-src | Plonky3/Plonky3 at f98331687e47106a64ab82a77e2e1d0d66c9161b | none |
| a Ragu checkout | tachyon-zcash/ragu at 7914b3b86037e1fb0795a3ffd0cbf9198c2ade92, the revision Tachyon pins, and a worktree of it named ragu-tachyon-pin beside it at the same revision | scripts/patches/ragu/0001-* on the worktree: a counting feature of ragu_pcd that reports the size of a step’s circuit |
| a Tachyon checkout | tachyon-zcash/tachyon at b482fbf32fb9e3329754674460647dd921561fcc, beside the Ragu checkout | scripts/tachyon-gates/, copied to work/gates/ there |
| an Orchard benchmark crate | a crate depending on the orchard 0.16.0 release from crates.io, running its benches/circuit.rs | the profiler removed, the recipient counts widened to 1, 2, 4, 8, 16, and pasta_curves 0.6.1 with its asm feature |
Akita’s crates build with RUSTUP_TOOLCHAIN=1.96.0, which the scripts set. The Akita runs take
hours, and the benchmarks need an otherwise idle machine. Note: on a MacBook, it may be helpful for
long-running jobs to run under caffeinate -i to stop the machine from sleeping.
Pedersen-IPA
- The proof size and the circuit budget
(
ragu-size-model.py): the component structure is Ragu’s wire format, and the gate and constraint counts are the ones that ragu_pcd’s tests pin (crates/ragu_pcd/tests/internal.rs).python ragu-size-model.pyprints the checked-in proof’s length, andpython ragu-size-model.py budgetthe budget table. The frontier model fails if that is not the length that Ragu’s own test pins (encoded_length_is_a_function_of_profile_and_rankincrates/ragu_pcd/src/serialization/format.rs). After a Ragu change: setRAGU_REVISIONin the frontier model; read the pinned counts off those tests and the component counts offcrates/ragu_pcd/src/internal/into the constants at the top of the size model; and measure the fuse again. - The fuse (
PEDERSEN_FUSE_SECONDS): in the Ragu checkout,cargo bench -p ragu_pcd --features multicore --bench criterion_fuse -- 'fuse/serial', the Merge2 step at the wallet rank with one worker, on one core, the accelerated backend’s time. Udon’s AArch64 assembly is inragu_pcd’s default features at this revision. The model calibrates the Pedersen prover to it. - Tachyon’s circuits (
TACHYON_STEPS): apply the patch underscripts/patches/ragu/withgit amto the Ragu worktree at 7914b3b8, copyscripts/tachyon-gates/towork/gates/in the Tachyon checkout (its manifest points at../../crates/tachyonand at the worktree beside the checkout), andcargo run --releasethere. It prints the gates and constraints of each of Tachyon’s steps, and of Ragu’s rerandomization step, at header 9 and a stage of 5 values. The model’s entries also name each step’s Poseidon permutations, the lengths of its fixed-base scalars, and its openings, which are read off the step’s source incrates/tachyon/src/stamp/proof/. - Halo 2 (
HALO2_SECONDS): Orchard 0.16.0’sbenches/circuit.rsproving group with the recipient counts widened, built with rustc 1.100.0 andpasta_curves0.6.1 withasm; the two-action and sixteen-action times on one thread.
Akita
-
Openings, slopes, rows and the catalog report (
AKITA_128,SLOPE[128],ROWS,estimates/):scripts/akita-pasta-estimates.shbuilds the patched Akita and runs the rank ladder (pasta-rank.csv), the catalog re-pricing, the re-plans under each pricing override, and the 128-bit width tables for Pallas and Goldilocks. It writes the TSVs and CSVs thatestimates/holds. The catalog security report there isgen_schedule_artifacts --catalog-reportover the shipped families, built with thecatalog-securityfeature, as the re-plan scripts run it. The per-K group runs behind the opening tables are not kept underestimates/; the re-plan scripts reproduce them. -
A plan at 170 bits, which the model does not read:
scripts/akita-170-pipeline.sh, on thelevel3-170worktree, does at a 170-bit floor what the 165-bit level’s pipeline does at its own. That floor is block size 642, just above the 638 of ML-DSA-65’s SIS instance. -
The 165-bit level’s plan (
AKITA_165_PLANNED,SLOPE[165],LEVEL3_COMPRESSION_CELLS,MODULE_RANK_SUMS_165):scripts/akita-165-pipeline.sh, on thelevel3-165worktree, regenerates the width tables at 165 bits (about four hours;SKIP_TABLES=1resumes), re-sizes the nine compression cells and checks that each covers its map, rebuilds, and runs the re-plan intowork/akita-165-out/replan. Then:python scripts/akita-150-page-inputs.py work/akita-165-out/replan python scripts/linf-accumulation-widths.py 165 \ work/akita-src-165/crates/akita-params/src/sis/generated_sis_table - - \ > estimates/linf-accumulation-widths-165.tsv python scripts/derive-linf-widths.py 147 165 estimates/linf-accumulation-widths.tsv pallas \ > estimates/linf-accumulation-widths-derived.tsv python scripts/rank-scale.py estimates/catalog-security.tsv \ work/akita-src/crates/akita-params/src/sis/generated_sis_table \ work/akita-src-165/crates/akita-params/src/sis/generated_sis_table \ estimates/linf-width-table-goldilocks.csv estimates/linf-width-table-goldilocks.csvThe first prints the opening’s bytes; its slopes are from 2^14 to 2^16, and the model’s are from the 2^14 and 2^24 rows of the same files (2^26 for Goldilocks). The second writes the level’s accumulation widths for the 64-bit and 128-bit moduli, and the third derives Pallas’s, which the estimator has not been run for at the level. Deriving all three moduli and running
scripts/derive-linf-widths.py --check DERIVED.tsv estimates/linf-accumulation-widths-165.tsvgives the rule’s error against the estimator: a median of +0.004 in log2 of the width for the 64-bit modulus and +0.014 for the 128-bit one, with 5th to 95th percentiles of about -0.12 to +0.48. The last command’sownline is the level’s module-rank growth for the catalog’s own moduli; itsq64line is not meaningful there, since the 64-bit modulus’s CSV table at the level has not been generated and the 128-bit one stands in for it. -
The 147-bit floor (
AKITA_147,SLOPE[147]):scripts/akita-147-pipeline.sh, on the worktree that the checkout script made, regenerates its width tables at 147 bits (hours;SKIP_TABLES=1resumes), re-sizes the compression cells, rebuilds and runsscripts/akita-147-replan.sh; thenpython scripts/akita-150-page-inputs.py work/akita-147-out/replanprints the two dicts in the model’s shape.scripts/akita-150-tables.shwrites CSV width tables at a given floor for every modulus, and the Pallas table alone isinfinity_width_table --policy Quantum147BitADPS16 --profiles pallas --format csv --profile local-minimum --output ...in the worktree: 5.5 hours with the estimator built without itsparallelfeature. -
The 165-bit level’s derived parts (floor key 165): the Pallas modulus’s accumulation-width table is extrapolated from the 147-bit rows by
scripts/derive-linf-widths.py, whose--checktests the rule on the estimator’s own tables; the compression chain’s security (LEVEL3_COMPRESSION_CHAIN,SHIPPED_COMPRESSION_CHAIN) is printed byscripts/compression-chain.shfrom Akita’s single-instance estimator, in a checkout with the estimator’s examples built. -
Module-rank growth (
MODULE_RANK_SUMS_147): over the weakest instance of each of the catalog report’s 115 schedules, the least module rank that covers its width at each floor, mapped through each variant’s modulus:python scripts/rank-scale.py estimates/catalog-security.tsv \ work/akita-src/crates/akita-params/src/sis/generated_sis_table \ work/akita-src-150/crates/akita-params/src/sis/generated_sis_table \ estimates/linf-width-table-goldilocks.csv work/akita-147-out/linf-width-table-147-goldilocks.csv \ estimates/linf-width-table-pallas.csv work/akita-147-out/linf-width-table-147-pallas.csv -
Width shrink (
WIDTH_SHRINK_147): the median of the 128-bit width over the 147-bit one, per modulus and ring dimension, over the cells where neither width is at the estimator’s search cap and the width falls. The shipped moduli come from the production table’s policy audit at each floor, Pallas and Goldilocks from the CSV tables:python scripts/width-shrink.py 147 \ work/akita-src/crates/akita-params/src/sis/generated_sis_table/policy_audit.csv \ work/akita-src-150/crates/akita-params/src/sis/generated_sis_table/policy_audit.csv \ pallas=estimates/linf-width-table-pallas.csv:work/akita-147-out/linf-width-table-147-pallas.csv \ goldilocks=estimates/linf-width-table-goldilocks.csv:work/akita-147-out/linf-width-table-147-goldilocks.csv -
The accumulation matrix (
LINF_WIDTHS,estimates/linf-accumulation-widths.tsv): the largest width that Akita’s ℓ∞ estimator certifies at each module rank and each bound of the catalog’s ladder, at ring degrees 512 and 1024, for the Pallas, 64-bit and 128-bit moduli at both floors. The 64-bit and 128-bit moduli come from the production tables the estimator writes intoakita-params(generated_sis_table/q64.rs,q128.rs, in the pinned checkout at 128 bits and the 147-bit worktree at 147), Pallas from the CSV width tables above; the Goldilocks CSV tables are checked to coincide with the 64-bit modulus’s rows, which the Goldilocks variant reads. The estimator evaluates only the catalog’s own cells, so a bound is rounded up to the ladder:python scripts/linf-accumulation-widths.py \ 128 work/akita-src/crates/akita-params/src/sis/generated_sis_table \ estimates/linf-width-table-pallas.csv estimates/linf-width-table-goldilocks.csv \ 147 work/akita-src-150/crates/akita-params/src/sis/generated_sis_table \ work/akita-147-out/linf-width-table-147-pallas.csv work/akita-147-out/linf-width-table-147-goldilocks.csv \ > estimates/linf-accumulation-widths.tsv -
The hiding padding’s hardness (
HIDING_PADDING_ATTACK_BITS,HIDING_PADDING_SWEEP): the pinned lattice estimator in Akita’sthird_partysubmodule, which the checkout script initialises, under Sage, costs every LWE attack on the knapsack-LWE instance behind the hardware wallet’s padding at 5,000 bits and 1,024, 1,385, and 2,048 rows, then sweeps the padding from 3,500 to 6,000 bits at the device’s 1,024 rows, by 250 and by 50 where the floors are crossed, under the ADPS16 quantum model:sage scripts/knapsack-lwe-check.pyfromragu-pcs, about an hour. With arguments it runs one sweep at other rows, as for the 165-bit level, whose wallet matrix has 2,048 rows:sage scripts/knapsack-lwe-check.py 2048 5500 8000 250, then2048 6050 6200 50and2048 6120 6144 8around the crossing, a few minutes in all (HIDING_PADDING_SWEEP_2048). -
The pruned leanSPHINCS key (
LEANSPHINCS_PRUNED_LIFETIME,LEANSPHINCS_KEYGEN_COMPRESSIONS): the proved signature limits are the table “Proved lifetimes” in sphincs.art’sformal/sphincs/README.md, and key generation in compressions is its cost script’s count:scripts/leansphincs-keygen.py, run aspython scripts/leansphincs-keygen.py SPHINCS_ART_CHECKOUT, with the checkout at 8157875. -
The opening of a batch of groups, by their number (
estimates/akita-group-batch.tsv):scripts/akita-group-batch.sh, in the clone, on one core of an otherwise idle machine. Each group is one dense polynomial of 2^20 evaluations over the 64-bit field. Akita’s catalog has no schedule for more than two groups, so the script plans one for each count with Akita’s generator, a quarter of an hour at eight groups, and then runs the benchmark that patch0007adds. The file has the planner’s proof bound, the coefficients that the root fold passes on, and the times to commit one group, to prove, and to verify. The model does not read it; the working notes record what it shows. -
The commitment’s rate at the 64-bit modulus (
AKITA_MATVEC_US): Akita’sntt_matvecbenchmark in the clone, on one core of an otherwise idle machine. The “narrow” entries are the times namedi16_l8_…in the group that patch0006adds, and the “sixteen” entries the benchmark’s own 16-bit ones:cargo bench -p akita-cpu-backend --bench ntt_matvec -- 'ntt_matvec_q64/small_digits' cargo bench -p akita-cpu-backend --bench ntt_matvec -- \ 'ntt_matvec_q64/rank_ring_dim/w128/i16_l16_base/d(512|1024)_r[12]_'Each entry is the mean time in microseconds, by ring degree and module rank.
-
The range check by digit base (
AKITA_STAGE1_NS): in the first worktree, on one core of an otherwise idle machine,cargo bench -p akita-cpu-backend --bench stage1_bases. It prints, for each base and table size, the time of Akita’s whole range check and its nanoseconds a digit, the run of least total of five. -
Typed from the paper and the notes: the verifier times (
AKITA_VERIFY_MS, Table 16), the terminal’s inner-image coordinates (IMAGE_COORDS, pasta-proof-size.md §6.1), and the mask’s parameters (MASK_*, the zero-knowledge note’s §5).
WHIR, FRI and the limb hybrid
-
The sweeps (
estimates/whir-sweep.tsv,estimates/whir-sweep-grind.tsv): the reference binary at 2^17, 2^18 and 2^20 variables overField256andGoldilocks3, rates 1/2 to 1/64, maximum proof of work 0, 16, 20 and 24 bits, 128 bits in the Johnson regime, three verifier repetitions:target/release/main -l 128 -d 17 -r 3 -f Field256 -p 20 --reps 3
Each run prints Proof size, Average hashes and Prover time, which are the TSV’s proof_KiB,
verifier_khashes and prover_ms; first_samples and queries are the first round’s sample count
and the sum over rounds from its commit ... samples N lines.
- The quadratic extension under BEEP
(
estimates/whir-sweep-beep.tsv): with the patch underscripts/patches/whir/applied bygit amand the build repeated,scripts/whir-sweep-beep.shruns the same grid overGoldilocks2and prints the table. The patch is a diagnostic, not a sound configuration: it takes the fold’s error as BEEP’s, and BEEP’s samples are not sent. It quotes lines of the reference implementation, which is MIT or Apache-2.0. The table’s sizes and counts are deterministic; its prover times are not used. - The higher floor (
WHIR_147):scripts/whir-sweep-147.shruns the same binary at 128 and 147 bits over both fields at rates 1/2 to 1/8; the model takes the mean ratios. - Zero knowledge (
ZK_BYTES,ZK_HASHES,ZK_PROVER): Plonky3’s HVZK-WHIR benchmark,RUSTFLAGS="-Ctarget-cpu=native" cargo bench --bench zk_overhead -p p3-whir -- whir_zk_overheadinwork/plonky3-src. - FRI’s factors over WHIR (1.95 on the proof, 2.07 on the hashes) are the WHIR paper’s measurements, typed.
The 𝔽₂ family
frib_optimizer.py is the tracked port of Ulrich Haböck’s
FRI-Binius proof-size optimizer and runs inside the model. Its calibration (FRIB_MEASURED_MS) and
Flock’s throughput and shares are typed from the two papers.
BitZ
BITZ_MEASURED is the proof of concept’s own benchmark on one thread, by
scripts/bitz-st-sweep.sh, after
scripts/bitz-rerun.sh build:
scripts/bitz-st-sweep.sh st 22-29 udrg:1:4:128 udrg:3:4:128for the unique-decoding configurations, rates 1/2 and 1/8 at 128 bits; and- with the patch under
scripts/patches/bitz/applied bygit amand the build repeated,scripts/bitz-st-sweep.sh st 22-28 beep:custom:1:4:128and so on tobeep:custom:6:4:128, for the configurations derived from BEEP, rates 1/2 to 1/64.
Then python scripts/bitz-summary.py work/bitz-out/st/sweep-*.log gives the table of commit,
grand-product, Ligerito and verifier times and proof bytes. BITZ_QUERIES are the per-level query
counts of each run’s resolved configuration, which its RESULT line carries hex-encoded.
The script sets RAYON_NUM_THREADS=1. The benchmark’s --threads 1 sizes only its main thread
pool, and the library’s Merkle trees, encoder, combine step and lincheck fold hop onto a second
pool of every core unless that variable is set. The script also refuses to start on battery power
where it can tell. scripts/bitz-pcs-sweep.sh and
scripts/bitz-overnight.sh are earlier sweeps of
the same benchmark that do not set the variable; their times are not used.
The patch is a diagnostic, not a sound configuration: it lets the Johnson profile run at a 128-bit
target by dropping three checks, which the model’s comment on BITZ_MEASURED lists. It quotes
lines of the proof of concept, which is MIT-licensed, and of its vendored flock-mod, which is MIT
or Apache-2.0.
Kishu
BOOL_CHECK holds the Booleanity draft’s measured reduction (prover and verifier times, payloads,
the projection’s scan). spike/ models the protocol and is not a source
of page numbers.
The figure of a transaction’s nodes, steps, merges, and fold, on the page What Kishu Is Made
Of, is an inline SVG that
scripts/structure-figure.py draws. Its layout,
its title, and the description that a screen reader gives are in the script.
python scripts/structure-figure.py --write rewrites the figure in the page, and without --write
the script fails when the page’s figure is not the one that it draws. The book build runs that
check.
Akita’s binary groups
BINARY_MEASURED is the Akita development branch’s measurement of an opening over a binary field
(LayerZero-Labs/akita#285, scripts/binary-full-size.sh there at 8046b4cd2, the P128 root), typed.
The applications
The recovery circuit’s and the Merkle path’s costs in each arithmetization (RECOVERY_*,
RECOVERY_PATH_*, BOOL_*) are derived in the model’s comments from ZIP 2005’s cost section and
the arithmetizations’ own gate costs; Tachyon’s nodes are the measured circuits above. Nothing
external is needed beyond the gate probe.
CAPSS
CAPSS_* are the CAPSS paper’s Tables 2, 3, and 6, typed; the CAPSS page’s Kishu estimates
apply the model’s Poseidon and digit costs to them.
The sampler
MASK_SAMPLE_NS and its companions are
scripts/sampler-bench.c’s measurement: build it with
clang -O3 -o work/sampler-bench scripts/sampler-bench.c -lm and run work/sampler-bench 22 32 22.9 aes and work/sampler-bench 22 32 on one core of an idle machine on mains, three times each, and
take the medians of the whole-path and randomness-alone lines. The aes form needs macOS
(CommonCrypto); the ChaCha20 form is portable.
The carry-less multiplication
GF128_MEASURED_NS is scripts/clmul-bench.c’s
measurement of a GF(2^128) multiplication by PMULL against the model’s word multiplication: build it
with cc -O3 -mcpu=native -DCHAINS=16 -o work/clmul-bench scripts/clmul-bench.c and run
work/clmul-bench on one core of an idle Apple Silicon machine on mains; take the GF(2^128) line’s
nanoseconds. The chain count sets how many independent multiplications are in flight, and the
Goldilocks line is a scalar reference whose own rate is below the page’s 3e9 a second.
The notes’ own tables
The tables in pasta-proof-size.md §3, §3.1, §6.2 and §6.3
are the planner’s figures from
estimates/catalog-reprice.tsv and
estimates/reprice-*.tsv, which
scripts/akita-pasta-estimates.sh writes; the
Pedersen figures there are ragu-size-model.py’s. The
figures that the model also computes carry markers and refill with --fill.