-
Notifications
You must be signed in to change notification settings - Fork 79
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
State machine AIR #841
State machine AIR #841
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @shaharsamocha7 and the rest of your teammates on Graphite |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #841 +/- ##
=======================================
Coverage 91.91% 91.91%
=======================================
Files 90 90
Lines 12375 12375
Branches 12375 12375
=======================================
Hits 11374 11374
Misses 892 892
Partials 109 109
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @shaharsamocha7)
crates/prover/src/examples/state_machine/components.rs
line 8 at r1 (raw file):
use crate::core::lookups::utils::Fraction; pub const N_STATE: usize = 2;
STATE_SIZE
/ STATE_LEN
/ N_FELTS_IN_STATE
.
Code quote:
N_STATE
crates/prover/src/examples/state_machine/components.rs
line 9 at r1 (raw file):
pub const N_STATE: usize = 2; pub type StateMachineElements = LookupElements<N_STATE>;
Since this is the usage example, document what the sum with multiple lookup elements should look like.
crates/prover/src/examples/state_machine/components.rs
line 14 at r1 (raw file):
/// Transition `INDEX` of state increments the state by 1 at that offset. #[derive(Clone)] pub struct StateTransitionEval<const INDEX: usize> {
COORDINATE
?
Code quote:
INDEX
crates/prover/src/examples/state_machine/components.rs
line 25 at r1 (raw file):
} fn max_constraint_log_degree_bound(&self) -> u32 { self.log_n_rows + 1
LOG_BLOW_UP_FACTOR
Code quote:
1
crates/prover/src/examples/state_machine/components.rs
line 32 at r1 (raw file):
let input_state: [_; N_STATE] = std::array::from_fn(|_| eval.next_trace_mask()); let q0: E::EF = self.lookup_elements.combine(&input_state);
input_denom
Code quote:
q0
crates/prover/src/examples/state_machine/gen.rs
line 27 at r1 (raw file):
inc_index: usize, ) -> ColumnVec<CircleEvaluation<SimdBackend, M31, BitReversedOrder>> { let n_lanes = PackedM31::broadcast(M31::from_u32_unchecked(N_LANES as u32));
Isn't there AddAssign<M31> for PackedM31
? If not maybe it's clearer to implement that that to generate this.
crates/prover/src/examples/state_machine/gen.rs
line 61 at r1 (raw file):
) { let ones = PackedM31::broadcast(M31::one()); let n_lanes_minus_one = PackedM31::broadcast(M31::from_u32_unchecked(N_LANES as u32)) - ones;
Same as above.
crates/prover/src/examples/state_machine/gen.rs
line 72 at r1 (raw file):
for vec_row in 0..(1 << (log_size - LOG_N_LANES)) { let q0: PackedQM31 = lookup_elements.combine(&packed_state);
Same as above.
Code quote:
q0
da54d68
to
cef3cc6
Compare
2495710
to
5f285c4
Compare
cef3cc6
to
f6fc394
Compare
5f285c4
to
e35616b
Compare
e35616b
to
820a2ef
Compare
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.
Reviewable status: 1 of 4 files reviewed, 8 unresolved discussions (waiting on @Alon-Ti)
crates/prover/src/examples/state_machine/components.rs
line 8 at r1 (raw file):
Previously, Alon-Ti wrote…
STATE_SIZE
/STATE_LEN
/N_FELTS_IN_STATE
.
Done.
crates/prover/src/examples/state_machine/components.rs
line 9 at r1 (raw file):
Previously, Alon-Ti wrote…
Since this is the usage example, document what the sum with multiple lookup elements should look like.
Done
I think we should document the LookupElements better in the struct itself.
crates/prover/src/examples/state_machine/components.rs
line 14 at r1 (raw file):
Previously, Alon-Ti wrote…
COORDINATE
?
Done.
crates/prover/src/examples/state_machine/components.rs
line 25 at r1 (raw file):
Previously, Alon-Ti wrote…
LOG_BLOW_UP_FACTOR
Done
This is not due to the blow_up factor, this is defined in the PCS.
Here the +1 is because the log constraint degree is 1.
crates/prover/src/examples/state_machine/components.rs
line 32 at r1 (raw file):
Previously, Alon-Ti wrote…
input_denom
Done.
crates/prover/src/examples/state_machine/gen.rs
line 27 at r1 (raw file):
Previously, Alon-Ti wrote…
Isn't there
AddAssign<M31> for PackedM31
? If not maybe it's clearer to implement that that to generate this.
I think we don't have that.
Also that kind of implementation will use PackedM31::broadcast
each time, no?
crates/prover/src/examples/state_machine/gen.rs
line 61 at r1 (raw file):
Previously, Alon-Ti wrote…
Same as above.
Same as above
crates/prover/src/examples/state_machine/gen.rs
line 72 at r1 (raw file):
Previously, Alon-Ti wrote…
Same as above.
Done.
f6fc394
to
81e8174
Compare
820a2ef
to
b095514
Compare
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.
up to the stylistic suggestions.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)
crates/prover/src/examples/state_machine/components.rs
line 9 at r1 (raw file):
Previously, shaharsamocha7 wrote…
Done
I think we should document the LookupElements better in the struct itself.
I agree, add TODO?
crates/prover/src/examples/state_machine/gen.rs
line 27 at r1 (raw file):
Previously, shaharsamocha7 wrote…
I think we don't have that.
Also that kind of implementation will usePackedM31::broadcast
each time, no?
It can (but you could also not generate another packed element, maybe this could be better if we increase VeryPacked size too much), but it'll be cleaner here.
81e8174
to
cbe1dd7
Compare
b095514
to
7242e27
Compare
cbe1dd7
to
257a05a
Compare
7242e27
to
6911522
Compare
257a05a
to
aa70c61
Compare
6911522
to
c60d8da
Compare
97d0f88
to
92540c0
Compare
c60d8da
to
3d01595
Compare
92540c0
to
8ba2299
Compare
7acbcd9
to
f86b74a
Compare
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.
Reviewable status: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @Alon-Ti)
crates/prover/src/examples/state_machine/components.rs
line 9 at r1 (raw file):
Previously, Alon-Ti wrote…
I agree, add TODO?
On a second thought I think that the lookup elements doesn't need more documentation
crates/prover/src/examples/state_machine/gen.rs
line 27 at r1 (raw file):
Previously, Alon-Ti wrote…
It can (but you could also not generate another packed element, maybe this could be better if we increase VeryPacked size too much), but it'll be cleaner here.
Removed.
f86b74a
to
bfa4e93
Compare
b63647d
to
80a2ca5
Compare
80a2ca5
to
7372a06
Compare
Merge activity
|
This change is