Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
77c43d1
repr(C) StepRecord
Velaciela Mar 4, 2026
ac2bf54
fix
Velaciela Mar 4, 2026
f550783
witgen: add
Velaciela Mar 3, 2026
5a10916
witgen: lw
Velaciela Mar 3, 2026
07360f8
witgen: integration
Velaciela Mar 3, 2026
9b673ca
minor
Velaciela Mar 3, 2026
35154b1
fmt
Velaciela Mar 3, 2026
2d82306
minor
Velaciela Mar 3, 2026
65985ff
dev-local
Velaciela Mar 3, 2026
0f96033
GPU: AOS StepRecord
Velaciela Mar 4, 2026
4fc7368
SHARD_STEPS_DEVICE
Velaciela Mar 4, 2026
72dd155
batch-1234
Velaciela Mar 5, 2026
273cf7c
batch-5,12
Velaciela Mar 5, 2026
31697bf
batch-6-shift
Velaciela Mar 5, 2026
707ea1d
batch-8,9-slt
Velaciela Mar 5, 2026
3fcc70e
test: orrectness
Velaciela Mar 5, 2026
7191624
batch-10,11-branch
Velaciela Mar 5, 2026
1b6f346
batch-13-JALR
Velaciela Mar 6, 2026
107f72f
batch-14-SW
Velaciela Mar 6, 2026
4ac98ab
batch-15-SH,SB
Velaciela Mar 6, 2026
3b9e4b5
batch-16-LH,LB
Velaciela Mar 6, 2026
32c0acb
batch-17-MUL
Velaciela Mar 6, 2026
cb48e7a
batch-18-DIV
Velaciela Mar 6, 2026
6c43c6a
dev: non-witgen-overlap
Velaciela Mar 6, 2026
4ba08c0
test coverage: compare all column
Velaciela Mar 6, 2026
e943735
test coverage: edge cases
Velaciela Mar 6, 2026
bcdc2a3
gpu witgen: col-major
Velaciela Mar 6, 2026
1e21d37
phase5
Velaciela Mar 8, 2026
8307ba1
shard-1
Velaciela Mar 12, 2026
a24c51c
phase6-2: dispatch all 22 GPU kinds with shard metadata + enable all …
Velaciela Mar 12, 2026
45a359e
fa_sort
Velaciela Mar 12, 2026
e539505
perf-preflight
Velaciela Mar 13, 2026
12cd5ee
shardram: ec
Velaciela Mar 13, 2026
4cd7281
api
Velaciela Mar 13, 2026
2974a8a
debug
Velaciela Mar 13, 2026
018ad73
perf
Velaciela Mar 13, 2026
39078ce
profile
Velaciela Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 110 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ lto = "thin"
#ceno_crypto_primitives = { path = "../ceno-patch/crypto-primitives", package = "ceno_crypto_primitives" }
#ceno_syscall = { path = "../ceno-patch/syscall", package = "ceno_syscall" }

#[patch."https://github.com/scroll-tech/ceno-gpu-mock.git"]
#ceno_gpu = { path = "../ceno-gpu/cuda_hal", package = "cuda_hal", default-features = false, features = ["bb31"] }
[patch."https://github.com/scroll-tech/ceno-gpu-mock.git"]
ceno_gpu = { path = "../ceno-gpu/cuda_hal", package = "cuda_hal", default-features = false, features = ["bb31"] }

#[patch."https://github.com/scroll-tech/gkr-backend"]
#ff_ext = { path = "../gkr-backend/crates/ff_ext", package = "ff_ext" }
Expand Down
4 changes: 3 additions & 1 deletion ceno_emul/src/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ pub type Word = u32;
pub type SWord = i32;
pub type Addr = u32;
pub type Cycle = u64;
pub type RegIdx = usize;
pub type RegIdx = u8;

#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[repr(C)]
pub struct ByteAddr(pub u32);

#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
pub struct WordAddr(pub u32);

