Repository navigation
Prover speedups for M-heavy guests: thirteen optimization layers in twenty commits - #60
Merged
Merged
Conversation
… sums by column The GKR prover no longer allocates a 2^(t+5)-entry T3 table per proof (64 MiB at t = 17) to feed the forward pass: each level-3 value is the product of the two 16-entry halves the layers already use, taken from the buffer pool. At s <= 6 the bit rounds' cross sums are computed column by column instead of through four 256-entry buckets and their transforms per chunk; BITZ_CROSS_DIRECT_MAX_S overrides the bound (default 6; negative disables it). Prover-only: every prover message is the same field element, so the proof bytes are unchanged. New tests check the direct cross sums against the bucket pass and the forward pass against the definition, and pin the proof bytes of fourteen shapes to the previous prover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Design C (bitz.md M16) proves a MUL and a MULHU on the same operands with one unsigned product. The honest prover now uses it, through mtable::pairs: - The choice of (ℓ, ℓ′) needs only the number of pairs. Per operand key the FIFO rule pairs min(#MUL, #MULHU) operations of each kind, so count_pairs sums that over the keys and rounds down to even. There is no pair table below 64 pairs, when the paired cycles are under half of the M cycles, or unless the committed M bits strictly decrease; ℓ′ and ℓ come from the pair and single counts. - Only a run that takes the table matches its pairs, once: each operand key hashes into one of up to 2^12 buckets, each bucket is sorted on its own and goes through the FIFO rule, and reading the matches in record order gives the pairs sorted by the MUL cycle. - split divides the M cycles between the single table and the pair table over the run's length T, refuses an M cycle at or beyond T, and sizes the pair table's coverage by T. Both witness producers (the stored run and the streamed builder) build the pair table; the CPU's coverage column is unchanged, and P.T reaches G through the pair witness. - MAGNETAR_NO_PAIRS, a benchmark switch read once per process, turns pairing off; it changes only the prover's choice of (ℓ, ℓ′). Runs without a pair table take the previous path, so their proofs are byte-identical; paired runs change the honest proof bytes. The verifier's rule is unchanged. The ledger checks design C for the first operation set of each MUL/MULHU class (0009, 0029, 0049) at every ℓ from L_MIN to n − 1 and every ℓ′: the worst squeeze run is exactly 2^-128 per query. The census adds the two classes of the paired guests at n = 20 (31 cases). bitz.md M16.1 states the honest pairing policy and what the choice needs. Regenerated: the ledger, its census, the headline table, the pinned copies and the counts the specs quote. limits.tsv classifies the pair tests' memory configuration as a test fixture. Tests: the pair count equals the matcher's on random traces (small chunks and bucket counts included), at scale and on the corpus guests with M operations; the j4h corpus driver checks it on every halting run. The paired witness is the same from both producers; paired proofs verify with and without the row merge, with the test shapes asserted; consistently committed forged pair witnesses are rejected. The corpus record carries ℓ′ and the single table's rows and padding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Next sum-check, sum_x K~(r_u, x) d(x), built a T-entry d and a T-entry successor table (plus its eq table and a single-threaded copy), then ran dense product rounds over both; most of its time was page faults on those tables. The prover now computes the first three round messages from 16 eq-weighted residue sums of d in one walk over Next's column words, builds d and K~ bound at the first three challenges (T/8 entries) with per-column byte tables up to Next's halted tail, and runs the remaining rounds with the tail-aware product rounds that Shout uses, with K~'s tail in closed form. The previous prover stays as a test reference; the tests compare NARG bytes and claims for n = 6..15 over tail shapes, block sizes and the split tables' seams. limits.tsv drops the stale TRACE_BUFFER_BYTES whitelist entry: #57 removed that constant, and the entry made tests/j4h_limits.rs fail. Prover-only: the verifier, the transcript and the proof bytes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n by stores Large prover tables are fresh memory that glibc maps block by block, so each was faulted in 4 KiB at a time on first touch, from every core at once. RoomAllocator now marks every block of 2 MiB and more, and every growing realloc, MADV_HUGEPAGE: where the kernel's transparent huge pages are "madvise" or "always", a first touch faults 2 MiB at a time. The advice covers the pages that hold the block and asks the allocator below nothing, so any allocator may sit there; for a block glibc mapped on its own those pages are the whole mapping, which stays one VMA, so a growing realloc can still move it with mremap. pool::set_huge_pages turns the advice off; nothing changes elsewhere than Linux or for a binary that does not install RoomAllocator. RoomAllocator also skips its shared counters for small blocks: every allocation of every core did locked read-modify-writes on the one cache line that holds them, although only large blocks are counted. Mosaic's weight table W was zeroed memory updated in place, so the first access to each page was a load (the shared zero page) followed by a copy-on-write fault and a TLB flush on the other cores. pool::zeroed_for_update stores a zero to one entry per 4 KiB of the ranges the caller will update, in parallel, so each page takes one store fault. The corpus driver now installs RoomAllocator, as the prover binaries do, unless built with --cfg binary_jolt_system_alloc; MAGNETAR_HUGEPAGES=0 turns the advice off there for an A/B. Prover-only: the proof bytes are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… table MUL, MULHU and MULW rows need neither R nor a carry chain once the honest prover sets z_R = 0 on them (M6 leaves z_R a one-sided hint there), so a simple row is valid anywhere in the table. MULH, MULHSU and the divisions are general: a valid row can need R or a chain. The honest single table is now ordered [general | simple | padding], each part in cycle order, and G commits MR and MC1..MC4 on its first 2^l_g rows only, l_g = max(6, ceil(log2 of the general rows)); MQ and MT keep all 2^l rows. - mtable::prefix: the general/simple split, l_g, the order and the prefix check. Both producers apply the same permutation to tau and to the cycle records, and a general row beyond the prefix is an assembly error in release builds too. - The parameter set gains l_g after l' (so every statement digest changes, with or without an M table); stage::multiplication::check admits 6 <= l_g <= l, and l_g = 0 without a table. - GLayout places the five general components at l_g rows; Mosaic packs only their prefix. - Before G's Mosaic lifts them, prover and verifier convert the claims on MR and MC1..MC4: the point must have exactly 6 + l coordinates, it is cut to 6 + l_g and the value divided by eq(r_hi, 0); eq(r_hi, 0) = 0 is rejected. With l_g = l the conversion is the identity. - The pairing cost rule compares 32 2^l' + 96 2^l with 96 2^l0: pairing removes only simple rows, so the prefix term cancels. Spec: the frontend (specs/binary-jolt/jolt/) overrides M4's and M12's layout for its single M table: J2.3 and J4 (the parameter set, the honest l_g, the pairing cost rule, J3.4's committed cost 96 2^l + 320 2^l_g, the J4.1 known answer), J10.2, J10.4 and J10.6 (layout, budget, claim conversion, tests) and J14.5. rv64m.md M4/M12, bitz.md M16 and ledger_rv64m.py keep the RV64IMAC protocol's 416-bit row, with a cross-reference to the override. Ledger and census: ledger_jolt.py carries l_g through the layout, the sites, the closed forms, the RV64IMAC comparison, the shape entries and the PCS slot selection, and checks every configuration with an M table at l_g = 6 and at l_g = l (the two ends cover every admitted l_g). The census gains the prefix pair at n = 17, l = 14 (l_g = 6 and 14, n_G = 25 and 26), for 35 cases, and fs_census_jolt.rs records the live verifier on both. Regenerated: the ledger (worst squeeze run 2^-128.00), its census, the headline table, the pinned copies and the counts J13-fs.md and J18-delta.md quote. Tests: simple and general rows over the oracle's edge grid (Python and Rust), the conversion against a zero-extended component, the binding of l_g at equal geometry, the parameter check, both producers on a run with general cycles after simple ones, the 64/65 boundary end to end, and a DIVU row forged beyond the prefix (refused by the assembly, rejected by the verifier). Refreshed: the parameter-set known answer and its pins, both Fibonacci vectors, the per-role vectors and their limits.tsv copies; the corpus records l_g, n_G and G's used bits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The witness pass ran the whole run a second time on one executor thread, which handed 128-byte cycles to a builder on the prover pool. The pass was serial, and much slower whenever the two threads landed on different L3 domains, so parts.witness switched between a fast and a slow mode at large n. The facts pass now keeps checkpoints of the run: the machine, the host's state and the trace reader's position, at every multiple of K cycles up to the halt. K is a power of two from 4096; it doubles, dropping every other checkpoint, to keep at most 512 checkpoints within 1 GiB. The window RAM's pages are copy-on-write, so a checkpoint costs its page table plus the pages the run later writes. The pages the checkpoints hold beyond the run's own are bounded by the page copies since the last exact count; past the budget, WindowRam::pages_beyond counts them exactly and the checkpoints are thinned unless they take at most half of it. The pass stops the padding after its first stall cycle and counts the M cycles before each checkpoint. The witness pass splits T into K-cycle items and builds them in parallel. Each item restores its checkpoint, runs the executor's step to the halt (the stall after it) and writes in place, 1024 cycles at a time: its mcov words (with the M table's padding parity at T - 1), its chunks of the planes (a pure stall chunk is a copy), the trace and RAM columns, and its M cycles (32-byte records) at the offsets the checkpoints counted. An item copies its checkpoint's page table and tape and allocates at most the pages the run allocated between its checkpoint and the next; the items run in waves whose largest items fit ITEM_BYTES (2 GiB) together. An item checks that it ends in the next checkpoint's state, and after a failed batch its buffer is cleared at every batch boundary. The M table is then built serially from the M cycles, and the recorded trace is freed on a background thread before the M table takes its memory. The checkpointed path keeps the pair table's split and the general-row prefix: the run facts carry ℓ_g, the singles and their M cycle records are put in prefix order before the padding, and the M table is checked against its prefix. With no M table (ℓ = 0) the padding parity is 0 and any M cycle is refused. The witness, the parameters and the proof bytes are unchanged. Tests check every part (planes, trace columns, M planes, tau, RAM witness and G) against the stored-run oracle on corpus guests, also with one item per wave; the traced run replays from checkpoints thinned to four and from checkpoints thinned by a zero budget; unit cases cover the wave split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chain With an M table (l != NO_TABLE) the M block moves to a transcript instance of its own, forked from the main transcript before Spartan and joined after DL-A (J13.2): - fork: the main transcript labels magnetar/piop/m-lane/fork and squeezes sigma_M (4 elements); the lane transcript starts from it under the session tag magnetar/piop/m-lane; - lane: the M block unchanged (M-Spartan, the product relation, the pairs, DL-M1, DL-M2 and the row merge), then the digest label and delta_M (4 elements); the verifier requires the lane NARG consumed exactly; - join: the main transcript labels magnetar/piop/m-lane/join and the prover sends delta_M; the verifier rejects unless its lane accepted with the same delta_M. The lane's pool is spliced in at the M block's place (Pool::splice), so DL-B and Mosaic see the serial order's claims. The concurrent schedule runs the lane from the fork on a pool of its own (runtime::workers::m_lane, k = MAGNETAR_M_LANE_THREADS, default floor(N/4), at least 4; unpinned unless MAGNETAR_M_LANE_PIN=1 on Linux). The inline schedule runs it at the M block's serial place with the same bytes; the prover takes it when max(l, l') < 12, and MAGNETAR_M_LANE=inline|concurrent forces either on prover and verifier. Proof layout with an M table: u64 LE len(L) || L || N (L the lane NARG, N the main one); Sizes.m_lane counts the lane section and the robustness regions shift by it. Without an M table nothing changes: no fork, no header, the same bytes. The global session tag is unchanged; the lane's own tag separates its transcript. fibonacci's trace-slot NARG known answer with an M table is re-pinned. measure: frontend.mblock stays a top-level record and frontend.join measures the join's wait. Spec: J13.1 and J13.2 give the absorption order and the partial order of the stages; J13.3 adds the fork, digest and DL-B rows and the lane's site and run counts; J13.4 states how the ledger forms runs per instance and which differences from the RV64IMAC protocol it admits. The security document adds the fork/join lemma over a logical oracle (kappa_bind at most 3(Q_A + R)^2 / 2^512) and threads it through the model, the PCS composition and the Jolt slot theorem. Ledger and census: each site names its transcript instance. With an M table the ledger adds sigma_M (main, first, loss 0) and delta_M (the lane, right after the M block), puts the M block on the lane, and makes DL-B's first gamma fresh with message_words = 4. Squeeze runs are formed per instance and indexed globally, the main instance's first; a run of loss 0 has no rate. The RV64IMAC comparisons take the serial projection and admit exactly DL-B's gamma differing in freshness. Every case with an M table gains 2 sites and 2 runs (3 with the row merge). Grid: 330,801 configurations, 590,858,354 squeeze runs, the worst still exactly 2^-128. Census: 35 cases, 19 with an M lane. The census harness reads the instance, the message words and the optional rate, checks runs, replays and forgeries per instance, and records the live verifier on both instances (frontend::verify_with). The ledger labels the kappa runs the lane ends: with an M table DL-A's last kappa runs alone (DL-B's first gamma is fresh after the join), and without the row merge DL-M2's last kappa runs with delta_M; the serial projection keeps the serial labels. Regenerated: the ledger, its census, the generated TeX, the pinned copies and PIN. Tests: inline and concurrent schedules give the same NARGs and the same pool at Mosaic's intake, and both verifier schedules accept with the same claims; Pool::splice against the serial pushes and its refusals; no stage between the fork and the join takes an M claim; no M table means no lane, and a lane section is refused; rejections (delta_M flipped, a lane byte more or less, another proof's lane, no lane, bad or missing length headers) give the same error under both verifier schedules; sigma_M is the first squeeze after the commitment exchange under Akita, WHIR and flock; the lane pool's size rule. The sigma_M record (frontend::seeds) and Pool::virtual_claims are built only with the WHIR tests that read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Carriers::into_vec copied a lent slot, or read a ranged one, on one thread. For flock's commit of a whole G (2^(n_G - 7) carriers) that single thread also took every fault of the fresh vector. A lent slot is now collected in parallel (in place, with no zeroing pass) and a ranged one read in chunks of 2^16 carriers, one per task on the current pool. The carriers and their order are unchanged, so proofs are byte-identical. Tests: index-distinct carriers at 0, 1, 2^16 - 1, 2^16, 2^16 + 1 and 2^18 - 5 carriers, moved, lent and ranged, on pools of one and four workers; an empty source is not read, a ranged one is read once per chunk, and a failing read's own error comes back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add prover::testkit::census. It builds an honest frontend proof with exactly one census case's configuration: n, P, l, l', w_f, L, the program mode, trusted advice and U. It then records frontend::verify on that proof under sites::Recorder. Design C uses the pair table at l' = 9, as the case defines it. In committed mode the proof carries placeholder commitments, which the frontend never reads. The census test runs sites::compare and sites::check_runs on the recording for 23 of the census's 25 cases with n >= 17, the PCS minimum: every one but design C at n = 20 with P = 0x0009 and P = 0x0049. It also checks that the recording matches no other case. The 8 cases at n = 22 and 24 are ignored by default. Adding a case takes one line in the live! list. The live cases prove under pcs::hash::DefaultHash, which exists only with pcs-whir, so the test requires that feature (as the backend-internals tests require pcs-akita); default builds and CI's test runs are unchanged. J13-fs.md no longer calls the site-by-site recording of the verifier an open test obligation. It names the cases recorded live and notes that the n = 12 cases have no proof to record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run that executes no M instruction now takes no M table (l = 0), whatever the image's operation set P. Until now an image with M operations always got a table of at least 2^8 padding rows, plus the M block, the M Router and the M components of G, even when no M cycle ran (fibonacci, sha2-chain). - pairs::choose_with: the empty-run rule is step 0. A run with no M cycle takes (l, l') = (0, 0) for every P, with pairing on or off. A fully paired run keeps its single table of padding rows, as before. - multiplication::check admits l = 0 for every P. Without an M table the verifier accepts Spartan's mcov claim only with value 0 (the public zero column). The CPU row m.cover, g_m (1 + mcov) = 0, then proves that no cycle is a guarded M cycle. - Shout takes 11 claims without an M table and 12 with one (the M Router's rom3), keyed on l instead of P. ClaimManifest::for_program and CircuitsJ::new take the same m_table flag. - The program key keeps the image's real P, which still selects the M circuit and enters the statement digest. Proofs of runs with M cycles are byte-identical. A test-only l override (parts_from_elf_with_l) keeps fibonacci's pinned per-role vector at l = 8. Spec: the frontend admits l = 0 for every P, and the honest prover takes it iff the run has no M cycle (J2.3); the RV64IMAC protocol keeps l = 0 iff P = 0 and its ledgers are unchanged. J4.2, J9.3, J9.4, J13.2 and J13.3 state the program key, Shout's claim count, the [M] stages and sigma_L at the effective set P_e = P if l != 0, else 0; bitz.md M16.1 takes no M table before the pair-table choice. Ledger and census: ledger_jolt.py treats a run without an M table at P_e in frontend_sites, the RV64IMAC comparison and the shape entries, and asserts that every operation-set class at l = l' = 0 has the sites of P = 0, site for site. Each census case now carries its l and U, and two cases are added (the full set without an M table at n = 17 and 20, with trusted advice; 33 cases); fs_census_jolt.rs keys Shout's count, the claim lists and Mosaic's M claims on l != 0, checks the two cases against their P = 0 controls, and records the live verifier on both (J16). The census harness passes the m_table flag and checks the honest l of l = 0 cases. Regenerated: the ledger, its census, the headline table, the pinned copies and the counts J13-fs.md and J18-delta.md quote. Tests (WHIR): the assembly refuses l = 0 for a run with M cycles, from the streamed and the stored run; muldiv proved at l = 0 is rejected, with mcov zeroed and with the honest mcov; fibonacci proved with and without an M table verifies only under its own parameters; Shout's claim count follows l. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inline fallback, and its limits.tsv entries Every prove and every verify built the M lane's pool, with or without an M table, and panicked when the pool or its scoped thread could not be had, or on an unknown MAGNETAR_M_LANE. Now: - the schedule is read, and the pool asked for, only for a proof with an M table under the concurrent schedule; - the pool is fallible (an unusable MAGNETAR_M_LANE_THREADS or a refused thread gives none), and the lane's thread is spawned with spawn_scoped; either failure runs the lane inline from the saved σ_M, with the same bytes; - a caller that is one of the lane pool's own workers runs the lane inline (with one worker it would wait for itself); - the concurrent lane's verifier thread catches a panic and the join rejects (Error::Reject) instead of re-raising it; the thread always ends cleanly, joined or not. The prover still re-raises its lane's panic; - MAGNETAR_M_LANE and MAGNETAR_M_LANE_THREADS values that are not recognized are ignored and noted once on stderr; - with MAGNETAR_M_LANE_PIN=1 the lane pins its workers only to CPUs of the sched_getaffinity mask it inherits: it reads the L3 domains of the mask's CPUs, cuts each down to the mask and takes the last ones that hold k CPUs. When the mask holds fewer than k, or a call or a read fails, the lane is not pinned and a note goes to stderr once. The workers' l3_domains test no longer assumes the process may use every CPU of the machine. A test-only seam makes the next lane spawn fail; tests show that prover and verifier then run the lane inline with the inline bytes and claims, and that a panicking lane verifier returns an error. tests/m_lane_pin.rs checks on Linux that the pinned workers' masks stay inside the inherited one. Proof bytes are unchanged. limits.tsv lists the lane's three constants: INLINE_BELOW, Transcript::ALL and LANE_PANICKED (the verifier's rejection message when the lane's thread panics). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, record every census case, check set_len - The corpus driver only recorded the single M table's rows and padding rows. For the p256 fixture with pairing on, which is fully paired, it now asserts before proving that (l, l') is (8, 16) and that the single table has 256 rows, every one padding (T - 1). The check is selected by the fixture's name, so a fallback to l' = 0 or any other shape fails the entry. - find_pairs, count_pairs and Buckets document their precondition: fewer than 2^32 records, since record indices and bucket offsets are u32 and u32::MAX is the matching's no-partner sentinel; admission bounds a run's M records at 2^31. - GLayout::new documents its panics (l_g that does not fit l, w_hi above 16, d_U below 3), which the public SlotLayout::for_program reaches with the parameter set it is given. - fs_census_jolt records design C at n = 20 live for P = 0x0009 and 0x0049, so the implemented verifier is recorded against every census case with n >= 17; a test checks that the live! list names each such case once, and another that the verifier's claim manifest (zkvm::circuit::jolt::claim_lists) is ledger-jolt.json's "claim_lists" at both fixture shapes. full-tests.yml runs it in the WHIR job, the ignored n = 22 and 24 cases included. It removes artifacts/protocol/cpu-jolt/ledger-jolt-claim-lists.json, an unused copy of the claim lists that ledger-jolt.json holds. - The replayed witness checks the two facts its unsafe set_len relies on: the first checkpoint counts no M cycle before it, and one item ran per share; either failure returns an error. The replay test checks that shifted counts are refused. Tests, CI, doc comments, an unused artifact and two witness checks that honest runs always pass: no proof changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- bitz.md M16 and ledger_bitz.py name GLayout::new, the layout's constructor, instead of the removed GLayout::with_pairs. - row_merge.rs no longer cites a measurement test that was removed; the measured costs stay in the comment. - Comments that cited rounds of the spec review now cite the spec section (J-number) they refer to, or nothing. Comments and docs only: no code path or proof changes. (The evidence scripts' move to src/pcs/pins.rs is in the docs-hygiene layer.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…all passes as one task ProductBatch cut every pass into tasks of at least 4096 pairs, whatever a pair cost, folded a stored table the first time in place by dependency waves, and split passes of a few microseconds across many workers. Now: - the fill passes (first, deep, stream) aim at 8 tasks per thread, between ~16 us of estimated fold work and 8192 filled positions per task; fold and read passes aim at ~16 us of estimated work per task; - a pass's work is estimated on its active pairs, outside the tail blocks it skips, and a pass estimated under 100 us runs as one task; - tables of at most 256 MiB are allocated with half again their size, so their first fold takes the out-of-place branch; - run_pass takes its splitting floor; eq_pass_tail keeps 4096 pairs for its other callers. Prover only: every message is the same field element (exact binary-field sums under any partition, the same fold arithmetic), so proofs are byte-identical. Tests compare every ProductBatch entry point, under the fixed 4096-pair and the cost-aware schedule, in pools of 1, 3 and 8 threads and on given and recycled buffers, with one reference outcome (NARG bytes, challenges and finals); cases estimated above the one-task cutoff check that their passes split into two tasks or more, and tables that are all tail prove as the dense table with the same constant row. They also check the buffer room, the read pass and every splitting floor of the eq passes. On the 15-guest set, against the stack without it, prove time is 2.1% lower (2.8% with huge pages), 2.4% / 2.9% with grinding normalized. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The deferred bit ring switch's suffix-bank pass (suffix_bank_tensors_many) runs as GF(2) bit-block products over tiles of rows (GFNI with AVX-512BW and VBMI, in the vendored prover's new ring_switch/bits/wide.rs), with per-run accumulators, and the per-claim loops around it (prove_deferred, ClaimHead::new, the deferred weight's rounds and fold, the fused weight table) run in parallel. Targets without those instructions keep the existing sweep. Prover only: every proof byte is unchanged, for every input and thread count. Test support: bank_passes() counts kernel and sweep passes; the oracle computed_suffix_banks_are_the_dense_sums checks the computed banks against the dense sums and the exact counter deltas per opening. Vendoring: local-prover.diff, README.md, MODIFICATIONS.md and docs/third-party-provenance.md record the change. On the 15-guest set, against the stack without it, prove time is 13.5% lower, every guest faster. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd column kernels and the DL rounds - Field: a weighted sum of bits over GF(2^128) is GF(2)-linear in the bits, so byte g of a vector adds an 8 x 8 bit matrix times that byte to each byte of the sum. With AVX-512 (F, BW, VBMI) and GFNI, one GF2P8AFFINEQB applies eight such matrices to byte g of eight vectors, so eight vectors cost two products per byte instead of eight table lookups. BitSums holds one weight vector, ColumnSums up to eight (with paired sums). Other targets keep the byte tables behind the same interface; both paths give the exact XOR of the selected weights, and unit tests compare them on random inputs. - Spartan: the small-value grid, the F2 tables' chunk entries and the column evaluations take eight rows or columns per pass. - DL: the broadcast stage's grid and product rows take eight cycles or positions per pass, and the bitwise cycle rounds' round 0 and product rows eight words per pass where GF2P8AFFINEQB runs; without GFNI the bitwise rounds keep the 16-bit tables. - Checks: ColumnSums states, and debug builds assert, that its words are below 2^bits; both backends refuse the same pair shapes; the F2 chunk entries assert a weight for every row. - CI: the lint job type-checks (warnings fail) and lints every target for x86-64-v3 with AVX-512 F, BW, VBMI, GFNI and carry-less multiplication, so the GFNI kernels compile on any runner. The values, and so the proofs, are unchanged on both paths. On layers 1-10 (15 guests, 5 rounds, grinding normalized), the kernels, measured before the checks, the CI job and the kept 16-bit tables were added, lower prove time by 3.2% (3.0% with huge pages), and no guest is slower (modinv unchanged). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tests - Evidence: #55 moved the generated pin table from src/pcs_pins.rs to src/pcs/pins.rs, but large-rows/pcs_sites_large.py (and through it block-rows/pcs_sites_block.py), ledger_bitz_large.py and ledger_rv64imac_large.py still opened the old path and stopped with FileNotFoundError. With the new path they exit 0 and regenerate their JSON byte for byte. bitz.md and the delta-bitz and changes sections name src/pcs/pins.rs. - Site exports: the WHIR exports j7w_sites_<profile>.json cited a test that was removed with the WHIR backend's library tests; nothing in the code regenerates the uniform exports now. backends/README.md, binary-whir/README.md and the WHIR design note say so and name the two checks that remain (every_certified_row_meets_128_bits and per_role_sites_match_the_imported_exports_field_by_field). The flock note no longer claims byte-identical regeneration: regenerated with e2e_bench --pcs-sites, all three profiles differ in run membership (the live schedule draws each consistency glue and the next level's first fold round in one squeeze run, which the imported exports list as two runs); all other fields match, and ledger_jolt.check_rows passes on the regenerated exports with the same least run margin per profile. - Removed tests: the specs, the security sections and three ledger comments cited tests deleted with the raw RV64IMAC proof path (tests/fs_census_rv64imac.rs, tests/rv64m.rs, tests/exec_vs_reference.rs, tests/e2e_binding.rs). The text now says what each checked and that it was removed; for guest ELFs, bitz.md and delta-bitz name tests/fs_census_jolt.rs, which records the implemented frontend verifier against the Jolt census on honest proofs (n >= 17); rv64m.md and eei.md cite random_programs_match_the_tracer_at_every_boundary (tests/j4x_exec.rs), which runs the executor in lockstep with Jolt's tracer on random RV64IM programs covering all 13 M operations. J5.3 names image::tohost. - Removed builders and test modules: P1, P2 and the operation set point to the table builder (TableJ::build_with, table::premises::check, TableJ::ops / ProgramKey::ops) in rv64m.md, eei.md, J9, J11 and the eei, changes, verdict and delta-rv64m sections; the test lists in bitz.md M14' and M16.7 (with the pair matching's tests in mtable::pairs and assemble/pair_tests), rv64m.md M14, rv64imac.md C9 and J6 name the tests that remain; the W-C1 citations in J10, the backends README and the WHIR note mark the w_c1 tests removed and cite the precommitment tests that replace them; single_bitz_params is table_bitz_params with pairs. - README: the backend table names the per-role WHIR rate switch (uniform rate 1/16 only through BinaryWhir<Sixteenth> and e2e_bench --pcs whir16), and the coverage paragraph says the corpus driver now records only the step count against Jolt's tracer. The ledger scripts exit 0 and regenerate their outputs byte for byte; doc_guardrails reports no findings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eneral-row prefix, the census and BitZ's seed - Security report: Jolt's M lane is covered as a second transcript instance, seeded by a squeeze of the main transcript after the commitments and joined by its digest before DL-B (the fork/join lemma and remark). R1, R2, R6 and R8 say so, including the exact-EOF check on the lane's NARG string and a panic on the lane's verifier thread counting as a rejection. The verdict carries the typed fork/join term kappa_bind <= 3(Q_A+R)^2/2^512, charged once. - Changes since the previous revision: runs without an M table (l = 0 for every operation set), the general-row prefix l_g in Jolt's parameter-set identity and the claim conversion before Mosaic, the M lane and the proof's layout, design C in the honest prover and when it is taken, the census on live proofs, and the prover-only changes, which leave honest proofs unchanged byte for byte. - Jolt's instantiation of the frontend theorem: the refinement's hypotheses, runs without an M table, P's provenance per mode (key generation builds the table; the verifier takes P from the key), both layouts in the slots theorem, the paired relation, the mixed-field bound and the (S3') hypothesis. - Specs: J9.2 names where each premise is enforced; M14's liveness obligation covers the M table's committed columns, with the free cells on padding rows and under the general-row prefix, and states the pair table's P.T separately (bits below n bound by the M Router and the pair table's tree, bits n..31 read by nothing); J13 states what the census compares live and what is data only, the M cycle bound and the census word counts; J10 names the main NARG and flock's glue runs (each glue with its level's first fold round); the README's fork/join term and per-projection kappa_0 at 2^37 bits. - BitZ's projection seed: Lemma bz-round1 bounds the seed's bad set for a fixed prime stream. kappa_0 is k/L(a, 128 - t) + 2^-148, with L the Dusart lower bound on the primes in the interval; on every fixed good prime stream a projection's first-touch weight is (9/8) kappa_0, within the shipped grinding at every shape, and the unconditional bound adds eps_q < 2^-151 once, beside kappa_bind. The reported interactive figures are the fresh-stream ones. Theorem frontend-m, Proposition M9', bitz.md, J13.3, J18, the verdict and the README carry the term. - Ledger: labels only in ledger_jolt.py (the l = 0 column reads "no M table", the backend table's last column is a fixture rather than a maximum, the fork site's note), and ledger_bitz.py asserts 9 L <= 8 2^b at every Round 1 seed; no generated output changes. - The PDF is rebuilt reproducibly (SOURCE_DATE_EPOCH=0, FORCE_SOURCE_DATE=1). Docs and specs only: no code, transcript or proof changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add docs/notes/prover-optimization-todo.md, the owner's working list: the prover optimizations planned next, in priority order, and the ones measured and set aside, with the reason. The file is deleted once the list is done. Docs only: no code or proof changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revises docs/report to describe this pull request's implementation at b987bd9 (2026-12-02), and folds in the unpublished 0.2 draft, so version 0.2 is the first revision after 0.1 (c99d4ef). - Execution: the witness from a recorded tracer run, replayed in parallel from checkpoints of a first pass, with the record's limits, the wave memory estimate, the post-halt chunks and the boundary checks; the statement's raw key maxima and rounded admission; the general-row prefix in the parameter identity; the CPU circuit built from the generator's rows. - Reductions: runs without an M table; the general-row prefix and its claim conversion; the honest pair-table policy and the pair BitZ shape; the M lane (fork, join, framing, schedules, pool, inline fallback, pinning); Next streaming, BitZ halves and cross sums; the batched sumcheck schedule; weighted bit sums with GF2P8AFFINEQB on GFNI builds; huge pages, Mosaic store faults and parallel carrier copies. Prover-only changes keep proof bytes. - Backends: the WHIR ring switch's bank pass as bit-block products over tiles and its parallel claim loops; Akita's shared setup artifacts and their test coverage; the default backend rule. - Security: two transcript instances and kappa_bind; the projection seed's fresh-stream and good-stream bounds with eps_q charged once; the amended guest theorem's premises per program mode, matching the security analysis in this change. - Parameters and evidence: the grid's pair-table scope and prefix ends, the 35-case census with 29 live recordings, regenerated ledgers and flock exports (run grouping, two 1-ULP flock-ud rows), and the maintenance guide without the pin-table workaround. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sumchecker
enabled auto-merge
December 2, 2026 23:21
sumchecker
disabled auto-merge
December 2, 2026 23:21
sumchecker
enabled auto-merge
December 2, 2026 23:25
sumchecker
disabled auto-merge
December 2, 2026 23:26
mtbadakhshan
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR stacks twenty commits on
main(24437ca): thirteen optimization layers, one commit each, a robustness fixfor the M lane, review fixes, two cleanup commits, the security-document amendments, one notes commit and the
technical report's revision. Layers 1–12
are optimizations; the thirteenth, GFNI (layer 16), comes after the robustness fix, the review fixes and the first
cleanup. Eight optimization layers are prover-only and keep every proof byte-identical, and one (layer 5) adds a test
harness and spec text. Four change the honest proof or the protocol: the pair table, runs without an M table, the
general-row prefix and the M lane. Each of those four updates the spec, the Fiat-Shamir ledger, its census and the
pinned copies in the same commit. Layer 9 also adds its lemma to the security document, and layer 18 amends the
security document for layers 6, 7 and 9. Each optimization layer showed a gain on its target metric in an A/B before
it joined. Layers 1–10 passed their own gates (apart from one known failure on
main, which layer 1 fixes), and thetop of this PR passed the final gate (see Gates). Most of the A/Bs were against
main, not against the layer below;the Layers table gives each one's base.
Please merge with Rebase and merge, so that each layer stays its own commit on
main.Layers
mainmainine2e_bench's allocator configurationmainmainmain+ layer 2main(the lane alone)main+ layer 2: −6.0%main, flock backendcodegen-units = 1and functions aligned to 64 bytesartifacts/protocol/cpu-jolt/ledger-jolt-claim-lists.json, an unused copy of the claim lists thatledger-jolt.jsonholdsfind_pairs,count_pairs,choose,split) and their testsledger_jolt.pyand one assertion inledger_bitz.py(no generated output changes)Commit 20 revises the technical report to describe this PR's implementation (execution, reductions, backends, and
the security statements: κ_bind, the projection seed's fresh-stream and good-stream bounds, ε_q), with its evidence
regenerated: the ledgers are unchanged, and the flock exports are regrouped, with two rows of the flock-ud profile
moving by one unit in the last place and every margin unchanged.
How the A/Bs were measured:
its median; a set's figure is the sum of its guests' medians. "With huge pages" is a second run with huge pages
enabled.
modinv, fibonacci and sha2-chain (n = 17–24). The larger sets add guests up to n = 26. The 5 M-heavy guests are
bignum at n = 24 and 26 and the three ECDSA verifiers. Layers 11, 12 and 16 were measured on the 15 guests of the
combined result below.
codegen-units = 1and functions aligned to 64 bytes, over 5 rounds without huge pages.GFNI, so it timed the GFNI path. It measured the layer's four kernel commits before the layer's review fixes. Those
fixes add a CI check, keep the 16-bit tables in the bitwise cycle rounds without GFNI, and add checks; on the GFNI
path they add only a length check in the F2 chunk entries and two fields to an existing shape check, beside debug
assertions. Without GFNI the layer was checked for equal proofs on an AMD EPYC without GFNI, not timed.
rounds do not average it out. The figures for layers 4, 6 and 7 subtract each run's grinding time on both sides.
The M lane runs its grinding off the main chain, so its lane-aware figure subtracts, on the layer's side, only the
part the main chain waits for. For layers that keep proof bytes, both sides grind the same draws, so the adjustment
only takes that common time out of both totals.
layer 16.
Combined result
The stack without layer 16 (GFNI) against
main(24437ca), on WHIR with 15 guests (the 13 above, bignum at n = 26and sum-of-squares n = 320000), over 5 interleaved rounds on one GCP C4D instance. Both sides were built with the
release profile and
-C target-cpu=native. All 75 runs of each side proved and verified. Layer 16 joined after thisrun, and no combined run includes it; its own A/B, on layers 1–10, is in its row. Apart from layer 16, the commits
since this run change only tests, comments, docs and specs.
Over the 15 guests, the sum of per-guest median prove times drops from 21.32 s to 10.38 s. Every guest is faster, from
−31.7% (muldiv) to −58.4% (bignum n = 26); modinv is −33.5% (−36.6% grind-adjusted).
Layers 1–10 alone were slower than
mainon modinv: +8.8% prove (+7.4% grind-adjusted) in the same configuration,and +7.2% with both sides built with
codegen-units = 1and functions aligned to 64 bytes, so code placement did notexplain it. We have not measured its cause. Layer 12 more than recovers it: on layers 1–10 it measured modinv 38.8%
faster.
The same run timed classic Jolt, at the Jolt revision this repository pins for execution (44a878f0) and with the
Akita commitment scheme (ours ran on WHIR). It proved each guest once, on the same machine right after the five
rounds, with 96 threads as ours had. Its proving time and ours both exclude tracing, building the witness and key
generation. Over the 15 guests, classic's proving time divided by ours has a geometric mean of 1.27 on
mainand2.20 on this stack. Per guest it ranges from 0.89 to 1.89 on
main, where classic is faster on bignum at n = 24 and26, and from 1.69 (modinv) to 3.19 (sha2-chain) on the stack, where ours is faster on every guest. Every classic
proof verified. Classic's proofs are much smaller: 87–104 kB on these guests, against 252–532 kB for ours on the
stack.
Proof size, from the same run (each guest's size was the same in all 5 rounds): the total drops from 6,157,932 to
5,955,348 bytes, −3.3%. Most guests shrink, by up to 12.8% (bignum n = 24); four grow, by at most 1.5%
(recover-ecdsa). Proofs on the stack range from 252 kB (muldiv) to 532 kB (sum-of-squares n = 320000).
Protocol and security changes
admitted. The ledger checks design C for the first operation set of each MUL/MULHU class at every ℓ and ℓ′; the
worst squeeze run is exactly 2^-128 per query. The census adds the paired guests' two classes at n = 20.
accepts Spartan's mcov claim only with value 0, and the CPU row m.cover then proves that no cycle is a guarded M
cycle (J2.3, J13.2). The RV64IMAC protocol keeps its own admission and ledgers.
parameter set, so every statement digest changes. The claims on those components are converted before G's
Mosaic lift, and eq(r_hi, 0) = 0 is rejected (J10.4).
transcript before Spartan (σ_M) and joined after DL-A (δ_M). The proof is
u64 LE len(L) || L || N.worst still exactly 2^-128.
The census and the ledger pins (
tests/fixtures/ledger-pin) are regenerated in each protocol layer.fs_census_joltrecords the implemented verifier on live proofs for the census cases with n ≥ 17, the PCS minimum.Before layer 14 it records 27 of the 29; the two it leaves out are design C at n = 20 with P = 0x0009 and
P = 0x0049. Layer 14 records those two, so at the top of this PR every case with n ≥ 17 is recorded. Layer 14 also
adds a test that the live list names each such case once, and a test that the claim lists the verifier checks DL-A's
and DL-C's intake against are those in
ledger-jolt.json. The eight cases at n = 22 and 24 are ignored by default.The full-tests WHIR job now runs the census, then the ignored cases one at a time.
Review
Before this PR, layer by layer:
main; it confirmed that the proofs stay byte-identical; the cutoff below which a pass runs as one task went from 30 µs to 100 µs after itlocal.diffare untouched; applyinglocal.diffandlocal-prover.diffto upstream reproduces the vendored files byte for byte; no unsafe-code or concurrency issue; only test-coverage and CI nits remainEvery design review covered the spec. None checked an implementation of layers 4, 6, 7 or 9; for those, the evidence
before this PR is the gates, the ledger and the live census.
The pre-PR review, on the commits as they stand in this PR:
and 9, against
docs/securityand the specs. It covered what the verifier checks, the transcript's order andinstances, the parameter and statement identity, layouts and unconstrained cells, the proof format, the ledger's
accounting, verifier robustness, and whether the documents match the code. It found no blocking issue: each layer
is sound as implemented, and the pair table leaves the verifier unchanged. It required seven corrections to the
security document for layers 6, 7 and 9, which layer 18 applies. Most of its smaller findings on the code, tests
and specs are fixed in layers 13, 14 and 18; one ledger nit is a follow-up (below).
the security document's coverage of runs without an M table for every operation set and a lemma for the
general-row prefix's claim conversion, are in layer 18.
1, 2 and 96 threads under debug assertions and overflow checks, and proof-hash comparisons layer by layer. It found
no blocking issue, no memory-safety bug, data race or nondeterministic proof; the prover-only layers leave proof
bytes unchanged. The panics it found need a bad environment variable, a failure to create OS threads or a
malformed call to an internal API; valid guest input does not reach them. Layer 13 fixes the three M lane issues it
asked to fix; its remaining notes are hardening follow-ups. Layers 11, 12 and 16 have their own code reviews (rows
11, 12 and 16 above), which covered their unsafe code, and for layers 11 and 12 their concurrency; none found an
unsafe-code issue.
genuine check of each transcript instance's draw structure (draw count and order, element counts, grinding,
freshness, field and round degrees), on honest proofs at each case's own configuration. It asked for CI coverage
and the two cases left out, which layer 14 adds, and for J13 to state exactly what the census compares, which
layer 18 does. Further checks it suggested are follow-ups.
and 16 come from those layers' own review records.
From review: layer 13 (M lane robustness), layer 14 (the p256 table-shape assertion, two precondition docs, the
last two live census cases with a coverage test and a claim-list test, and two witness checks before an unsafe
set_len), layer 11's test cases above the one-task cutoff, layer 16's review fixes, and layer 18's corrections tothe security document and specs.
Gates
The full gate ran on the top of this PR on an Intel Xeon with AVX-512, VBMI and GFNI, which runs the GFNI paths. For
the table and fallback paths, the same gate ran on the top of this PR on an AMD EPYC (Zen 3) without AVX-512 or
GFNI. CI covers the table path too.
cargo test --releaseon every target, doc-tests includedmain; no mutated proof acceptedLayer 18's docs gate, from the sources alone:
Reports, 85 pages).
ledger_bitz.pywith its new seed assertion among them,and every file they generate is unchanged.
ledger_jolt.pygrid, run on the security documents before layer 18's last revision (BitZ's projectionseed, which leaves
ledger_jolt.pyand its outputs unchanged): 330,801 configurations, 590,858,354 squeeze runs,the worst run 2^-128.00 per query; every generated output reproduced byte for byte; doc guardrails 0 findings; the
specs' quotes of the ledger checked.
ledger_jolt.pygrid, with the new seed assertion at every configuration: 330,801configurations, 590,858,354 squeeze runs, the worst run 2^-128.00 per query; every generated output reproduced
byte for byte; doc guardrails 0 findings; the specs' quotes of the ledger checked.
Known, pre-existing:
malformed_proofs_are_rejected_without_a_paniccan exceed its 60 s per-case limit when itruns beside the other library tests. Run alone, it checked 3,788 malformed proofs with no findings, in 122.03 s on
the Intel host and in 205.84 s on the AMD host, both on the top of this PR.
Follow-ups
docs/notes/prover-optimization-todo.mdlists the prover optimizations planned next, in priority order, and theones measured and set aside, with the reason; it is deleted once the list is done.
rate changes; a follow-up aligns the count with the verifier.
Reports
docs/security: layers 4, 6, 7 and 9 regenerate the ledger, its census, the headline table and the pinned copies.Layer 9 adds the fork/join lemma to the model, composition, PCS and Jolt-delta sections. Layer 18 amends the
security report for layers 6, 7 and 9 and adds the lemmas the reviews asked for. It also bounds BitZ's projection
seed for a fixed prime stream: κ_0 uses the Dusart lower bound on the primes in the interval, on every good prime
stream a projection's first-touch weight is (9/8)κ_0, within the shipped grinding at every shape, and the
unconditional bound adds ε_q < 2^-151 once.
ledger_bitz.pyasserts the condition behind the 9/8 factor at everyRound 1 seed, and its output does not change. The PDF is rebuilt with fixed source dates: 85 pages, SHA-256
302cf36c5a0ac5ae8bf34414db7b369c2222d8de0b62c55ef8597912c0d52616. Two clean builds reproduce it byte for byte(see Gates).
docs/report: the technical report is revised in commit 20 and pinned to the implementation tip b987bd9, thecommit before it, as
AGENTS.mdanddocs/report/MAINTAINING.mdrequire; its PDF builds reproducibly.🤖 Generated with Claude Code