-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: Allow array of fields on public output #131
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4a4fb69
allow array of fields on public output
erhant c879418
remove comment / log and redundant clones
erhant 3aa65fb
allow only fields and bools for the array output
erhant 6d7f689
public output respects the size of returned type
erhant 30f31ab
use `BTreeMap` instead of `HashMap` for Kimchi public outputs
erhant f6a563d
use `educe(PartialOrd)` instead of impl
erhant 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 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 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@ noname.0.7.0 | ||
|
||
DoubleGeneric<1> | ||
DoubleGeneric<1> | ||
DoubleGeneric<1> | ||
DoubleGeneric<1,1,-1> | ||
DoubleGeneric<1,0,0,0,-2> | ||
DoubleGeneric<1,0,-1,0,6> | ||
DoubleGeneric<0,0,-1,1> | ||
DoubleGeneric<1,-1> | ||
DoubleGeneric<1,-1> | ||
(0,0) -> (7,0) | ||
(1,0) -> (8,0) | ||
(2,0) -> (3,1) -> (6,1) | ||
(3,2) -> (4,0) -> (5,0) -> (6,0) | ||
(5,2) -> (7,1) | ||
(6,2) -> (8,1) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@ noname.0.7.0 | ||
|
||
DoubleGeneric<1> | ||
DoubleGeneric<1> | ||
DoubleGeneric<1> | ||
DoubleGeneric<1> | ||
DoubleGeneric<1> | ||
DoubleGeneric<1> | ||
DoubleGeneric<2,0,-1> | ||
DoubleGeneric<2,0,-1> | ||
DoubleGeneric<2,0,-1> | ||
DoubleGeneric<1,-1> | ||
DoubleGeneric<2,0,-1> | ||
DoubleGeneric<1,-1> | ||
DoubleGeneric<1,-1> | ||
DoubleGeneric<1,-1> | ||
DoubleGeneric<1,-1> | ||
DoubleGeneric<1,-1> | ||
(0,0) -> (12,0) | ||
(1,0) -> (13,0) | ||
(2,0) -> (14,0) | ||
(3,0) -> (15,0) | ||
(4,0) -> (6,0) -> (8,0) -> (14,1) | ||
(5,0) -> (7,0) -> (10,0) -> (13,1) | ||
(6,2) -> (9,1) -> (12,1) | ||
(7,2) -> (11,1) -> (15,1) | ||
(8,2) -> (9,0) | ||
(10,2) -> (11,0) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@ noname.0.7.0 | ||
|
||
2 == (v_3 + v_4) * (1) | ||
v_5 == (v_3 + v_4) * (v_3) | ||
v_3 + v_4 + 6 == (v_1) * (1) | ||
v_5 == (v_2) * (1) | ||
This file contains 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@ noname.0.7.0 | ||
|
||
2 * v_5 == (2 * v_5) * (1) | ||
2 * v_6 == (2 * v_6) * (1) | ||
2 * v_5 == (v_1) * (1) | ||
v_6 == (v_2) * (1) | ||
v_5 == (v_3) * (1) | ||
2 * v_6 == (v_4) * (1) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fn main(pub public_input: Field, private_input: Field) -> [Field; 2] { | ||
let xx = private_input + public_input; | ||
assert_eq(xx, 2); | ||
let yy = xx + 6; | ||
return [yy, xx * public_input]; | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
struct Thing { | ||
xx: Field, | ||
yy: Field, | ||
} | ||
|
||
fn main(pub xx: Field, pub yy: Field) -> [Thing; 2] { | ||
let thing1 = Thing { | ||
xx: xx * 2, | ||
yy: yy, | ||
}; | ||
let thing2 = Thing { | ||
xx: xx, | ||
yy: yy * 2, | ||
}; | ||
let things = [thing1, thing2]; | ||
|
||
assert_eq(things[1].xx * 2, things[0].xx); | ||
assert_eq(things[0].yy * 2, things[1].yy); | ||
|
||
return things; | ||
} |
This file contains 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 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 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 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.
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.
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 last constraint seems really useless, we should optimize that, I'll create an issue :)
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.
Do you mean the second constraint should be instead
v_2 = (v_3 + v_4) * (v_3)
?v_1
andv_2
are the outputs and they have to be constrainedThere 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.
yeah!
v_2 == (v_3 + v_4) * v_3
would have been better. But I don't think we should look to create such optimization, because an optimization pass that would do inlining would easily inline the last constraint