impl From<ByteAddr> for WordAddr {
Expand Down
41 changes: 22 additions & 19 deletions ceno_emul/src/disassemble/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::rv32im::{InsnKind, Instruction};
use crate::{
addr::RegIdx,
rv32im::{InsnKind, Instruction},
};
use itertools::izip;
use rrs_lib::{
InstructionProcessor,
Expand All @@ -19,9 +22,9 @@ impl Instruction {
pub const fn from_r_type(kind: InsnKind, dec_insn: &RType, raw: u32) -> Self {
Self {
kind,
rd: dec_insn.rd,
rs1: dec_insn.rs1,
rs2: dec_insn.rs2,
rd: dec_insn.rd as RegIdx,
rs1: dec_insn.rs1 as RegIdx,
rs2: dec_insn.rs2 as RegIdx,
imm: 0,
raw,
}
Expand All @@ -32,8 +35,8 @@ impl Instruction {
pub const fn from_i_type(kind: InsnKind, dec_insn: &IType, raw: u32) -> Self {
Self {
kind,
rd: dec_insn.rd,
rs1: dec_insn.rs1,
rd: dec_insn.rd as RegIdx,
rs1: dec_insn.rs1 as RegIdx,
imm: dec_insn.imm,
rs2: 0,
raw,
Expand All @@ -45,8 +48,8 @@ impl Instruction {
pub const fn from_i_type_shamt(kind: InsnKind, dec_insn: &ITypeShamt, raw: u32) -> Self {
Self {
kind,
rd: dec_insn.rd,
rs1: dec_insn.rs1,
rd: dec_insn.rd as RegIdx,
rs1: dec_insn.rs1 as RegIdx,
imm: dec_insn.shamt as i32,
rs2: 0,
raw,
Expand All @@ -59,8 +62,8 @@ impl Instruction {
Self {
kind,
rd: 0,
rs1: dec_insn.rs1,
rs2: dec_insn.rs2,
rs1: dec_insn.rs1 as RegIdx,
rs2: dec_insn.rs2 as RegIdx,
imm: dec_insn.imm,
raw,
}
Expand All @@ -72,8 +75,8 @@ impl Instruction {
Self {
kind,
rd: 0,
rs1: dec_insn.rs1,
rs2: dec_insn.rs2,
rs1: dec_insn.rs1 as RegIdx,
rs2: dec_insn.rs2 as RegIdx,
imm: dec_insn.imm,
raw,
}
Expand Down Expand Up @@ -231,7 +234,7 @@ impl InstructionProcessor for InstructionTranspiler {
fn process_jal(&mut self, dec_insn: JType) -> Self::InstructionResult {
Instruction {
kind: InsnKind::JAL,
rd: dec_insn.rd,
rd: dec_insn.rd as RegIdx,
rs1: 0,
rs2: 0,
imm: dec_insn.imm,
Expand All @@ -242,8 +245,8 @@ impl InstructionProcessor for InstructionTranspiler {
fn process_jalr(&mut self, dec_insn: IType) -> Self::InstructionResult {
Instruction {
kind: InsnKind::JALR,
rd: dec_insn.rd,
rs1: dec_insn.rs1,
rd: dec_insn.rd as RegIdx,
rs1: dec_insn.rs1 as RegIdx,
rs2: 0,
imm: dec_insn.imm,
raw: self.word,
Expand All @@ -265,7 +268,7 @@ impl InstructionProcessor for InstructionTranspiler {
// See [`InstructionTranspiler::process_auipc`] for more background on the conversion.
Instruction {
kind: InsnKind::ADDI,
rd: dec_insn.rd,
rd: dec_insn.rd as RegIdx,
rs1: 0,
rs2: 0,
imm: dec_insn.imm,
Expand All @@ -276,7 +279,7 @@ impl InstructionProcessor for InstructionTranspiler {
{
Instruction {
kind: InsnKind::LUI,
rd: dec_insn.rd,
rd: dec_insn.rd as RegIdx,
rs1: 0,
rs2: 0,
imm: dec_insn.imm,
Expand Down Expand Up @@ -311,7 +314,7 @@ impl InstructionProcessor for InstructionTranspiler {
// real world scenarios like a `reth` run.
Instruction {
kind: InsnKind::ADDI,
rd: dec_insn.rd,
rd: dec_insn.rd as RegIdx,
rs1: 0,
rs2: 0,
imm: dec_insn.imm.wrapping_add(pc as i32),
Expand All @@ -322,7 +325,7 @@ impl InstructionProcessor for InstructionTranspiler {
{
Instruction {
kind: InsnKind::AUIPC,
rd: dec_insn.rd,
rd: dec_insn.rd as RegIdx,
rs1: 0,
rs2: 0,
imm: dec_insn.imm,
Expand Down
5 changes: 3 additions & 2 deletions ceno_emul/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pub use platform::{CENO_PLATFORM, Platform};
mod tracer;
pub use tracer::{
Change, FullTracer, FullTracerConfig, LatestAccesses, MemOp, NextAccessPair, NextCycleAccess,
PreflightTracer, PreflightTracerConfig, ReadOp, ShardPlanBuilder, StepCellExtractor, StepIndex,
PackedNextAccessEntry, PreflightTracer, PreflightTracerConfig, ReadOp, ShardPlanBuilder,
StepCellExtractor, StepIndex,
StepRecord, Tracer, WriteOp,
};

Expand All @@ -34,7 +35,7 @@ pub use syscalls::{
BN254_FP_MUL, BN254_FP2_ADD, BN254_FP2_MUL, KECCAK_PERMUTE, SECP256K1_ADD,
SECP256K1_DECOMPRESS, SECP256K1_DOUBLE, SECP256K1_SCALAR_INVERT, SECP256R1_ADD,
SECP256R1_DECOMPRESS, SECP256R1_DOUBLE, SECP256R1_SCALAR_INVERT, SHA_EXTEND, SyscallSpec,
UINT256_MUL,
SyscallWitness, UINT256_MUL,
bn254::{
BN254_FP_WORDS, BN254_FP2_WORDS, BN254_POINT_WORDS, Bn254AddSpec, Bn254DoubleSpec,
Bn254Fp2AddSpec, Bn254Fp2MulSpec, Bn254FpAddSpec, Bn254FpMulSpec,
Expand Down
4 changes: 2 additions & 2 deletions ceno_emul/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Platform {
/// Virtual address of a register.
pub const fn register_vma(index: RegIdx) -> Addr {
// Register VMAs are aligned, cannot be confused with indices, and readable in hex.
(index << 8) as Addr
(index as Addr) << 8
}

/// Register index from a virtual address (unchecked).
Expand Down Expand Up @@ -220,7 +220,7 @@ mod tests {
// Registers do not overlap with ROM or RAM.
for reg in [
Platform::register_vma(0),
Platform::register_vma(VMState::<PreflightTracer>::REG_COUNT - 1),
Platform::register_vma((VMState::<PreflightTracer>::REG_COUNT - 1) as RegIdx),
] {
assert!(!p.is_rom(reg));
assert!(!p.is_ram(reg));
Expand Down
Loading
Loading