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

[Super Issue] Ceno-ZKVM V2 #95

Open
79 of 93 tasks
hero78119 opened this issue Aug 6, 2024 · 3 comments
Open
79 of 93 tasks

[Super Issue] Ceno-ZKVM V2 #95

hero78119 opened this issue Aug 6, 2024 · 3 comments

Comments

@hero78119
Copy link
Collaborator

hero78119 commented Aug 6, 2024

This is a super issue to track relevant sub issues of zkVM tasks.

@hero78119 hero78119 changed the title Ceno-ZKVM Tasks Breakdown [Super Issue] Ceno-ZKVM V2 Aug 6, 2024
@kunxian-xia
Copy link
Collaborator

The number of execution traces running the following Fibonacci program (compiled by SP1 rust toolchain) is around 12.5M (12587994).

Fibonacci rust program computing $2^{20}$-th fibonacci number
pub fn main() {
    // Compute the n'th fibonacci number, using normal Rust code.
    let mut a = 0_u32;
    let mut b = 1_u32;
    let n = 1 << 20_u32;
    for _ in 0..n {
        let mut c = a + b;
        c %= 7919; // Modulus to prevent overflow.
        a = b;
        b = c;
    }

    sp1_zkvm::io::commit(&a);
    sp1_zkvm::io::commit(&b);
}

And we report the instruction / syscall counts here.

instruction type count
BNE Branching 1048598
BLTU Branching 25
BEQ Branching 20
BGEU Branching 13
BLT Branching 1
ADD ALU 5243955
SUB ALU 2097163
MUL ALU 1048578
MULHU ALU 1048576
SRL ALU 2097844
XOR ALU 706
OR ALU 687
SLL ALU 676
AND ALU 240
SLTU ALU 7
DIVU ALU 1
LW Memory 363
SW Memory 337
LBU Memory 102
SB Memory 21
JALR Control Flow 33
AUIPC Control Flow 20
JAL Control Flow 9
Ecall + Halt Ecall 1
Ecall + Commit Ecall 8
Ecall + Commit_deferred_proofs Ecall 8

@kunxian-xia
Copy link
Collaborator

kunxian-xia commented Oct 14, 2024

The table below lists opcodes that occur in the execution of several example programs.

  • ✅: means that opcode occurs in the execution.
  • ❌: means that opcode does not occur in the execution.
category instruction fibonacci rsa regex ssz-withdrawal tendermint light client
ALU add
sub
and
or
xor
sll
srl
sra
slt
sltu
ALU (M extension) mul
mulhu
mulh
mulhsu
div
divu
rem
remu
Branch beq
bltu
bne
bgeu
blt
bge
Memory Access sw
lw
sb
lb
lbu
sh
lh
lhu
Jump jal
jalr
U-type auipc
lui
syscall ecall/halt

@naure naure unpinned this issue Nov 2, 2024
@naure naure pinned this issue Nov 2, 2024
@naure naure unpinned this issue Nov 13, 2024
@naure naure pinned this issue Nov 13, 2024
@hero78119
Copy link
Collaborator Author

circuit statistics
#585 (comment)

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