0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
615 stars 152 forks source link

Fix segment page alignment issue in metal prover #1281

Closed cf closed 2 months ago

cf commented 5 months ago

Describe your changes

  1. Added test_example_with_options to miden/src/examples/mod.rs to allow for custom proving options (ex. ProvingOptions::with_96_bit_security(true))
  2. Added a fibonacci test which uses ProvingOptions::with_96_bit_security(true)
  3. Fixed the page alignment issue in build_segments by implementing a custom build_aligned_segements which uses page_aligned_uninit_vector to allocate the segment data (instead of the uninit_vector function used in winterfell's [original implementation])(https://github.com/facebook/winterfell/blob/23eb7132c60ab4132eefbfac117fe1fc55f02171/prover/src/matrix/segments.rs#L67)

Original bug writeup: https://gist.github.com/cf/f5d582319d62ed0d7a7751c2001b6301/

bobbinth commented 3 months ago

@cf - thank you for flagging this! Sorry for not looking into it earlier - we were migrating from the ministark-based implementation to miden-gpu-based implementation over the last few weeks.

@TheMenko - is the issue brought up here fixed in #1310?

TheMenko commented 3 months ago

Ah, i forgot about this issue. I just tested it with miden-gpu and the bug is still present @bobbinth

bobbinth commented 3 months ago

@cf - I just merged #1310 into the next branch. Would you be able to rebase your PR from the latest next?

bobbinth commented 2 months ago

Superseded by #1353.