-
Notifications
You must be signed in to change notification settings - Fork 4
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: add ISA specific setting instrument_inst
for zkASM
#230
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.
Overall, looks good to me!
I would probably go with a more specific name for the option like emit_profiling_info
as the current instrument_inst
does not clearly show the purpose without reading the documentation.
@@ -63,6 +74,15 @@ pub fn generate_zkasm(wasm_module: &[u8]) -> String { | |||
program.join("\n") | |||
} | |||
|
|||
fn handle_zkasm_settings( |
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.
(just an opinion, no expectation to change anything)
I see the reasoning for having a dedicated function if we have more settings in the future, but at this stage, I would call this a premature optimization and follow YAGNI (You aren't gonna need it) [1], [2].
[1] https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it
[2] https://martinfowler.com/bliki/Yagni.html
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.
Adding a separate handle_zkasm_settings
function also aims at encapsulating functionality and avoiding that generate_zkasm(...)
grows too big. I think the separate function does not add any significant overhead here. No strong opinion on my side, merging now to wrap up the PR.
instrument_inst
setting for zkasm.ZkasmSettings
to handle ISA specific settings inzkasm_codegen
.Can be reviewed commit by commit and commit messages provide a summary of the changes.
Context
Benchmarking infra will use the
instrument_inst
setting to enable instruction tracing. I propose to add this in a separate PR.Enabling
instrument_inst
It is disabled by default. To see the changes introduced by this PR in action, it can be enabled with the following patch:
Then instrumented zkasm can be generated by running a test like: