-
Notifications
You must be signed in to change notification settings - Fork 136
Hints for existing vars #3761
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
Hints for existing vars #3761
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4eff4c2
Hints for equal zero rules.
chriseth 286308a
More code for hints.
chriseth 25a8aec
Finishing touches.
chriseth 6d53ac7
remove prints.
chriseth 648af11
Merge remote-tracking branch 'origin/main' into hints_for_existing_vars
chriseth 85c0d71
fix clippy.
chriseth 5e6e58a
Remove stray comment.
chriseth 4d1bf45
Skip old variables for gpu.
chriseth d5bb868
Update snapshot tests
georgwiese 063d3f1
Simplify expression conversion
georgwiese af8dfb0
Merge pull request #3771 from powdr-labs/hints_for_existing_vars_sugg…
chriseth de92a70
Update openvm/src/powdr_extension/trace_generator/cuda/mod.rs
chriseth aa049b6
Use only one diff_val.
chriseth d066c4d
fmt
chriseth 1d5a85e
fix hint
chriseth 26d643f
Merge remote-tracking branch 'origin/main' into hints_for_existing_vars
chriseth 59529cd
update tests.
chriseth 4144bec
Merge branch 'main' of github.com:powdr-labs/powdr into hints_for_exi…
georgwiese abb51f2
Update snapshot
georgwiese File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,21 +45,37 @@ pub fn convert_machine_field_type<T, U>( | |
| .derived_columns | ||
| .into_iter() | ||
| .map(|derived_variable| { | ||
| let method = match derived_variable.computation_method { | ||
| ComputationMethod::Constant(c) => { | ||
| ComputationMethod::Constant(convert_field_element(c)) | ||
| } | ||
| ComputationMethod::QuotientOrZero(e1, e2) => ComputationMethod::QuotientOrZero( | ||
| convert_expression(e1, convert_field_element), | ||
| convert_expression(e2, convert_field_element), | ||
| DerivedVariable::new( | ||
| derived_variable.is_new, | ||
| derived_variable.variable, | ||
| convert_computation_method( | ||
| derived_variable.computation_method, | ||
| convert_field_element, | ||
| ), | ||
| }; | ||
| DerivedVariable::new(derived_variable.variable, method) | ||
| ) | ||
| }) | ||
| .collect(), | ||
| } | ||
| } | ||
|
|
||
| fn convert_computation_method<T, U>( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess if you go for 063d3f1, this should also be a method on |
||
| method: ComputationMethod<T, AlgebraicExpression<T>>, | ||
| convert_field_element: &impl Fn(T) -> U, | ||
| ) -> ComputationMethod<U, AlgebraicExpression<U>> { | ||
| match method { | ||
| ComputationMethod::Constant(c) => ComputationMethod::Constant(convert_field_element(c)), | ||
| ComputationMethod::QuotientOrZero(e1, e2) => ComputationMethod::QuotientOrZero( | ||
| convert_expression(e1, convert_field_element), | ||
| convert_expression(e2, convert_field_element), | ||
| ), | ||
| ComputationMethod::IfEqZero(condition, then, else_) => ComputationMethod::IfEqZero( | ||
| convert_expression(condition, convert_field_element), | ||
| Box::new(convert_computation_method(*then, convert_field_element)), | ||
| Box::new(convert_computation_method(*else_, convert_field_element)), | ||
| ), | ||
| } | ||
| } | ||
|
|
||
| fn convert_symbolic_constraint<T, U>( | ||
| constraint: SymbolicConstraint<T>, | ||
| convert: &impl Fn(T) -> U, | ||
|
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.