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:
@@ -12,3 +12,4 @@ prometeu-hal = { path = "../prometeu-hal" }
|
||||
[dev-dependencies]
|
||||
prometeu-drivers = { path = "../prometeu-drivers" }
|
||||
prometeu-bytecode = { path = "../prometeu-bytecode" }
|
||||
prometeu-test-support = { path = "../../dev/prometeu-test-support" }
|
||||
|
||||
@@ -3,12 +3,16 @@ use crate::firmware::firmware_state::{
|
||||
FirmwareState, GameRunningStep, LoadCartridgeStep, ResetStep,
|
||||
};
|
||||
use crate::firmware::prometeu_context::PrometeuContext;
|
||||
#[cfg(test)]
|
||||
use prometeu_bytecode::registry::FunctionDecl;
|
||||
use prometeu_hal::app_mode::AppMode;
|
||||
use prometeu_hal::cartridge::Cartridge;
|
||||
use prometeu_hal::log::LogSource;
|
||||
use prometeu_hal::telemetry::CertificationConfig;
|
||||
use prometeu_hal::{InputSignals, RuntimePlatform};
|
||||
use prometeu_system::{PrometeuHub, ResidentGameState, SystemOS};
|
||||
#[cfg(test)]
|
||||
use prometeu_test_support::program::{TestProgram, int64_signature};
|
||||
|
||||
/// PROMETEU Firmware.
|
||||
///
|
||||
@@ -252,7 +256,7 @@ mod tests {
|
||||
use crate::firmware::firmware_state::HubHomeStep;
|
||||
use crate::firmware::resident_game_termination::{self, ResidentGameTerminationOutcome};
|
||||
use prometeu_bytecode::assembler::assemble;
|
||||
use prometeu_bytecode::model::{BytecodeModule, FunctionMeta, SyscallDecl};
|
||||
use prometeu_bytecode::model::SyscallDecl;
|
||||
use prometeu_drivers::{GlyphBankPoolAccess, SceneBankPoolAccess, TestPlatform};
|
||||
use prometeu_hal::RuntimePlatform;
|
||||
use prometeu_hal::app_mode::AppMode;
|
||||
@@ -345,13 +349,17 @@ mod tests {
|
||||
|
||||
fn halting_program() -> Vec<u8> {
|
||||
let code = assemble("HALT").expect("assemble");
|
||||
BytecodeModule {
|
||||
version: 0,
|
||||
TestProgram {
|
||||
const_pool: vec![],
|
||||
functions: vec![FunctionMeta {
|
||||
functions: vec![FunctionDecl {
|
||||
code_offset: 0,
|
||||
code_len: code.len() as u32,
|
||||
..Default::default()
|
||||
|
||||
signature: int64_signature(0, 0),
|
||||
captures: vec![],
|
||||
name: None,
|
||||
local_slots: 0,
|
||||
max_stack_slots: 256,
|
||||
}],
|
||||
code,
|
||||
debug_info: None,
|
||||
@@ -381,13 +389,17 @@ mod tests {
|
||||
|
||||
fn trapping_game_cartridge() -> Cartridge {
|
||||
let code = assemble("PUSH_BOOL 1\nHOSTCALL 0\nHALT").expect("assemble");
|
||||
let program = BytecodeModule {
|
||||
version: 0,
|
||||
let program = TestProgram {
|
||||
const_pool: vec![],
|
||||
functions: vec![FunctionMeta {
|
||||
functions: vec![FunctionDecl {
|
||||
code_offset: 0,
|
||||
code_len: code.len() as u32,
|
||||
..Default::default()
|
||||
|
||||
signature: int64_signature(0, 0),
|
||||
captures: vec![],
|
||||
name: None,
|
||||
local_slots: 0,
|
||||
max_stack_slots: 256,
|
||||
}],
|
||||
code,
|
||||
debug_info: None,
|
||||
@@ -497,7 +509,7 @@ mod tests {
|
||||
match &firmware.state {
|
||||
FirmwareState::AppCrashes(step) => match &step.report {
|
||||
CrashReport::VmInit { error } => {
|
||||
assert!(matches!(error, prometeu_vm::VmInitError::InvalidFormat));
|
||||
assert!(matches!(error, prometeu_vm::VmInitError::RegistryLoadFailed(_)));
|
||||
}
|
||||
other => panic!("expected VmInit crash report, got {:?}", other),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user