a16z / jolt

The simplest and most extensible zkVM. Fast and fully open source from a16z crypto and friends. ⚡
https://jolt.a16zcrypto.com
MIT License
580 stars 105 forks source link

Bug report: Memory/Instruction decoding #391

Closed benoitrazet closed 2 weeks ago

benoitrazet commented 3 weeks ago

We are encountering a bug while developing a matrix multiplication example, which causes the program to crash when the size of the square matrix is set to be greater than or equal to 19. This issue appears to be related to the program encountering a compressed RISC-V instruction.

Steps to reproduce the bug:

Clone the repository and checkout the relevant branch

git clone https://github.com/benoitrazet/jolt.git
cd jolt
git checkout bug/matmul-compressed-instr

Run the matrix multiplication exampke:

cargo run -p matmul

Change the value of N here to toggle the bug.

The expected behavior is that it should run successfully without any crash.

The actual behavior is that the program crashes when the matrix size N is set to 19 or greater.

Thanks to @jprider63 for helping with the initial troubleshooting of this issue.

moodlezoup commented 2 weeks ago

Try increasing the stack size (#[jolt::provable(stack_size = 100000)])

Created an issue for more descriptive errors here