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:
@@ -6,18 +6,19 @@ use prometeu_vm::{
|
||||
resource_budget::{RuntimeLimits, RuntimeResource},
|
||||
};
|
||||
|
||||
// Independent executable oracle: 32-byte header, seven directory entries,
|
||||
// payload at 116, one Bool import, one zero-slot HALT function; total 173.
|
||||
// Independent executable oracle: 32-byte header, eight directory entries,
|
||||
// payload at 128, one Bool import, one zero-slot HALT function; total 193.
|
||||
fn minimal() -> Vec<u8> {
|
||||
"50 42 58 00 01 00 00 00 07 00 00 00
|
||||
"50 42 58 00 01 00 00 00 08 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 74 00 00 00 04 00 00 00
|
||||
01 00 00 00 78 00 00 00 1d 00 00 00
|
||||
02 00 00 00 95 00 00 00 02 00 00 00
|
||||
04 00 00 00 97 00 00 00 04 00 00 00
|
||||
05 00 00 00 9b 00 00 00 04 00 00 00
|
||||
06 00 00 00 9f 00 00 00 0a 00 00 00
|
||||
07 00 00 00 a9 00 00 00 04 00 00 00
|
||||
00 00 00 00 80 00 00 00 04 00 00 00
|
||||
01 00 00 00 84 00 00 00 1d 00 00 00
|
||||
02 00 00 00 a1 00 00 00 02 00 00 00
|
||||
04 00 00 00 a3 00 00 00 04 00 00 00
|
||||
05 00 00 00 a7 00 00 00 04 00 00 00
|
||||
06 00 00 00 ab 00 00 00 0a 00 00 00
|
||||
07 00 00 00 b5 00 00 00 04 00 00 00
|
||||
08 00 00 00 b9 00 00 00 08 00 00 00
|
||||
00 00 00 00
|
||||
01 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00
|
||||
@@ -25,7 +26,8 @@ fn minimal() -> Vec<u8> {
|
||||
00 00 00 00
|
||||
00 00 00 00
|
||||
01 00 00 00 00 00 13 00 00 00
|
||||
00 00 00 00"
|
||||
00 00 00 00
|
||||
01 00 00 00 00 00 00 00"
|
||||
.split_whitespace()
|
||||
.map(|byte| u8::from_str_radix(byte, 16).unwrap())
|
||||
.collect()
|
||||
@@ -46,7 +48,7 @@ impl NativeInterface for Native {
|
||||
#[test]
|
||||
fn independent_v1_bytes_load_publish_and_execute_through_the_public_sealed_boundary() {
|
||||
let bytes = minimal();
|
||||
assert_eq!(bytes.len(), 173);
|
||||
assert_eq!(bytes.len(), 193);
|
||||
let mut load = LoadBudget::new(Default::default());
|
||||
let image = ValidatedProgramImage::load(&bytes, &mut load, caps::NONE).unwrap();
|
||||
assert_eq!(load.used(LoadResource::TemporaryBytes), 0);
|
||||
@@ -63,9 +65,9 @@ fn independent_v1_bytes_load_publish_and_execute_through_the_public_sealed_bound
|
||||
fn single_violation_oracles_reject_before_image_publication_with_typed_context() {
|
||||
for (offset, replacement, code, reason, pc) in [
|
||||
(4, 0, LoadCode::UnsupportedFormat, LoadReason::Version, None),
|
||||
(165, 0, LoadCode::UnsupportedFormat, LoadReason::Builtin, None),
|
||||
(149, 0xff, LoadCode::InvalidCode, LoadReason::UnknownOpcode, Some(0)),
|
||||
(149, 0x11, LoadCode::InvalidCode, LoadReason::StackUnderflow, Some(0)),
|
||||
(177, 0, LoadCode::UnsupportedFormat, LoadReason::Builtin, None),
|
||||
(161, 0xff, LoadCode::InvalidCode, LoadReason::UnknownOpcode, Some(0)),
|
||||
(161, 0x11, LoadCode::InvalidCode, LoadReason::StackUnderflow, Some(0)),
|
||||
] {
|
||||
let mut bytes = minimal();
|
||||
bytes[offset] = replacement;
|
||||
|
||||
Reference in New Issue
Block a user