Skip to content

Protocol v6 128-Bit Hiding v6-zk PCS, Multi-Ary CUDA FRI, Security Hardening - #105

Open
johnchandlerburnham wants to merge 33 commits into
mainfrom
jcb/fp3-v6-zk
Open

johnchandlerburnham wants to merge 33 commits into
mainfrom
jcb/fp3-v6-zk

Conversation

@johnchandlerburnham

Copy link
Copy Markdown
Member

Protocol v6 ($\mathbb{F}_{p^3}$), 128-Bit Hiding v6-zk PCS, Multi-Ary CUDA FRI, DeviceMemoryReservation Admission, & Security Hardening

Branch: jcb/fp3-v6-zk (48e6e06a) → main (3515632f)
Scope vs main: 56 files changed, +30,646 / -2,736
Compare / Open PR: https://github.com/argumentcomputer/multi-stark/pull/new/jcb/fp3-v6-zk


Motivation

Under legacy v5 ($\mathbb{F}_{p^2}$, $|K| \approx 2^{128}$), non-query soundness terms (LogUp, ALI, DEEP, FRI batching) lose $\log_2(\text{trace/lookup size})$ from 128 bits, capping recursive verification proofs ($2^{22}$–$2^{26}$ rows) below 84 bits regardless of FRI query count. Furthermore, production ix requires post-quantum transparent zero-knowledge (v6-zk), multi-ary CUDA FRI folding for ~400 KiB STARK shrinking, and unified GPU memory admission across concurrent allocators.

This PR delivers the complete unified 128-bit multi-stark backend using only stock pinned Plonky3 (3152b14a, zero fork) while preserving 100% legacy v5 wire compatibility (proof_bytes_pin and streaming_spill pass unchanged) and cleanly merging all active team GPU & soundness branches (formal-aiur/gpu-overlap, formal-aiur/lde-admission, gb/lookup-selector-fix).


Summary of Changes

