Real Render Worker Establishment
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
This commit is contained in:
@@ -1596,9 +1596,10 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_push_f64_immediate() {
|
||||
let value = 3.125f64;
|
||||
let mut rom = Vec::new();
|
||||
rom.extend_from_slice(&(OpCode::PushF64 as u16).to_le_bytes());
|
||||
rom.extend_from_slice(&3.14f64.to_le_bytes());
|
||||
rom.extend_from_slice(&value.to_le_bytes());
|
||||
rom.extend_from_slice(&(OpCode::Halt as u16).to_le_bytes());
|
||||
|
||||
let mut vm = new_test_vm(rom.clone(), vec![]);
|
||||
@@ -1606,7 +1607,7 @@ mod tests {
|
||||
let mut ctx = HostContext::new(None);
|
||||
|
||||
vm.step(&mut native, &mut ctx).unwrap();
|
||||
assert_eq!(vm.peek().unwrap(), &Value::Float(3.14));
|
||||
assert_eq!(vm.peek().unwrap(), &Value::Float(value));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -2537,9 +2538,8 @@ mod tests {
|
||||
let report = vm.run_budget(100, &mut native, &mut ctx).unwrap();
|
||||
|
||||
// Any non-trap outcome is considered success here
|
||||
match report.reason {
|
||||
LogicalFrameEndingReason::Trap(trap) => panic!("Unexpected trap: {:?}", trap),
|
||||
_ => {}
|
||||
if let LogicalFrameEndingReason::Trap(trap) = report.reason {
|
||||
panic!("Unexpected trap: {:?}", trap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2672,8 +2672,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_loader_hardening_successful_init() {
|
||||
let mut vm = VirtualMachine::default();
|
||||
vm.pc = 123; // Pollution
|
||||
let mut vm = VirtualMachine { pc: 123, ..Default::default() };
|
||||
let code = assemble("HALT").expect("assemble");
|
||||
|
||||
let header = prometeu_bytecode::model::BytecodeModule {
|
||||
@@ -3978,26 +3977,26 @@ mod tests {
|
||||
let mut a_href = None;
|
||||
let mut b_href = None;
|
||||
// Consider currently running coroutine
|
||||
if let Some(cur) = vm.current_coro {
|
||||
if let Some(f) = vm.call_stack.last() {
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(cur);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(cur);
|
||||
}
|
||||
if let Some(cur) = vm.current_coro
|
||||
&& let Some(f) = vm.call_stack.last()
|
||||
{
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(cur);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(cur);
|
||||
}
|
||||
}
|
||||
// And also consider suspended (Ready/Sleeping) coroutines
|
||||
for h in vm.heap.suspended_coroutine_handles() {
|
||||
if let Some(co) = vm.heap.coroutine_data(h) {
|
||||
if let Some(f) = co.frames.last() {
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(h);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(h);
|
||||
}
|
||||
if let Some(co) = vm.heap.coroutine_data(h)
|
||||
&& let Some(f) = co.frames.last()
|
||||
{
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(h);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4108,25 +4107,25 @@ mod tests {
|
||||
// Identify A and B coroutine handles (consider both running and suspended)
|
||||
let mut a_href = None;
|
||||
let mut b_href = None;
|
||||
if let Some(cur) = vm.current_coro {
|
||||
if let Some(f) = vm.call_stack.last() {
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(cur);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(cur);
|
||||
}
|
||||
if let Some(cur) = vm.current_coro
|
||||
&& let Some(f) = vm.call_stack.last()
|
||||
{
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(cur);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(cur);
|
||||
}
|
||||
}
|
||||
for h in vm.heap.suspended_coroutine_handles() {
|
||||
if let Some(co) = vm.heap.coroutine_data(h) {
|
||||
if let Some(f) = co.frames.last() {
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(h);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(h);
|
||||
}
|
||||
if let Some(co) = vm.heap.coroutine_data(h)
|
||||
&& let Some(f) = co.frames.last()
|
||||
{
|
||||
if f.func_idx == 1 {
|
||||
a_href = Some(h);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b_href = Some(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4253,26 +4252,26 @@ mod tests {
|
||||
let mut a = None;
|
||||
let mut b = None;
|
||||
// running
|
||||
if let Some(cur) = vm.current_coro {
|
||||
if let Some(f) = vm.call_stack.last() {
|
||||
if f.func_idx == 1 {
|
||||
a = Some(cur);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b = Some(cur);
|
||||
}
|
||||
if let Some(cur) = vm.current_coro
|
||||
&& let Some(f) = vm.call_stack.last()
|
||||
{
|
||||
if f.func_idx == 1 {
|
||||
a = Some(cur);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b = Some(cur);
|
||||
}
|
||||
}
|
||||
// suspended
|
||||
for h in vm.heap.suspended_coroutine_handles() {
|
||||
if let Some(co) = vm.heap.coroutine_data(h) {
|
||||
if let Some(f) = co.frames.last() {
|
||||
if f.func_idx == 1 {
|
||||
a = Some(h);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b = Some(h);
|
||||
}
|
||||
if let Some(co) = vm.heap.coroutine_data(h)
|
||||
&& let Some(f) = co.frames.last()
|
||||
{
|
||||
if f.func_idx == 1 {
|
||||
a = Some(h);
|
||||
}
|
||||
if f.func_idx == 2 {
|
||||
b = Some(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user