feat: pass machine explicitly everywhere applicable#2753
Merged
Conversation
Schaeff
commented
Apr 27, 2026
Schaeff
commented
Apr 27, 2026
| gate: super::ProveShardGate<A, W>, | ||
| minimal_executor_cache: Option<MinimalExecutorCache>, | ||
| cycle_limit: Option<u64>, | ||
| _machine: Machine<SP1Field, RiscvAir<SP1Field>>, |
Collaborator
Author
There was a problem hiding this comment.
This is not used now, because we do not customize the executor using the machine so that APCs are executed instead of the software path. The change that introduces the customization is in #2738
137be28 to
06f0fa0
Compare
Co-authored-by: qwang98 <qian.wang.wg24@wharton.upenn.edu> Co-authored-by: Georg Wiese <georgwiese@gmail.com>
06f0fa0 to
2ef46aa
Compare
Contributor
|
Schaeff
commented
Apr 28, 2026
| struct ConnectionCtx { | ||
| pk_cache: HashMap<[u8; 32], CachedProgram>, | ||
| prover: Arc<SP1LocalNode>, | ||
| prover: tokio::sync::OnceCell<Arc<SP1LocalNode>>, |
Collaborator
Author
There was a problem hiding this comment.
We only know the machine at setup time, therefore we can't create a prover before that.
tamirhemo
reviewed
May 1, 2026
| num_deferred_proofs, | ||
| cycle_limit, | ||
| context: context.clone(), | ||
| // TODO: is this expensive? |
Contributor
There was a problem hiding this comment.
shouldn't be since chips are references
tamirhemo
approved these changes
May 1, 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.
The machine to be proven is currently always the same instance of
Machinecreated withRiscvAir::machine().As a result, many places in the code just rebuild it on the fly instead of passing it around.
In the context of APCs however, not all
Machineinstances are the same, as they get created dynamically with some autoprecompile chips.Therefore, pass the machine around everywhere applicable, in preparation for APCs.
This PR has no APC specific code, it's just a generalisation.