-
Notifications
You must be signed in to change notification settings - Fork 102
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
Make ArrayLiteralExpression
sugar for PIL implementation
#1623
base: main
Are you sure you want to change the base?
Conversation
@@ -167,14 +167,14 @@ FunctionDefinition: FunctionDefinition = { | |||
body, | |||
outer_var_references: Default::default() | |||
})), | |||
<start:@L> "=" <array:ArrayLiteralExpression> <end:@R> => FunctionDefinition::Array(array), | |||
<start:@L> "=" <array:ArrayLiteralExpression> <end:@R> => desugar_array_literal_expression_with_sourceref(ctx.source_ref(start, end), array).into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like that this is done at parsing time already!
std/expand_fixed.asm
Outdated
use std::result::Result; | ||
use std::check::panic; | ||
|
||
// A term in an array expression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// A term in an array expression | |
/// A term in an array expression |
std/expand_fixed.asm
Outdated
} | ||
|
||
// returns the total size of the repeated array in this array expression | ||
let solve: ArrayTerm[], int -> Result<int, string> = |terms, degree| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solve
sounds a bit too generic for me. What about something like compute_length
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, compute_length_of_repeated_part
a718b0a
to
8a43f05
Compare
@@ -15,7 +15,7 @@ namespace Main(N); | |||
|
|||
// only make a call every other row, otherwise set `c` to 0 | |||
// we do this to prevent running out of blocks in `Add` | |||
col fixed CALL = [1, 0]*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not necessary, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not have the stdlib in PIL
@@ -599,7 +599,7 @@ enum Operation<'a, T> { | |||
struct Evaluator<'a, 'b, T: FieldElement, S: SymbolLookup<'a, T>> { | |||
symbols: &'b mut S, | |||
local_vars: Vec<Arc<Value<'a, T>>>, | |||
type_args: HashMap<String, Type>, | |||
type_args: Arc<HashMap<String, Type>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where this Arc
is useful - am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
powdr/pil-analyzer/src/evaluator.rs
Line 982 in a7577de
self.type_args = type_args.clone(); |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense! :)
Extracted from @Schaeff `s #1623 --------- Co-authored-by: schaeff <[email protected]>
} | ||
}; | ||
|
||
enum OffsetSearch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably get a better name.
Equivalent to #1623 but in Rust Closes #1570 @georgwiese I wanted to add a test but everything I try either panics (we sometimes assume the fixed columns to be available in a single size) or runs forever (when I add fixed columns to a machine, I assume witgen keeps increasing the degree and never stops? or it picks the largest size and just takes time?) any thoughts?
Mainly a test file to see what the JIT features are we need to support #1623 The "Add functionality benchmark" commit is the only important one here, the rest are merges from the implementing branches.
Mainly a test file to see what the JIT features are we need to support #1623 The "Add functionality benchmark" commit is the only important one here, the rest are merges from the implementing branches.
No description provided.