438 lines
18 KiB
Rust
438 lines
18 KiB
Rust
use prometeu_bytecode::load_limits::{LoadBudget, LoadCode as C, LoadReason as R};
|
|
use prometeu_bytecode::{
|
|
TRAP_DIV_ZERO, TRAP_NON_FINITE as NON_FINITE, TRAP_NUMERIC_DOMAIN as DOMAIN,
|
|
TRAP_NUMERIC_RANGE as RANGE, TRAP_TYPE, Value, assemble,
|
|
};
|
|
use prometeu_hal::vm_fault::VmFault;
|
|
use prometeu_test_support::program::TestProgram;
|
|
use prometeu_vm::resource_budget::RuntimeLimits;
|
|
use prometeu_vm::{
|
|
HostContext, HostReturn, IntrinsicExecutionError as E, LogicalFrameEndingReason as End,
|
|
NativeInterface, ValidatedProgramImage, VirtualMachine, VmInitError, lookup_intrinsic_by_id,
|
|
materialize_builtin_constant,
|
|
};
|
|
|
|
struct NoNative;
|
|
impl NativeInterface for NoNative {
|
|
fn syscall(
|
|
&mut self,
|
|
_: u32,
|
|
_: &[Value],
|
|
_: &mut HostReturn,
|
|
_: &mut HostContext,
|
|
) -> Result<(), VmFault> {
|
|
panic!("unexpected native call")
|
|
}
|
|
}
|
|
fn call(id: u32, args: &[Value]) -> Result<Value, E> {
|
|
let m = lookup_intrinsic_by_id(id).unwrap();
|
|
(m.implementation.host_callback().expect("host intrinsic"))(args, &mut HostContext::new(None))
|
|
.map(|mut v| v.remove(0))
|
|
}
|
|
fn floats(id: u32, xs: &[f64]) -> Result<u64, u32> {
|
|
match call(id, &xs.iter().copied().map(Value::Float).collect::<Vec<_>>()) {
|
|
Ok(Value::Float(x)) => Ok(x.to_bits()),
|
|
Err(E::Numeric(e)) => Err(e.code),
|
|
v => panic!("{v:?}"),
|
|
}
|
|
}
|
|
fn vm(source: &str, limits: RuntimeLimits) -> VirtualMachine {
|
|
let bytes =
|
|
TestProgram::single(assemble(source).unwrap(), Default::default(), 0, 8).serialize();
|
|
let image =
|
|
ValidatedProgramImage::load(&bytes, &mut LoadBudget::new(Default::default()), 0).unwrap();
|
|
let mut vm = VirtualMachine::from_image(image, limits);
|
|
vm.prepare_call("0").unwrap();
|
|
vm
|
|
}
|
|
fn run(vm: &mut VirtualMachine, budget: u64) -> prometeu_vm::BudgetReport {
|
|
vm.run_budget(budget, &mut NoNative, &mut HostContext::new(None)).unwrap()
|
|
}
|
|
fn trap(r: &prometeu_vm::BudgetReport) -> &prometeu_bytecode::TrapInfo {
|
|
let End::Trap(t) = &r.reason else { panic!("{r:?}") };
|
|
t
|
|
}
|
|
|
|
#[test]
|
|
fn integer_limits_are_exact_and_abs_does_not_wrap() {
|
|
for (base, a, b) in [
|
|
(0x3000, Value::Int32(i32::MIN), Value::Int32(i32::MAX)),
|
|
(0x3004, Value::Int64(i64::MIN), Value::Int64(i64::MAX)),
|
|
] {
|
|
assert_eq!(call(base, &[b.clone(), a.clone()]).unwrap(), a);
|
|
assert_eq!(call(base + 1, &[a.clone(), b.clone()]).unwrap(), b);
|
|
assert!(
|
|
matches!(call(base+3,std::slice::from_ref(&a)),Err(E::Numeric(e)) if e.code==RANGE)
|
|
);
|
|
assert!(matches!(call(base+2,&[b.clone(),b,a]),Err(E::Numeric(e)) if e.code==DOMAIN));
|
|
}
|
|
assert_eq!(
|
|
call(0x3002, &[Value::Int32(-5), Value::Int32(0), Value::Int32(10)]).unwrap(),
|
|
Value::Int32(0)
|
|
);
|
|
assert!(
|
|
matches!(call(0x3002,&[Value::Int32(5),Value::Int32(10),Value::Int32(0)]),Err(E::Numeric(e)) if e.code==DOMAIN)
|
|
);
|
|
}
|
|
#[test]
|
|
fn signed_zero_limits_and_rounding_follow_bits() {
|
|
for a in [0.0f64, -0.0] {
|
|
for b in [0.0f64, -0.0] {
|
|
let same = a.to_bits() == b.to_bits();
|
|
assert_eq!(
|
|
floats(0x3008, &[a, b]),
|
|
Ok(if same { a.to_bits() } else { (-0.0f64).to_bits() })
|
|
);
|
|
assert_eq!(floats(0x3009, &[a, b]), Ok(if same { a.to_bits() } else { 0 }));
|
|
}
|
|
}
|
|
assert_eq!(floats(0x300a, &[-0.0, 0.0, 1.0]), Ok(0));
|
|
assert_eq!(floats(0x300b, &[-0.0]), Ok(0));
|
|
assert_eq!(floats(0x3010, &[-0.0]), Ok((-0.0f64).to_bits()));
|
|
for id in 0x300c..=0x300f {
|
|
assert_eq!(floats(id, &[-0.0]), Ok((-0.0f64).to_bits()));
|
|
}
|
|
for (x, y) in [
|
|
(0.5, 0.0f64),
|
|
(-0.5, -0.0),
|
|
(1.5, 2.0),
|
|
(2.5, 2.0),
|
|
(3.5, 4.0),
|
|
(-2.5, -2.0),
|
|
(-3.5, -4.0),
|
|
(f64::from_bits(0x3fe0000000000001), 1.0),
|
|
(f64::from_bits(0x3fdfffffffffffff), 0.0),
|
|
] {
|
|
assert_eq!(floats(0x300f, &[x]), Ok(y.to_bits()));
|
|
}
|
|
assert_eq!(floats(0x300c, &[-2.7]), Ok((-3.0f64).to_bits()));
|
|
assert_eq!(floats(0x300d, &[-2.7]), Ok((-2.0f64).to_bits()));
|
|
assert_eq!(floats(0x300e, &[-2.7]), Ok((-2.0f64).to_bits()));
|
|
}
|
|
#[test]
|
|
fn atan2_has_explicit_zero_vector_and_signed_axis_contract() {
|
|
for y in [0.0, -0.0] {
|
|
for x in [0.0, -0.0] {
|
|
assert_eq!(floats(0x3013, &[y, x]), Err(DOMAIN));
|
|
}
|
|
}
|
|
for (y, x, bits) in [
|
|
(0.0, 1.0, 0),
|
|
(-0.0, 1.0, 1 << 63),
|
|
(0.0, -1.0, 0x400921fb54442d18),
|
|
(-0.0, -1.0, 0xc00921fb54442d18),
|
|
(1.0, 0.0, 0x3ff921fb54442d18),
|
|
(1.0, -0.0, 0x3ff921fb54442d18),
|
|
(-1.0, 0.0, 0xbff921fb54442d18),
|
|
(-1.0, -0.0, 0xbff921fb54442d18),
|
|
] {
|
|
assert_eq!(floats(0x3013, &[y, x]), Ok(bits));
|
|
}
|
|
assert_eq!(floats(0x3011, &[-0.0]), Ok(1 << 63));
|
|
assert_eq!(floats(0x3012, &[-0.0]), Ok(1.0f64.to_bits()));
|
|
}
|
|
#[test]
|
|
fn conversions_check_the_truncated_integer_without_saturating() {
|
|
for (x, expected) in [(3.9, 3), (-3.9, -3), (-2147483648.9, i32::MIN)] {
|
|
assert_eq!(call(0x3018, &[Value::Float(x)]).unwrap(), Value::Int32(expected));
|
|
}
|
|
assert!(
|
|
matches!(call(0x3018,&[Value::Float(2147483648.0)]),Err(E::Numeric(e)) if e.code==RANGE)
|
|
);
|
|
let minimum = f64::from_bits(0xc3e0000000000000);
|
|
assert_eq!(call(0x3019, &[Value::Float(minimum)]).unwrap(), Value::Int64(i64::MIN));
|
|
let Value::Float(wide) = call(0x3017, &[Value::Int64(i64::MAX)]).unwrap() else { panic!() };
|
|
assert_eq!(wide.to_bits(), 0x43e0000000000000);
|
|
assert!(matches!(call(0x3019,&[Value::Float(wide)]),Err(E::Numeric(e)) if e.code==RANGE));
|
|
assert_eq!(
|
|
call(0x3019, &[Value::Float(f64::from_bits(0x43dfffffffffffff))]).unwrap(),
|
|
Value::Int64(9223372036854774784)
|
|
);
|
|
assert_eq!(call(0x3014, &[Value::Int32(i32::MIN)]).unwrap(), Value::Int64(i64::from(i32::MIN)));
|
|
assert!(matches!(call(0x3015,&[Value::Int64(i64::MAX)]),Err(E::Numeric(e)) if e.code==RANGE));
|
|
assert_eq!(call(0x3018, &[Value::Float(-0.0)]).unwrap(), Value::Int32(0));
|
|
for (integer, bits) in
|
|
[(9007199254740993, 0x4340000000000000), (9007199254740995, 0x4340000000000002)]
|
|
{
|
|
let Value::Float(v) = call(0x3017, &[Value::Int64(integer)]).unwrap() else { panic!() };
|
|
assert_eq!(v.to_bits(), bits);
|
|
}
|
|
}
|
|
#[test]
|
|
fn faults_validate_all_types_then_finitude_then_domain() {
|
|
assert!(matches!(
|
|
call(0x300a, &[Value::Float(f64::NAN), Value::Float(2.), Value::Int32(1)]),
|
|
Err(E::TypeMismatch { index: 2, .. })
|
|
));
|
|
assert_eq!(floats(0x300a, &[f64::NAN, 2., 1.]), Err(NON_FINITE));
|
|
assert_eq!(floats(0x300a, &[0., 2., 1.]), Err(DOMAIN));
|
|
assert_eq!(floats(0x3010, &[-1.]), Err(DOMAIN));
|
|
for x in [f64::NAN, f64::INFINITY, f64::NEG_INFINITY] {
|
|
assert_eq!(floats(0x3010, &[x]), Err(NON_FINITE));
|
|
}
|
|
assert!(matches!(
|
|
call(
|
|
0x1000,
|
|
&[Value::Float(f64::NAN), Value::Float(1.), Value::Float(2.), Value::Int32(3)]
|
|
),
|
|
Err(E::TypeMismatch { index: 3, .. })
|
|
));
|
|
}
|
|
#[test]
|
|
fn vector_sequences_keep_stage_rounding_and_scaled_extremes() {
|
|
assert_eq!(floats(0x1001, &[1e200, 0.]), Ok(1e200f64.to_bits()));
|
|
assert_eq!(floats(0x1001, &[f64::from_bits(1), 0.]), Ok(1));
|
|
assert_eq!(floats(0x1001, &[-0., -0.]), Ok(0));
|
|
assert_eq!(floats(0x1001, &[f64::MAX, f64::MAX]), Err(RANGE));
|
|
assert_eq!(floats(0x1000, &[f64::MAX, f64::MAX, 2., -2.]), Err(RANGE));
|
|
// (1+2^-27)*(1-2^-27) rounds to 1 before subtracting 1.
|
|
assert_eq!(
|
|
floats(
|
|
0x1000,
|
|
&[f64::from_bits(0x3ff0000002000000), 1., f64::from_bits(0x3feffffffc000000), -1.]
|
|
),
|
|
Ok(0)
|
|
);
|
|
}
|
|
#[test]
|
|
fn math_attempts_charge_before_failure_and_positive_budget_overshoots() {
|
|
for (bits, expected) in [(0x4010000000000000u64, None), (0xbff0000000000000, Some(DOMAIN))] {
|
|
let mut v =
|
|
vm(&format!("PUSH_F64 f64:0x{bits:016x}\nINTRINSIC 0x3010\nHALT"), Default::default());
|
|
assert_eq!(run(&mut v, 1).cycles_used, 2);
|
|
let before = v.operand_stack_top(1);
|
|
let zero = run(&mut v, 0);
|
|
assert_eq!((zero.cycles_used, zero.steps_executed), (0, 0));
|
|
assert_eq!(&*before, &*v.operand_stack_top(1));
|
|
let attempt = run(&mut v, 1);
|
|
assert_eq!(attempt.cycles_used, 16);
|
|
if let Some(code) = expected {
|
|
assert_eq!((trap(&attempt).code, trap(&attempt).pc), (code, 10));
|
|
} else {
|
|
assert_eq!(attempt.reason, End::BudgetExhausted);
|
|
let Value::Float(x) = v.operand_stack_top(1)[0] else { panic!() };
|
|
assert_eq!(x.to_bits(), 2.0f64.to_bits());
|
|
assert_eq!(run(&mut v, 1).cycles_used, 1);
|
|
}
|
|
}
|
|
let mut v =
|
|
vm("PUSH_I32 1\nSET_GLOBAL 0\nGET_GLOBAL 0\nINTRINSIC 0x3010\nHALT", Default::default());
|
|
run(&mut v, 8);
|
|
let attempt = run(&mut v, 1);
|
|
assert_eq!((attempt.cycles_used, trap(&attempt).code), (16, TRAP_TYPE));
|
|
let mut v = vm(
|
|
"PUSH_F64 f64:0x4010000000000000\nINTRINSIC 0x3010\nHALT",
|
|
RuntimeLimits::default()
|
|
.lowered(prometeu_bytecode::RuntimeResource::TemporaryBytes, 0)
|
|
.unwrap(),
|
|
);
|
|
run(&mut v, 1);
|
|
let attempt = run(&mut v, 1);
|
|
assert_eq!(
|
|
(attempt.cycles_used, trap(&attempt).code),
|
|
(16, prometeu_bytecode::TRAP_RESOURCE_LIMIT)
|
|
);
|
|
}
|
|
#[test]
|
|
fn float_opcodes_preserve_underflow_zero_division_and_numeric_faults() {
|
|
for (source, bits) in [
|
|
("PUSH_F64 f64:0x0000000000000001\nPUSH_F64 f64:0x3ff0000000000000\nMUL\nHALT", 1),
|
|
("PUSH_F64 f64:0x0000000000000001\nPUSH_F64 f64:0x4000000000000000\nDIV\nHALT", 0),
|
|
("PUSH_F64 f64:0x8000000000000000\nNEG\nHALT", 0),
|
|
(
|
|
"PUSH_I64 9007199254740993\nPUSH_F64 f64:0x0000000000000000\nADD\nHALT",
|
|
0x4340000000000000,
|
|
),
|
|
] {
|
|
let mut v = vm(source, Default::default());
|
|
assert_eq!(run(&mut v, 100).reason, End::Halted);
|
|
let Value::Float(x) = v.operand_stack_top(1)[0] else { panic!() };
|
|
assert_eq!(x.to_bits(), bits);
|
|
}
|
|
for (source, code) in [
|
|
("PUSH_F64 f64:0x7fefffffffffffff\nPUSH_F64 f64:0x4000000000000000\nMUL\nHALT", RANGE),
|
|
(
|
|
"PUSH_F64 f64:0x3ff0000000000000\nPUSH_F64 f64:0x8000000000000000\nDIV\nHALT",
|
|
TRAP_DIV_ZERO,
|
|
),
|
|
] {
|
|
let mut v = vm(source, Default::default());
|
|
assert_eq!(trap(&run(&mut v, 100)).code, code);
|
|
}
|
|
}
|
|
#[test]
|
|
fn load_rejects_nonfinite_immediates_and_unknown_intrinsics_even_when_dead() {
|
|
for (source, reason) in [
|
|
("HALT\nPUSH_F64 f64:0x7ff0000000000000", R::NonFiniteValue),
|
|
("HALT\nPUSH_F64 f64:0x7ff8000000000042", R::NonFiniteValue),
|
|
("HALT\nINTRINSIC 0xffffffff", R::NativeId),
|
|
] {
|
|
let bytes =
|
|
TestProgram::single(assemble(source).unwrap(), Default::default(), 0, 8).serialize();
|
|
let Err(VmInitError::RegistryLoadFailed(e)) =
|
|
ValidatedProgramImage::load(&bytes, &mut LoadBudget::new(Default::default()), 0)
|
|
else {
|
|
panic!()
|
|
};
|
|
assert_eq!(
|
|
(e.code, e.reason, e.function, e.pc),
|
|
(C::InvalidCode, reason, Some(0), Some(2))
|
|
);
|
|
}
|
|
}
|
|
#[test]
|
|
fn native_signature_checks_all_types_before_rejecting_nonfinite() {
|
|
use prometeu_bytecode::registry::{NamedType, Signature, TypeId};
|
|
let mut program = TestProgram::single(assemble("HALT").unwrap(), Default::default(), 0, 8);
|
|
program.functions[0].signature = Signature {
|
|
parameters: vec![NamedType { type_id: TypeId(2), name: None }; 2],
|
|
results: vec![],
|
|
};
|
|
let image = ValidatedProgramImage::load(
|
|
&program.serialize(),
|
|
&mut LoadBudget::new(Default::default()),
|
|
0,
|
|
)
|
|
.unwrap();
|
|
let mut v = VirtualMachine::from_image(image, Default::default());
|
|
for (args, slot, code) in [
|
|
([Value::Float(f64::NAN), Value::Int32(1)], 1, TRAP_TYPE),
|
|
([Value::Float(f64::NAN), Value::Float(1.)], 0, NON_FINITE),
|
|
] {
|
|
assert_eq!(
|
|
v.prepare_call_with_args("0", &args),
|
|
Err(VmInitError::EntrypointArgumentsInvalid { function: 0, slot, trap_code: code })
|
|
);
|
|
assert!(v.operand_stack_top(10).is_empty());
|
|
}
|
|
assert!(matches!(v.push(Value::Float(f64::INFINITY)), Err(VmFault::Trap(NON_FINITE, _))));
|
|
assert!(v.operand_stack_top(10).is_empty());
|
|
}
|
|
#[test]
|
|
fn catalog_has_exact_ids_costs_names_and_canonical_constants() {
|
|
let costs = [2, 2, 4, 2, 2, 2, 4, 2, 2, 2, 4, 2, 4, 4, 4, 4, 16, 32, 32, 48, 2, 2, 2, 2, 2, 2];
|
|
for (offset, cost) in costs.into_iter().enumerate() {
|
|
let m = lookup_intrinsic_by_id(0x3000 + offset as u32).unwrap();
|
|
assert_eq!((m.version, m.cost_cycles), (1, cost));
|
|
assert_eq!(m.parameter_names.len(), m.arg_layout.len());
|
|
assert!(m.deterministic && !m.may_allocate);
|
|
}
|
|
for (id, cost) in [(0x1000, 10), (0x1001, 40), (0x1101, 1), (0x2100, 1)] {
|
|
assert_eq!(lookup_intrinsic_by_id(id).unwrap().cost_cycles, cost);
|
|
}
|
|
for (name, bits) in [("pi", 0x400921fb54442d18), ("tau", 0x401921fb54442d18)] {
|
|
let constants = materialize_builtin_constant("mathf", name, 1).unwrap().unwrap();
|
|
let Value::Float(x) = constants[0] else { panic!() };
|
|
assert_eq!(x.to_bits(), bits);
|
|
}
|
|
assert_eq!(lookup_intrinsic_by_id(0x3013).unwrap().parameter_names, &["y", "x"]);
|
|
}
|
|
|
|
#[test]
|
|
fn exported_artifacts_match_the_single_runtime_catalog() {
|
|
assert_eq!(
|
|
prometeu_vm::intrinsic_catalog_csv(),
|
|
include_str!("../../../../docs/vm-arch/INTRINSICS.csv")
|
|
);
|
|
assert_eq!(
|
|
prometeu_vm::builtin_constant_catalog_csv(),
|
|
include_str!("../../../../docs/vm-arch/BUILTIN_CONSTANTS.csv")
|
|
);
|
|
let mut ids = std::collections::HashSet::new();
|
|
let mut keys = std::collections::HashSet::new();
|
|
for m in prometeu_vm::intrinsic_catalog() {
|
|
assert!(ids.insert(m.id));
|
|
assert!(keys.insert(m.key()));
|
|
assert_eq!(m.parameter_names.len(), m.arg_slots());
|
|
}
|
|
}
|
|
|
|
fn fixture_value(token: &str) -> Value {
|
|
let (kind, v) = token.split_once(':').unwrap();
|
|
match kind {
|
|
"f" => Value::Float(f64::from_bits(u64::from_str_radix(v, 16).unwrap())),
|
|
"i" => Value::Int32(v.parse().unwrap()),
|
|
"l" => Value::Int64(v.parse().unwrap()),
|
|
_ => panic!("numeric fixture"),
|
|
}
|
|
}
|
|
fn value_token(v: &Value) -> String {
|
|
match v {
|
|
Value::Float(v) => format!("f:{:016x}", v.to_bits()),
|
|
Value::Int32(v) => format!("i:{v}"),
|
|
Value::Int64(v) => format!("l:{v}"),
|
|
_ => panic!("numeric fixture result"),
|
|
}
|
|
}
|
|
fn push_source(v: &Value) -> String {
|
|
match v {
|
|
Value::Float(v) => format!("PUSH_F64 f64:0x{:016x}\n", v.to_bits()),
|
|
Value::Int32(v) => format!("PUSH_I32 {v}\n"),
|
|
Value::Int64(v) => format!("PUSH_I64 {v}\n"),
|
|
_ => panic!("numeric fixture argument"),
|
|
}
|
|
}
|
|
#[test]
|
|
fn mpfr_fixed_corpus_replays_without_a_runtime_or_test_mpfr_dependency() {
|
|
for row in include_str!("fixtures/numeric-conformance.tsv").lines() {
|
|
let tokens: Vec<_> = row.split_whitespace().collect();
|
|
let op = tokens[0];
|
|
let expected = tokens[tokens.len() - 2];
|
|
let cycles: u64 = tokens[tokens.len() - 1].parse().unwrap();
|
|
let args: Vec<_> = tokens[1..tokens.len() - 2].iter().map(|t| fixture_value(t)).collect();
|
|
if matches!(op, "ADD" | "SUB" | "MUL" | "DIV") {
|
|
let source = args.iter().map(push_source).collect::<String>() + op + "\nHALT";
|
|
let mut v = vm(&source, Default::default());
|
|
let report = run(&mut v, 100);
|
|
assert_eq!(report.cycles_used, cycles, "{row}");
|
|
let actual = match report.reason {
|
|
End::Halted => value_token(&v.operand_stack_top(1)[0]),
|
|
End::Trap(t) => format!("trap:{:x}", t.code),
|
|
e => panic!("{row}: {e:?}"),
|
|
};
|
|
assert_eq!(actual, expected, "{row}");
|
|
} else {
|
|
let id = u32::from_str_radix(op, 16).unwrap();
|
|
let actual = match call(id, &args) {
|
|
Ok(v) => value_token(&v),
|
|
Err(E::Numeric(e)) => format!("trap:{:x}", e.code),
|
|
e => panic!("{e:?}"),
|
|
};
|
|
assert_eq!(actual, expected, "{row}");
|
|
assert_eq!(lookup_intrinsic_by_id(id).unwrap().cost_cycles, cycles);
|
|
}
|
|
}
|
|
}
|
|
#[test]
|
|
fn every_scalar_and_vector_call_has_the_published_total_execution_cost() {
|
|
for m in prometeu_vm::intrinsic_catalog()
|
|
.filter(|m| m.owner == "vec2" || m.owner == "mathf" || m.owner.starts_with("math."))
|
|
{
|
|
let args: Vec<_> = m
|
|
.arg_layout
|
|
.iter()
|
|
.enumerate()
|
|
.map(|(i, t)| {
|
|
let n = if m.name == "clamp" { [1, 0, 2][i] } else { 1 };
|
|
match t {
|
|
prometeu_vm::AbiType::Scalar(prometeu_vm::BuiltinScalarType::Int32) => {
|
|
Value::Int32(n)
|
|
}
|
|
prometeu_vm::AbiType::Scalar(prometeu_vm::BuiltinScalarType::Int64) => {
|
|
Value::Int64(i64::from(n))
|
|
}
|
|
_ => Value::Float(f64::from(n)),
|
|
}
|
|
})
|
|
.collect();
|
|
let source = args.iter().map(push_source).collect::<String>()
|
|
+ &format!("INTRINSIC 0x{:x}\nHALT", m.id);
|
|
let mut v = vm(&source, Default::default());
|
|
let prefix = run(&mut v, 2 * args.len() as u64);
|
|
assert_eq!(prefix.cycles_used, 2 * args.len() as u64);
|
|
let attempt = run(&mut v, 1);
|
|
assert_eq!(attempt.cycles_used, m.cost_cycles, "{}", m.id);
|
|
assert_eq!(attempt.reason, End::BudgetExhausted, "{}", m.id);
|
|
}
|
|
}
|