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

Mock prover assert_satisfied_par always fails with "cell not assigned" #32

Open
nulltea opened this issue Feb 2, 2024 · 2 comments
Open

Comments

@nulltea
Copy link

nulltea commented Feb 2, 2024

If a circuit builder has at least one relation between cells (e.g. addition, etc), the MockProver::assert_satisfied_par() fails with the errors bellow. The assert_satisfied() method works without an issue.

Total 1 fixed cells
Total range check advice cells to lookup per phase: [0, 0, 0]
error: cell not assigned

  Cell layout in region 'BaseCircuitBuilder generated circuit':
    | Offset | A0 |
    +--------+----+
    |    1   |  X | <--{ X marks the spot! 🦜
    |    2   | x1 |
    |    3   | x2 |
    |    4   | x3 |

  Gate '1 column a + b * c = out' (applied at offset 1) queries these cells.

error: cell not assigned

  Cell layout in region 'BaseCircuitBuilder generated circuit':
    | Offset | A0 |
    +--------+----+
    |    1   | x0 |
    |    2   |  X | <--{ X marks the spot! 🦜
    |    3   | x2 |
    |    4   | x3 |

  Gate '1 column a + b * c = out' (applied at offset 1) queries these cells.

thread 'sync_step_circuit::tests::test_step_circuit' panicked at /Users/timofey/.cargo/registry/src/index.crates.io-6f17d22bba15001f/halo2-axiom-0.4.2/src/dev.rs:1571:13:
circuit was not satisfied
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test sync_step_circuit::tests::test_step_circuit ... FAILED
@nulltea nulltea changed the title Mock prover assert_satisfied_par always fail "cell not assigned" Mock prover assert_satisfied_par always fails with "cell not assigned" Feb 2, 2024
@jonathanpwang
Copy link
Collaborator

Good catch! We have not been using any of the parallel assignment APIs, so we didn't catch this. The reason is likely because we turned off all offset calculations in the Layouter so when you parallel assign it will just assign different regions all overlapping without offsets.

I am not sure how to fix this without needing to call assign_region twice everywhere -- but it's been on my mind as something to try to resolve.

@nulltea
Copy link
Author

nulltea commented Feb 5, 2024

Yes, it's not a critical one, but it's good to have an issue for visibly in case someone will encounter this.

nulltea added a commit to ChainSafe/Spectre that referenced this issue Feb 5, 2024
jonathanpwang pushed a commit that referenced this issue Jul 19, 2024
Add new api `assign_regions` to enable parallel synthesize of regions
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