Skip to content
This repository was archived by the owner on Oct 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions circuits/src/register/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ where
/// Generates the trace for registers.
///
/// There are 3 steps:
/// 1) populate the trace with a similar layout as the
/// [`RegisterInit` table](crate::registerinit::columns),
/// 2) go through the program and extract all ops that act on registers,
/// filling up this table,
/// 1) populate the trace with a similar layout as the [`RegisterInit`
/// table](crate::registerinit::columns),
/// 2) go through the program and extract all ops that act on registers, filling
/// up this table,
/// 3) pad with dummy rows (`is_used` == 0) to ensure that trace is a power of
/// 2.
#[allow(clippy::type_complexity)]
Expand Down
5 changes: 5 additions & 0 deletions examples-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ repository = "https://github.com/0xmozak/mozak-vm"
version = "0.1.0"

[features]
bss-tester = []
empty = []
fibonacci = []
inputtape = []
inputtapebin = []
memory-access = []
min-max = []
mozak-sort = []
Expand All @@ -21,4 +23,7 @@ rkyv-serialization = []
sha2 = []
static-mem-access = []
token = []
# Not sure whether token, tokenbin, wallet and walletbin should all be here, or whether we forget cleaning them up in recent renames?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether token, tokenbin, wallet and walletbin should all be here, or whether we forget cleaning them up in recent renames?

@supragya You recently did some renames / cleanups here. Do you have an opinion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those should be needed for testing I hope?

tokenbin = []
wallet = []
walletbin = []
46 changes: 20 additions & 26 deletions examples-builder/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,28 @@ const CRATES: &[Crate] = &[
const CARGO_MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR");

fn build_elf(dest: &mut File, crate_path: &str, elf_path: &str, glob_name: &str, uses_std: bool) {
// Use a dummy array for clippy, since not building the elf is faster than
// building the elf
if cfg!(feature = "cargo-clippy") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Daniel-Aaron-Bloom The new version's linter doesn't like this. Do you know whether this ever worked (and perhaps how to repair it)?

writeln!(dest, r#"pub const {glob_name}: &[u8] = &[];"#)
let args = if uses_std {
vec!["build", "--release", "--features=std"]
} else {
let args = if uses_std {
vec!["build", "--release", "--features=std"]
} else {
vec!["build", "--release"]
};
let output = Command::new("cargo")
.args(args)
.current_dir(crate_path)
.env_clear()
.envs(std::env::vars().filter(|x| !x.0.starts_with("CARGO_")))
.output()
.expect("cargo command failed to run");
if !output.status.success() {
io::stdout().write_all(&output.stdout).unwrap();
io::stderr().write_all(&output.stderr).unwrap();
panic!("cargo build {crate_path} failed.");
}
writeln!(
dest,
r#"pub const {glob_name}: &[u8] =
include_bytes!(r"{CARGO_MANIFEST_DIR}/{elf_path}");"#
)
vec!["build", "--release"]
};
let output = Command::new("cargo")
.args(args)
.current_dir(crate_path)
.env_clear()
.envs(std::env::vars().filter(|x| !x.0.starts_with("CARGO_")))
.output()
.expect("cargo command failed to run");
if !output.status.success() {
io::stdout().write_all(&output.stdout).unwrap();
io::stderr().write_all(&output.stderr).unwrap();
panic!("cargo build {crate_path} failed.");
}
writeln!(
dest,
r#"pub const {glob_name}: &[u8] =
include_bytes!(r"{CARGO_MANIFEST_DIR}/{elf_path}");"#
)
.expect("failed to write vars.rs");

println!("cargo:rerun-if-changed={crate_path}");
Expand Down
3 changes: 3 additions & 0 deletions examples/bss-tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ version = "0.1.0"
[dependencies]
mozak-sdk = { path = "../../sdk", default-features = false }

[features]
std = []

[[bin]]
name = "bss-tester"
path = "main.rs"
3 changes: 3 additions & 0 deletions examples/empty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ version = "0.1.0"
[dependencies]
mozak-sdk = { path = "../../sdk", default-features = false }

[features]
std = []

[[bin]]
name = "empty"
path = "main.rs"
5 changes: 4 additions & 1 deletion examples/mozak-sort/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ version = "0.1.0"

[dependencies]
mozak-sdk = { path = "../../sdk", default-features = false }
rand = { version = "0.8", default_features = false, features = ["alloc", "small_rng"] }
rand = { version = "0.8", default-features = false, features = ["alloc", "small_rng"] }

[features]
std = []

[[bin]]
name = "mozak-sort"
Expand Down
4 changes: 2 additions & 2 deletions expr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
//!
//! - [ ] TODO: support `|` via multiplication.
//! - [ ] TODO support `&` via distributive law, and integration with constraint
//! builder. (a & b) | c == (a | c) & (b | c) == [(a | c), (b | c)] where [..]
//! means split into multiple constraints.
//! builder. (a & b) | c == (a | c) & (b | c) == [(a | c), (b | c)] where [..]
//! means split into multiple constraints.

pub mod ops;

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-04-24"
channel = "nightly-2024-05-27"
components = ["rustfmt", "rust-src", "clippy"]
profile = "minimal"
2 changes: 2 additions & 0 deletions sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#![allow(clippy::missing_panics_doc)]
#![feature(trait_alias)]
#![deny(warnings)]
// To allow `target_os = "mozakvm"` cfg on native, when the defining json file ain't available.
#![allow(unexpected_cfgs)]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "std", feature(restricted_std))]

Expand Down