Skip to content

Quadratic symbolic expression only #2647

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

Merged
merged 43 commits into from
Apr 16, 2025
Merged

Conversation

chriseth
Copy link
Member

No description provided.

@chriseth chriseth requested a review from Copilot April 10, 2025 21:28
georgwiese
georgwiese previously approved these changes Apr 10, 2025
Copy link
Collaborator

@georgwiese georgwiese left a comment

Choose a reason for hiding this comment

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

Let's go 🚀

@chriseth chriseth enabled auto-merge April 10, 2025 21:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

executor/src/witgen/jit/symbolic_expression.rs:141

  • [nitpick] The method compute_updated uses operator matching for both 'Sub' and 'Add' with negation. Consider using explicit subtraction to improve clarity, unless operator overloading for '-' is definitively the intended behavior.
match op {

executor/src/witgen/jit/symbolic_expression.rs:116

  • New branches introduced in compute_updated and apply_update would benefit from added test cases to verify that all update scenarios and operator overloading behaviors work as expected.
/// Applies a variable update and returns a modified version if there was a change.

SymbolicExpression::Concrete(_) => None,
SymbolicExpression::Symbol(v, _) => {
if *v == variable_update.variable {
assert!(variable_update.known);
Copy link
Preview

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

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

Using an assert here may lead to a runtime panic in production if variable_update.known is false. Consider handling this case more gracefully, for example by returning an error or a None value with a proper log message.

Suggested change
assert!(variable_update.known);
if !variable_update.known {
// Log a message or handle the error gracefully if needed.
return None;
}

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

};
match op {
BinaryOperator::Add => Some(l + r),
BinaryOperator::Sub => Some(l + -r),
Copy link
Member Author

Choose a reason for hiding this comment

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

Could use l - r here now

@chriseth chriseth added this pull request to the merge queue Apr 16, 2025
Merged via the queue into main with commit 1d2464f Apr 16, 2025
25 checks passed
@chriseth chriseth deleted the quadratic_symbolic_expression_only branch April 16, 2025 11:52
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