diff --git a/crates/metal2vulkan-runtime/src/tests/unshared_hold.rs b/crates/metal2vulkan-runtime/src/tests/unshared_hold.rs index 459ef5a17..2f8c98e3f 100644 --- a/crates/metal2vulkan-runtime/src/tests/unshared_hold.rs +++ b/crates/metal2vulkan-runtime/src/tests/unshared_hold.rs @@ -36,7 +36,11 @@ fn a_longer_run_is_taken_at_once_and_a_shorter_one_halves_the_way() { expected.observed(10 * MS); assert_eq!(expected.nanos(), 20 * MS, "halfway to a shorter one"); expected.observed(0); - assert_eq!(expected.nanos(), 10 * MS, "a run of nothing counts as 1 ns"); + assert_eq!( + expected.nanos(), + 10 * MS + 1, + "a run of nothing counts as 1 ns, the half rounded toward the longer" + ); } /// A queue whose batches ran 30 ms, then 1 ms: within five of the short ones, its next batch may diff --git a/crates/metal2vulkan/src/tests/fast_paths.rs b/crates/metal2vulkan/src/tests/fast_paths.rs index ae8a91f88..31affda80 100644 --- a/crates/metal2vulkan/src/tests/fast_paths.rs +++ b/crates/metal2vulkan/src/tests/fast_paths.rs @@ -609,6 +609,25 @@ fn the_runtime_s_queue_sharing_choice_keys_no_profile() { } } +/// The runtime's choice of how much of other queues' work goes ahead of an unshared queue's +/// (`unshared_isolation`) moves no committed profile's fingerprint: no profile carries it, so no +/// translation follows it. +#[test] +fn the_runtime_s_unshared_isolation_choice_keys_no_profile() { + use crate::spirv::testing::committed_profiles_with; + let bounded = committed_profiles_with(DevicePolicy::UNTRUSTED).expect("profiles"); + let off = committed_profiles_with(DevicePolicy { + unshared_isolation: UnsharedIsolationPolicy::Off, + ..DevicePolicy::UNTRUSTED + }) + .expect("profiles"); + assert_eq!(bounded.len(), off.len()); + for ((stem, b), (other, o)) in bounded.iter().zip(&off) { + assert_eq!(stem, other); + assert_eq!(b.fingerprint(), o.fingerprint(), "{stem}"); + } +} + /// `DevicePolicy::exact_answers()` keeps every command queue on the `VkQueue` it took at its /// creation, and the default shares them where the device's GPU idles between `VkQueue`s. #[test]