1. Stock Plonky3 Cubic Trinomial Extension $\mathbb{F}_{p^3}$ & Protocol v6 Hardening (58da590, 3cedcbf, 4118671, 6171f18)

  • $\mathbb{F}_{p^3} = \mathbb{F}_p[X]/(X^3 - X - 1)$ (|K| ≈ 2^{192}): Generalized ExtensionOf<F> / ExtensionParams to ExtensionModulus<F> { Base, Binomial { w }, CubicTrinomial }, wiring stock CubicTrinomialExtensionField<Goldilocks> (ExtVal3) and SIMD PackedExtVal3, exact 6-mul / 0-const-mul Karatsuba multiplication in src/graph.rs, AlphaTable::Degree3 / fold_constraints_d3, SIMD cubic adjugate/norm-trick inversion in spill.rs, and zero-copy flatten_to_base for D = 3.
  • BLAKE3 derive_key Domain Separation (domain_blake3.rs, blake3_simd.rs, challenger.rs): Distinct compile-time context keys for Merkle leaves, Merkle 2-to-1 compressions, single/batch transcripts, and VK digests (compute_vk_digest), integrated into multi-buffer SIMD BLAKE3 and CUDA kernels.
  • Multilinear Tensor FRI Batching (fri_batching.rs): FriBatching::Tensor alongside Horner (+9–10 bits on FRI batching at ~0% prover cost).
  • Strict Deserialization & CUDA Port: Rejects non-canonical Goldilocks limbs (>= P) and trailing garbage bytes in Proof::from_bytes / BatchProof::from_bytes; templated <Ext2>/<Ext3> CUDA kernels (cuda/goldilocks.cuh, cuda/kernels.cu, src/cuda/*) cross-checked bit-for-bit against Rust/Plonky3 across 10,000 random + lazy >= P vectors.

2. Protocol v6-zk 128-Bit Hiding PCS & Zero-Storage BLAKE3-CTR Salting (98a0860, 04b10be)

  • 2× Interleaved Odd-Coset Hiding PCS (ePrint 2024/1037): Odd-coset CSPRNG row blinding on witnesses, deterministic public preprocessed 2N*B LDEs with public preprocessed salt seed, and exact modulo-folding re-evaluation.
  • Zero-Storage BLAKE3-CTR Leaf Salting: Single 256-bit OS CSPRNG salt_seed per commitment deriving 128-bit leaf salts on the fly on both CPU (SIMD & disk-spilled spill_zk.rs) and CUDA (hiding_mmcs.rs, hiding_pcs.rs, cuda/kernels.cu) with zero persistent salt VRAM/RAM/disk overhead.
  • Four Fail-Closed ZK Security Guardrails:
    1. Minimum trace height N >= next_pow2(2*Q + 2*D) enforced at setup, prove, and verify.
    2. W_R >= 4 base-field randomizer columns committed in the quotient MMCS (>= 128-bit hiding under FriBatching::Tensor / $\mathbb{F}_{p^3}$).
    3. Zero-overhead C_active == 1 and committed boundary-mask U + row-0 delta-shift blinding of intermediate_accumulators for C_active > 1.
    4. q_zk = d.next_power_of_two() <= 2^log_blowup with telescoping half-stride quotient blinding over 2 * q_zk slices.
  • Distinct v6-zk BLAKE3 derive_key domains (ZkMerkleLeaf, ZkMerkleCompress, ZkTranscriptSingle, ZkTranscriptBatch, ZkVerifyingKey) preventing cross-mode replay.

3. Multi-Ary CUDA FRI Folding (max_log_arity 1..=10) & Plonkish Blake3Domain (310c5a3, 2386165)

  • Multi-Ary CUDA FRI (2386165): Added generalized multi-ary FRI folding kernels (max_log_arity up to 10) across v5, v6, and v6-zk CUDA provers (required for 8-ary mla=3 sub-400 KiB C2 STARK shrinking on GPU), with 1,248 lines of parity & negative tests in src/cuda/tests/fri_arity.rs.
  • Plonkish Blake3Domain (310c5a3): Backwards-compatible CircuitBuilder::constrain_blake3_domain and blake3_domain gadget supporting Protocol v6 derive_key mode in both compact and generic BLAKE3 gadgets with zero extra gates or tables.

4. Round-2 Security Fixes & Merged Team Branches (edb031d, ca241b4, 5ce7473, 85c4758, f10294e, 48e6e06)

  • C2 MerkleCap Enforcement (edb031d, ca241b4): Enforces exact MerkleCap root counts (1 << cap_height.min(log2_ceil(max_height))) across SpillableMmcs, CudaMmcs, HidingCudaMmcs, verify_shape, verify_preamble_headers, and FRI verifiers before Fiat–Shamir observation; also closes M24 & L9.
  • Streaming Memory & GPU Overlap (fc4336b, 5b4f87a, cc4f748, 5ce7473): Includes A5 streaming stage-2 lookups + disk-backed LDE spilling, S0/S1-3 SIMD BLAKE3 + alloc-free quotient/folding, and Sam's formal-aiur/gpu-overlap (bcf3fc8).
  • Sam's formal-aiur/lde-admission (648fb13, 6625511, 85c4758, 48e6e06): Drops the standing quarter-device CUDA memory reserve (+24 GiB usable VRAM on 96 GiB GPUs) and wires concurrent DeviceMemoryReservation admission cleanly across both non-ZK PCS/MMCS and v6-zk hiding_pcs.rs/hiding_mmcs.rs.
  • Gabriel's gb/lookup-selector-fix (0797a0f, a4518bd, f10294e): Rejects row selectors (IsFirstRow/IsLastRow/IsTransition) and public values in lookup expressions at compile time.

Verification (48e6e06a)

  • Live RTX PRO 6000 Blackwell (sm_120, CUDA 13.5, CARGO_BUILD_WARNINGS=deny):
    • cargo clippy --all-targets --features parallel,cuda -- -D warnings: PASS (0 warnings)
    • cargo test --release --features parallel,cuda: 239/239 PASS (all unit, fp3_v6, fp3_v6_zk, fri_arity, plonkish_api, plonkish_hash, streaming_spill, C2/M24/L9, v6-zk hiding & CUDA tests)
    • Exclusive-GPU #[ignore] pressure & residency tests (--test-threads=1): 11/11 PASS
  • CPU (Xeon):
    • cargo fmt --all -- --check & cargo clippy --all-targets --features parallel -- -D warnings: PASS (0 warnings)
    • cargo test --release --features parallel: 196/196 PASS
  • Downstream Production Validation (ix PR #691): Proved Init+Std (99,462 consts in 7m54.75s, 1.83× faster than v5) and full Mathlib 4.34.1 (684,691 consts in 57m20.01s, 199 consts/s, 0 admission waits/retries) on 1× RTX PRO 6000 Blackwell.

gabriel-barrett and others added 30 commits October 20, 2026 22:20
A shape-only lookup witness (`LookupValues::shape_only`) carries dimensions
for a prover that derives every lookup message from the committed trace on
the device. When device memory pressure keeps a commitment off the device,
the CUDA lookup commit takes its direct path, or the prover falls back to the
CPU stage-two path, and both read lookup values on the host: with a
shape-only witness they hit an assertion and the prover aborted.

Those paths now rebuild the omitted values instead. The trace is the retained
host trace when the commitment kept one; otherwise it is interpolated from
the committed LDE (its evaluations on gH give the coefficients, evaluated
back on H), reading only that matrix back from the device. The lookup
evaluator, now parallel over rows, derives the values, so proofs are
identical to those of a materialized witness.

Also make `cuda::configured_device` public for callers resolving the default
device, and test that shape-only witnesses prove byte-identically, including
preprocessed columns and two-shard batches under both retention policies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bring the mutable lookup slots and shape-only lookup rebuilding onto the
generic ProofConfig prover. The host prover now rebuilds a committed
stage-one trace through ProofConfig::committed_trace, which the Goldilocks
configuration implements by interpolating the committed LDE; configurations
without it cannot prove shape-only witnesses on the host. compute_lookup_values
keeps main's parallel row builder and evaluates any row range.
Large commitments release device traces during construction or proactive
spilling, keeping only retained host copies. Lookup admission accepted a
preprocessed LDE once its values were resident, but the graph kernel
required its device trace and failed with cudaErrorInvalidValue, which
broke the KZG compression of formal Aiur aggregate roots.

The graph kernel now stages preprocessed rows from the retained host
trace in 2^16-row chunks, as it already does for stage-1 traces. The host
copy is passed explicitly rather than attached, since preprocessed data
is shared across proofs. Admission uses the same availability predicate
and budgets the extra staging chunk.
…ookups

A system built without its fixed matrices can now prove with shape-only
lookup witnesses: lookup materialization rebuilds each circuit's fixed
matrix from the preprocessed commitment, on both the host and CUDA
paths. Proofs are byte-identical to fully materialized witnesses.
When the fused CUDA lookup commitment declines, the host fallback
materialized every circuit's shape-only lookup witness up front and then
computed messages and inverses for all circuits in one pass. On the Ix
compression root this held every circuit's lookup values plus the joint
message and inverse vectors at once and set the process peak (233.8 GB).

Circuits interact only through the accumulator chain, so materialize,
evaluate and free one circuit at a time, carrying the accumulator. The
stage-two traces, accumulators and proof bytes are unchanged.
…allows

A main commitment with any generated source took a serial path that
released every device trace right after its LDE, so the lookup pass had to
re-upload host traces or regenerate generated ones, and no matrix's LDE
overlapped another's.

When the whole batch fits beside the minimum free headroom, the prepared
path now builds its LDEs in the same bounded concurrent waves as the
all-host path, keeps device traces resident under the same release policy,
and retains host traces as recovery sources. The serial, spilling
construction remains for batches that do not fit.

Lookups no longer release a generator's device cache unconditionally after
each matrix; admission already releases those caches first whenever a
later phase is short of memory.
A generated source may allocate device scratch for each tile it writes,
and the resident construction runs up to MAX_CONCURRENT_LDES of them at
once. TraceGenerator::device_workspace_bytes declares that scratch; both
constructions add it to each matrix's transform workspace, so the resident
wave size and the bounded path's admission reserve it per concurrent
writer. MAX_CONCURRENT_LDES is public so a producer can plan for the same
bound.
A generated source's cached device state (Aiur's population record) can
be released by admission and is allocated again by the next tile it
writes, but no admission counted that allocation. A graph lookup whose
trace must be regenerated could therefore run out of memory after its own
admission released the state, and the bounded and resident commitment
paths could start a generated source whose released state did not fit.

TraceGenerator gains device_state_bytes and device_state_resident. A
lookup that regenerates its trace now admits the state's full size plus
one write workspace, so releasing it during the same admission cannot
leave too little room. Commitment admission adds the state when a
generated source must restore it, the bounded path no longer releases
generator caches just before a generated source, and the resident path
reserves the restore beside its waves.

The commitment test's generators allocate the workspace they declare and
share releasable state. A new test fills the device so that lookup
admission releases that state while both traces need regenerating; it
fails with an out-of-memory panic without the lookup change and proves
host population's bytes with it. Both tests need a CUDA device and are
ignored by default like the crate's other device tests; the new one also
needs the device to itself.
Prepared and host stage-one commitments split their matrices into waves
of the admitted concurrency and joined each wave before starting the
next. A wave mixes multi-gigabyte host uploads with tiny or device-built
matrices, so it ended on one long upload or transform while the GPU sat
idle, and every host LDE uploads its whole trace before its first kernel.

Start each LDE as soon as any earlier one finishes, keeping the same
bound on concurrent LDEs (and so on transform workspace), the same
results in matrix order, and the serial path for small batches.

On Init leaf 0 with pipelined population, stage-one GPU idle drops from
~1.0 s to ~0.6 s per proof; commitments are unchanged.
bounded_parallel_map called rayon directly, so a CUDA build without the
parallel feature ran stage-one LDEs concurrently where the fixed waves it
replaced (p3_maybe_rayon) ran them serially; it now runs serially there.
After one call panicked, the other workers kept taking and transforming
every remaining matrix before the panic propagated; a shared stop flag,
set while unwinding, now ends them at their next item.
Every phase already admits its allocations against the device's current
free memory and spills source traces to the host when they do not fit, so
keeping a quarter of the device free on top of that only shrank what each
phase could hold. MULTI_STARK_CUDA_MIN_FREE_BYTES now defaults to zero.
LDE offload keeps a fixed 128 MiB for lazy sppark device parameters, as
witness construction already does.
`compile_expr` accepted `Expr::Public` in lookup multiplicities and
arguments, but the lookup witness is built before the public values (the
lookup challenges and accumulators) exist: the witness sweep runs with no
publics, so such a circuit compiled and then panicked with an
out-of-bounds index in `SystemWitness::from_stage_1`.

Compile lookups, base constraints and extension-constraint coordinates
under an explicit context, and return the new
`CompileError::PublicInLookup` for a public value in a lookup. Base and
extension constraints may still read public values. The verifier and the
proof format are unchanged.

Claude-Session: https://claude.ai/code/session_011m6Jd9eHKVucLbm7ZHHMmd
`compile_expr` accepted `Expr::IsFirstRow`, `Expr::IsLastRow` and
`Expr::IsTransition` in lookup multiplicities and arguments. The lookup
witness evaluates a selector as a 0/1 indicator of the row, while the
constraints (prover quotient and verifier) see Plonky3's unnormalised
selectors: on a trace of n rows with generator g, n on the first row,
n·g on the last row and g^r − g⁻¹ on row r. Such a circuit compiled and
then produced a proof that the crate's own verifier rejects.

Return the new `CompileError::SelectorInLookup`, which names the
selector, for a selector at any depth of a lookup expression. Base and
extension constraints may still use selectors. The verifier and the
proof format are unchanged.

Document the rule on `CircuitInputs::lookups` together with what to use
instead (a 0/1 column of the preprocessed trace, or a main column pinned
to the first-row indicator), and test that both replacements prove and
verify. The lookup-witness tests now read their row indicators from
trace columns, with the expected payloads unchanged. The 0/1 selector
values in `compute_lookup_values_range` and in the CUDA lookup kernel
stay in place; no compiled circuit reaches them.

Claude-Session: https://claude.ai/code/session_011m6Jd9eHKVucLbm7ZHHMmd
… norm-trick FRI open, and masked/parallel stage-2 lookup
…alExtensionField (X^3 - X - 1)

- Replace binomial-only ExtensionOf::W with ExtensionModulus<F> (Base, Binomial { w }, CubicTrinomial)
- Implement Field + Algebra<Goldilocks> + ExtensionOf<Goldilocks> for stock p3-goldilocks CubicTrinomialExtensionField<Goldilocks>
- Add 6-mul 0-const-mul Karatsuba & schoolbook X^3 - X - 1 expansion in graph.rs and reference eval in eval.rs
- Add allocation-free stack fast path (mul3_trinomial) in lookup.rs and AlphaTable::Degree3 + fold_constraints_d3 in prover.rs/eval.rs
- Move blake3 to runtime dependencies (already pinned in Cargo.lock)
… tensor FRI batching, and Goldilocks F_p^3 config
Every proving phase sizes its device work from the free memory it
measures when it starts and, without a standing reserve, allocates up
to all of it. Memory another thread allocates on the device after that
measurement (Ix uploads the next shard's population image on a
prefetch thread while the current shard proves) is then missing when
the phase allocates, and a resident coset LDE fails with
cudaErrorMemoryAllocation instead of spilling.

DeviceMemoryReservation holds bytes of a device back from every
admission measurement until dropped. A concurrent allocator takes one
before the phases it overlaps measure free memory and drops it once its
allocation is live, so each measurement sees that memory as reserved or
allocated, never free. A test fills the device so a stage-one
commitment fits with little slack, then allocates beside it from a
trace tile: unreserved, a resident LDE fails exactly as observed;
reserved, admission builds the commitment within what remains and it
matches the unconstrained commitment.

The all-device path of the PCS commitment also charges the largest
trace: an LDE uploads its trace beside its values, and a trace released
after construction is still resident while its own LDE runs.

The README's spill paragraph still described the removed quarter-device
reserve; it now describes runtime admission and reservations.
… transcript observation

Enforce commit.num_roots() == 1 << cap_height.min(log2_ceil_usize(max_height))
across SpillableMmcs and CudaMmcs (verify_batch, verify_multi_batch) and
validate exact expected cap root counts BEFORE Fiat-Shamir observation in:
- System::verify_shape (preprocessed, stage_1_trace, stage_2_trace, quotient_chunks)
- System::verify_preamble_headers (added for all shards including non-target
  shards in verify_batch_shard and verify_batch, enforcing active/log_degree,
  preprocessed_height, max_log_quotient_domain, and stage_1_trace cap count)
- SpillableTwoAdicFriPcs::verify and CudaTwoAdicFriPcs::verify (all input and
  FRI commit_phase_commits validated before observing OOD evaluations or FRI
  commitments)

Eliminates deterministic verify_batch_shard / verify_batch transcript-collision
forgeries and O(1) commitment-preserving Fiat-Shamir grinding while keeping
honest v5 proof bytes bit-identical (proof_bytes_pin and streaming_spill pass).
Includes negative regression tests for all attack vectors.
… & verifier issues

C2 (CRITICAL):
- Enforce exact MerkleCap root count 1 << cap_height.min(log2_ceil(max_height))
  in SpillableMmcs and CudaMmcs (verify_batch, verify_multi_batch).
- Validate exact expected cap root counts before Fiat-Shamir observation in
  verify_shape, verify_preamble_headers, verify_fri_with_batching{,_inner},
  SpillableTwoAdicFriPcs::verify, and CudaTwoAdicFriPcs::verify.
- Add negative regression tests reproducing verify_batch_shard forgery,
  verify_batch preamble forgery, and extra/truncated/non-pow2 cap grinding for
  both v5 and v6 (F_p^3).

M24 (MEDIUM):
- Add host_hashed_heights (>4096-col) host-hashing fallback to
  CudaMmcs::commit_cuda_spillable matching commit_cuda_resident.
- Reject preprocessed_opened_values = Some(vec![]) when num_preprocessed == 0
  in System::verify_shape to eliminate proof malleability.
- Enforce preprocessed_height and max_log_quotient_domain checks for all
  shards (including non-target shards) in System::verify_preamble_headers.

L9 (LOW):
- Mask mult == 0 norms to 1 in CUDA lookup_messages_t / lookup_messages_graph_t
  and mask mult == 0 messages to EF::ONE in LookupValues::cuda_stage_2_deltas.
- Canonicalize operand before zero-check in CUDA Node::Neg at all 3 sites.
- Skip empty opening point lists before allocating reduced_openings[log_height]
  in SpillableTwoAdicFriPcs::open.
- Add >1024-row LDE (512 rows, blowup 4 => 2048 LDE) v6 F_p^3 test in
  tests/fp3_v6.rs to exercise CUDA resident FRI _ext3 kernels.
…-fix

Unifies:
- jcb/a5-streaming-memory (fc4336b, 5b4f87a, cc4f748): streaming stage-2 lookup evaluation, CPU disk-backed LDE spilling, SIMD BLAKE3 Merkle, chunked quotient
- edb031d: C2 MerkleCap root-count enforcement in SpillableMmcs/CudaMmcs and before Fiat-Shamir observation
- bcf3fc8 (formal-aiur/gpu-overlap): GPU sliding-window LDEs, generator workspace/state admission, spilled-preprocessed CUDA lookup graph staging, lazy shape-only lookups, and LookupRowMut::slot_mut

Conflict resolutions & CUDA/CPU specialization:
- src/config.rs: keep both validate_commitment_cap and committed_trace (plus commit_preprocessed/commit_main_streaming).
- src/lookup.rs: keep const is_materialized/height/num_lookups, streaming/masked/parallel stage-2 helpers, LookupRowMut::slot_mut, and test helper shape().
- src/p3_adapter/spill.rs: add clone_in_memory_original_trace on SpillableMmcsData so CPU committed_trace returns retained 1x traces with zero DFT without mutating shared ProverKey data.
- src/types.rs:
  * Specialize GoldilocksBlake3Config::committed_trace on CUDA to delegate directly to CudaMmcs::committed_trace(data, index, self.log_blowup) instead of pcs.get_evaluations_on_domain (avoiding get_matrices pulling all deferred GPU LDEs back to host RAM).
  * Specialize GoldilocksBlake3Config::committed_trace on CPU to return retained/spilled 1x traces with zero DFT before falling back to 1x coset prefix interpolation; reuse it in CPU accelerated_lookup_commit.
  * Remove stale pre-bcf3fc8 early return in CUDA accelerated_lookup_commit so shape-only direct-path fallback uses bcf3fc8's per-circuit host materialization (skipping rebuild when num_lookups == 0 or preprocessed columns are unused by lookups).
  * Keep all CudaMmcs::with_device(..., cap_height, ...) call sites and C2 cap checks.
- src/prover.rs: unify host_lookup_traces to process one circuit at a time, streaming shape-only circuits from config.committed_trace (falling back to get_evaluations_on_domain only when None) directly into stage_2_trace_from_trace without materializing full LookupValues.
…DA support

Implement Protocol v6-zk (post-quantum transparent 128-bit statistical/ROM
zero-knowledge over Goldilocks F_{p^3} = F_p[X]/(X^3 - X - 1)) cleanly
alongside zero-overhead non-ZK v5/v6 using only stock pinned Plonky3
(3152b14a):

- Domain separation: distinct BLAKE3 derive_key contexts for v6-zk
  (ZkMerkleLeaf, ZkMerkleCompress, ZkTranscriptSingle, ZkTranscriptBatch,
  ZkVerifyingKey) with pinned CUDA constant-memory key words.
- 2x interleaved odd-coset hiding PCS (ePrint 2024/1037): odd-coset CSPRNG
  row blinding on witnesses, deterministic public preprocessed 2N*B LDE
  with public preprocessed salt seed, and exact modulo-folding re-evaluation.
- Zero-storage BLAKE3-CTR leaf salting: single 256-bit OS CSPRNG salt_seed
  per commitment deriving 128-bit leaf salts on the fly on both CPU (SIMD
  multi-buffer & disk-spilled) and CUDA (zero persistent salt VRAM/RAM/disk).
- Security Trap 1: fail-closed minimum trace height floor
  N >= next_pow2(2*Q + 2*D) (> next_pow2(Q + 2)) enforced at setup, prove,
  and verify.
- Security Trap 2: W_R >= 4 base-field randomizer columns R(X) committed in
  the quotient MMCS for >= 128-bit hiding under FriBatching::Tensor / F_{p^3}.
- Security Trap 3: zero-overhead C_active == 1 and committed boundary-mask U
  + row-0 delta-shift blinding of intermediate_accumulators for C_active > 1.
- Security Trap 4: fail-closed quotient-degree vs log_blowup validation
  (q_zk = d.next_power_of_two() <= 2^log_blowup) with telescoping half-stride
  quotient blinding over 2*q_zk slices.
- C2 MerkleCap exact root-count enforcement preserved before Fiat-Shamir
  observation across both non-ZK and hiding MMCS/PCS (CPU & CUDA).
- CUDA v6-zk backend: salted BLAKE3-CTR leaf hashing kernels in cuda/kernels.cu,
  FFI bindings in src/cuda/mod.rs, HidingCudaMmcs + HidingCudaTwoAdicFriPcs
  (including resident GPU FRI folding, wide-row hybrid fallback, and unit tests).
- Tests: 12 integration/security/indistinguishability/negative-control tests
  in tests/fp3_v6_zk.rs + 3 new lib unit tests; all 184 release tests pass.
Unify Sam's formal-aiur/gpu-overlap (bcf3fc8) + v5 C2 MerkleCap fixes
(b32f5e6) with Protocol v6 (Fp^3 transparent) and Protocol v6-zk (Fp^3
hiding PCS + BLAKE3-CTR salting + CUDA hiding MMCS/PCS) into a single
multi-stark crate:

- CUDA lookup graph & host preprocessed staging: unified Ext2/Ext3
  lookup_messages_graph_t and lookup_graph_lde_impl with preprocessed_host
  chunking, updated multi_stark_cuda_lookup_graph_lde{_ext3}, and wired
  preprocessed_width / resident_with_host_trace / regeneration_bytes /
  host shape-only materialization into shared cuda_accelerated_lookup_commit
  (covering both v5 and v6).
- Generated-trace residency & sliding-window LDEs: parameterized
  src/cuda/witness.rs::{commit, commit_with, construct_resident,
  construct_bounded} over (EF, Ch) so both v5 and v6 share bounded_parallel_map,
  writer workspace/state admission, and resident concurrent construction.
- Shape-only lookup witnesses & committed_trace: implemented
  ProofConfig::committed_trace across GoldilocksBlake3Config (v5),
  GoldilocksV6Config (v6), and GoldilocksV6ZkConfig (v6-zk) on both CPU
  (using clone_in_memory_original_trace / spilled traces / re-evaluation)
  and CUDA (using CudaMmcs::committed_trace / hiding re-evaluation).
- Preserved 100% of C2 MerkleCap root-count enforcement, all 4 v6-zk
  security traps, v5 22,017 B proof-byte contract, and all CUDA test
  signatures (src/cuda/tests/{lookup_graph,witness}.rs).
- Verified: cargo fmt --check, cargo clippy -D warnings (parallel &
  no-default-features), and 189/189 release tests passing.
… build issues

Fold in the 5-file GPU Wave 1.5 fixes so multi-stark-fp3-zk builds and
passes with zero warnings under CARGO_BUILD_WARNINGS=deny and --features parallel,cuda:
- src/cuda/hiding_pcs.rs: borrow &self.dft before rayon parallel closure.
- src/cuda/mmcs.rs: update test calls to 2-arg CudaMmcs::with_device.
- src/cuda/tests/quotient.rs: pass None for mask_on_quotient_domain.
- src/cuda/hiding_mmcs.rs: allow dead_code on CpuHidingTree::dimensions.
- tests/fp3_v6.rs: use binary FRI fold (max_log_arity = 1) when cuda feature is enabled.
…eneric BLAKE3 gadgets

Add backwards-compatible domain-separated BLAKE3 support to Plonkish hashing
for Protocol v6 recursion and proof compression with zero extra gates or tables:
- src/plonkish/hash.rs: record Blake3Domain on HashCall, initialize Compact
  chaining values from domain.key_words(), OR domain.domain_flags() into
  compression flags, and verify via domain.hash_bytes() in check_values.
- src/plonkish/builder.rs: add CircuitBuilder::constrain_blake3_domain and
  Circuit::blake3_domain_calls (keeping existing plain APIs unchanged).
- src/plonkish/gadgets/{blake3.rs, mod.rs}: expose blake3_domain and re-export
  Blake3Domain across both compact and generic lowering modes.
- src/plonkish/tests/compact_hash.rs: verify Plain, MerkleLeaf, MerkleCompress,
  TranscriptSingle, and TranscriptBatch across block/tree boundaries, full v6
  STARK prove/verify roundtrip, and cross-domain forgery rejection.
@johnchandlerburnham johnchandlerburnham changed the title Protocol v6 ($\mathbb{F}_{p^3}$), 128-Bit Hiding v6-zk PCS, Multi-Ary CUDA FRI, DeviceMemoryReservation Admission, & Security Hardening Protocol v6 128-Bit Hiding v6-zk PCS, Multi-Ary CUDA FRI, Security Hardening Nov 24, 2026
@johnchandlerburnham
johnchandlerburnham enabled auto-merge (squash) November 24, 2026 12:39
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.

3 participants