feat(vm): add VM-owned PCG64 random and coverage headroom
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
Implement GC-managed random generators, next/nextf intrinsics, bounded ranges and deterministic conformance coverage. Publish the runtime contract and producer guidance. Give coverage domains at least five percentage points of measured headroom while preserving sufficient floors. Record local qualification: make ci-domains passes with 939 tests and all domain gates green.
This commit is contained in:
@@ -8,6 +8,7 @@ mod control;
|
||||
mod dynamic;
|
||||
mod gc;
|
||||
mod loader;
|
||||
mod random;
|
||||
mod reference;
|
||||
mod runtime;
|
||||
mod stack;
|
||||
@@ -892,6 +893,10 @@ impl VirtualMachine {
|
||||
)
|
||||
})?;
|
||||
|
||||
if matches!(intrinsic.implementation, crate::IntrinsicImplementation::VmOwned) {
|
||||
return self.execute_random(intrinsic, pc_at_intrinsic);
|
||||
}
|
||||
|
||||
let args_count = intrinsic.arg_slots();
|
||||
let mut args = BudgetVec::new(&self.budget, RuntimeResource::TemporaryBytes);
|
||||
args.reserve(args_count)
|
||||
@@ -923,7 +928,11 @@ impl VirtualMachine {
|
||||
.map_err(|e| self.resource_trap(e, opcode, start_pc as u32))?;
|
||||
let results = intrinsic
|
||||
.validate_argument_values(&args)
|
||||
.and_then(|()| (intrinsic.implementation)(&args, ctx))
|
||||
.and_then(|()| {
|
||||
(intrinsic.implementation.host_callback().expect("host intrinsic"))(
|
||||
&args, ctx,
|
||||
)
|
||||
})
|
||||
.map_err(|err| match err {
|
||||
crate::IntrinsicExecutionError::ArityMismatch { expected, got } => self
|
||||
.trap(
|
||||
|
||||
Reference in New Issue
Block a user