-
Notifications
You must be signed in to change notification settings - Fork 135
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
Finish M extension #434
Finish M extension #434
Conversation
feat: m extension support in tracer
// All instructions in virtual sequence are mapped from the same | ||
// ELF address. Thus if an instruction is virtual (and not the last one | ||
// in its sequence), then we should *not* update the PC. | ||
flags[11] = match self.virtual_sequence_remaining { | ||
Some(i) => i != 0, | ||
None => false | ||
}; |
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 need this flag (and so we had to reverse the virtual sequence indexing) for the new non-uniform constraint, which ensures that virtual sequences are executed in full and in order
@@ -26,6 +26,23 @@ impl JoltField for ark_bn254::Fr { | |||
} | |||
} | |||
|
|||
fn to_u64(&self) -> Option<u64> { |
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.
for debugging
@@ -190,7 +201,26 @@ impl<const WORD_SIZE: usize> VirtualInstructionSequence for DIVInstruction<WORD_ | |||
advice_value: None, | |||
}); | |||
|
|||
virtual_sequence | |||
virtual_trace.push(RVTraceRow { |
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.
Previously, we had elided the MOVE instruction as described in the Jolt paper as an optimization, instead writing the advice directly to the destination register
But as it turns out, we actually did need the separate virtual register + MOVE for the edge case where rd
is equal to rs1
or rs2
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 was implemented as a signed ≤, but it should be an unsigned ≤
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.
LGTM
SubtableIndices::from(C - 1), | ||
), | ||
( | ||
// Not used for lookup, but this implicitly range-checks |
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.
Let's make a utility function for this so it's self documenting and use across all the memory ops that need range-checking.
fn RangeCheck(C) -> (Box<Subtable<...>>, SubtableIndices)
Finishes wiring up the M extension to Jolt: