Skip to content

AVM improvements #4366

Description

@sirasistant

This ticket tracks a list of possible improvements for the public VM and the reasoning behind every item (ordered by need!):

### Wishlist
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7054
- [x] **Adding integer division for fields**. This one is needed to be able to perform to_radix. to_radix is used to decompose a field in an array of items that go from 0 to radix. This is implemented via a loop of integer divisions.
- [x] **LT/LTE opcode support for field type.** Brillig range checks are implemented as field comparisons thus requiring LT/LTE over fields.
- [x] **Allow the set opcode to have inTag of field**. It's very typical that we create field constants where the actual value is less than 128 bits, to operate with it as a field. This would save some cast opcodes that aren't really necessary.
- [ ] **Adding a relative direct addressing mode**. If we have relative addressing, we can efficiently implement having a proper stack instead of the current solution of just having one stack frame that we dump/restore to heap on every internal call.
- [ ] **Adding a relative indirect addressing mode**. If we have both relative direct and relative indirect we can operate efficiently with all the items in the stack, being them pointers or immediate values.

Most of these items have workarounds but implementing them would enable the compiler to generate smaller bytecodes for the same programs.

Activity

  1. added
    C-avmComponent: AVM related tickets (aka public VM)
    on Feb 1, 2024
  2. added this to the milestone on Jun 19, 2024
  3. removed this from the milestone on Oct 7, 2024
  4. dbanks12 commented on Jan 30, 2025

    @dbanks12
    Contributor

    I think we can check off the remaining items and close this ticket, right @sirasistant @fcarreiro @jeanmon ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-avmComponent: AVM related tickets (aka public VM)

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions