feat(vm)!: implement typed callables and single-context execution
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
Add structural Fn signatures, typed capture environments, indirect calls and Trait dispatch while preserving logical parameter and result groups, ownership and budgets. Remove guest coroutine execution and legacy loading. Activate bounded sealed PBX v1 with mandatory capture metadata, preserve frame continuations and root return results, and migrate producers and shipped cartridges. Publish coordinated specs, handoffs and the completed runtime lesson. Validation: 880 workspace tests passed, 9 existing tests ignored; both cartridges completed six production-host frames.
This commit is contained in:
@@ -139,7 +139,49 @@ fn intrinsic_boundaries_reject_implicit_carrier_conversions_in_execution() {
|
||||
"PUSH_I64 1\nPUSH_F64 f64:0x4000000000000000\nINTRINSIC 0x1001", // Float/Float required
|
||||
"PUSH_I64 -1\nINTRINSIC 0x1106", // out-of-range color
|
||||
] {
|
||||
let mut vm = VirtualMachine::new(assemble(source).unwrap(), vec![]);
|
||||
let bytes = prometeu_test_support::program::TestProgram::single(
|
||||
assemble(&(source.to_string() + "\nHALT")).unwrap(),
|
||||
Default::default(),
|
||||
0,
|
||||
8,
|
||||
)
|
||||
.serialize();
|
||||
let known = prometeu_vm::ValidatedProgramImage::load(
|
||||
&bytes,
|
||||
&mut prometeu_bytecode::load_limits::LoadBudget::new(Default::default()),
|
||||
0,
|
||||
);
|
||||
if let Err(error) = known {
|
||||
assert!(
|
||||
matches!(error,prometeu_vm::VmInitError::RegistryLoadFailed(e) if e.code==prometeu_bytecode::load_limits::LoadCode::InvalidCode && e.reason==prometeu_bytecode::load_limits::LoadReason::TypeMismatch)
|
||||
);
|
||||
}
|
||||
// Globals deliberately hide the concrete carrier from static facts;
|
||||
// the same rejected values must still fault at the runtime boundary.
|
||||
let lines: Vec<_> = source.lines().collect();
|
||||
let mut unknown = String::new();
|
||||
for (i, line) in lines[..lines.len() - 1].iter().enumerate() {
|
||||
unknown.push_str(&format!("{line}\nSET_GLOBAL {i}\n"));
|
||||
}
|
||||
for i in 0..lines.len() - 1 {
|
||||
unknown.push_str(&format!("GET_GLOBAL {i}\n"));
|
||||
}
|
||||
unknown.push_str(lines.last().unwrap());
|
||||
unknown.push_str("\nHALT");
|
||||
let bytes = prometeu_test_support::program::TestProgram::single(
|
||||
assemble(&unknown).unwrap(),
|
||||
Default::default(),
|
||||
0,
|
||||
8,
|
||||
)
|
||||
.serialize();
|
||||
let image = prometeu_vm::ValidatedProgramImage::load(
|
||||
&bytes,
|
||||
&mut prometeu_bytecode::load_limits::LoadBudget::new(Default::default()),
|
||||
0,
|
||||
)
|
||||
.unwrap();
|
||||
let mut vm = VirtualMachine::from_image(image, Default::default());
|
||||
vm.prepare_call("0").expect("prepare entry call");
|
||||
let report = vm.run_budget(100, &mut NoSyscalls, &mut HostContext::new(None)).unwrap();
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user