Skip to content

Use Hint Bridge for Constraining HintLoad - #39

Merged
kunxian-xia merged 18 commits into
feat/v1.4.1-scroll-extfrom
feat/hint_bridge
Mar 16, 2026
Merged

Use Hint Bridge for Constraining HintLoad#39
kunxian-xia merged 18 commits into
feat/v1.4.1-scroll-extfrom
feat/hint_bridge

Conversation

@darth-cy

Copy link
Copy Markdown
  • Add a LookupBus encapsulation to constrain the values loaded from hint_space.
  • Change NativeSumcheck to use hint space loading by default. Make opcode's writeback operation optional to reduce cycles.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new “hint bus/bridge” mechanism to constrain values read from hint_space, and updates Native sumcheck to source inputs from hint space by default with optional witness-array writeback.

Changes:

  • Add HintBus/HintBridge to the system port and plumb it through circuit extensions.
  • Update NativeSumcheck to always read prod/logup inputs from hint_space, make writeback optional, and add hint-bus lookups for those reads.
  • Introduce a HintSpaceProvider AIR/chip intended to provide hint keys for the lookup table.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.

Show a summary per file
FileDescription
extensions/sha256/circuit/src/sha256_chip/air.rsIgnore new hint_bridge system port field.
extensions/rv32im/circuit/src/extension/mod.rsIgnore new hint_bridge system port field in RV32 extensions.
extensions/native/circuit/src/sumcheck/execution.rsSumcheck executor now reads prod/logup evals from hint_space and gates writeback.
extensions/native/circuit/src/sumcheck/columns.rsReplace is_hint_src_id with is_writeback + hint-id columns.
extensions/native/circuit/src/sumcheck/chip.rsTracegen updated for hint-space inputs, optional writeback, and hint-provider requests.
extensions/native/circuit/src/sumcheck/air.rsSumcheck AIR adds HintBridge lookups and optional writeback behavior.
extensions/native/circuit/src/poseidon2/air.rsPlumb HintBridge into Native Poseidon2 AIR constructor/state.
extensions/native/circuit/src/lib.rsExport new hint_space_provider module.
extensions/native/circuit/src/hint_space_provider.rsNew provider AIR/chip to supply (hint_id, offset, value) keys on the hint bus.
extensions/native/circuit/src/extension/mod.rsWire hint bridge/provider AIR + chip into Native extension (CPU).
extensions/keccak256/circuit/src/extension/mod.rsIgnore new hint_bridge system port field.
extensions/ecc/circuit/src/extension/weierstrass.rsIgnore new hint_bridge system port field.
extensions/bigint/circuit/src/extension/mod.rsIgnore new hint_bridge system port field.
extensions/algebra/circuit/src/extension/modular.rsIgnore new hint_bridge system port field.
extensions/algebra/circuit/src/extension/fp2.rsIgnore new hint_bridge system port field.
crates/vm/src/system/mod.rsAdd HintBus/HintBridge to system config, inventory, and SystemPort.
crates/vm/src/system/memory/offline_checker/columns.rsAdd hint read/write aux column structs.
crates/vm/src/system/memory/offline_checker/bus.rsAdd HintBus wrapper over LookupBus.
crates/vm/src/system/memory/offline_checker/bridge.rsAdd HintBridge wrapper exposing lookup/provide API.
crates/vm/src/arch/testing/mod.rsReserve HINT_BUS bus index for tests.
crates/vm/src/arch/testing/cuda.rsAdd hint_bridge() and include it in SystemPort for GPU tests.
crates/vm/src/arch/testing/cpu.rsAdd hint bridge to SystemPort for CPU tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadextensions/native/circuit/src/hint_space_provider.rs
Comment threadextensions/native/circuit/src/extension/mod.rs
Comment threadextensions/native/circuit/src/sumcheck/air.rs
Comment threadextensions/native/circuit/src/sumcheck/air.rs
Comment threadextensions/native/circuit/src/sumcheck/air.rs
Comment threadextensions/native/circuit/src/sumcheck/execution.rs
Comment threadextensions/native/circuit/src/sumcheck/chip.rs
This PR adds CUDA/GPU support for the HintSpaceProvider periphery chip used by the new HintBridge, enabling GPU-side trace generation for the hint space provider table and registering the chip in the GPU prover extension.
Comment threadextensions/native/circuit/src/sumcheck/air.rs
let local = main.row_slice(0);
let local: &HintSpaceProviderCols<AB::Var> = (*local).borrow();

builder.assert_bool(local.is_valid);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have to make sure that the tuple (hint_id, offset) is monotonically increasing s.t. two different lookups with key (hint_id, offset) will not return different value.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Monotonicity constraints are now available

Comment threadcrates/vm/src/system/memory/offline_checker/columns.rs Outdated
Comment threadextensions/native/circuit/src/sumcheck/air.rs
Comment threadextensions/native/circuit/src/sumcheck/chip.rs Outdated
Comment threadextensions/native/circuit/src/hint_space_provider.rs Outdated
Comment threadextensions/native/circuit/src/hint_space_provider.rs Outdated
Comment threadcrates/continuations/src/verifier/common/non_leaf.rs
Comment threadcrates/vm/src/arch/vm.rs
Comment threadextensions/native/circuit/src/hint_space_provider.rs Outdated

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadextensions/native/circuit/src/sumcheck/air.rs
Comment threadextensions/native/circuit/src/sumcheck/chip.rs
Comment threadextensions/native/circuit/src/hint_space_provider.rs
Comment threadextensions/native/circuit/src/hint_space_provider.rs Outdated
Comment threadextensions/native/circuit/src/hint_space_provider.rs Outdated

@kunxian-xiakunxian-xia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 🎉

@kunxian-xia
kunxian-xia merged commit f2981fe into feat/v1.4.1-scroll-extMar 16, 2026
1 of 37 checks passed
Sign up for freeto 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

@darth-cy@kunxian-xia