Skip to content
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/PRINTF and FAIL instructions + make instruction set expansion easier #98

Merged
merged 5 commits into from
Jun 28, 2024

Conversation

TlatoaniHJ
Copy link
Contributor

@TlatoaniHJ TlatoaniHJ commented Jun 27, 2024

Add PRINTF and FAIL instructions. PRINTF is used for debugging and will cause generate_program_execution to print out the field element at address a in address space d; the trace generated will not be verifiable. FAIL will cause generate_program_execution to fail (return Err). Neither affects the AIR constraints as they can never appear in a verifiable execution (in this way, a program that fails cannot be verified, which seems desirable).

The eDSL instructions PrintV and PrintF are compiled to PRINTF. The eDSL instruction Trap is compiled to FAIL. Additionally, FAIL is used in the program AIR to pad the trace.

Change generate_program_execution to return a Result and introduce the ExecutionError enum to capture the possible failure modes.

Overhaul how enabling/disabling instruction sets is handled to make (near) future expansion easier.

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

vm/src/cpu/trace.rs Outdated Show resolved Hide resolved
vm/src/cpu/columns.rs Show resolved Hide resolved
@TlatoaniHJ TlatoaniHJ merged commit abefbdf into main Jun 28, 2024
2 checks passed
@TlatoaniHJ TlatoaniHJ deleted the feat/edsl-print branch June 28, 2024 15:38
luffykai pushed a commit that referenced this pull request Dec 13, 2024
…sier (#98)

* Add PRINT and FAIL instructions, make improvements for variable instruction set

* Fix lint

* Use FAIL

* Remove debug statement and convert panics to asserts

* Add pc field to ExecutionError::Fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants