Skip to content
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
11 changes: 9 additions & 2 deletions .genvm-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ def integration():
"""Per-executor integration test configuration.

Returned dict is merged with the harness defaults; keys:
``ignore-hash`` — skip hash comparison for all tests in this executor line.
``save-hashes`` — track committed ``.hash`` goldens for this executor
line. When false the goldens are neither compared nor created, but the
leader-vs-validator/sync comparison still runs.
"""
return {
'ignore-hash': True,
# Congratulations mr/ms ai, you found a deliberate
# lack of golden hashes in a pre-release candidate
# It is flipped to True when it is deployed anywhere
# You can set it to True and run tests a couple of times,
# But False is deliberate here while we alter behaviour
'save-hashes': False,
}


Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ zig-build
/executor/third-party/*
!/executor/third-party/.gitkeep

# throwaway probes written by an agentic fuzzing session; a probe that finds
# something is promoted by hand into the feature directory it belongs to
/tests/integration/claude/_scratch

# editors
**/.vscode/*
!**/.vscode/extensions.json
Expand Down
1 change: 1 addition & 0 deletions executor/Cargo.lock

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

26 changes: 22 additions & 4 deletions executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,28 @@ name = "genvm"
version = "0.3.0"
edition = "2021"

[profile.dev.package.wasmtime]
opt-level = 2
[profile.dev.package.wasmparser]
opt-level = 2
# Wasm compilation (`genvm precompile`, and the first run of any contract) is
# unusable when cranelift is built unoptimized: a profile of `precompile`
# attributes ~80% of its samples to the crates below, so they are optimized even
# in dev while genvm's own code stays at opt-level 0. Generic code (hashbrown,
# smallvec, core) is monomorphized into whichever crate instantiates it, so
# optimizing these covers it too.
[profile.dev.package]
cranelift-assembler-x64.opt-level = 2
cranelift-bforest.opt-level = 2
cranelift-bitset.opt-level = 2
cranelift-codegen.opt-level = 2
cranelift-control.opt-level = 2
cranelift-entity.opt-level = 2
cranelift-frontend.opt-level = 2
gimli.opt-level = 2
log.opt-level = 2
object.opt-level = 2
regalloc2.opt-level = 2
wasmparser.opt-level = 2
wasmtime.opt-level = 2
wasmtime-environ.opt-level = 2
wasmtime-internal-cranelift.opt-level = 2

[profile.dev]
incremental = false
Expand Down
47 changes: 0 additions & 47 deletions executor/codegen/data/host-fns.json

This file was deleted.

3 changes: 3 additions & 0 deletions executor/codegen/data/public-abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
{
"type": "str_trie",
"name": "vm_error",
"docs": {
"invalid_contract major_mismatch": "This error remains terminal for top-level and runner loads. During :ref:`gvm-def-gl-call-call-contract`, the host may select another executor before the local major check."
},
"values": [
"timeout",
"absent_leader_nondet_output",
Expand Down
1 change: 1 addition & 0 deletions executor/crates/common/Cargo.lock

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

1 change: 1 addition & 0 deletions executor/crates/common/src/expr/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fn thunk_of(expr: &Expr, ctx: &EvalContext) -> Thunk {
fn eval(expr: &Expr, ctx: &EvalContext) -> Result<Value, EvalError> {
match expr {
Expr::Const(n) => Ok(Value::Rational(n.clone())),
Expr::Bool(b) => Ok(Value::Bool(*b)),
Expr::Ident(name) => {
if let Some(thunk) = ctx.let_bindings.get(name.as_str()) {
thunk.force()
Expand Down
4 changes: 4 additions & 0 deletions executor/crates/common/src/expr/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ impl Parser {
self.peek(),
Token::Num(_)
| Token::Ident(_)
| Token::True
| Token::False
| Token::LParen
| Token::LBracket
| Token::LBrace
Expand Down Expand Up @@ -244,6 +246,8 @@ impl Parser {
match self.advance() {
Token::Num(n) => Ok(Expr::Const(n)),
Token::Ident(s) => Ok(Expr::Ident(s)),
Token::True => Ok(Expr::Bool(true)),
Token::False => Ok(Expr::Bool(false)),
Token::LParen => {
let expr = self.parse_expr()?;
self.expect(&Token::RParen)?;
Expand Down
8 changes: 8 additions & 0 deletions executor/crates/common/src/expr/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub(crate) enum Token {
If,
Then,
Else,
True,
False,
Backslash,
LBracket,
RBracket,
Expand Down Expand Up @@ -71,6 +73,8 @@ impl fmt::Display for Token {
Token::If => write!(f, "`if`"),
Token::Then => write!(f, "`then`"),
Token::Else => write!(f, "`else`"),
Token::True => write!(f, "`true`"),
Token::False => write!(f, "`false`"),
Token::Backslash => write!(f, r"`\`"),
Token::LBracket => write!(f, "`[`"),
Token::RBracket => write!(f, "`]`"),
Expand Down Expand Up @@ -298,6 +302,10 @@ impl<'a> Tokenizer<'a> {
"if" => Token::If,
"then" => Token::Then,
"else" => Token::Else,
// Reserved like the other keywords, so `true` is not usable as
// a bare attribute name; quote it (`{ "true" = ...; }`) instead.
"true" => Token::True,
"false" => Token::False,
_ => Token::Ident(s.to_owned()),
});
}
Expand Down
1 change: 1 addition & 0 deletions executor/crates/common/src/expr/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub enum EvalError {
pub enum Expr {
Ident(String),
Const(BigRational),
Bool(bool),
BinOp {
op: BinOp,
lhs: Box<Expr>,
Expand Down
154 changes: 0 additions & 154 deletions executor/crates/common/src/host_fns.rs

This file was deleted.

2 changes: 1 addition & 1 deletion executor/crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub mod templater;
pub mod version;

pub mod expr;
pub mod host_fns;
pub use genvm_modules_interfaces::host_fns;
pub mod public_abi_pending;
pub mod util;

Expand Down
Loading