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

Add operation tracking to VmStateIterator #235

Closed
bobbinth opened this issue Jun 4, 2022 · 3 comments
Closed

Add operation tracking to VmStateIterator #235

bobbinth opened this issue Jun 4, 2022 · 3 comments
Assignees
Labels
processor Related to Miden VM processor

Comments

@bobbinth
Copy link
Contributor

bobbinth commented Jun 4, 2022

Currently, the VmState struct which is returned from the VmStateIterator does not contain the operation which was executed to put the VM into this state. We should add another field to this struct so that it looks something like this:

#[derive(Clone, Debug, Eq, PartialEq)]
pub struct VmState {
    pub op: Operation,
    pub clk: usize,
    pub fmp: Felt,
    pub stack: Vec<Felt>,
    pub memory: Vec<(u64, Word)>,
}

The op field would need to be populated from the information in the decoder. The decoder doesn't explicitly track the operations yet. It is possible to infer the operations from the trace, but I think a better approach would be to have a vector of operations in the decoder struct. Then, as the VM executes operations, they would be pushed into this vector.

Since tracking operations would result in some overhead, the above should happen only when we are executing programs via execute_iter() function.

Implementing this functionality will enable counting operations executed by the VM which would be useful for things like #198.

@bobbinth bobbinth added the processor Related to Miden VM processor label Jun 4, 2022
@tohrnii
Copy link
Contributor

tohrnii commented Jun 4, 2022

@bobbinth I can complete this first as one PR and use that to complete #198.

@bobbinth
Copy link
Contributor Author

bobbinth commented Jun 4, 2022

That would be awesome! Thank you!

@bobbinth
Copy link
Contributor Author

Closed by #251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor Related to Miden VM processor
Projects
None yet
Development

No branches or pull requests

2 participants