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

CPU chip: failure to satisfy LOADFP output constraint #132

Open
morganthomas opened this issue Mar 26, 2024 · 0 comments
Open

CPU chip: failure to satisfy LOADFP output constraint #132

morganthomas opened this issue Mar 26, 2024 · 0 comments
Assignees

Comments

@morganthomas
Copy link
Collaborator

On an example in the Valida LLVM compiler test suite, the trace fails to satisfy a particular constraint of the CPU chip, in cpu/src/stark.rs:

builder
    .when(is_loadfp)
    .assert_eq(local.fp, reduce::<AB>(base, local.write_value()));

This file compiles into the following assembly code:

IMM32 -8, 0, 0, 0, 0
JAL -4, 1e0, 0, 1, 1
IMM32 -8, 0, 0, 0, 14
JAL -10, 90, -14, 1, 1
STOP 0, 0, 0, 0, 0
JALV -4, 4, c, 0, 0
IMM32 -10, 0, 0, 0, 0
ADD32 -4, -10, 0, 0, 1
IMM32 -14, 0, 0, 0, 5
ADD32 -8, -14, 0, 0, 1
a -18, -8, 0, 1, 1
ADD32 -c, -18, 0, 0, 1
ADD32 -1c, -c, 0, 0, 1
BEQ 198, -1c, 0, 0, 1
BEQ 168, 4, 4, 0, 0
BEQ 180, 4, 4, 0, 0
BEQ 180, 4, 4, 0, 0
IMM32 -20, 0, 0, 0, 0
ADD32 8, -20, 0, 0, 1
JALV -4, 4, c, 0, 0
IMM32 4, 0, 0, 0, 0
JALV 0, -4, -8, 0, 0

The following is the result of trying to prove an execution of this program:

Proof successful
thread 'main' panicked at /home/morgan/code/lita/issue/completeness/valida/basic/src/lib.rs:54:10:
Failed to verify constraints on chip 0: OodEvaluationMismatch
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

When the mentioned constraint is commented out, then proving succeeds and results in a verifiable proof of execution for this example.

Produce a minimal example which exhibits the issue. Fix the issue. Add a regression test to the test suite which verifies the proof of an execution of a minimal example which exhibits the issue.

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

2 participants