-
Notifications
You must be signed in to change notification settings - Fork 272
Specs for opcode DIV and MOD #149
Specs for opcode DIV and MOD #149
Conversation
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.
In the latest version of master
, Instruction
just has the following two methods for rlc_to_fq:
def rlc_to_fq_unchecked(self, rlc: RLC, n_bytes: int) -> FQ:
rlc_le_bytes = self.rlc_to_le_bytes(rlc)
return self.bytes_to_fq(rlc_le_bytes[:n_bytes]), self.is_zero(
self.sum(rlc_le_bytes[n_bytes:])
)
def rlc_to_fq_exact(self, rlc: RLC, n_bytes: int) -> FQ:
rlc_le_bytes = self.rlc_to_le_bytes(rlc)
if sum(rlc_le_bytes[n_bytes:]) > 0:
raise ConstraintUnsatFailure(f"Value {rlc} has too many bytes to fit {n_bytes} bytes")
return self.bytes_to_fq(rlc_le_bytes[:n_bytes])
I guess that the branch is not up-to-date or similar. Please update the method name. See this
Aside from that, I'll wait to review the rest until my concern over conditional copies ending up on PermutationErrors is resolved. As it could lead to some big changes in the spec in case I'm right (I would like to not to be TBH).
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 what refers to the spec. Looks good TBH. I clarified my concerns above with Han and Edu.
The only part I think it's sill not ok from this PR is that seems to be off-sync with master
or the rebase removed a lot of stuff which is still used in master
(and it's not the purpose of the PR).
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!! Thanks for the PR and the great work!
If you can add a new line to the files that lack it at the end would be awesome 😄
@ChihChengLiang @han0110 The |
@icemelon It seems mdformat doesn't have a plan to support the ignore feature yet hukkin/mdformat#53. |
@ChihChengLiang Could you help review this PR? |
He'll be back on Wed. Maybe @ed255 can check this. |
Sorry for my absence. I am reviewing this now. |
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.
Find an issue in the compare_word. Maybe the testing bug is related?
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, mergeable after a rebase
@ChihChengLiang Rebased now |
Thank you Haichen for the PR! |
No description provided.