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

Pass SHA256 benchmark #143

Closed
3 tasks done
aborg-dev opened this issue Dec 5, 2023 · 3 comments
Closed
3 tasks done

Pass SHA256 benchmark #143

aborg-dev opened this issue Dec 5, 2023 · 3 comments
Assignees

Comments

@aborg-dev
Copy link

aborg-dev commented Dec 5, 2023

SHA256 now compiles to ZK ASM and runs to completion after a hacky set of changes, but the result of execution is still incorrect.

The missing pieces right now are:

  • Global variables - these are declared in WAT file and live at specific memory offsets. We can replace them with ZK ASM Global variables and would need to detect the access to these offsets and replace them with loads/store from globals
  • Data segment (e.g. "hello world" string in SHA256 benchmark) - these are very similar to global variables - reads from a very large offset. But this time it's from a contiguous slice of memory, rather than discrete slots of globals - one way to handle these is to dedicate a memory region and fill it with data at the start of the program
  • Loads from frame pointer + offset - I'm not sure what these are, likely part of the function ABI and would have to use stack or registers instead of the frame. Right now these are commented out

Let's fix them!

Tasks

@aborg-dev
Copy link
Author

We now have fully working global variables and initial work for data segments (preamble generation).

For fully working data segments we need to implement a form of #43 and #110.

We also still need to select an implementation for frame pointer reads.

@aborg-dev
Copy link
Author

After the implementation for the frame pointers and fixes to stack handing, the benchmark now runs till completion, but still fails on the asserts: #185

I will try to simplify it next to make sure it consumes fewer cycles and is easier to debug.

@aborg-dev
Copy link
Author

#185 is now submitted and we finally pass SHA256 benchmark on main!

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

No branches or pull requests

1 participant