Skip to content

feat: add PCS assist Dory opening formulas#1601

Open
markosg04 wants to merge 1 commit into
prover-stack/05-hyperkzg-zkfrom
prover-stack/06-pcs-assist-dory-openings
Open

feat: add PCS assist Dory opening formulas#1601
markosg04 wants to merge 1 commit into
prover-stack/05-hyperkzg-zkfrom
prover-stack/06-pcs-assist-dory-openings

Conversation

@markosg04

Copy link
Copy Markdown
Collaborator

Part of the draft Jolt prover stack.

Base: prover-stack/05-hyperkzg-zk
Head: prover-stack/06-pcs-assist-dory-openings

Adds Dory PCS-assist opening formulas, verifier protocol hooks, and the Dory assist protocol spec.

Validation before submission:

  • cargo fmt -q -- --check
  • cargo metadata --no-deps --format-version 1
  • local gh stack push simulation against a temporary bare remote
  • forbidden-path scan for handoffs/, old STACK.md, stack/, and old stack workflow

@github-actions github-actions Bot added spec Tracking issue for a feature spec implementation PR contains implementation of a spec labels Jun 9, 2026
@0xAndoroid 0xAndoroid force-pushed the prover-stack/05-hyperkzg-zk branch from 289808a to 627edbd Compare June 17, 2026 05:45
@0xAndoroid

0xAndoroid commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Stack maintenance — Pika is rebasing this PR onto #1600 (prover-stack/05-hyperkzg-zk) and fixing CI as part of the prover stack (#1596#1606). Rebase + CI summary to follow.

@0xAndoroid 0xAndoroid force-pushed the prover-stack/06-pcs-assist-dory-openings branch from aa8e52f to fd5609e Compare June 17, 2026 12:02
@0xAndoroid 0xAndoroid marked this pull request as ready for review June 17, 2026 12:22
@0xAndoroid 0xAndoroid added the claude-review-request Request a review from Claude Code label Jun 17, 2026
@0xAndoroid

0xAndoroid commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Stack maintenance — rebased onto #1600 and retargeted this PR's base to prover-stack/05-hyperkzg-zk; CI green.

📚 Stack A: #1596#1597#1598#1599#1600#1601 (this PR)#1602#1603
📚 Stack B: #1596#1597#1604#1605#1606

#1596 and #1597 are shared by both stacks; each PR targets the one before it.

