diff --git a/crates/metal2vulkan-validation/runtime-sources.sha256 b/crates/metal2vulkan-validation/runtime-sources.sha256 index 195b37c59..54bf2e829 100644 --- a/crates/metal2vulkan-validation/runtime-sources.sha256 +++ b/crates/metal2vulkan-validation/runtime-sources.sha256 @@ -1 +1 @@ -9679f1c8115f4456e4df7a838d8e2220c07efd615c929eee91c6e5e9ecc85da4 +48b7912f4dddee80bc4194dde8013d44e17cb6924d2e166efa68792c3a760327 diff --git a/crates/metal2vulkan/src/device/profile.rs b/crates/metal2vulkan/src/device/profile.rs index 86eb80d7a..38e1d944c 100644 --- a/crates/metal2vulkan/src/device/profile.rs +++ b/crates/metal2vulkan/src/device/profile.rs @@ -315,22 +315,27 @@ impl DeviceProfile { /// Count one derivation ([`FINGERPRINTS_DERIVED`]). #[cfg(test)] fn note_fingerprint_derived() { - FINGERPRINTS_DERIVED.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + FINGERPRINTS_DERIVED.with(|count| count.set(count.get() + 1)); } /// Count one derivation; nothing outside the crate's own tests. #[cfg(not(test))] fn note_fingerprint_derived() {} -/// The profile fingerprints derived in this process, which `tests::profile`'s count reads: a -/// device's compiles must add none to what its own making derived. +/// The profile fingerprints derived on this thread, which `tests::profile_fingerprint_derived`'s +/// count reads: a device's compiles must add none to what its own making derived. Per thread, +/// because a test harness that runs tests as threads of one process runs others beside it, and +/// their devices derive fingerprints of their own; the device's making and its compiles run on +/// the test's thread. #[cfg(test)] -static FINGERPRINTS_DERIVED: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); +thread_local! { + static FINGERPRINTS_DERIVED: std::cell::Cell = const { std::cell::Cell::new(0) }; +} /// [`FINGERPRINTS_DERIVED`]. #[cfg(test)] pub(crate) fn fingerprints_derived() -> u64 { - FINGERPRINTS_DERIVED.load(std::sync::atomic::Ordering::Relaxed) + FINGERPRINTS_DERIVED.with(std::cell::Cell::get) } /// The fingerprint of `fields` ([`DeviceProfile::fingerprint`]): the rendering streams into the