0xMiden / 0xMiden/miden-vm

Implement`adv.push_smtset` and `adv.push_smtget`

Open
#1,220 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
772
Forks
352
Avg merge
1d 7h
Merged PRs (30d)
84

Description

Prior to #1215, these instructions worked with the `TieredSmt`. They are currently not used in the `smt` implementation, but could be useful to improve performance.

_Originally posted by @bobbinth in https://github.com/0xPolygonMiden/miden-vm/pull/1215#discussion_r1468429893_

>I would keep them here but remove comments. The reason is that using these instructions we can optimize the implementation further. The way to do it is to pre-load advice info onto the advice stack here so that MASM code needs to do fewer `adv.push_mapvaln` operations (and associated stack manipulations). We can also use this to put binary flags onto the advice stack to flatten control flow a bit.
>
>My rough guess is that by using these techniques we could probably reduce cycle count of `smt::set` by 10% - 20%. The case of `smt::get` is not clear - savings there will probably be pretty small. But we can determine this and act accordingly in another PR.
>
>So, let's create an issue for this.

Contributor guide

Open the contributing guide

Research direction

The issue references PR #1215 and the TieredSmt. Start by reviewing that PR's changes to understand the current smt implementation and the removed adv.push_smtset/get instructions. Examine the MASM code for smt::set and smt::get to identify where adv.push_mapvaln operations and stack manipulations occur. The goal is to re-implement these instructions to pre-load advice info, potentially reducing cycle count. Determine the exact performance impact and the required changes to the advice stack handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.