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

Degree >2 expression in JALR #502

Closed
kunxian-xia opened this issue Oct 30, 2024 · 6 comments · Fixed by #504
Closed

Degree >2 expression in JALR #502

kunxian-xia opened this issue Oct 30, 2024 · 6 comments · Fixed by #504
Assignees
Labels
bug Something isn't working

Comments

@kunxian-xia
Copy link
Collaborator

kunxian-xia commented Oct 30, 2024

You can reproduce this issue by running the cmd in the feat/guest-example branch

RUST_LOG=info cargo run --release --example fibonacci_elf -- --nocapture  

to see the error msg

thread 'main' panicked at /Users/xkx/GKR/ceno/sumcheck/src/prover_v2.rs:546:26:
not implemented: do not support degree > 3
@kunxian-xia kunxian-xia added the bug Something isn't working label Oct 30, 2024
@kunxian-xia
Copy link
Collaborator Author

I think this bug is triggered by the constraints below.

circuit_builder.require_zero(
|| "overflow_0_or_pm1",
overflow.expr() * (overflow.expr() - 1) * (overflow.expr() + 1),
)?;

@matthiasgoergens
Copy link
Collaborator

Can we add a check for constraint degree as part of the normal tests you get with cargo make tests, please?

@matthiasgoergens
Copy link
Collaborator

I think this bug is triggered by the constraints below.

circuit_builder.require_zero(
|| "overflow_0_or_pm1",
overflow.expr() * (overflow.expr() - 1) * (overflow.expr() + 1),
)?;

Hmm, but that only looks like a cubic expression to me? Are you sure it's that one?

@hero78119
Copy link
Collaborator

There are 2 possible quick approach

  1. commit one extra column and reduce degree, let say "overflow_tmp" and 2 constrains "req_zero(overflow_tmp - (overflow) * (1-overflow))", "req_zero((overflow +1) * (overflow_tmp))" is sufficient with overall <=3 degree

one extra degree come from 'eq' function

  1. resolve/redesign circuit and see whether we can avoid "-1" logic

I think opt 1 is easier with minimal cost, opt 2 is even better

@kunxian-xia
Copy link
Collaborator Author

kunxian-xia commented Oct 30, 2024

I think this bug is triggered by the constraints below.

circuit_builder.require_zero(
|| "overflow_0_or_pm1",
overflow.expr() * (overflow.expr() - 1) * (overflow.expr() + 1),
)?;

Hmm, but that only looks like a cubic expression to me? Are you sure it's that one?

@matthiasgoergens The actual expression that is proved by sumcheck looks like 0 = \sum_b expr(b) * sel(b). Therefore its degree equals to expr.deg() + 1.

@kunxian-xia kunxian-xia changed the title Degree >3 expression in JALR Degree >2 expression in JALR Oct 30, 2024
@matthiasgoergens
Copy link
Collaborator

Thanks, that makes sense.

@naure naure self-assigned this Oct 30, 2024
@naure naure mentioned this issue Oct 30, 2024
@naure naure linked a pull request Oct 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants