-
Notifications
You must be signed in to change notification settings - Fork 73
feat: hint opcode implementation #108
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
Conversation
INT-1696 Implement hint opcodes
We need to support the instructions This involves adding a new opcodes
|
zlangley
left a comment
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.
Modify the test_io test to compile and run its program and make sure it passes.
zlangley
left a comment
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.
Is this generating trace rows to write the hints into the memory trace?
@zlangley no, since the accesses are not being pushed to the accesses array, which is the thing used to generate trace rows |
jonathanpwang
left a comment
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 safety, I think all HINTs should be at timestamp 0. If the HINT opcode does not even show up in the program code (so it is ignored by the CpuChip), then it is unsound to allow arbitrary HINTs at any timestamp: that would mean there's no way to tell if memory is properly constrained (how would you know the difference between a program where I inserted a bunch of random hints into memory trace in between every read vs. a normal program?). The fact that tests pass with this current implementation means there's definitely something fishy related to INT-1708.
Separately, the AsmInstruction::Hint needs to be able to allow e = 1 or 2 for compiler purposes. @TlatoaniHJ can you confirm and also see if there's a suggested fix?
zlangley
left a comment
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
jonathanpwang
left a comment
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
* feat: hint opcode implementation * wip * wip * wip * wip * wip * feat: hint * chore: add comment for to_field change * chore: use CPU_MAX_ACCESSES_PER_CYCLE * chore: add max_access_per_instruction for HINT * chore: address comments * wip * feat: integration test for hint * chore: address comments * chore: add HINT to Core instruction list * Modify hint instruction to write length + contents together * Remove AsmInstruction::HintLen * add comment for or * format * chore: fix lints * chore: fix test_vm_hint * chore: uncomment felts --------- Co-authored-by: Zach Langley <[email protected]>
* Cuda tracegen + tests for Rv32DivRem * review comments
* Cuda tracegen + tests for Rv32DivRem * review comments
* Cuda tracegen + tests for Rv32DivRem * review comments
resolves https://linear.app/intrinsictech/issue/INT-1696/implement-hint-opcodes