feat: resume layout calls in VM instruction slices and expose slice statistics
Verify Tessera GUI / verify (push) Failing after 8m59s

This commit is contained in:
2026-10-23 01:00:49 +08:00
parent 33f94da927
commit 09c3902d84
8 changed files with 62 additions and 10 deletions
+28 -9
View File
@@ -795,20 +795,39 @@ pub fn render(
},
vec![desktop],
))?;
let result = vm.call_read_only_with_limits(
prepare,
&[],
endor_core::ExecutionLimits {
max_frames: 128,
max_instructions: 1_000_000,
},
);
let mut slices = 1;
let result = (|| {
let mut progress = vm.start_read_only_call(
prepare,
&[],
endor_core::ExecutionLimits {
max_frames: 128,
max_instructions: 1_000_000,
},
256,
)?;
loop {
match progress {
endor_core::ExecutionProgress::Complete { value, reads, .. } => {
return Ok((value, reads));
}
endor_core::ExecutionProgress::Pending { .. } => {
// The VM owns the continuation and keeps its read-only
// dependency scope intact. Worker-level parking follows.
std::thread::yield_now();
slices += 1;
progress = vm.resume_read_only_call(256)?;
}
}
}
})();
vm.release(prepare)?;
let (value, reads) = result.map_err(|error| crate::endor_host::runtime_error(vm, error))?;
vm.release_value(value)?;
let plan = plan
let mut plan = plan
.lock()
.map_err(|_| anyhow::anyhow!("layout plan poisoned"))?;
plan.runtime.slices = slices;
frame.commands.clear();
for (index, mount) in frame.mounts.iter_mut().enumerate() {
let [x, y, width, height] =