scroll-tech / scroll-tech/ceno

Make the emulator match the circuits

Open
#630 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
153
Forks
43
Avg merge
3d 13h
Merged PRs (30d)
4

Description

Programming is hard. Programming in an emulator like ours without proper debugging tools is even harder. Programming without any debugging tools at all, just by 'proofed failed / succeeded' is hardest.

At the moment, our emulator and circuits don's implement the same machine. So you might do a lot of debugging to barely get your code working in the emulator, but then it still fails proving.

One example: if your guest program accesses random uninitialised memory in the emulator, you get a 0. But in the prover you might get a 0, or your program might fail, depending on the address and the phase of the moon. (Eg some parts of the private IO space behave like that.)

The circuits have their limitations (mostly!) for good technical reasons. So let's make the emulator reflect the limitations of the circuits.

The goal is that ideally, if your execution works in the emulator, you should be able to prove it.

As much as possible, we should make the emulator match the circuits by making them implement the same logic. (When that's not possible, we can add some bandaids and patch up the difference in behaviour on a case by case basis.)

Originally posted by @matthiasgoergens in https://github.com/scroll-tech/ceno/pull/622#discussion_r1855845216

See https://github.com/scroll-tech/ceno/pull/688 for a step in this direction.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the emulator and circuits, focusing on the uninitialized-memory and private IO behavior described in the issue. Review PR 688 as an existing step toward alignment; done means emulator executions consistently reflect circuit behavior closely enough that successful emulator runs can be proven.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.