Expand description
Shared harness for nub’s benchmarks and end-to-end tests.
Every program in nub/programs is cross-compiled and linked by this
crate’s build.rs, then exposed here as a decoded
ProgramBlob. Both the criterion benches and the conformance
tests drive the same list, so a new program is one line away from
being both measured and checked.
Structs§
- Program
- One benchmark program: its name, its linked blob, and the
(return_value, gas_used)its endpoint 0 must produce.
Constants§
- BENCH_
GAS - Gas ceiling for a benchmark run.
i64::MAX, notu64::MAX: the JIT’s gas counter is ani64and it detects exhaustion by sign, so au64::MAXbudget would present as already-negative. - EXIT_
HOST_ CALL - Clean-halt exit reason:
nub-rt’s endpoint trampoline ends in a bareecall, which the linker rewrites tocustom-0 ecalli imm=0and the engine surfaces asHostCall(0). - FLAT_
GUEST_ BLOB_ PATH - Path to the flat personality’s guest ELF, built by this crate’s
build.rs. - PROGRAMS
- Every program, in a stable order.
Functions§
- flat_
sandbox - A process-wide
Nub<Flat>over the KVM sandbox. - run_
interpreter - Run endpoint 0 of
blobon the interpreter, returning(return_value, gas_used).