diff --git a/crates/metal2vulkan-runtime/src/command_buffer/completion.rs b/crates/metal2vulkan-runtime/src/command_buffer/completion.rs index 1343428af..aab8046b4 100644 --- a/crates/metal2vulkan-runtime/src/command_buffer/completion.rs +++ b/crates/metal2vulkan-runtime/src/command_buffer/completion.rs @@ -46,7 +46,8 @@ //! submitted to an idle `VkQueue` is waited for by that queue's own waiter, so it completes when //! its work does, not when another queue's does. No wait names several objects: MoltenVK 1.4.1's //! wait for any of several timelines (`vkWaitSemaphores` with `VK_SEMAPHORE_WAIT_ANY_BIT`, -//! `mvkWaitSemaphores`) loses a signal that lands while it is still registering a later timeline, +//! `mvkWaitSemaphores`) loses a signal that lands while it is still registering a later timeline +//! (`RuntimeDriverDefect::WaitForAnyObjectLosesASignal`, `driver_defects.rs`), //! so the waiter saw the batch only when its 100 ms wait ran out (the consumer's guest presented //! at about a quarter of Metal's rate); its wait for any of several fences has the same flaw. A //! wait for one timeline or one fence counts its one signal under a lock, and loses none. The diff --git a/crates/metal2vulkan-runtime/src/device/mod.rs b/crates/metal2vulkan-runtime/src/device/mod.rs index c10797059..ab31d9c50 100644 --- a/crates/metal2vulkan-runtime/src/device/mod.rs +++ b/crates/metal2vulkan-runtime/src/device/mod.rs @@ -88,7 +88,6 @@ use functions::{Functions, Vk}; use metal2vulkan::bind::RegionLimits; use metal2vulkan::device::{DeviceDescription, EnableSet}; use metal2vulkan::error::RuntimeDriverDefect; -use metal2vulkan::vk::DriverId; use relay::Flights; use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; @@ -1613,9 +1612,9 @@ impl Device { let lost = Arc::new(AtomicBool::new(false)); let relays = (properties.description.driver_facts()) .contains(&metal2vulkan::device::DriverFact::QueueFailuresReportedByMessenger); - // Read before the properties move into the device's shared state (below): still keyed on - // the driver's name, for the scheduler's wait alone. - let moltenvk = properties.description.driver_id == Some(DriverId::MOLTENVK); + // Read before the properties move into the device's shared state (below): whether the + // scheduler's thread waits for the GPU itself (`scheduler::waits_on_gpu`). + let waits_on_gpu = crate::scheduler::waits_on_gpu(&properties.driver_defects); if let (Some(relay), true) = (instance.relay(), relays) { for slot in &queues { let queue = slot.with(|queue| queue); @@ -1762,11 +1761,10 @@ impl Device { exit_guard::runs_in_process(device); } // The scheduler's thread waits for the GPU itself where heads wait for signals to land, - // but on MoltenVK, whose wait for any of several semaphores loses a signal that lands - // while it registers a later one (`command_buffer/completion.rs`). Still keyed on the - // driver's name: its home is a `RuntimeDriverDefect` beside - // `ReadsCommandBuffersAfterTheirSignal`, which this commit does not open. - if !moltenvk { + // but not where the driver loses a signal that lands while its wait for any of several + // objects registers a later one (`RuntimeDriverDefect::WaitForAnyObjectLosesASignal`, + // `driver_defects.rs`): there the turns wake it. A defect fact, never the driver's name. + if waits_on_gpu { (shared.scheduler).wait_on_gpu(Functions::clone(&shared.functions), shared.nudge); } let device = Device(shared); diff --git a/crates/metal2vulkan-runtime/src/driver_defects.rs b/crates/metal2vulkan-runtime/src/driver_defects.rs index 6fb0ea1e7..c7a2e1611 100644 --- a/crates/metal2vulkan-runtime/src/driver_defects.rs +++ b/crates/metal2vulkan-runtime/src/driver_defects.rs @@ -181,6 +181,27 @@ pub(super) struct Affected { /// fences are signaled with it, so a fence there only added a `vkCreateFence` to the commit /// path, which NVIDIA's 615.71.09 held for up to 1.9 s while other processes' work ran. /// +/// `WaitForAnyObjectLosesASignal`: +/// - MoltenVK (`MOLTENVK`): a host wait for any of several objects to be signaled, which the +/// driver serves by registering a wait on each of them in turn (`vkWaitSemaphores` with +/// `VK_SEMAPHORE_WAIT_ANY_BIT`, `mvkWaitSemaphores` in `MVKSync.mm`, over the shared events its +/// timeline semaphores are signaled through; `vkWaitForFences` with `waitAll` false has the same +/// shape), loses a signal that lands on an object it registered already while it is still +/// registering a later one, and sleeps on to its timeout although the condition it waited for +/// was met. A wait that names one object loses none. Measured on 1.4.1 (driverVersion 10401): a +/// completion waiter waiting for any of the device's queue timelines to reach its batch's value +/// saw the batch only when its 100 ms slice ran out, where a wait naming that one timeline +/// returns at the signal (the Vulkan consumer's guest presented at about a quarter of Metal's +/// rate meanwhile). Known broken through 1.4.1; 1.4.2 is unprobed and takes it. The scheduler's +/// wait on the GPU is a wait of that shape and is not measured apart. Nothing is refused: no +/// host wait of the runtime names several objects there. Each `VkQueue`'s completion waiter +/// waits for its queue's first pending batch, for that batch's fence or else for that one +/// timeline value (`command_buffer/completion.rs`), and the scheduler's thread sleeps on its +/// condition variable, woken by the completion turns, in place of waiting on the GPU for the +/// signals its heads wait for to land (`scheduler::waits_on_gpu`). Every other driver's thread +/// waits on the GPU, one `vkWaitSemaphores` for any of those event values or the nudge's next, +/// so a signal wakes it from the driver with no completion turn and no waker between. +/// /// `ImplicitPreprocessAfterExecutionSet`: /// - Mesa's RADV (`MESA_RADV`): `vkCmdExecuteGeneratedCommandsEXT` of a layout not made for /// explicit preprocessing dispatches the layout's preprocessing pipeline itself @@ -430,6 +451,11 @@ pub(super) const AFFECTED: &[Affected] = &[ driver: DriverId::MOLTENVK, clean: &[], }, + Affected { + defect: RuntimeDriverDefect::WaitForAnyObjectLosesASignal, + driver: DriverId::MOLTENVK, + clean: &[], + }, Affected { defect: RuntimeDriverDefect::ExplicitPlaneRowsPastHeight, driver: DriverId::MESA_LLVMPIPE, diff --git a/crates/metal2vulkan-runtime/src/scheduler/mod.rs b/crates/metal2vulkan-runtime/src/scheduler/mod.rs index 61ba4b0aa..b84d7fe4f 100644 --- a/crates/metal2vulkan-runtime/src/scheduler/mod.rs +++ b/crates/metal2vulkan-runtime/src/scheduler/mod.rs @@ -106,9 +106,11 @@ //! (`EventShared::value`, which waits for what it reads), then checks and submits. Every other //! waker (a commit, a host signal, a finished decode, a lost device, a stop) signals the nudge, //! under the lock, where the thread waits so; a completion turn needs not, as the thread's own -//! wait sees the signal the turn saw. Not on MoltenVK 1.4.1, whose wait for any of several -//! semaphores loses a signal that lands while it registers a later one (`completion.rs`): there -//! the thread sleeps on its condition variable, woken by the turns. Counted: +//! wait sees the signal the turn saw. Not where the driver's wait for any of several objects +//! loses a signal that lands while it registers a later one +//! (`RuntimeDriverDefect::WaitForAnyObjectLosesASignal`, `driver_defects.rs`; MoltenVK's): +//! there the thread sleeps on its condition variable, woken by the turns, and +//! [`waits_on_gpu`] says which. Counted: //! `WorkCounts::scheduler_gpu_waits`; checked by `runtime_lane::event_round_trips`, a host //! signal included. //! - **Exit.** Each submission is a section of the exit guard ([`exit_guard`]); once the process @@ -156,8 +158,9 @@ use ash::vk; use binary::{BinarySignals, Needs}; use inbox::Inbox; use left::{work_through, Kind, Left}; +use metal2vulkan::error::RuntimeDriverDefect; use order::{Behind, Order}; -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use std::sync::atomic::{fence, AtomicBool, AtomicU64, Ordering}; use std::sync::{Arc, Condvar, Mutex, OnceLock}; use std::thread::JoinHandle; @@ -172,6 +175,16 @@ const WAIT_SLICE: Duration = Duration::from_millis(100); /// A multiple of a group's batches (`command_buffer/group.rs`). const PASS_SUBMISSIONS: usize = 16; +/// Whether the thread of a device whose driver has `defects` waits for the GPU itself where its +/// heads wait only for submitted signals to land (the module docs, +/// [`Scheduler::wait_on_gpu`]): its one `vkWaitSemaphores` names several objects, which a driver +/// that loses a signal landing while it registers a later one would miss, so the thread sleeps on +/// its condition variable there instead, woken by the completion turns. The question is the +/// driver's, and the defect answers it, never the driver's name. +pub(crate) fn waits_on_gpu(defects: &BTreeSet) -> bool { + !defects.contains(&RuntimeDriverDefect::WaitForAnyObjectLosesASignal) +} + /// The device's nudge (the module docs): a timeline semaphore of its own, which a waker signals /// to the value the thread waits for beside the GPU's signals. struct Nudge { @@ -558,8 +571,8 @@ impl Scheduler { /// Wait for the GPU itself where heads wait for signals to land, with `semaphore`, a timeline /// semaphore at 0 of the device of `functions`, which destroys it after stopping the thread, - /// as its nudge (the module docs): on a device whose wait for any of several semaphores loses - /// no signal. + /// as its nudge (the module docs): on a device whose driver loses no signal in a wait for any + /// of several objects ([`waits_on_gpu`]). pub(crate) fn wait_on_gpu(&self, functions: Functions, semaphore: vk::Semaphore) { let _ = self.shared.nudge.set(Nudge { functions, diff --git a/crates/metal2vulkan-runtime/src/tests/driver_defects.rs b/crates/metal2vulkan-runtime/src/tests/driver_defects.rs index 1e3964084..c4b723122 100644 --- a/crates/metal2vulkan-runtime/src/tests/driver_defects.rs +++ b/crates/metal2vulkan-runtime/src/tests/driver_defects.rs @@ -29,6 +29,7 @@ const BAKED_SAMPLERS: RuntimeDriverDefect = RuntimeDriverDefect::ImmutableSample const SET_SUPPORT: RuntimeDriverDefect = RuntimeDriverDefect::SetLayoutSupportUnderstated; const PART_VIEWS: RuntimeDriverDefect = RuntimeDriverDefect::LazilyAllocatedSubresourceViews; const BIND_COPIES: RuntimeDriverDefect = RuntimeDriverDefect::HostTransferImagesCopiedAtBind; +const LOST_SIGNALS: RuntimeDriverDefect = RuntimeDriverDefect::WaitForAnyObjectLosesASignal; /// Every committed profile's driver has its defects at every release and GPU but those a probe /// found clean: MoltenVK the multisampled depth/stencil colour copies, the inexact depths past @@ -36,11 +37,11 @@ const BIND_COPIES: RuntimeDriverDefect = RuntimeDriverDefect::HostTransferImages /// compiled at load, the copies of compressed images that rewrite texels, the reads of command /// buffers after their signal, the frees that fail pending work, the destroys that fail a /// submission encoding meanwhile, the pushed sets' unset buffer sizes, the set layouts its support -/// query refuses though it runs them and the textureless views of some of a lazily allocated -/// image's levels or layers and the block-compressed image it copies out of host memory at bind -/// time with a one-block row pitch; lavapipe the colour copies, the depth/stencil resolve of the -/// first layer and level, the explicit plane's rows past its height and the baked samplers lost -/// after a copy; +/// query refuses though it runs them, the textureless views of some of a lazily allocated image's +/// levels or layers, the block-compressed image it copies out of host memory at bind time with a +/// one-block row pitch and the signal its wait for any of several objects loses; lavapipe the +/// colour copies, the depth/stencil resolve of the first layer and level, the explicit plane's +/// rows past its height and the baked samplers lost after a copy; /// RADV the multisampled copies that convert float NaNs, and the implicit /// preprocessing after an execution set on every GPU but the 780M at 26.2.4 (Phoenix's and Hawk /// Point's), measured clean; ANV @@ -75,6 +76,7 @@ fn the_committed_profiles_drivers_have_their_defects() { SET_SUPPORT, PART_VIEWS, BIND_COPIES, + LOST_SIGNALS, ] } Some(DriverId::MESA_LLVMPIPE) => vec![COPIES, RESOLVES, PAST_HEIGHT, BAKED_SAMPLERS], @@ -247,6 +249,40 @@ fn hawk_points_780m_is_phoenixs_measured_identity() { } } +/// The scheduler's thread waits for the GPU itself (one `vkWaitSemaphores` for any of the event +/// values its heads wait for, or the device's nudge) on every driver whose wait for any of several +/// objects loses no signal, and sleeps on its condition variable where one is lost +/// (`scheduler::waits_on_gpu`). On every committed MoltenVK profile it does not wait on the GPU, +/// and on every other committed profile it does; the decision reads the device's defects, so a +/// driver that gains or loses the row moves with it, and the driver's name decides nothing. +#[test] +fn the_scheduler_waits_on_the_gpu_where_no_signal_is_lost() { + use crate::scheduler::waits_on_gpu; + let mut moltenvk = 0; + let mut others = 0; + for (stem, desc) in super::capabilities::committed_descriptions() { + let defects = of(&desc); + let loses = desc.driver_id == Some(DriverId::MOLTENVK); + assert_eq!(defects.contains(&LOST_SIGNALS), loses, "{stem}"); + assert_eq!(waits_on_gpu(&defects), !loses, "{stem}"); + *(if loses { &mut moltenvk } else { &mut others }) += 1; + } + assert!( + moltenvk > 0 && others > 0, + "{moltenvk} MoltenVK, {others} other" + ); + // The defect alone decides: a set holding it waits on no GPU, and one without it does, + // whatever else the set holds. + assert!(!waits_on_gpu(&[LOST_SIGNALS].into_iter().collect())); + assert!(!waits_on_gpu( + &[LOST_SIGNALS, LATE_READS].into_iter().collect() + )); + assert!(waits_on_gpu(&Default::default())); + assert!(waits_on_gpu( + &[LATE_READS, BIND_COPIES].into_iter().collect() + )); +} + /// Each clean identity is a measured one: a committed profile of the driver, GPU and release /// that the device layer takes as measured (`DeviceDescription::measured_identity`). #[test] diff --git a/crates/metal2vulkan-validation/runtime-sources.sha256 b/crates/metal2vulkan-validation/runtime-sources.sha256 index f7cdc2f7b..2cdec9b9c 100644 --- a/crates/metal2vulkan-validation/runtime-sources.sha256 +++ b/crates/metal2vulkan-validation/runtime-sources.sha256 @@ -1 +1 @@ -b7e32be1ed39a35419fdbbf2b38c52f05d7b2a63918daab707c7e4bf8b44b0fa +e46898218279db0e5922b8b41367bd0b5314a930256a54fbb457965827cad90a diff --git a/crates/metal2vulkan/src/bind/dispatch.rs b/crates/metal2vulkan/src/bind/dispatch.rs index 45fb451de..4111d4575 100644 --- a/crates/metal2vulkan/src/bind/dispatch.rs +++ b/crates/metal2vulkan/src/bind/dispatch.rs @@ -669,7 +669,8 @@ impl BindingPlan { /// dispatch. /// - A `Threads` dispatch runs at group counts of its own, enough threadgroups of its own /// threadgroup size to cover the grid, whatever a whole number of them that grid is - /// ([`regions`]); the record is [`DispatchCommands::region_record`], which the consumer + /// (`regions`, a private reader that spreads the count a grid needs over the axes the + /// device admits); the record is [`DispatchCommands::region_record`], which the consumer /// writes. /// /// Any other form is `Unsupported{GpuEncodedIndirectCommands, NotImplemented}`. diff --git a/crates/metal2vulkan/src/error/mod.rs b/crates/metal2vulkan/src/error/mod.rs index 98ff367ee..88f62b75a 100644 --- a/crates/metal2vulkan/src/error/mod.rs +++ b/crates/metal2vulkan/src/error/mod.rs @@ -971,6 +971,15 @@ pub enum RuntimeDriverDefect { /// stays in memory of its own class, and its CPU copies go through a submission, as on a /// device without `VK_EXT_host_image_copy`. HostTransferImagesCopiedAtBind, + /// A host wait for any of several semaphores or fences to be signaled (`vkWaitSemaphores` + /// with `VK_SEMAPHORE_WAIT_ANY_BIT`, `vkWaitForFences` with `waitAll` false) loses a signal + /// that lands while the call is still registering a later one of them: it sleeps on to its + /// timeout although the condition it waited for was met. A wait that names one object loses + /// none. Nothing is refused: every host wait of the runtime names one object there — each + /// queue's completion waiter its queue's next fence or timeline value — and the scheduler's + /// thread sleeps on its condition variable, woken by the completion turns, in place of + /// waiting for the signals its held batches wait for to land on the GPU itself. + WaitForAnyObjectLosesASignal, } /// One device capability a refusal can name. diff --git a/docs/REFUSALS.md b/docs/REFUSALS.md index 92d9e9072..914cfcc3a 100644 --- a/docs/REFUSALS.md +++ b/docs/REFUSALS.md @@ -14,7 +14,7 @@ Columns: - `none`: no public API path: malformed or non-Metal input, Apple-private calls, or a cap no valid program of ordinary size meets; - `?`: not assessed yet. -Generated at `5762c934d`. +Generated at `6269e784f`. ## Totals @@ -33,7 +33,7 @@ Generated at `5762c934d`. | Variant | What it blocks | Where | Sites | Reach | |---|---|---|---|---| | `LibraryKind` | A metallib that is not an executable library (dynamic library, companion) | - | via a helper: 2: `crates/metal2vulkan-air/src/container/mtlb.rs:253`, `crates/metal2vulkan/src/error/mod.rs:244` | `none`: a metallib that is not an executable library, loaded as one | -| `Stage` | A function stage the model does not cover | - | via a helper: 2: `crates/metal2vulkan-air/src/abi/check.rs:579`, `crates/metal2vulkan/src/error/mod.rs:245` | `none`: a stage outside AIR's public stages | +| `Stage` | A function stage the model does not cover | - | via a helper: 2: `crates/metal2vulkan-air/src/abi/check.rs:588`, `crates/metal2vulkan/src/error/mod.rs:245` | `none`: a stage outside AIR's public stages | | `AddressSpace` | An LLVM address space the typed model does not define (it defines AIR's `thread` 0 through `threadgroup_imageblock` 4, `object_data` 6 and the... | every device (not implemented) | 2: `crates/metal2vulkan-air/src/ir/types.rs:191`, `crates/metal2vulkan/src/memory/plan.rs:2061` | `none`: Apple's AGX library address spaces | | `ModuleRecord` | A module-level record outside the accepted subset (alias, ifunc, comdat, …) | - | via a helper: 4: `crates/metal2vulkan-air/src/bitcode/module.rs:343`, `crates/metal2vulkan-air/src/bitcode/module.rs:435` (+2) | `none`: LLVM constructs AIR does not emit | | `Instruction` | An instruction record outside the closed instruction set | - | via a helper: 11: `crates/metal2vulkan-air/src/bitcode/function.rs:1010`, `crates/metal2vulkan-air/src/bitcode/function.rs:1057` (+9) | `none`: LLVM instructions AIR does not emit | @@ -98,7 +98,7 @@ Generated at `5762c934d`. | `PixelCoverageAtSampleRate` | The pixel's coverage (`[[sample_mask]]` read) in a fragment function that runs once per sample | drivers with a defect; every device (no Vulkan mechanism); every device (not implemented) | 3: `crates/metal2vulkan/src/lower/fragment/coverage.rs:310`, `crates/metal2vulkan/src/lower/simd/mod.rs:754` (+1) | `rare`: coverage read at sample rate | | `InterfaceComponents` | Too many interface components or locations | devices short of a device limit the site names; devices without VkLimit::MaxColorAttachments; devices without VkLimit::MaxVertexInputAttributes | 4: `crates/metal2vulkan/src/pipeline/compile/color_group.rs:202`, `crates/metal2vulkan/src/pipeline/link/graphics.rs:316` (+2) | `rare`: too many varyings or attachments for a device | | `UnmatchedVarying` | A fragment input without a vertex producer (a Metal link error) | every device (no Vulkan mechanism) | 3: `crates/metal2vulkan/src/pipeline/link/varyings.rs:318`, `crates/metal2vulkan/src/pipeline/link/varyings.rs:537` (+1) | `none`: a Metal link error | -| `KernelStageIn` | Kernel `[[stage_in]]` | every device (not implemented) | 3: `crates/metal2vulkan-runtime/src/indirect_execute.rs:376`, `crates/metal2vulkan/src/bind/dispatch.rs:953` (+1) | `rare`: kernel stage-in combinations Metal leaves unestablished | +| `KernelStageIn` | Kernel `[[stage_in]]` | every device (not implemented) | 3: `crates/metal2vulkan-runtime/src/indirect_execute.rs:376`, `crates/metal2vulkan/src/bind/dispatch.rs:954` (+1) | `rare`: kernel stage-in combinations Metal leaves unestablished | | `Tessellation` | Tessellation | devices without VkLimit::MaxPushConstantsSize; devices without VkLimit::MaxStorageBufferRange; devices without VkLimit::MaxTessellationGenerationLevel; every device (not implemented) | 13: `crates/metal2vulkan-air/src/canon/mod.rs:1250`, `crates/metal2vulkan-air/src/canon/mod.rs:1341` (+11) | `rare`: tessellation | | `MeshShading` | | devices short of a device limit the site names; devices without VkLimit::MaxMeshOutputLayers; devices without VkLimit::MaxTaskPayloadSize; devices without a capability the site computes (`missing`); every device (not implemented) | 7: `crates/metal2vulkan/src/bind/graphics.rs:1663`, `crates/metal2vulkan/src/bind/graphics.rs:3131` (+5) | `rare`: mesh pipelines | | `TileShading` | | devices without VkLimit::MaxStorageBufferRange; devices without a format's usage; every device (not implemented) | 5: `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:520`, `crates/metal2vulkan/src/bind/plan/compute.rs:237` (+3) | `rare`: tile shaders (Apple GPU families) | @@ -121,7 +121,7 @@ Generated at `5762c934d`. | `StageStoresAndAtomics` | Buffer or image stores or atomics in a vertex or fragment function without the stage's store feature (`vertexPipelineStoresAndAtomics`,... | devices without VkFeature::FragmentStoresAndAtomics | 1: `crates/metal2vulkan/src/lower/access/tile_memory.rs:72` | `app`: stores or atomics in vertex or fragment functions on a device without the feature | | `FunctionConstantArgument` | An observed read of a pointer entry argument that a function-constant predicate removes, other than an absent buffer (which reads as null) or an... | devices short of a Vulkan feature the site names; every device (not implemented) | 2: `crates/metal2vulkan-air/src/canon/interface.rs:899`, `crates/metal2vulkan/src/lower/access/absent.rs:100` | `rare`: a function-constant-removed argument read | | `SamplerBicubicFilter` | A use of Metal's bicubic filter that no Metal reading establishes | every device (not implemented) | 5: `crates/metal2vulkan/src/bind/heap.rs:997`, `crates/metal2vulkan/src/bind/plan/resources.rs:1901` (+3) | `system`: bicubic filtering forms Metal does not establish; macOS 26.6.2 makes a runtime sampler with MTLSamplerMinMagFilterCubic (the consumer's boots), whose mip-filtered form is refused | -| `GroupCount` | A dispatch whose threadgroup count on `axis` exceeds `maxComputeWorkGroupCount` by more than the binder splits into regions (`None` | every device (no Vulkan mechanism) | 7: `crates/metal2vulkan/src/bind/dispatch.rs:1035`, `crates/metal2vulkan/src/bind/dispatch.rs:389` (+5) | `rare`: more threadgroups than a device dispatches, past the binder's split | +| `GroupCount` | A dispatch whose threadgroup count on `axis` exceeds `maxComputeWorkGroupCount` by more than the binder splits into regions (`None` | every device (no Vulkan mechanism) | 7: `crates/metal2vulkan/src/bind/dispatch.rs:1036`, `crates/metal2vulkan/src/bind/dispatch.rs:389` (+5) | `rare`: more threadgroups than a device dispatches, past the binder's split | | `IntersectionFunctionTable` | A ray intersection through intersection functions | every device (no Vulkan mechanism); every device (not implemented) | 9: `crates/metal2vulkan/src/bind/acceleration.rs:177`, `crates/metal2vulkan/src/bind/acceleration.rs:183` (+7) | `rare`: ray tracing (out of scope by ruling) | | `IndependentBlending` | Color attachments whose write masks or blend states differ, as Metal sets them per attachment, on a device without `independentBlend`, where no... | devices without VkFeature::IndependentBlend | 2: `crates/metal2vulkan-runtime/src/render.rs:2201`, `crates/metal2vulkan/src/pipeline/link/graphics.rs:1020` | `rare`: per-attachment blending on a device without independentBlend | | `RasterSampleCount` | A `rasterSampleCount` outside the device's framebuffer sample counts for the pipeline's attachments (`framebuffer*SampleCounts`), and, for a color... | devices short of a Vulkan property the site names; devices without a capability the site computes | 2: `crates/metal2vulkan-runtime/src/families/limits.rs:1063`, `crates/metal2vulkan/src/pipeline/graphics.rs:573` | `app`: a sample count a device lacks for the attachments | @@ -136,7 +136,7 @@ Generated at `5762c934d`. | `TextureSwizzle` | A texture swizzle whose Metal behavior is not measured | devices short of a Vulkan feature the site names; every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/binding_view.rs:167`, `crates/metal2vulkan-runtime/src/texture.rs:1028` (+5) | `app`: texture swizzles whose Metal behaviour is unmeasured | | `MipmapGeneration` | `generateMipmapsForTexture:` where the device's filter is not shown to give Metal's answer | devices without VkFeature::ShaderInt64; devices without a format's usage; every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/blit_texture.rs:1904`, `crates/metal2vulkan-runtime/src/mipmap_pick.rs:37` (+5) | `app`: generateMipmapsForTexture: where the device's filter is not Metal's | | `HostMemory` | A buffer over the caller's host memory without a copy (`newBufferWithBytesNoCopy:`) | devices without VkExtension::ExtExternalMemoryHost; every device (no Vulkan mechanism); every device (not implemented) | 5: `crates/metal2vulkan-runtime/src/host_memory.rs:430`, `crates/metal2vulkan-runtime/src/host_memory.rs:470` (+3) | `system`: newBufferWithBytesNoCopy: where the device cannot import the memory | -| `GpuTimes` | A command buffer's GPU times (`GPUStartTime`, `GPUEndTime`) on a device whose queue family writes no timestamps (`timestampValidBits` 0) | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2941` | `rare`: GPU times on a queue without timestamps | +| `GpuTimes` | A command buffer's GPU times (`GPUStartTime`, `GPUEndTime`) on a device whose queue family writes no timestamps (`timestampValidBits` 0) | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2945` | `rare`: GPU times on a queue without timestamps | | `CountingVisibility` | A `Counting` visibility result (`MTLVisibilityResultModeCounting`) on a device without `occlusionQueryPrecise` | devices without VkFeature::OcclusionQueryPrecise | 1: `crates/metal2vulkan-runtime/src/visibility.rs:452` | `rare`: counting occlusion queries on a device without precise queries | | `ViewFormatReinterpretation` | A texture view whose format has other components, or components of other widths, than its texture's (`RGBA8Unorm` as `R32Uint`), on a device whose... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/view_plan.rs:573` | `app`: a view of another component layout on a portability subset (MoltenVK) | | `SeparateMultisampledDepthStencil` | A render pass whose depth and stencil attachments are separate multisampled textures that it loads or may store, on a device without maintenance8,... | - | via a helper: 7: `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:188`, `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:294` (+5) | `rare`: separate multisampled depth and stencil textures | @@ -232,7 +232,7 @@ Generated at `5762c934d`. | Variant | What it blocks | Where | Sites | Reach | |---|---|---|---|---| -| `ProtectedContent` | Protection options whose answer on Metal is not measured (`command_buffer/protection.rs`) | every device (Apple-private, Metal's answer not measured) | 3: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2472`, `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126` (+1) | `none`: Apple-private (no public header) | +| `ProtectedContent` | Protection options whose answer on Metal is not measured (`command_buffer/protection.rs`) | every device (Apple-private, Metal's answer not measured) | 3: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2476`, `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126` (+1) | `none`: Apple-private (no public header) | | `LineWidth` | A line width other than 1 (`setLineWidth:`) | every device (Apple-private, Metal's answer not measured) | 1: `crates/metal2vulkan-runtime/src/apple_only.rs:190` | `none`: Apple-private (no public header) | | `ViewportTransformDisabled` | The viewport transform turned off (`setViewportTransformEnabled:NO`) | every device (Apple-private, Metal's answer not measured) | 1: `crates/metal2vulkan-runtime/src/apple_only.rs:192` | `none`: Apple-private (no public header) | | `VertexAmplificationMode` | `setVertexAmplificationMode:value:` of a count (the value's set bits in mode 1, else the value) of 0, whose copies change from run to run on... | every device (Apple-private, Metal's answer not measured) | 2: `crates/metal2vulkan-runtime/src/apple_only.rs:196`, `crates/metal2vulkan-runtime/src/apple_only.rs:321` | `none`: Apple-private (no public header) | @@ -248,7 +248,7 @@ Generated at `5762c934d`. | `TessellationFactorRange` | The tessellation factors a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`),... | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3834` | `rare`: tessellation factors past one storage descriptor | | `PatchIndexRange` | The patch indices a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`) | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3878` | `rare`: patch indices past one storage descriptor | | `ControlPointIndexRange` | The control-point indices a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`) | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3916` | `rare`: control-point indices past one storage descriptor | -| `MissingStageInRegion` | The kernel reads the compute encoder's stage-in region (a `[[stage_in]]` attribute stepping by thread position, or `[[grid_origin]]` or... | at the device's limit | 1: `crates/metal2vulkan/src/bind/dispatch.rs:878` | `none`: a stage-in region never set, which Metal leaves undefined | +| `MissingStageInRegion` | The kernel reads the compute encoder's stage-in region (a `[[stage_in]]` attribute stepping by thread position, or `[[grid_origin]]` or... | at the device's limit | 1: `crates/metal2vulkan/src/bind/dispatch.rs:879` | `none`: a stage-in region never set, which Metal leaves undefined | | `UniformViewAliased` | A `device` buffer slot the pipeline reads through a uniform view (Profile F's per-stage storage-buffer fallback,... | at the device's limit | 1: `crates/metal2vulkan/src/bind/instantiate.rs:609` | `rare`: Profile F's uniform-view fallback aliased by a write | | `MissingDeviceAddress` | A device-address slot received a buffer without a device address | at the device's limit | 1: `crates/metal2vulkan/src/bind/plan/slots.rs:133` | `rare`: a slot reached through a pointer loaded from memory, bound with inline bytes or on a device without device addresses | @@ -292,7 +292,7 @@ Generated at `5762c934d`. Each refusal's sites, with the function that builds it. - `feature::LibraryKind`: `crates/metal2vulkan-air/src/container/mtlb.rs:253 (parse)`; `crates/metal2vulkan/src/error/mod.rs:244 (from)` -- `feature::Stage`: `crates/metal2vulkan-air/src/abi/check.rs:579 (unsupported_stage)`; `crates/metal2vulkan/src/error/mod.rs:245 (from)` +- `feature::Stage`: `crates/metal2vulkan-air/src/abi/check.rs:588 (unsupported_stage)`; `crates/metal2vulkan/src/error/mod.rs:245 (from)` - `feature::AddressSpace`: `crates/metal2vulkan-air/src/ir/types.rs:191 (from_raw)`; `crates/metal2vulkan/src/memory/plan.rs:2061 (reprs)` - `feature::ModuleRecord`: `crates/metal2vulkan-air/src/bitcode/module.rs:343 (record)`; `crates/metal2vulkan-air/src/bitcode/module.rs:435 (global)`; `crates/metal2vulkan-air/src/bitcode/module.rs:514 (function)`; `crates/metal2vulkan/src/error/mod.rs:247 (from)` - `feature::Instruction`: `crates/metal2vulkan-air/src/bitcode/function.rs:1010 (record)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1057 (record)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1078 (record)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1135 (record)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1209 (record)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1217 (record)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1233 (record)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1338 (call)`; `crates/metal2vulkan-air/src/bitcode/function.rs:1380 (call)`; `crates/metal2vulkan-air/src/bitcode/function.rs:823 (record)`; `crates/metal2vulkan/src/error/mod.rs:248 (from)` @@ -357,7 +357,7 @@ Each refusal's sites, with the function that builds it. - `feature::PixelCoverageAtSampleRate`: `crates/metal2vulkan/src/lower/fragment/coverage.rs:310 (finish)`; `crates/metal2vulkan/src/lower/simd/mod.rs:754 (select_param)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:882 (sample_invocations)` - `feature::InterfaceComponents`: `crates/metal2vulkan/src/pipeline/compile/color_group.rs:202 (refusal)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:316 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:409 (assign)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:90 (limit_error)` - `feature::UnmatchedVarying`: `crates/metal2vulkan/src/pipeline/link/varyings.rs:318 (mesh_fragment)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:537 (varyings)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:548 (varyings)` -- `feature::KernelStageIn`: `crates/metal2vulkan-runtime/src/indirect_execute.rs:376 (record)`; `crates/metal2vulkan/src/bind/dispatch.rs:953 (instantiate)`; `crates/metal2vulkan/src/lower/stage_io/stage_in.rs:143 (select)` +- `feature::KernelStageIn`: `crates/metal2vulkan-runtime/src/indirect_execute.rs:376 (record)`; `crates/metal2vulkan/src/bind/dispatch.rs:954 (instantiate)`; `crates/metal2vulkan/src/lower/stage_io/stage_in.rs:143 (select)` - `feature::Tessellation`: `crates/metal2vulkan-air/src/canon/mod.rs:1250 (post_check)`; `crates/metal2vulkan-air/src/canon/mod.rs:1341 (post_check)`; `crates/metal2vulkan/src/bind/graphics.rs:4037 (tessellation_dispatch)`; `crates/metal2vulkan/src/lower/stage_io/fetch.rs:527 (select)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1524 (primitive_id_output)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1810 (input_builtin)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:842 (param)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:150 (not_implemented)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:489 (plan_entry)`; `crates/metal2vulkan/src/metal/vertex.rs:219 (fetch_as)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:212 (control_plan)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:292 (check_fragment)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:316 (push_offset)` - `feature::MeshShading`: `crates/metal2vulkan/src/bind/graphics.rs:1663 (plan)`; `crates/metal2vulkan/src/bind/graphics.rs:3131 (mesh_limit)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:521 (check_payload)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:560 (plan_entry)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:594 (plan_entry)`; `crates/metal2vulkan/src/memory/plan.rs:2056 (reprs)`; `crates/metal2vulkan/src/pipeline/link/mesh.rs:102 (records)` - `feature::TileShading`: `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:520 (scratch)`; `crates/metal2vulkan/src/bind/plan/compute.rs:237 (tile_memory)`; `crates/metal2vulkan/src/lower/access/tile.rs:151 (not_implemented)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:275 (tile_shading)`; `crates/metal2vulkan/src/pipeline/compile/api.rs:729 (tile_pipeline)` @@ -380,7 +380,7 @@ Each refusal's sites, with the function that builds it. - `feature::StageStoresAndAtomics`: `crates/metal2vulkan/src/lower/access/tile_memory.rs:72 (written)` - `feature::FunctionConstantArgument`: `crates/metal2vulkan-air/src/canon/interface.rs:899 (absent_values)`; `crates/metal2vulkan/src/lower/access/absent.rs:100 (require)` - `feature::SamplerBicubicFilter`: `crates/metal2vulkan/src/bind/heap.rs:997 (new)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1901 (bicubic_texels)`; `crates/metal2vulkan/src/bind/plan/slots.rs:503 (cubic_variant)`; `crates/metal2vulkan/src/lower/sampler/bicubic.rs:120 (refuse)`; `crates/metal2vulkan/src/lower/sampler/select.rs:35 (bicubic_refused)` -- `feature::GroupCount`: `crates/metal2vulkan/src/bind/dispatch.rs:1035 (instantiate)`; `crates/metal2vulkan/src/bind/dispatch.rs:389 (product)`; `crates/metal2vulkan/src/bind/dispatch.rs:465`; `crates/metal2vulkan/src/bind/dispatch.rs:487`; `crates/metal2vulkan/src/bind/dispatch.rs:594 (regions)`; `crates/metal2vulkan/src/bind/graphics.rs:3426 (mesh_draw)`; `crates/metal2vulkan/src/bind/graphics.rs:3483 (emulated_draw)` +- `feature::GroupCount`: `crates/metal2vulkan/src/bind/dispatch.rs:1036 (instantiate)`; `crates/metal2vulkan/src/bind/dispatch.rs:389 (product)`; `crates/metal2vulkan/src/bind/dispatch.rs:465`; `crates/metal2vulkan/src/bind/dispatch.rs:487`; `crates/metal2vulkan/src/bind/dispatch.rs:594 (regions)`; `crates/metal2vulkan/src/bind/graphics.rs:3426 (mesh_draw)`; `crates/metal2vulkan/src/bind/graphics.rs:3483 (emulated_draw)` - `feature::IntersectionFunctionTable`: `crates/metal2vulkan/src/bind/acceleration.rs:177 (geometry_table_offset)`; `crates/metal2vulkan/src/bind/acceleration.rs:183 (geometry_table_offset)`; `crates/metal2vulkan/src/bind/acceleration.rs:188 (geometry_table_offset)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1222 (null_table)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1251 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1272 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:406 (table_of)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:422 (select_table)`; `crates/metal2vulkan/src/lower/select.rs:885 (route_air)` - `feature::IndependentBlending`: `crates/metal2vulkan-runtime/src/render.rs:2201 (check_pipeline)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:1020 (uniform_blend)` - `feature::RasterSampleCount`: `crates/metal2vulkan-runtime/src/families/limits.rs:1063 (sample_count)`; `crates/metal2vulkan/src/pipeline/graphics.rs:573 (sample_count_properties)` @@ -395,7 +395,7 @@ Each refusal's sites, with the function that builds it. - `feature::TextureSwizzle`: `crates/metal2vulkan-runtime/src/binding_view.rs:167 (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs:1028 (may_view)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1114 (plain_texture)`; `crates/metal2vulkan/src/lower/sampler/select.rs:2591 (select_one)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3499 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3856 (select_write)`; `crates/metal2vulkan/src/lower/texture/slice.rs:307 (select)` - `feature::MipmapGeneration`: `crates/metal2vulkan-runtime/src/blit_texture.rs:1904 (mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_pick.rs:37 (pick_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:262 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:270 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:275 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:304 (plan_mipmaps)`; `crates/metal2vulkan/src/bind/mipmap_filter.rs:973 (mipmap_filter_module)` - `feature::HostMemory`: `crates/metal2vulkan-runtime/src/host_memory.rs:430 (not_importable)`; `crates/metal2vulkan-runtime/src/host_memory.rs:470 (refuse_unwritable)`; `crates/metal2vulkan-runtime/src/host_memory.rs:689 (new)`; `crates/metal2vulkan-runtime/src/host_memory.rs:694 (new)`; `crates/metal2vulkan-runtime/src/host_memory.rs:712 (new)` -- `feature::GpuTimes`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2941 (gpu_times)` +- `feature::GpuTimes`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2945 (gpu_times)` - `feature::CountingVisibility`: `crates/metal2vulkan-runtime/src/visibility.rs:452 (check_mode)` - `feature::ViewFormatReinterpretation`: `crates/metal2vulkan-runtime/src/view_plan.rs:573 (reinterpretation_refused)` - `feature::SeparateMultisampledDepthStencil`: `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:188 (sampled_candidate)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:294 (by_draws)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:336 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:376 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:777 (plan)`; `crates/metal2vulkan-runtime/src/nan_clear.rs:658 (nan_write)`; `crates/metal2vulkan-runtime/src/texture/signed_depth.rs:191 (sample_strip)` @@ -481,7 +481,7 @@ Each refusal's sites, with the function that builds it. - `gap::MultisampledBufferCopy`: `crates/metal2vulkan-runtime/src/blit_texture.rs:536 (copy_from_buffer_to_texture)`; `crates/metal2vulkan-runtime/src/blit_texture.rs:693 (copy_from_texture_to_buffer)` - `gap::MultisampledBufferLayout`: `crates/metal2vulkan-runtime/src/sample_interleave.rs:1029 (plan)` - `gap::ColorAttachmentGroups`: `crates/metal2vulkan-runtime/src/render/color_groups.rs:106 (gap)` -- `apple::ProtectedContent`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2472 (commit_now)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126 (refuse_protected_state_encoder)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:52 (set)` +- `apple::ProtectedContent`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2476 (commit_now)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126 (refuse_protected_state_encoder)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:52 (set)` - `apple::LineWidth`: `crates/metal2vulkan-runtime/src/apple_only.rs:190 (check)` - `apple::ViewportTransformDisabled`: `crates/metal2vulkan-runtime/src/apple_only.rs:192 (check)` - `apple::VertexAmplificationMode`: `crates/metal2vulkan-runtime/src/apple_only.rs:196 (check)`; `crates/metal2vulkan-runtime/src/apple_only.rs:321 (set_vertex_amplification_mode)` @@ -492,7 +492,7 @@ Each refusal's sites, with the function that builds it. - `bind::TessellationFactorRange`: `crates/metal2vulkan/src/bind/graphics.rs:3834 (patch_binding)` - `bind::PatchIndexRange`: `crates/metal2vulkan/src/bind/graphics.rs:3878 (patch_binding)` - `bind::ControlPointIndexRange`: `crates/metal2vulkan/src/bind/graphics.rs:3916 (patch_binding)` -- `bind::MissingStageInRegion`: `crates/metal2vulkan/src/bind/dispatch.rs:878 (instantiate)` +- `bind::MissingStageInRegion`: `crates/metal2vulkan/src/bind/dispatch.rs:879 (instantiate)` - `bind::UniformViewAliased`: `crates/metal2vulkan/src/bind/instantiate.rs:609 (check_uniform_aliasing)` - `bind::MissingDeviceAddress`: `crates/metal2vulkan/src/bind/plan/slots.rs:133 (plan_buffer)` - `limit::InlinedInstructions`: `crates/metal2vulkan-air/src/canon/inline.rs:330 (u32_of)`; `crates/metal2vulkan-air/src/canon/inline.rs:334 (usize_of)`; `crates/metal2vulkan-air/src/canon/inline.rs:61 (inline)`