Closed raphaelDkhn closed 5 months ago
I think this is expected
behaviour coz the proof mode is adding infinite loop
at the end of the program to fill trace
to the closest power of two
. It should jump up to next power of two if u supply really big fib num.
Power of two sized trace is required in proof mode coz it is needed for FFT
to work on the prover side.
Regular execution is not adding this kind of stuff so it behaves more naturally.
Afaik :)
I think this is
expected
behaviour coz the proof mode is addinginfinite loop
at the end of the program tofill trace
to the closestpower of two
. It should jump up to next power of two if u supply really big fib num. Power of two sized trace is required in proof mode coz it is needed forFFT
to work on the prover side. Regular execution is not adding this kind of stuff so it behaves more naturally. Afaik :)
Thanks for your answer @Okm165, pretty clear!
I am encountering a bug where the step count remains constant in
proof_mode
, regardless of the input, when executing a Fibonacci program in Cairo1.Steps to Reproduce:
fn main(n: felt252) -> felt252 { let result = fib(1, 1, n); result }
fn fib(a: felt252, b: felt252, n: felt252) -> felt252 { match n { 0 => a, _ => fib(b, a + b, n - 1), } }
$ cargo run ./programs/fib.sierra.json --layout all_cairo --args '50'
$ cargo run ./programs/fib.sierra.json --layout all_cairo --args '50' --proof_mode
It appears that in proof mode, the number of steps is consistently 32,768 regardless of the number of iterations in the Fibonacci function.
Expected Behavior:
The number of steps should vary based on the input parameter n, similar to the behavior observed without proof mode.
Actual Behavior:
In proof mode, the number of steps remains constant at 32,768 for any input.
Version/Commit:
I am on commit c5839fd.
Additional Context:
Similar behavior has been detected on more complex programs. I suspect that the origin of this bug causes fake proofs when trace/memory files are submitted to Platinum, as the proof time is too fast, even on very complex programs.