Conflict resolution

  • crates/jolt-dory/src/{scheme.rs,streaming.rs,types.rs} — integrated the Dory-assist opening artifact/transcript extraction with the existing stack's Dory streaming and transcript interfaces; fixed transcript replay to consume an owned transcript and removed unnecessary clones on copyable field values.
  • crates/jolt-verifier/** — the PR's verifier wiring targeted older precommitted/advice/program-image APIs; preserved feat: add HyperKZG zero-knowledge openings #1600's verifier stage architecture and kept the new Dory-assist formulas/artifacts without reintroducing obsolete verifier wiring.
  • crates/jolt-claims/src/protocols/dory_assist/formulas/miller_loop.rs — renamed G2HomState to G2MapState to satisfy the repo typos check; no semantic protocol change.

@github-actions

Copy link
Copy Markdown
Contributor

Claude code review session started: https://claude.ai/code/session_01AU8AYnvPCA7UnbdxegABgM

@moodlezoup moodlezoup left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the Dory PCS-assist additions. The formula/relation tree under dory_assist/ is the bulk of the diff but isn't wired into live verification yet (only the no-op NoPcsAssist exists), so I focused on the code that compiles and runs: the dory scheme/streaming/types changes and the stage-8 opening path.

Main thing to look at: the clear DoryScheme::verify no longer rejects ZK-artifact proofs, and with the zk dory feature always on this lets a ZK-shaped proof pass PCS::verify while ignoring the claimed evaluation — a binding gap in the stage-8 clear path. Details inline. Also two new verifier files (pcs_assist.rs, stage8/final_openings.rs) are orphan modules that never get compiled, and a combine_hints row-count divergence from core that's latent for now.

The reduce-round transcript replay, fold-factor coordinate math, one-hot commitment fast paths, the repr(transparent) transmutes, and the streaming bounds checks all read correctly against the upstream dory implementation.


Generated by Claude Code

}

dory::verify::<ArkFr, InnerBN254, G1Routines, G2Routines, _>(
dory::verify::<ArkFr, InnerBN254, JoltG1Routines, JoltG2Routines, _>(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This drops the guard that rejected proofs carrying ZK artifacts (e2/y_com/sigma1_proof/sigma2_proof/scalar_product_proof) on the clear path. dory is built with zk enabled unconditionally (root Cargo.toml), so the #[cfg(feature = "zk")] branch in verify_evaluation_proof is always live: when those fields are Some, it takes e2 from the proof and the caller-supplied eval is never used (only the (None, None) arm binds e2 = g2_0^eval). It then only checks the sigma proofs, i.e. that y_com/e2 open to some value — not that that value equals eval.

stage8_clear calls PCS::verify(&joint_commitment, point, joint_claim, &proof.joint_opening_proof, …). A prover who submits a ZK-shaped joint_opening_proof gets Ok(()) regardless of joint_claim, severing the binding between the sumcheck-derived claim and the committed witness. The clear stage-8 path is internally reachable in this crate, so the binding is unsound here even though jolt-verifier isn't the production verifier yet.

types.rs already has has_transparent_opening_artifacts() — restore the rejection (call it and bail otherwise) on the clear path. verify_zk is fine since it requires y_com.is_some() and dory rejects mixed shapes.


Generated by Claude Code

let num_rows = hints
.iter()
.map(|hint| hint.row_commitments.len())
.max()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says this resizes "to the global max" like core, but it uses the per-call batch max (hints.iter().map(len).max()), whereas jolt-core/src/poly/commitment/dory/commitment_scheme.rs:311 uses DoryGlobals::get_max_num_rows(). These agree only when the batch happens to contain a hint at the global row count. If combine_hints is ever called on a subset whose local max is smaller than 2^nu, the combined hint is shorter than the matrix shape open/dory::prove derive from point.len(). Latent today (the live prover still uses the core impl), but worth aligning before this crate replaces it — either resize to the global max or document why the batch always contains the max-width hint.


Generated by Claude Code

@@ -0,0 +1,100 @@
//! Generic PCS-assist verifier boundary.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file isn't declared anywhere — lib.rs lists only compat, config, error, preprocessing, proof, stages, verifier, and there's no #[path]/build.rs pulling it in. As an orphan module it's excluded from compilation, so the PcsProofAssist trait, NoPcsAssist impl, and the input structs get no cargo build/clippy/test coverage and can silently rot. If it's intended scaffolding for a later stack PR, either add pub mod pcs_assist; now so CI checks it, or hold the file until the consumer lands. (Same applies to crates/jolt-verifier/src/stages/stage8/final_openings.rs, which stage8/mod.rs doesn't declare.)


Generated by Claude Code

@@ -0,0 +1,595 @@
#[cfg(feature = "field-inline")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stage8/mod.rs declares only inputs, outputs, verify — there's no mod final_openings;, so these 595 lines (and their #[cfg(test)] module) are never compiled. None of stage8_final_opening_* are referenced from stage8/verify.rs. Add the mod declaration so it's type-checked/linted, or defer the file until it's wired into the verify flow.


Generated by Claude Code

@0xAndoroid 0xAndoroid force-pushed the prover-stack/05-hyperkzg-zk branch from 6d77405 to fd2a7a3 Compare June 17, 2026 21:06
Squashed feat + adapt-to-stack during rebase onto restacked parent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-review-request Request a review from Claude Code implementation PR contains implementation of a spec spec Tracking issue for a feature spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants