Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split compile function and use interpreter for large code. #2569

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chriseth
Copy link
Member

@chriseth chriseth commented Mar 20, 2025

This first derives the code and then makes the decision of whether or not to use the interpreter based on the derived code.

@chriseth chriseth force-pushed the split_compile_fun branch from 0f29393 to 18b2954 Compare March 20, 2025 10:53
@chriseth chriseth requested a review from georgwiese March 20, 2025 10:53
@chriseth chriseth changed the title Split compile function Split compile function and use interpreter for large code. Mar 20, 2025
variable::Variable,
witgen_inference::CanProcessCall,
};

const MAX_COMPILED_CODE_SIZE: usize = 500;
Copy link
Collaborator

Choose a reason for hiding this comment

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

might be good to leave a small comment here for usage/context

// Use the compiler for goldilocks with at most MAX_COMPILED_CODE_SIZE statements and
// the interpreter otherwise.
let interpreted = matches!(T::known_field(), Some(KnownField::GoldilocksField))
|| (code_size(&result.code) > MAX_COMPILED_CODE_SIZE && !has_prover_function_call);
Copy link
Collaborator

Choose a reason for hiding this comment

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

has_prover_function_call should not be tested here due to the following if

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.

2 participants