Skip to content

Print consistent names for zkASM Insts #217

@mooori

Description

@mooori

Benchmarking requires functionality to print the names of Inst variants. This functionality should be re-used as pointed out by @nagisa in this comment:

[...] I think we should also consider reusing this for print_with_state to maintain consistent names across various places where we print these instructions. This shouldn't be too hard (although the diff will not be minimal) and can be achieved roughly through:

let mut output = String::with_capacity(32);
output.push_str(self.print_name());
match self {
    Inst::Udf { trap_code } => write!(&mut output, "##trap_code={trap_code}"),
    ...
}

This should also reveal that e.g. Inst::Select is actually considered multiple different instructions depending on a ty field. It might or might not be useful to split them out for histogram purposes as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions