Key the driver tables by driver and GPU, never by release
One work packet, landed as 3 commits (a1f70a4962..ae43dbc9b3 on archive/development-linear-2026-10-28), in order:
* Key the driver tables by driver and GPU, never by release
The owner's ruling: the driver-release table goes. A driver's measured deviations, defects and
runtime facts were keyed on `driverVersion` windows, and a device whose exact identity (driver,
vendor, deviceID and release) was not measured fell off every measured answer onto the exact
paths, with an informational `metal2vulkan-unmeasured-driver` message, and a release past the last
measured recorded `PrecisionNote::BeyondMeasuredDeviation` in every module.
Now every row of `device::driver_facts` (DEVIATIONS, DEFECTS, MEASURED) and of the runtime's
`driver_defects` names a driver and, where it was measured on some alone, a vendor and a GPU
(`deviceID`, read by `canonical_device_id`), and holds at every release of that driver.
Removed:
- `Measured::{first, last}`, `Standing`, `NAMED_RELEASES`, `MeasuredDevice`, `MEASURED_DEVICES`,
the `mesa`/`nvidia`/`moltenvk` release encoders;
- `DeviceDescription::{measured_identity, driver_facts_withheld, measured_gpu,
assumed_unmeasured}` and `DriverFact::assumed_where_unmeasured`;
- the runtime's `DeviceOptions::assume_unmeasured_identity`, `DeviceProperties::driver_facts_withheld`,
`unmeasured_driver_message` and the `metal2vulkan-unmeasured-driver` message;
- `PrecisionNote::BeyondMeasuredDeviation`, its degrade code `beyond-measured-deviation`,
`ProfileFields::deviations_beyond` and `DeviceProfile::driver_deviations`;
- the runtime defects' clean list is GPUs alone (the RTX 5080 Laptop GPU, the Radeon 780M).
Rows the release windows made redundant were merged (MoltenVK 1.4.1's and 1.4.2's: 112 deviation
rows to 86, 98 runtime fact rows to 80). Two MoltenVK defects measured on Apple's GPUs now name
MoltenVK on every GPU (`TimestampPoolsAreCounterSampleBuffers`,
`DepthStencilImagesStayGpuOptimized`), keeping the reach the unmeasured-identity rule gave them.
What changes on the committed profiles: RADV's RDNA2 and RDNA3 captures take RADV's
`RobustIndexFetchReadsZero` and `InterpolationNeedsTheWholeQuad`; ANV's Arrow Lake and Tiger Lake
captures take ANV's driver-wide rows (hidden aliased writes, host-transfer bytes, the first sparse
resource's wait, the dispatched copies) and `VertexGroupingNotApples`; NVIDIA's Pascal and RTX 50
desktop captures take `DepthImageKeepsDenormals`; lavapipe takes its 26.2.4 rows
(`SubmissionsWithoutSignalsMerge`, the 8-bit linear filter's bound); MoltenVK's capture takes the
rows measured at 1.4.2 on its deviceID (`MetalFullQuads`, `FragmentDepthKeepsDepth16Codes`,
`BlendlessColorAttachmentsWarn`, the heap colour layouts). A defect fixed in a later release (the
780M's implicit preprocessing, broken at 26.0.8 and clean at 26.2.4) is now the GPU's at every
release.
SEMANTICS_VERSION 1869, ARTIFACT_FORMAT_VERSION 452 (a `PrecisionNote` member removed),
RUNTIME_VERSION 1650.
Verified: clippy clean (workspace, all targets, all features; plain and `--cfg m2v_gpu`); the core
suites (metal2vulkan, -runtime, -air, -devtools) pass but the golden and fixture tables, whose M4
columns and changed outputs are re-blessed on development after this lands.
* Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
* Re-bless the engine inventory and the golden tables
Blessed on development at b1ae235a12, after the Apple M4 profile left (its columns go) and the
driver tables stopped naming releases (the committed RADV, ANV, NVIDIA, lavapipe and MoltenVK
captures take the rows their drivers and GPUs were measured with, which changes their modules).
Verified: bless_engine_inventory, bless_golden_hashes and bless_engine_goldens each passed
(exit 0) in a tree at b1ae235a12.
This commit is contained in:
1 parent
00f7c18aab
commit
d4412c9c95
53 files changed
+7067
-8667
No files matched your search
@@ -140,7 +140,6 @@ Vulkan-side choices Metal has no counterpart for:
|
||||
| `announce_each` | Degradation kinds to announce at every occurrence instead of once. |
|
||||
| `lowering_refuses` | Degradation kinds that refuse a render encoder's call when its lowering after the call meets them (`RenderLoweringPolicy::Worker`), failing its command buffer, instead of being announced. Empty by default. |
|
||||
| `record_executions` | Keep, per command buffer, which pipeline each dispatch and draw ran (`CommandBuffer::executions`). Off by default. |
|
||||
| `assume_unmeasured_identity` | A diagnostic: take the device as another GPU of its driver at its release, one no measurement names, so it runs the paths an unmeasured device of that driver runs (every exact path, every assumed defect, no deviation measured on one GPU alone) and says so in its `metal2vulkan-unmeasured-driver` message. Off by default. |
|
||||
|
||||
While a handle lives, equal options give the same device for a physical device, as Metal has one
|
||||
`MTLDevice` per GPU. Nothing is read from the environment but the platform's default cache
|
||||
|
||||
@@ -139,17 +139,9 @@ pub struct DeviceProperties {
|
||||
/// ([`Needs::RuntimeDriverDefect`](metal2vulkan::error::Needs::RuntimeDriverDefect)).
|
||||
pub driver_defects: BTreeSet<RuntimeDriverDefect>,
|
||||
/// What the device's driver is measured to answer where Vulkan leaves the result undefined,
|
||||
/// from its identity and release ([`DeviceDescription::driver_facts`]): the runtime relies on
|
||||
/// one only where the driver has it, and elsewhere takes the exact path that needs none.
|
||||
/// from its identity and GPU ([`DeviceDescription::driver_facts`]): the runtime relies on one
|
||||
/// only where the driver has it, and elsewhere takes the exact path that needs none.
|
||||
pub driver_facts: BTreeSet<DriverFact>,
|
||||
/// The answer facts the device's driver is measured to give on another release or GPU, which
|
||||
/// the device does not take because its identity (driver, GPU and release) is not measured
|
||||
/// ([`DeviceDescription::driver_facts_withheld`]): the runtime takes the exact path instead,
|
||||
/// assumes the driver's measured defects ([`driver_facts`](Self::driver_facts),
|
||||
/// [`driver_defects`](Self::driver_defects)), and says so once as it is made in an
|
||||
/// informational message, `metal2vulkan-unmeasured-driver` (`driver_facts.rs`, no degrade
|
||||
/// notice, as the paths it takes are exact).
|
||||
pub driver_facts_withheld: BTreeSet<DriverFact>,
|
||||
/// The pixel interlock is enabled, so every fragment function's raster order groups are
|
||||
/// ordered.
|
||||
raster_order_groups: bool,
|
||||
@@ -237,7 +229,6 @@ impl DeviceProperties {
|
||||
max_vertex_amplification_count,
|
||||
driver_defects: driver_defects::of(&description),
|
||||
driver_facts: description.driver_facts(),
|
||||
driver_facts_withheld: description.driver_facts_withheld(),
|
||||
description,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2139,7 +2139,6 @@ degradations! {
|
||||
QuadsCountedBeforeDiscard = "quads-counted-before-discard";
|
||||
DeviceDepthComparison = "device-depth-comparison";
|
||||
DeviceTexelDenormals = "device-texel-denormals";
|
||||
BeyondMeasuredDeviation = "beyond-measured-deviation";
|
||||
ViewBaseTexelOffset = "view-base-texel-offset";
|
||||
DeviceColorConversion = "device-color-conversion";
|
||||
DeviceInterpolation = "device-interpolation";
|
||||
@@ -3856,8 +3855,7 @@ impl Device {
|
||||
}
|
||||
|
||||
/// Why a stage that records `note` degrades: the note, and for
|
||||
/// `PrecisionNote::BeyondMeasuredDeviation` each deviation the device's profile takes past
|
||||
/// its measurement, with the last release measured.
|
||||
/// `PrecisionNote::FragmentSimdgroupGrouping` the device's grouping.
|
||||
fn note_reason(&self, note: PrecisionNote) -> String {
|
||||
let recorded = format!("its translation records `PrecisionNote::{note:?}`");
|
||||
if note == PrecisionNote::FragmentSimdgroupGrouping {
|
||||
@@ -3867,21 +3865,7 @@ impl Device {
|
||||
self.name()
|
||||
);
|
||||
}
|
||||
if note != PrecisionNote::BeyondMeasuredDeviation {
|
||||
return recorded;
|
||||
}
|
||||
let profile = self.compile_device().profile();
|
||||
let named: Vec<String> = profile
|
||||
.driver_deviations()
|
||||
.iter()
|
||||
.map(|(deviation, last)| {
|
||||
format!("{deviation:?} (measured through driverVersion {last:#x})")
|
||||
})
|
||||
.collect();
|
||||
format!(
|
||||
"{recorded}: the driver's deviations measured on earlier releases: {}",
|
||||
named.join(", ")
|
||||
)
|
||||
recorded
|
||||
}
|
||||
|
||||
/// Announce what the pass `layout` (an ended encoder's, recorded) degrades: separate depth
|
||||
|
||||
@@ -178,16 +178,6 @@ pub struct DeviceOptions {
|
||||
/// No Metal counterpart.
|
||||
#[doc(hidden)]
|
||||
pub record_executions: bool,
|
||||
/// Take each device as an identity no measurement names
|
||||
/// ([`DeviceDescription::assumed_unmeasured`]), whatever its driver, GPU and release are: as
|
||||
/// another GPU of its driver at its release. The device then takes the paths an unmeasured
|
||||
/// identity of its driver takes, in translation and in the runtime: no deviation or defect
|
||||
/// measured on one GPU alone, every exact path in place of an answer fact, every defect its
|
||||
/// driver is measured with assumed, and the informational message
|
||||
/// `metal2vulkan-unmeasured-driver` naming them as the device is made. Off by default. A
|
||||
/// diagnostic, for running a measured device as an unmeasured one of its driver runs (a
|
||||
/// report from a GPU no venue measured). No Metal counterpart.
|
||||
pub assume_unmeasured_identity: bool,
|
||||
/// Make each device's check of the first move of an image over host pages fail whatever the
|
||||
/// moves did (`in_place_check.rs`), and keep no record of it: every texture over host pages
|
||||
/// is then a shadow, its notice naming the failed check. Off by default. A test hook, for the
|
||||
@@ -1213,16 +1203,6 @@ pub(super) fn argument_buffers_kept(description: &DeviceDescription) -> Result<(
|
||||
check(Facts::of(description).argument_buffers())
|
||||
}
|
||||
|
||||
/// `description` as `options` take its identity: an identity no measurement names where they
|
||||
/// assume one ([`DeviceOptions::assume_unmeasured_identity`]), else as the device reports it.
|
||||
pub(crate) fn identity_as_options(
|
||||
mut description: DeviceDescription,
|
||||
options: &DeviceOptions,
|
||||
) -> DeviceDescription {
|
||||
description.assumed_unmeasured = options.assume_unmeasured_identity;
|
||||
description
|
||||
}
|
||||
|
||||
/// A device on `physical`, made from `instance`.
|
||||
fn create_on(
|
||||
instance: &Arc<InstanceShared>,
|
||||
@@ -1234,7 +1214,6 @@ fn create_on(
|
||||
let description =
|
||||
unsafe { DeviceDescription::query(&instance.raw, physical, instance.api_version) }
|
||||
.map_err(device_error)?;
|
||||
let description = identity_as_options(description, options);
|
||||
// SAFETY: as above.
|
||||
unsafe { timeline_conformant(&instance.raw, physical) }?;
|
||||
argument_buffers_kept(&description)?;
|
||||
@@ -1574,7 +1553,6 @@ fn same_options(a: &DeviceOptions, b: &DeviceOptions) -> bool {
|
||||
announce_each,
|
||||
lowering_refuses,
|
||||
record_executions,
|
||||
assume_unmeasured_identity,
|
||||
fail_in_place_check,
|
||||
} = a;
|
||||
*policy == b.policy
|
||||
@@ -1595,7 +1573,6 @@ fn same_options(a: &DeviceOptions, b: &DeviceOptions) -> bool {
|
||||
&& *announce_each == b.announce_each
|
||||
&& *lowering_refuses == b.lowering_refuses
|
||||
&& *record_executions == b.record_executions
|
||||
&& *assume_unmeasured_identity == b.assume_unmeasured_identity
|
||||
&& *fail_in_place_check == b.fail_in_place_check
|
||||
}
|
||||
|
||||
|
||||
@@ -1839,7 +1839,6 @@ impl Device {
|
||||
// Woken by the scheduler's thread for what a commit queued (`recorder`).
|
||||
(device.shared().scheduler).wake_recorder(Arc::clone(recorder));
|
||||
}
|
||||
device.say_unmeasured_driver();
|
||||
// The verdicts of its check of textures over host pages, where a record holds them.
|
||||
device.recall_in_place_checks();
|
||||
device.degrade_argument_buffers_unread();
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
//! The defects of a device's driver in commands the runtime records for itself, keyed on the
|
||||
//! driver's identity, release and GPU: `VkPhysicalDeviceDriverProperties`'s `driverID`, and
|
||||
//! `VkPhysicalDeviceProperties`'s `driverVersion`, which each driver raises with every release
|
||||
//! (Mesa encodes it as `VK_MAKE_API_VERSION`, MoltenVK as `major * 10000 + minor * 100 + patch`),
|
||||
//! and `deviceID`. A device's defects are in its properties
|
||||
//! ([`DeviceProperties::driver_defects`](super::DeviceProperties::driver_defects)), and what a
|
||||
//! defect breaks is taken another way where an exact one exists, else refused there, typed
|
||||
//! driver's identity and GPU: `VkPhysicalDeviceDriverProperties`'s `driverID` and
|
||||
//! `VkPhysicalDeviceProperties`'s `deviceID`, never its release. A device's defects are in its
|
||||
//! properties ([`DeviceProperties::driver_defects`](super::DeviceProperties::driver_defects)), and
|
||||
//! what a defect breaks is taken another way where an exact one exists, else refused there, typed
|
||||
//! ([`Needs::RuntimeDriverDefect`]), never run wrong unannounced: only where a refusal would
|
||||
//! withhold a feature of the families the device claims (a row of the feature table,
|
||||
//! `families/features.rs`) does it run, announced as a degradation.
|
||||
//!
|
||||
//! Each defect lists the drivers that have it and, for each, the measured identities a probe found
|
||||
//! clean: a GPU (`deviceID`, the one it was measured under for a GPU that reports several:
|
||||
//! `DeviceDescription::canonical_device_id`) at one release, which the device layer measured
|
||||
//! (`DeviceDescription::measured_identity`). Every other release and GPU of the driver has it,
|
||||
//! measured broken or not measured at all, so a release or GPU nobody probed takes the exact path,
|
||||
//! and one probed clean then needs only its identity in the list, not new code.
|
||||
//! Each defect lists the drivers that have it and, for each, the GPUs a probe found clean
|
||||
//! (`deviceID`, the one it was measured under for a GPU that reports several:
|
||||
//! `DeviceDescription::canonical_device_id`). Every other GPU of the driver has it, measured broken
|
||||
//! or not measured at all, so a GPU nobody probed takes the exact path, and one probed clean then
|
||||
//! needs only its `deviceID` in the list, not new code.
|
||||
//!
|
||||
//! None is a translation's (`DriverWorkaround` covers those), so none is in the compile profile,
|
||||
//! a cache key or a digest.
|
||||
@@ -30,9 +27,9 @@ use std::collections::BTreeSet;
|
||||
pub(super) struct Affected {
|
||||
pub(super) defect: RuntimeDriverDefect,
|
||||
pub(super) driver: DriverId,
|
||||
/// The measured identities a probe found without the defect, each a GPU (`deviceID`) at one
|
||||
/// release (`driverVersion`); every other GPU and release of the driver has it.
|
||||
pub(super) clean: &'static [(u32, u32)],
|
||||
/// The GPUs (`deviceID`) a probe found without the defect; every other GPU of the driver
|
||||
/// has it.
|
||||
pub(super) clean: &'static [u32],
|
||||
}
|
||||
|
||||
/// Every known defect, by driver.
|
||||
@@ -428,8 +425,8 @@ pub(super) const AFFECTED: &[Affected] = &[
|
||||
Affected {
|
||||
defect: RuntimeDriverDefect::MultisampledStencilColourCopies,
|
||||
driver: DriverId::NVIDIA_PROPRIETARY,
|
||||
// The RTX 5080 Laptop GPU at 615.71.09, measured clean.
|
||||
clean: &[(0x2c19, (615 << 22) | (71 << 14) | (9 << 6))],
|
||||
// The RTX 5080 Laptop GPU, measured clean.
|
||||
clean: &[0x2c19],
|
||||
},
|
||||
Affected {
|
||||
defect: RuntimeDriverDefect::NormalizedDepthPastUnitRange,
|
||||
@@ -489,8 +486,8 @@ pub(super) const AFFECTED: &[Affected] = &[
|
||||
Affected {
|
||||
defect: RuntimeDriverDefect::ImplicitPreprocessAfterExecutionSet,
|
||||
driver: DriverId::MESA_RADV,
|
||||
// The Radeon 780M at 26.2.4, measured clean.
|
||||
clean: &[(0x15bf, (26 << 22) | (2 << 12) | 4)],
|
||||
// The Radeon 780M, measured clean.
|
||||
clean: &[0x15bf],
|
||||
},
|
||||
Affected {
|
||||
defect: RuntimeDriverDefect::FreedAddressMemoryFailsPendingWork,
|
||||
@@ -530,29 +527,26 @@ pub(super) const AFFECTED: &[Affected] = &[
|
||||
];
|
||||
|
||||
/// The defects of the driver and device `description` names, its GPU read by the `deviceID` it
|
||||
/// was measured under (`DeviceDescription::measured_gpu`).
|
||||
/// was measured under (`DeviceDescription::canonical_device_id`).
|
||||
pub(super) fn of(description: &DeviceDescription) -> BTreeSet<RuntimeDriverDefect> {
|
||||
among(
|
||||
AFFECTED,
|
||||
description.driver_id,
|
||||
description.measured_gpu(),
|
||||
description.driver_version,
|
||||
description.canonical_device_id(),
|
||||
)
|
||||
}
|
||||
|
||||
/// The defects of `table` that the driver `driver` has on the device `device` at release
|
||||
/// `version`: each of the driver's but those a probe found clean on that GPU at that release. A
|
||||
/// `device` of `None` is a GPU no probe ran (`DeviceDescription::measured_gpu`): it has them all.
|
||||
/// The defects of `table` that the driver `driver` has on the GPU `device`: each of the driver's
|
||||
/// but those a probe found clean on that GPU.
|
||||
pub(super) fn among(
|
||||
table: &[Affected],
|
||||
driver: Option<DriverId>,
|
||||
device: Option<u32>,
|
||||
version: u32,
|
||||
device: u32,
|
||||
) -> BTreeSet<RuntimeDriverDefect> {
|
||||
table
|
||||
.iter()
|
||||
.filter(|affected| Some(affected.driver) == driver)
|
||||
.filter(|affected| !device.is_some_and(|d| affected.clean.contains(&(d, version))))
|
||||
.filter(|affected| !affected.clean.contains(&device))
|
||||
.map(|affected| affected.defect)
|
||||
.collect()
|
||||
}
|
||||
@@ -1,43 +1,19 @@
|
||||
//! The runtime's message of a device whose driver, GPU and release were not measured
|
||||
//! (which replaced the announcement of facts taken past their measurement). The facts, a driver's
|
||||
//! measured answers where Vulkan leaves the result undefined
|
||||
//! The runtime's informational messages and driver diagnostics. The facts, a driver's measured
|
||||
//! answers where Vulkan leaves the result undefined
|
||||
//! ([`DriverFact`](metal2vulkan::device::DriverFact)), are rows of the table type the description's
|
||||
//! deviations share (`device::driver_facts`), keyed on the driver's identity and release:
|
||||
//! `VkPhysicalDeviceDriverProperties`'s `driverID` and `VkPhysicalDeviceProperties`'s
|
||||
//! `driverVersion`. A device's facts are in its properties
|
||||
//! ([`DeviceProperties::driver_facts`](super::DeviceProperties::driver_facts)). The runtime
|
||||
//! relies on a fact only where the driver is measured to have it, and elsewhere takes the exact
|
||||
//! path that needs none.
|
||||
//!
|
||||
//! Each row names a driver and the first and last releases measured with the fact, and the vendor
|
||||
//! and GPU where it was measured on some alone. The facts are taken on a measured identity alone, a
|
||||
//! driver at a release on a GPU a venue ran (`DeviceDescription::measured_identity`). On any other,
|
||||
//! a later or earlier release or another GPU, the device takes no answer fact (the runtime takes
|
||||
//! the exact path instead) and assumes its driver's measured defects, and says so once as it is
|
||||
//! made in an informational message (`metal2vulkan-unmeasured-driver`, no degrade notice, as the
|
||||
//! paths it takes are exact), naming what it withholds and assumes. A lane that measures a fact runs at the master gate on each venue, so a measured
|
||||
//! identity whose answer changes fails there rather than drawing wrong.
|
||||
//! deviations share (`device::driver_facts`), keyed on the driver's identity and, where measured
|
||||
//! on some alone, its GPU vendor and GPU: `VkPhysicalDeviceDriverProperties`'s `driverID` and
|
||||
//! `VkPhysicalDeviceProperties`'s `vendorID` and `deviceID`, never its release. A device's facts
|
||||
//! are in its properties ([`DeviceProperties::driver_facts`](super::DeviceProperties::driver_facts)).
|
||||
//!
|
||||
//! A driver diagnostic fact names a message the driver reports inside one call where Vulkan states
|
||||
//! nothing wrong: inside that call alone, on a release measured with it, the device withholds that
|
||||
//! message from its sink ([`expecting`], [`withholds`]) and counts it
|
||||
//! (`WorkCounts::driver_diagnostics_withheld`).
|
||||
//! nothing wrong: inside that call alone the device withholds that message from its sink
|
||||
//! ([`expecting`], [`withholds`]) and counts it (`WorkCounts::driver_diagnostics_withheld`).
|
||||
|
||||
use crate::{DebugMessage, MessageKind, MessageSeverity, MessageSink};
|
||||
use metal2vulkan::device::DriverDiagnostic;
|
||||
|
||||
impl super::Device {
|
||||
/// Say once, as the device is made, that its identity is not measured, where its driver has
|
||||
/// a measured answer it therefore withholds or a measured defect it assumes (the module
|
||||
/// docs): an informational message, id name `metal2vulkan-unmeasured-driver`, to the device's
|
||||
/// sink, else on stderr. The paths it takes are exact, so it degrades nothing and is no
|
||||
/// degrade notice.
|
||||
pub(super) fn say_unmeasured_driver(&self) {
|
||||
if let Some(text) = unmeasured_driver(self.properties()) {
|
||||
self.inform(UNMEASURED_DRIVER, text);
|
||||
}
|
||||
}
|
||||
|
||||
/// Hand the informational message `text`, id name `id_name`, to the device's sink, else to
|
||||
/// stderr: what the runtime says that degrades nothing (the pipeline creation log).
|
||||
pub(crate) fn inform(&self, id_name: &str, text: String) {
|
||||
@@ -68,56 +44,6 @@ fn informational(id_name: &str, text: String) -> DebugMessage {
|
||||
}
|
||||
}
|
||||
|
||||
/// The informational message a device of `properties` sends as it is made where its identity is
|
||||
/// not measured (`metal2vulkan-unmeasured-driver`), as its sink receives it; `None` where it
|
||||
/// sends none. It reads the fact the device's own message reads (`unmeasured_driver`), so a
|
||||
/// check of what a device said as it was made expects the message exactly where the device
|
||||
/// sends it.
|
||||
#[doc(hidden)]
|
||||
pub fn unmeasured_driver_message(properties: &super::DeviceProperties) -> Option<DebugMessage> {
|
||||
unmeasured_driver(properties).map(|text| informational(UNMEASURED_DRIVER, text))
|
||||
}
|
||||
|
||||
/// The id name of the message a device whose identity is not measured sends as it is made
|
||||
/// ([`unmeasured_driver`]).
|
||||
pub(crate) const UNMEASURED_DRIVER: &str = "metal2vulkan-unmeasured-driver";
|
||||
|
||||
/// The text of the informational message a device of `properties` sends as it is made: where its
|
||||
/// identity is not measured and its driver has an answer measured elsewhere that it withholds
|
||||
/// or a defect measured elsewhere that it assumes, naming the identity and each; `None`
|
||||
/// elsewhere (a measured identity, or a driver with nothing measured).
|
||||
pub(crate) fn unmeasured_driver(properties: &super::DeviceProperties) -> Option<String> {
|
||||
let description = &properties.description;
|
||||
if description.measured_identity() {
|
||||
return None;
|
||||
}
|
||||
let withheld: Vec<String> = (properties.driver_facts_withheld.iter())
|
||||
.map(|fact| format!("{fact:?}"))
|
||||
.collect();
|
||||
let assumed: Vec<String> = (properties.driver_facts.iter())
|
||||
.map(|fact| format!("{fact:?}"))
|
||||
.chain(properties.driver_defects.iter().map(|d| format!("{d:?}")))
|
||||
.collect();
|
||||
if withheld.is_empty() && assumed.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let list = |names: Vec<String>| match names.is_empty() {
|
||||
true => "none".to_owned(),
|
||||
false => names.join(", "),
|
||||
};
|
||||
Some(format!(
|
||||
"metal2vulkan: the device's driver {:?} at driverVersion {:#x} on deviceID {:#x} is an \
|
||||
identity not measured: the runtime takes the exact path in place of the driver's answers \
|
||||
measured elsewhere ({}) and works around its defects measured elsewhere ({}); every \
|
||||
answer is Metal's [{UNMEASURED_DRIVER}]",
|
||||
description.driver_id,
|
||||
description.driver_version,
|
||||
description.device_id,
|
||||
list(withheld),
|
||||
list(assumed),
|
||||
))
|
||||
}
|
||||
|
||||
/// The driver diagnostics ([`DriverDiagnostic`]) the thread's current driver call is measured to
|
||||
/// report, and how many of them it reported so far: set only inside [`expecting`].
|
||||
struct Expected {
|
||||
|
||||
@@ -78,7 +78,6 @@ mod draw_source;
|
||||
mod driver_defects;
|
||||
mod driver_facts;
|
||||
#[doc(hidden)]
|
||||
pub use driver_facts::unmeasured_driver_message;
|
||||
mod dynamic_library;
|
||||
mod dynamic_state;
|
||||
mod enables;
|
||||
|
||||
@@ -305,9 +305,8 @@ fn only_drivers_measured_to_merge_their_submissions_group_their_batches() {
|
||||
/// (`DriverFact::QueueFailuresReportedByMessenger`); every other driver takes none, and its
|
||||
/// batches take a fence only where their command buffer ends at one.
|
||||
///
|
||||
/// It is a **defect** fact, so a driver with a row takes it at every release and on every GPU
|
||||
/// (`DriverFact::assumed_where_unmeasured`): that is what makes the fact answer exactly as the
|
||||
/// driver's name did, and the check is that MoltenVK's profiles take it while every other
|
||||
/// Its row names MoltenVK on every GPU at every release: that is what makes the fact answer
|
||||
/// exactly as the driver's name did, and the check is that MoltenVK's profiles take it while every other
|
||||
/// committed profile -- RADV's, ANV's, NVIDIA's, lavapipe's and SwiftShader's -- does not,
|
||||
/// including at a release and on a GPU no lane measured.
|
||||
#[test]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! The runtime's driver defects, keyed on the driver's identity and release
|
||||
//! (`driver_defects.rs`).
|
||||
//! The runtime's driver defects, keyed on the driver and its GPU (`driver_defects.rs`).
|
||||
|
||||
use super::super::driver_defects::{among, of, Affected, AFFECTED};
|
||||
use metal2vulkan::device::DeviceDescription;
|
||||
@@ -43,13 +42,13 @@ const LOST_SIGNALS: RuntimeDriverDefect = RuntimeDriverDefect::WaitForAnyObjectL
|
||||
/// 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
|
||||
/// preprocessing after an execution set on every GPU but the 780M (Phoenix's and Hawk Point's),
|
||||
/// measured clean; ANV
|
||||
/// the compressed image's short size, the occlusion count per color output and the pushed
|
||||
/// descriptors a pipeline bind leaves stale on every GPU (Arrow Lake's, not measured, too);
|
||||
/// NVIDIA's the
|
||||
/// stencil colour copies on every GPU but the RTX 5080 Laptop GPU at 615.71.09, measured clean (the
|
||||
/// GTX 1060 and the RTX 5080 desktop GPU, not measured, take them); SwiftShader none.
|
||||
/// stencil colour copies on every GPU but the RTX 5080 Laptop GPU, measured clean (the GTX 1060 and
|
||||
/// the RTX 5080 desktop GPU, not measured, take them); SwiftShader none.
|
||||
#[test]
|
||||
fn the_committed_profiles_drivers_have_their_defects() {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
@@ -80,20 +79,13 @@ fn the_committed_profiles_drivers_have_their_defects() {
|
||||
]
|
||||
}
|
||||
Some(DriverId::MESA_LLVMPIPE) => vec![COPIES, RESOLVES, PAST_HEIGHT, BAKED_SAMPLERS],
|
||||
// The 780M at 26.2.4, under Phoenix's `deviceID` and Hawk Point's.
|
||||
Some(DriverId::MESA_RADV)
|
||||
if matches!(desc.device_id, 0x15bf | 0x1900)
|
||||
&& desc.driver_version == MESA_26_2_4 =>
|
||||
{
|
||||
// The 780M, under Phoenix's `deviceID` and Hawk Point's.
|
||||
Some(DriverId::MESA_RADV) if matches!(desc.device_id, 0x15bf | 0x1900) => {
|
||||
vec![NAN_COPIES]
|
||||
}
|
||||
Some(DriverId::MESA_RADV) => vec![NAN_COPIES, PREPROCESS],
|
||||
Some(DriverId::INTEL_OPEN_SOURCE_MESA) => vec![COMPRESSION, COUNTS, STALE_PUSHES],
|
||||
Some(DriverId::NVIDIA_PROPRIETARY)
|
||||
if (desc.device_id, desc.driver_version) == (0x2c19, NVIDIA_615_71_09) =>
|
||||
{
|
||||
Vec::new()
|
||||
}
|
||||
Some(DriverId::NVIDIA_PROPRIETARY) if desc.device_id == 0x2c19 => Vec::new(),
|
||||
Some(DriverId::NVIDIA_PROPRIETARY) => vec![STENCIL_COPIES],
|
||||
_ => Vec::new(),
|
||||
};
|
||||
@@ -107,116 +99,70 @@ fn the_committed_profiles_drivers_have_their_defects() {
|
||||
);
|
||||
}
|
||||
|
||||
/// Mesa's `driverVersion` of 26.2.4: `VK_MAKE_API_VERSION(0, 26, 2, 4)`.
|
||||
const MESA_26_2_4: u32 = (26 << 22) | (2 << 12) | 4;
|
||||
|
||||
/// NVIDIA's `driverVersion` of 615.71.09: the release's major, minor and patch in 10, 8 and 6 bits
|
||||
/// from bit 22, 14 and 6.
|
||||
const NVIDIA_615_71_09: u32 = (615 << 22) | (71 << 14) | (9 << 6);
|
||||
|
||||
/// A driver has a defect at every release and on every GPU but a measured identity a probe found
|
||||
/// clean; another driver, or none, has none of it.
|
||||
/// A driver has a defect on every GPU but one a probe found clean, at every release; another
|
||||
/// driver, or none, has none of it.
|
||||
#[test]
|
||||
fn a_clean_identity_alone_lacks_the_defect() {
|
||||
// Mesa's `driverVersion`: `VK_MAKE_API_VERSION(0, major, minor, patch)`.
|
||||
let mesa = |minor: u32, patch: u32| (26 << 22) | (minor << 12) | patch;
|
||||
fn a_clean_gpu_alone_lacks_the_defect() {
|
||||
let table = [Affected {
|
||||
defect: COPIES,
|
||||
driver: DriverId::MESA_LLVMPIPE,
|
||||
clean: &[(0, (26 << 22) | (3 << 12))],
|
||||
clean: &[0],
|
||||
}];
|
||||
let lavapipe = Some(DriverId::MESA_LLVMPIPE);
|
||||
assert!(among(&table, lavapipe, Some(0), mesa(2, 9)).contains(&COPIES));
|
||||
assert!(among(&table, lavapipe, Some(0), mesa(3, 0)).is_empty());
|
||||
assert!(among(&table, lavapipe, Some(0), mesa(3, 1)).contains(&COPIES));
|
||||
assert!(among(&table, lavapipe, Some(1), mesa(3, 0)).contains(&COPIES));
|
||||
assert!(among(&table, Some(DriverId::MESA_RADV), Some(0), mesa(2, 9)).is_empty());
|
||||
assert!(among(&table, None, Some(0), mesa(2, 9)).is_empty());
|
||||
assert!(among(&table, lavapipe, 0).is_empty());
|
||||
assert!(among(&table, lavapipe, 1).contains(&COPIES));
|
||||
assert!(among(&table, Some(DriverId::MESA_RADV), 1).is_empty());
|
||||
assert!(among(&table, None, 1).is_empty());
|
||||
}
|
||||
|
||||
/// NVIDIA's stencil colour-copy defect, measured on the RTX 3090 (`deviceID` 0x2204) at 615.71.09,
|
||||
/// is every NVIDIA GPU's at every release but the RTX 5080 Laptop GPU's (0x2c19) at 615.71.09,
|
||||
/// measured clean: the RTX 3070 (0x2484), an Ada GPU (0x2684) and the 5080 Laptop GPU at another
|
||||
/// release take it; a device that runs another driver has none.
|
||||
/// NVIDIA's stencil colour-copy defect, measured on the RTX 3090 (`deviceID` 0x2204), is every
|
||||
/// NVIDIA GPU's but the RTX 5080 Laptop GPU's (0x2c19), measured clean: the RTX 3070 (0x2484) and
|
||||
/// an Ada GPU (0x2684) take it; a device that runs another driver has none.
|
||||
#[test]
|
||||
fn nvidia_s_colour_copies_are_clean_on_the_identity_measured_alone() {
|
||||
fn nvidia_s_colour_copies_are_clean_on_the_gpu_measured_alone() {
|
||||
let nvidia = Some(DriverId::NVIDIA_PROPRIETARY);
|
||||
let of = |device, release| among(AFFECTED, nvidia, Some(device), release);
|
||||
for (device, release) in [
|
||||
(0x2204, NVIDIA_615_71_09),
|
||||
(0x2484, NVIDIA_615_71_09),
|
||||
(0x2684, NVIDIA_615_71_09),
|
||||
(0x2c19, NVIDIA_615_71_09 + (1 << 6)),
|
||||
] {
|
||||
let of = |device| among(AFFECTED, nvidia, device);
|
||||
for device in [0x2204, 0x2484, 0x2684] {
|
||||
assert_eq!(
|
||||
of(device, release).into_iter().collect::<Vec<_>>(),
|
||||
of(device).into_iter().collect::<Vec<_>>(),
|
||||
vec![STENCIL_COPIES],
|
||||
"{device:#x} {release:#x}"
|
||||
"{device:#x}"
|
||||
);
|
||||
}
|
||||
assert!(of(0x2c19, NVIDIA_615_71_09).is_empty());
|
||||
let radv = among(
|
||||
AFFECTED,
|
||||
Some(DriverId::MESA_RADV),
|
||||
Some(0x2204),
|
||||
NVIDIA_615_71_09,
|
||||
);
|
||||
assert!(of(0x2c19).is_empty());
|
||||
let radv = among(AFFECTED, Some(DriverId::MESA_RADV), 0x2204);
|
||||
assert!(!radv.contains(&COPIES) && !radv.contains(&STENCIL_COPIES));
|
||||
}
|
||||
|
||||
/// RADV's implicit preprocessing after an execution set, measured broken on the Radeon 780M
|
||||
/// (`deviceID` 0x15bf) and the RX 7900 XTX (0x744c) at 26.0.8, is every RADV GPU's at every release
|
||||
/// but the 780M's at 26.2.4, measured clean: the 780M at 26.0.8 and 26.2.5 and the RX 7900 XTX at
|
||||
/// 26.2.4 (not a measured identity) take it; a device that runs another driver has none.
|
||||
/// RADV's implicit preprocessing after an execution set, measured broken on the RX 7900 XTX
|
||||
/// (0x744c), is every RADV GPU's but the Radeon 780M's (`deviceID` 0x15bf), measured clean; a device
|
||||
/// that runs another driver has none.
|
||||
#[test]
|
||||
fn radv_s_preprocessing_is_clean_on_the_identity_measured_alone() {
|
||||
fn radv_s_preprocessing_is_clean_on_the_gpu_measured_alone() {
|
||||
let radv = Some(DriverId::MESA_RADV);
|
||||
let of = |device, release| among(AFFECTED, radv, Some(device), release);
|
||||
let mesa_26_0_8 = (26 << 22) | 8;
|
||||
for (device, release) in [
|
||||
(0x15bf, mesa_26_0_8),
|
||||
(0x744c, mesa_26_0_8),
|
||||
(0x744c, MESA_26_2_4),
|
||||
(0x15bf, MESA_26_2_4 + 1),
|
||||
] {
|
||||
assert!(
|
||||
of(device, release).contains(&PREPROCESS),
|
||||
"{device:#x} {release:#x}"
|
||||
);
|
||||
}
|
||||
assert!(!of(0x15bf, MESA_26_2_4).contains(&PREPROCESS));
|
||||
let nvidia = among(
|
||||
AFFECTED,
|
||||
Some(DriverId::NVIDIA_PROPRIETARY),
|
||||
Some(0x15bf),
|
||||
mesa_26_0_8,
|
||||
);
|
||||
let of = |device| among(AFFECTED, radv, device);
|
||||
assert!(of(0x744c).contains(&PREPROCESS));
|
||||
assert!(!of(0x15bf).contains(&PREPROCESS));
|
||||
let nvidia = among(AFFECTED, Some(DriverId::NVIDIA_PROPRIETARY), 0x744c);
|
||||
assert!(!nvidia.contains(&PREPROCESS));
|
||||
}
|
||||
|
||||
/// lavapipe's baked samplers lost after a copy, measured broken at 26.0.8, are every lavapipe
|
||||
/// release's: 26.2.4, measured clean, has no committed profile to be a measured identity. A device
|
||||
/// that runs another driver has none.
|
||||
/// lavapipe's baked samplers lost after a copy, measured broken at 26.0.8, are lavapipe's at every
|
||||
/// release. A device that runs another driver has none.
|
||||
#[test]
|
||||
fn lavapipe_s_baked_samplers_are_every_release_s() {
|
||||
let lavapipe = Some(DriverId::MESA_LLVMPIPE);
|
||||
let of = |release| among(AFFECTED, lavapipe, Some(0), release);
|
||||
let mesa_26_0_8 = (26 << 22) | 8;
|
||||
for release in [mesa_26_0_8, MESA_26_2_4 - 1, MESA_26_2_4, MESA_26_2_4 + 1] {
|
||||
assert!(of(release).contains(&BAKED_SAMPLERS), "{release:#x}");
|
||||
}
|
||||
let radv = among(AFFECTED, Some(DriverId::MESA_RADV), Some(0), mesa_26_0_8);
|
||||
let lavapipe = among(AFFECTED, Some(DriverId::MESA_LLVMPIPE), 0);
|
||||
assert!(lavapipe.contains(&BAKED_SAMPLERS));
|
||||
let radv = among(AFFECTED, Some(DriverId::MESA_RADV), 0);
|
||||
assert!(!radv.contains(&BAKED_SAMPLERS));
|
||||
}
|
||||
|
||||
/// Hawk Point's Radeon 780M (`deviceID` 0x1900) is Phoenix's GPU (0x15bf): at RADV 26.2.4 it is a
|
||||
/// measured identity, so it sends no unmeasured-driver message and takes Phoenix's driver facts
|
||||
/// and defects, the implicit preprocessing measured clean among them. At another release, or as a
|
||||
/// neighbouring `deviceID` (0x1901), it is unmeasured, works the preprocessing around, and says
|
||||
/// so in the message, naming its own `deviceID`.
|
||||
/// Hawk Point's Radeon 780M (`deviceID` 0x1900) is Phoenix's GPU (0x15bf): it takes Phoenix's
|
||||
/// driver facts and defects, the implicit preprocessing measured clean among them, at every
|
||||
/// release. A neighbouring `deviceID` (0x1901) is another GPU, which works the preprocessing
|
||||
/// around.
|
||||
#[test]
|
||||
fn hawk_points_780m_is_phoenixs_measured_identity() {
|
||||
use crate::driver_facts::{unmeasured_driver, UNMEASURED_DRIVER};
|
||||
fn hawk_points_780m_is_phoenixs_gpu() {
|
||||
let (stem, phoenix) = super::capabilities::committed_descriptions()
|
||||
.into_iter()
|
||||
.find(|(stem, _)| stem == "amd-780m-radv")
|
||||
@@ -225,7 +171,6 @@ fn hawk_points_780m_is_phoenixs_measured_identity() {
|
||||
let mut hawk_point = phoenix.clone();
|
||||
hawk_point.device_id = 0x1900;
|
||||
let (_, properties) = super::capabilities::created(&stem, &hawk_point);
|
||||
assert_eq!(unmeasured_driver(&properties), None);
|
||||
assert_eq!(properties.driver_facts, measured.driver_facts);
|
||||
assert!(!properties.driver_facts.is_empty());
|
||||
assert_eq!(properties.driver_defects, measured.driver_defects);
|
||||
@@ -233,20 +178,14 @@ fn hawk_points_780m_is_phoenixs_measured_identity() {
|
||||
of(&hawk_point).into_iter().collect::<Vec<_>>(),
|
||||
[NAN_COPIES]
|
||||
);
|
||||
for (device, release) in [
|
||||
(0x1900, MESA_26_2_4 + 1),
|
||||
(0x1900, MESA_26_2_4 - 1),
|
||||
(0x1901, MESA_26_2_4),
|
||||
] {
|
||||
let mut other = phoenix.clone();
|
||||
(other.device_id, other.driver_version) = (device, release);
|
||||
let (_, properties) = super::capabilities::created(&stem, &other);
|
||||
let text = unmeasured_driver(&properties).expect("an unmeasured identity");
|
||||
assert!(text.contains(&format!("deviceID {device:#x}")), "{text}");
|
||||
assert!(text.ends_with(&format!("[{UNMEASURED_DRIVER}]")), "{text}");
|
||||
assert!(properties.driver_facts.is_empty(), "{text}");
|
||||
assert!(of(&other).contains(&PREPROCESS), "{device:#x} {release:#x}");
|
||||
}
|
||||
hawk_point.driver_version += 1;
|
||||
assert_eq!(
|
||||
of(&hawk_point).into_iter().collect::<Vec<_>>(),
|
||||
[NAN_COPIES]
|
||||
);
|
||||
let mut neighbour = phoenix;
|
||||
neighbour.device_id = 0x1901;
|
||||
assert!(of(&neighbour).contains(&PREPROCESS));
|
||||
}
|
||||
|
||||
/// The scheduler's thread waits for the GPU itself (one `vkWaitSemaphores` for any of the event
|
||||
@@ -283,12 +222,11 @@ fn the_scheduler_waits_on_the_gpu_where_no_signal_is_lost() {
|
||||
));
|
||||
}
|
||||
|
||||
/// 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`).
|
||||
/// Each clean GPU is a committed profile's GPU of the driver.
|
||||
#[test]
|
||||
fn every_clean_identity_is_measured() {
|
||||
fn every_clean_gpu_is_a_committed_profiles() {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let mut measured = Vec::new();
|
||||
let mut committed = Vec::new();
|
||||
for path in std::fs::read_dir(&dir).expect("validation/profiles is readable") {
|
||||
let path = path.expect("directory entry").path();
|
||||
if path.extension().is_none_or(|x| x != "json") {
|
||||
@@ -296,98 +234,19 @@ fn every_clean_identity_is_measured() {
|
||||
}
|
||||
let text = std::fs::read_to_string(&path).expect("profile is readable");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("profile parses");
|
||||
if desc.measured_identity() {
|
||||
measured.push((desc.driver_id, desc.device_id, desc.driver_version));
|
||||
}
|
||||
committed.push((desc.driver_id, desc.canonical_device_id()));
|
||||
}
|
||||
for affected in AFFECTED {
|
||||
for &(device, release) in affected.clean {
|
||||
for &device in affected.clean {
|
||||
assert!(
|
||||
measured.contains(&(Some(affected.driver), device, release)),
|
||||
"{:?} clean on {device:#x} at {release:#x}, which is not measured",
|
||||
committed.contains(&(Some(affected.driver), device)),
|
||||
"{:?} clean on {device:#x}, which no committed profile describes",
|
||||
affected.defect
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A device whose identity is not measured says so in an informational message, never a degrade
|
||||
/// notice: on every committed profile of a measured identity nothing; on the M4's profile at
|
||||
/// another MoltenVK release, the identity, the answers it withholds and the defects it assumes,
|
||||
/// under the message's id name; on SwiftShader, whose driver has nothing measured, nothing.
|
||||
#[test]
|
||||
fn an_unmeasured_identity_says_so_in_an_informational_message() {
|
||||
use crate::driver_facts::{unmeasured_driver, UNMEASURED_DRIVER};
|
||||
for (stem, desc) in super::capabilities::committed_descriptions() {
|
||||
let (_, properties) = super::capabilities::created(&stem, &desc);
|
||||
let text = unmeasured_driver(&properties);
|
||||
let measured = properties.description.measured_identity();
|
||||
let nothing = properties.driver_facts_withheld.is_empty()
|
||||
&& properties.driver_facts.is_empty()
|
||||
&& properties.driver_defects.is_empty();
|
||||
assert_eq!(text.is_some(), !measured && !nothing, "{stem}: {text:?}");
|
||||
}
|
||||
let (stem, mut desc) = super::capabilities::committed_descriptions()
|
||||
.into_iter()
|
||||
.find(|(stem, _)| stem == "moltenvk-m3")
|
||||
.expect("moltenvk-m3");
|
||||
desc.driver_version += 1;
|
||||
let (_, properties) = super::capabilities::created(&stem, &desc);
|
||||
let text = unmeasured_driver(&properties).expect("an unmeasured MoltenVK release");
|
||||
assert!(text.ends_with(&format!("[{UNMEASURED_DRIVER}]")), "{text}");
|
||||
assert!(text.contains("DepthImageKeepsDenormals"), "{text}");
|
||||
assert!(text.contains("DepthStencilImagesLieApart"), "{text}");
|
||||
assert!(!text.contains("metal2vulkan-degrade-"), "{text}");
|
||||
}
|
||||
|
||||
/// `DeviceOptions::assume_unmeasured_identity` takes a device as an identity no measurement names:
|
||||
/// the description it hands the device ([`identity_as_options`]) answers as another GPU of its
|
||||
/// driver at its release, so on every committed profile the device's facts, withheld answers and
|
||||
/// defects are such a GPU's, and it says so in the `metal2vulkan-unmeasured-driver` message where
|
||||
/// such a GPU does. On the RTX 5080 Laptop GPU's measured identity the message appears only under
|
||||
/// the option. Off, the description is the device's.
|
||||
#[test]
|
||||
fn the_unmeasured_identity_option_runs_another_gpu_s_paths() {
|
||||
use crate::device::create::identity_as_options;
|
||||
use crate::driver_facts::{unmeasured_driver, UNMEASURED_DRIVER};
|
||||
use crate::DeviceOptions;
|
||||
let assume = DeviceOptions {
|
||||
assume_unmeasured_identity: true,
|
||||
..DeviceOptions::default()
|
||||
};
|
||||
for (stem, desc) in super::capabilities::committed_descriptions() {
|
||||
assert_eq!(
|
||||
identity_as_options(desc.clone(), &DeviceOptions::default()),
|
||||
desc,
|
||||
"{stem}"
|
||||
);
|
||||
let assumed = identity_as_options(desc.clone(), &assume);
|
||||
assert!(assumed.assumed_unmeasured, "{stem}");
|
||||
let mut other = desc.clone();
|
||||
other.device_id ^= 0x8000_0000;
|
||||
let (_, a) = super::capabilities::created(&stem, &assumed);
|
||||
let (_, o) = super::capabilities::created(&stem, &other);
|
||||
assert_eq!(a.driver_facts, o.driver_facts, "{stem}");
|
||||
assert_eq!(a.driver_facts_withheld, o.driver_facts_withheld, "{stem}");
|
||||
assert_eq!(a.driver_defects, o.driver_defects, "{stem}");
|
||||
assert_eq!(
|
||||
unmeasured_driver(&a).is_some(),
|
||||
unmeasured_driver(&o).is_some(),
|
||||
"{stem}"
|
||||
);
|
||||
}
|
||||
let (stem, laptop) = super::capabilities::committed_descriptions()
|
||||
.into_iter()
|
||||
.find(|(stem, _)| stem == "nvidia-rtx5080-laptop")
|
||||
.expect("nvidia-rtx5080-laptop");
|
||||
let (_, measured) = super::capabilities::created(&stem, &laptop);
|
||||
assert!(unmeasured_driver(&measured).is_none());
|
||||
let (_, assumed) = super::capabilities::created(&stem, &identity_as_options(laptop, &assume));
|
||||
let text = unmeasured_driver(&assumed).expect("the option's message");
|
||||
assert!(text.ends_with(&format!("[{UNMEASURED_DRIVER}]")), "{text}");
|
||||
assert!(!text.contains("metal2vulkan-degrade-"), "{text}");
|
||||
}
|
||||
|
||||
/// A descriptor set layout of at most 1024 descriptors (the least `maxPerSetDescriptors` Vulkan
|
||||
/// allows) is made without asking the driver; a larger one is made where the driver's
|
||||
/// `vkGetDescriptorSetLayoutSupport` answers `VK_TRUE`, made and announced where it answers
|
||||
|
||||
@@ -984,7 +984,7 @@ fn multisampled_depth_targets_take_custom_sample_positions() {
|
||||
/// driver is not measured to keep every `float` in: without `VK_EXT_depth_range_unrestricted` and
|
||||
/// the driver's fact that its depth images keep values outside `[0, 1]`, the Xe-LP ANV ones among
|
||||
/// them, or without its fact that they keep denormals, RADV's among them; and in its depth
|
||||
/// image, as `plan_image` plans it, elsewhere: NVIDIA's 615 and lavapipe, with the extension, and
|
||||
/// image, as `plan_image` plans it, elsewhere: NVIDIA's and lavapipe, with the extension, and
|
||||
/// MoltenVK without it. A render target (`Unknown` usage counts as one), a memoryless or
|
||||
/// multisampled texture and another depth format have no twin.
|
||||
#[test]
|
||||
@@ -1086,18 +1086,17 @@ fn depth_twins_hold_the_texels_in_colour_where_a_depth_image_may_not() {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Lavapipe 26.2.3 (`lavapipe`) is no measured identity, so it takes the twin too.
|
||||
for stem in [
|
||||
"intel-irisxe-rplp-anv",
|
||||
"amd-780m-radv",
|
||||
"amd-rdna3-radv",
|
||||
"lavapipe",
|
||||
] {
|
||||
for stem in ["intel-irisxe-rplp-anv", "amd-780m-radv", "amd-rdna3-radv"] {
|
||||
assert!(twinned.iter().any(|n| n == stem), "{stem}: {twinned:?}");
|
||||
}
|
||||
// Drivers measured to keep every `float` in a depth image: NVIDIA's and lavapipe with the
|
||||
// extension, MoltenVK without it.
|
||||
for stem in ["nvidia-rtx5080-laptop", "gate-lavapipe", "moltenvk-m3"] {
|
||||
// extension, at every release, MoltenVK without it.
|
||||
for stem in [
|
||||
"nvidia-rtx5080-laptop",
|
||||
"gate-lavapipe",
|
||||
"lavapipe",
|
||||
"moltenvk-m3",
|
||||
] {
|
||||
assert!(!twinned.iter().any(|n| n == stem), "{stem}: {twinned:?}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,7 @@ fn device(cache: &Path) -> Device {
|
||||
}
|
||||
|
||||
/// The live device's queues keep their submissions in flight exactly where its driver has the
|
||||
/// fact, and its identity is printed either way: a release the lanes measured for other facts but
|
||||
/// not for this one takes no relay, and nothing else in the suite would say so.
|
||||
/// fact, and its identity is printed either way.
|
||||
#[test]
|
||||
fn the_live_device_relays_its_queue_failures_exactly_where_its_driver_has_the_fact() {
|
||||
let scratch = Scratch::new();
|
||||
@@ -65,16 +64,13 @@ fn the_live_device_relays_its_queue_failures_exactly_where_its_driver_has_the_fa
|
||||
let description = &properties.description;
|
||||
let fact = DriverFact::QueueFailuresReportedByMessenger;
|
||||
let has = properties.driver_facts.contains(&fact);
|
||||
let withheld = properties.driver_facts_withheld.contains(&fact);
|
||||
println!(
|
||||
"RELAY-FACT {:?} {} ({:#x}/{:#x}, driver version {:#x}, measured identity {}): \
|
||||
the fact {has}, withheld {withheld}",
|
||||
"RELAY-FACT {:?} {} ({:#x}/{:#x}, driver version {:#x}): the fact {has}",
|
||||
description.driver_id,
|
||||
properties.name,
|
||||
properties.vendor_id,
|
||||
properties.device_id,
|
||||
description.driver_version,
|
||||
description.measured_identity(),
|
||||
);
|
||||
let queues = device.shared().queues.len();
|
||||
let relays = (0..queues).any(|queue| device.shared().flights(queue).is_some());
|
||||
@@ -89,12 +85,5 @@ fn the_live_device_relays_its_queue_failures_exactly_where_its_driver_has_the_fa
|
||||
"the device has the fact that earns the relay and relays nothing: its instance has no \
|
||||
messenger, or the relay was not installed"
|
||||
);
|
||||
// A defect this driver was measured to have at an earlier release and not re-measured at
|
||||
// this one is withheld, never silently dropped: the runtime would take a path no
|
||||
// measurement cleared (`driver_facts.rs`).
|
||||
assert!(
|
||||
has || withheld || description.driver_id.is_none(),
|
||||
"the driver has neither the fact nor it withheld, so nothing says the relay is off"
|
||||
);
|
||||
drop(device);
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
dd9f49c08b8ec98ec37144c49ecbbf5be44af02f182123ee1cfbd6c7a57c6e54
|
||||
0ea1af2cfe371ad3b7d2dc548b219b4da8d6bf61bd204987822d9fb3aeda9d35
|
||||
@@ -727,7 +727,6 @@ fn capability_members(description: &DeviceDescription) -> Value {
|
||||
"device_id",
|
||||
"device_name",
|
||||
"device_type",
|
||||
"assumed_unmeasured",
|
||||
"extensions",
|
||||
"features",
|
||||
"formats",
|
||||
|
||||
@@ -571,7 +571,6 @@ mod tests {
|
||||
let messages = Messages::default();
|
||||
messages.device_asked_layers(&[VALIDATION_LAYER.to_owned()]);
|
||||
for id_name in [
|
||||
"metal2vulkan-unmeasured-driver",
|
||||
"metal2vulkan-driver-pipeline-cache-kept",
|
||||
"metal2vulkan-pipeline-creation",
|
||||
"",
|
||||
|
||||
@@ -247,9 +247,6 @@ impl UlpTable {
|
||||
/// - `FunctionStorageAssumed`: [`Allowance::Recorded`]. A vertex or fragment function's private
|
||||
/// memory passes the floor of a device not measured, resting on no measurement; a difference is
|
||||
/// a mismatch for review, never accepted or explained by the note.
|
||||
/// - `BeyondMeasuredDeviation`: [`Allowance::Recorded`]. Every module compiled for a driver release
|
||||
/// past its deviations' measurement records it; a difference is a mismatch for review, never
|
||||
/// accepted or explained by the note.
|
||||
/// - `ViewBaseTexelOffset`: [`Allowance::Recorded`]. Only a view whose first level lies above its
|
||||
/// parent's base level reads otherwise than Metal, which no authored case binds: a difference is
|
||||
/// a mismatch for review.
|
||||
@@ -278,7 +275,6 @@ pub fn allowance(note: PrecisionNote) -> Allowance {
|
||||
| N::DeviceNanEncoding
|
||||
| N::FunctionStorageAssumed
|
||||
| N::DeviceTexelDenormals
|
||||
| N::BeyondMeasuredDeviation
|
||||
| N::ViewBaseTexelOffset => Allowance::Recorded,
|
||||
N::DeviceColorConversion => Allowance::Recorded,
|
||||
N::LinkedSamplerNumbering | N::ColorAttachmentGroups => Allowance::Recorded,
|
||||
|
||||
@@ -67,7 +67,6 @@ fn every_precision_note_has_its_table_row() {
|
||||
(N::CubeFaceReciprocal, Allowance::Unbounded),
|
||||
(N::FunctionStorageAssumed, Allowance::Recorded),
|
||||
(N::DeviceTexelDenormals, Allowance::Recorded),
|
||||
(N::BeyondMeasuredDeviation, Allowance::Recorded),
|
||||
(N::ViewBaseTexelOffset, Allowance::Recorded),
|
||||
(N::DeviceColorConversion, Allowance::Recorded),
|
||||
(N::DeviceInterpolation, Allowance::Unbounded),
|
||||
@@ -115,7 +114,6 @@ fn only_the_environment_notes_are_told_value_by_value() {
|
||||
N::BicubicFilterArithmetic,
|
||||
N::SparseResidency,
|
||||
N::DeviceTexelDenormals,
|
||||
N::BeyondMeasuredDeviation,
|
||||
N::ViewBaseTexelOffset,
|
||||
N::DeviceColorConversion,
|
||||
] {
|
||||
|
||||
@@ -956,10 +956,7 @@ const METAL_CACHE_KEPT: &str = "metal2vulkan-driver-pipeline-cache-kept";
|
||||
/// [`creation_checked`] of `heard`, every message `device`'s making delivered to a sink that hears
|
||||
/// every message (not the lane's, which keeps notices and failures alone): its notices exactly
|
||||
/// its [`creation_kinds`], one each, and its other messages exactly the informational ones the
|
||||
/// device sends as it is made, each once and in this order: `metal2vulkan-unmeasured-driver`
|
||||
/// exactly where its identity is not measured, as the runtime reads it
|
||||
/// (`unmeasured_driver_message`, the fact the device's own message reads); then [`LAYERS_DROPPED`]
|
||||
/// where the loader could not provide the instance layers the device asked for, which the device
|
||||
/// device sends as it is made, each once and in this order: [`LAYERS_DROPPED`] where the loader could not provide the instance layers the device asked for, which the device
|
||||
/// alone can say (the instance's answer, not the loader's listing: a layer the loader lists and
|
||||
/// cannot load answers the same); then [`METAL_CACHE_KEPT`] exactly where its driver keeps its
|
||||
/// internal pipeline cache and that cache is Metal's own ([`metal_cache_kept`], read from the
|
||||
@@ -983,7 +980,6 @@ pub(crate) fn creation_heard_checked(
|
||||
for message in &informed {
|
||||
messages.heard_informational(&message.id_name, &message.text);
|
||||
}
|
||||
let unmeasured = metal2vulkan_runtime::unmeasured_driver_message(device.properties());
|
||||
let dropped = messages.layers_dropped_message();
|
||||
let cache_kept = metal_cache_kept(device);
|
||||
let mut expected: Vec<String> = Vec::new();
|
||||
@@ -999,18 +995,6 @@ pub(crate) fn creation_heard_checked(
|
||||
rest = after;
|
||||
}
|
||||
}
|
||||
if let Some(message) = &unmeasured {
|
||||
expected.push(message.text.clone());
|
||||
match rest.split_first() {
|
||||
Some((first, after))
|
||||
if (first.severity, &first.id_name, &first.text)
|
||||
== (message.severity, &message.id_name, &message.text) =>
|
||||
{
|
||||
rest = after;
|
||||
}
|
||||
_ => rest = &[],
|
||||
}
|
||||
}
|
||||
if let Some(text) = &dropped {
|
||||
let tag = format!("[{LAYERS_DROPPED}]");
|
||||
expected.push(text.clone());
|
||||
|
||||
@@ -1413,9 +1413,7 @@ const OUTSIDE: [f32; 5] = [-0.5, 2.0, 1000.0, -1000.0, 1.5];
|
||||
/// `get_bytes`. Each count kept is printed with the driver's `driverID` and `driverVersion`. A
|
||||
/// driver with a fact keeps every value of its kind, and every device keeps the values outside
|
||||
/// `[0, 1]` where it enabled `VK_EXT_depth_range_unrestricted`. The shader's reads and
|
||||
/// comparisons of such a texture are `depth_compares`' (Metal's answers there). A device whose
|
||||
/// identity is not measured announces nothing for it (its paths are exact; it sends the
|
||||
/// informational `metal2vulkan-unmeasured-driver`, no degrade notice).
|
||||
/// comparisons of such a texture are `depth_compares`' (Metal's answers there).
|
||||
#[test]
|
||||
fn depth_images_keep_what_their_drivers_claim() {
|
||||
let cache = ScratchCache::new().unwrap();
|
||||
|
||||
-1
@@ -1438,7 +1438,6 @@ codec_enum! {
|
||||
QuadsCountedBeforeDiscard,
|
||||
DeviceDepthComparison,
|
||||
DeviceTexelDenormals,
|
||||
BeyondMeasuredDeviation,
|
||||
ViewBaseTexelOffset,
|
||||
DeviceColorConversion,
|
||||
DeviceInterpolation,
|
||||
|
||||
Vendored
+3
-3
@@ -60,7 +60,7 @@ mod tests;
|
||||
/// unchanged version, and its bless records the version. Independent of the crate's version and of
|
||||
/// [`ARTIFACT_FORMAT_VERSION`]. The commit that bumps it says what changed; this comment keeps no
|
||||
/// history.
|
||||
pub const SEMANTICS_VERSION: u32 = 1868;
|
||||
pub const SEMANTICS_VERSION: u32 = 1869;
|
||||
|
||||
/// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the
|
||||
/// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another
|
||||
@@ -70,7 +70,7 @@ pub const SEMANTICS_VERSION: u32 = 1868;
|
||||
/// re-typed in an encoded type, its `codec` body or its `envelope`. A variant removed while its tag
|
||||
/// stays unused needs no bump: an entry holding it fails to decode, which is a miss. The commit that
|
||||
/// bumps it says what changed; this comment keeps no history.
|
||||
pub const ARTIFACT_FORMAT_VERSION: u32 = 451;
|
||||
pub const ARTIFACT_FORMAT_VERSION: u32 = 452;
|
||||
|
||||
/// The version of what this crate's runtime does with a compiled pipeline: instantiating a binding
|
||||
/// plan (`BindingPlan::instantiate_*`: descriptor ranges, push bytes, root, argument, and handle
|
||||
@@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 451;
|
||||
/// changes no behaviour, and then updates that hash alone with the commit saying why, or changes
|
||||
/// behaviour and also bumps this version. The commit that bumps it says what changed; this comment
|
||||
/// keeps no history.
|
||||
pub const RUNTIME_VERSION: u32 = 1649;
|
||||
pub const RUNTIME_VERSION: u32 = 1650;
|
||||
|
||||
/// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex,
|
||||
/// of the manifest, the build script, and exactly the files the crate roots' module tree compiles
|
||||
|
||||
-9
@@ -539,15 +539,6 @@ fn the_version_212_members_round_trip() {
|
||||
assert_eq!(decode::<PrecisionNote>(&encode(¬e)), Ok(note));
|
||||
}
|
||||
|
||||
/// The member format version 214 appends encodes and decodes as itself:
|
||||
/// `PrecisionNote::BeyondMeasuredDeviation`.
|
||||
#[test]
|
||||
fn the_version_214_members_round_trip() {
|
||||
use crate::pipeline::artifact::PrecisionNote;
|
||||
let note = PrecisionNote::BeyondMeasuredDeviation;
|
||||
assert_eq!(decode::<PrecisionNote>(&encode(¬e)), Ok(note));
|
||||
}
|
||||
|
||||
/// The member format version 219 appends encodes and decodes as itself:
|
||||
/// `PrecisionNote::ViewBaseTexelOffset`.
|
||||
#[test]
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
//! only field that selects a pointer model; every other field selects leaf encodings or feeds the
|
||||
//! requirement check.
|
||||
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::collections::BTreeSet;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::device::description::{
|
||||
AllocationLimits, DeviceDescription, GeneratedCommandsProperties, APPLE_VENDOR_ID,
|
||||
};
|
||||
use crate::device::driver_facts::Standing;
|
||||
use crate::device::function_storage;
|
||||
use crate::device::metal::MetalDeviceProperties;
|
||||
use crate::device::policy::{
|
||||
@@ -69,14 +68,13 @@ impl Device {
|
||||
/// `device::enables` states), and a policy that turns containment off while guest isolation
|
||||
/// is on (`InvalidDescriptor`).
|
||||
pub fn new(desc: DeviceDescription, policy: DevicePolicy) -> Result<Device, Error> {
|
||||
// The driver's measured deviations at its release, never its name.
|
||||
// The driver's measured deviations on its GPU, never its name.
|
||||
let deviations = super::driver_facts::deviations(&desc);
|
||||
Device::with_deviations(desc, policy, deviations)
|
||||
}
|
||||
|
||||
/// [`Device::new`] with `deviation` taken (at its measured standing where the driver's
|
||||
/// release has it) or not, and the release's other deviations as measured: a test's way to
|
||||
/// take one route alone, which no driver release in the table gives.
|
||||
/// [`Device::new`] with `deviation` taken or not, and the driver's other deviations as
|
||||
/// measured: a test's way to take one route alone, which no driver in the table gives.
|
||||
#[cfg(test)]
|
||||
pub(crate) fn with_deviation(
|
||||
desc: DeviceDescription,
|
||||
@@ -87,7 +85,7 @@ impl Device {
|
||||
let mut deviations = super::driver_facts::deviations(&desc);
|
||||
match taken {
|
||||
true => {
|
||||
deviations.entry(deviation).or_insert(Standing::Measured);
|
||||
deviations.insert(deviation);
|
||||
}
|
||||
false => {
|
||||
deviations.remove(&deviation);
|
||||
@@ -99,7 +97,7 @@ impl Device {
|
||||
fn with_deviations(
|
||||
desc: DeviceDescription,
|
||||
policy: DevicePolicy,
|
||||
deviations: BTreeMap<DriverDeviation, Standing>,
|
||||
deviations: BTreeSet<DriverDeviation>,
|
||||
) -> Result<Device, Error> {
|
||||
if desc.api_version < ApiVersion::V1_2 {
|
||||
return Err(Unsupported::needs(
|
||||
@@ -187,9 +185,9 @@ impl Device {
|
||||
/// filter's where the policy keeps Metal's filter exact (`Unorm8LinearFilterPolicy::Exact`, the
|
||||
/// default), so the translation emulates it as on an unmeasured device.
|
||||
fn accepted(
|
||||
mut deviations: BTreeMap<DriverDeviation, Standing>,
|
||||
mut deviations: BTreeSet<DriverDeviation>,
|
||||
policy: &DevicePolicy,
|
||||
) -> BTreeMap<DriverDeviation, Standing> {
|
||||
) -> BTreeSet<DriverDeviation> {
|
||||
if policy.unorm8_linear_filter == Unorm8LinearFilterPolicy::Exact {
|
||||
deviations.remove(&DriverDeviation::Unorm8LinearFilter);
|
||||
}
|
||||
@@ -199,7 +197,7 @@ fn accepted(
|
||||
fn derive_fields(
|
||||
desc: &DeviceDescription,
|
||||
policy: &DevicePolicy,
|
||||
deviations: &BTreeMap<DriverDeviation, Standing>,
|
||||
deviations: &BTreeSet<DriverDeviation>,
|
||||
) -> ProfileFields {
|
||||
let has = |f: VkFeature| desc.has(f);
|
||||
let ext = |e: VkExtension| desc.extensions.contains(&e);
|
||||
@@ -334,7 +332,7 @@ fn derive_fields(
|
||||
};
|
||||
|
||||
let (vertex_formats, storage_formats, image_formats) = format_tables(desc);
|
||||
let deviates = |d: DriverDeviation| deviations.contains_key(&d);
|
||||
let deviates = |d: DriverDeviation| deviations.contains(&d);
|
||||
ProfileFields {
|
||||
buffer_access,
|
||||
pointer_domain: policy.pointer_domain,
|
||||
@@ -465,21 +463,12 @@ fn derive_fields(
|
||||
compute: route(&[(DriverDeviation::CubeGradientRoute, CubeGradientRoute::Metal)]),
|
||||
}
|
||||
},
|
||||
// The deviations taken past their last measured release, which a module records
|
||||
// `PrecisionNote::BeyondMeasuredDeviation` for (the coordinator's ruling of 2026-10-06).
|
||||
deviations_beyond: deviations
|
||||
.iter()
|
||||
.filter_map(|(&deviation, &standing)| match standing {
|
||||
Standing::Beyond { last } => Some((deviation, last)),
|
||||
Standing::Measured => None,
|
||||
})
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
/// The driver workarounds of the driver `desc` names (`driver_id`), on its GPU (`vendor_id`, or its
|
||||
/// generation's `device_id`s) where the defect is the GPU's, and those its release has by the
|
||||
/// measured table (`driver_facts::DEFECTS`), in order.
|
||||
/// generation's `device_id`s) where the defect is the GPU's, and those of the measured table
|
||||
/// (`driver_facts::DEFECTS`), in order.
|
||||
fn workarounds(desc: &DeviceDescription) -> Vec<DriverWorkaround> {
|
||||
let mut found = by_identity(desc);
|
||||
// Every rasterizer but Apple's hands a clipped primitive's fragments their coverage by the
|
||||
@@ -766,7 +755,7 @@ pub(crate) fn usage_class(usage: FormatUsage) -> UsageClass {
|
||||
|
||||
fn enabled_caps(
|
||||
desc: &DeviceDescription,
|
||||
deviations: &BTreeMap<DriverDeviation, Standing>,
|
||||
deviations: &BTreeSet<DriverDeviation>,
|
||||
policy: &DevicePolicy,
|
||||
) -> EnabledCaps {
|
||||
let sg = &desc.subgroup;
|
||||
@@ -842,97 +831,97 @@ fn enabled_caps(
|
||||
if desc.interpolates_at_offset_centered() {
|
||||
properties.insert(VkProperty::InterpolateAtOffsetCentered);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::SimdgroupLockstep) {
|
||||
if deviations.contains(&DriverDeviation::SimdgroupLockstep) {
|
||||
properties.insert(VkProperty::SimdgroupLockstep);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalSampler) {
|
||||
if deviations.contains(&DriverDeviation::MetalSampler) {
|
||||
properties.insert(VkProperty::MetalSampler);
|
||||
} else if policy.sampling == SamplingPolicy::NativeDevice {
|
||||
// Native device sampling, the policy's default, where the device's sampler is not Metal's.
|
||||
properties.insert(VkProperty::DeviceSampling);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalColorWrites) {
|
||||
if deviations.contains(&DriverDeviation::MetalColorWrites) {
|
||||
properties.insert(VkProperty::MetalColorWrites);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalFloatColorNans) {
|
||||
if deviations.contains(&DriverDeviation::MetalFloatColorNans) {
|
||||
properties.insert(VkProperty::MetalFloatColorNans);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfColorNans) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfColorNans) {
|
||||
properties.insert(VkProperty::MetalHalfColorNans);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::HalfColorOutputBits) {
|
||||
if deviations.contains(&DriverDeviation::HalfColorOutputBits) {
|
||||
properties.insert(VkProperty::HalfColorOutputBits);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfFma) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfFma) {
|
||||
properties.insert(VkProperty::MetalHalfFma);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalFloatDenormals) {
|
||||
if deviations.contains(&DriverDeviation::MetalFloatDenormals) {
|
||||
properties.insert(VkProperty::MetalFloatDenormals);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfQuantize) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfQuantize) {
|
||||
properties.insert(VkProperty::MetalHalfQuantize);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfConversion) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfConversion) {
|
||||
properties.insert(VkProperty::MetalHalfConversion);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalCenterVaryings) {
|
||||
if deviations.contains(&DriverDeviation::MetalCenterVaryings) {
|
||||
properties.insert(VkProperty::MetalCenterVaryings);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalSmallFloatColorWrites) {
|
||||
if deviations.contains(&DriverDeviation::MetalSmallFloatColorWrites) {
|
||||
properties.insert(VkProperty::MetalSmallFloatColorWrites);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalNorm16ColorWrites) {
|
||||
if deviations.contains(&DriverDeviation::MetalNorm16ColorWrites) {
|
||||
properties.insert(VkProperty::MetalNorm16ColorWrites);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalMinMax) {
|
||||
if deviations.contains(&DriverDeviation::MetalMinMax) {
|
||||
properties.insert(VkProperty::MetalMinMax);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfArithmetic) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfArithmetic) {
|
||||
properties.insert(VkProperty::MetalHalfArithmetic);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfStorageWrites) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfStorageWrites) {
|
||||
properties.insert(VkProperty::MetalHalfStorageWrites);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfStorageNans) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfStorageNans) {
|
||||
properties.insert(VkProperty::MetalHalfStorageNans);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalFloatStorageNans) {
|
||||
if deviations.contains(&DriverDeviation::MetalFloatStorageNans) {
|
||||
properties.insert(VkProperty::MetalFloatStorageNans);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalFragmentSimdgroups) {
|
||||
if deviations.contains(&DriverDeviation::MetalFragmentSimdgroups) {
|
||||
properties.insert(VkProperty::MetalFragmentSimdgroups);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalVertexSimdgroups) {
|
||||
if deviations.contains(&DriverDeviation::MetalVertexSimdgroups) {
|
||||
properties.insert(VkProperty::MetalVertexSimdgroups);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::CenterFragCoordDepth) {
|
||||
if deviations.contains(&DriverDeviation::CenterFragCoordDepth) {
|
||||
properties.insert(VkProperty::CenterFragCoordDepth);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::SampleFragCoordDepth) {
|
||||
if deviations.contains(&DriverDeviation::SampleFragCoordDepth) {
|
||||
properties.insert(VkProperty::SampleFragCoordDepth);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalHalfTexelWrites) {
|
||||
if deviations.contains(&DriverDeviation::MetalHalfTexelWrites) {
|
||||
properties.insert(VkProperty::MetalHalfTexelWrites);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalNormStorageWrites) {
|
||||
if deviations.contains(&DriverDeviation::MetalNormStorageWrites) {
|
||||
properties.insert(VkProperty::MetalNormStorageWrites);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::Unorm8LinearFilter) {
|
||||
if deviations.contains(&DriverDeviation::Unorm8LinearFilter) {
|
||||
properties.insert(VkProperty::Unorm8LinearFilter);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalDepth16Stores) {
|
||||
if deviations.contains(&DriverDeviation::MetalDepth16Stores) {
|
||||
properties.insert(VkProperty::MetalDepth16Stores);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalDepth16BiasedStores) {
|
||||
if deviations.contains(&DriverDeviation::MetalDepth16BiasedStores) {
|
||||
properties.insert(VkProperty::MetalDepth16BiasedStores);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalInterpolation) {
|
||||
if deviations.contains(&DriverDeviation::MetalInterpolation) {
|
||||
properties.insert(VkProperty::MetalInterpolation);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalFirstVertexIndices) {
|
||||
if deviations.contains(&DriverDeviation::MetalFirstVertexIndices) {
|
||||
properties.insert(VkProperty::MetalFirstVertexIndices);
|
||||
}
|
||||
if deviations.contains_key(&DriverDeviation::MetalFullQuads) {
|
||||
if deviations.contains(&DriverDeviation::MetalFullQuads) {
|
||||
properties.insert(VkProperty::MetalFullQuads);
|
||||
}
|
||||
if desc
|
||||
|
||||
@@ -82,19 +82,6 @@ pub struct DeviceDescription {
|
||||
/// `maxBufferLength` and the runtime's heap sizes read them from the `Device`.
|
||||
#[cfg_attr(feature = "serde", serde(default))]
|
||||
pub allocation: AllocationLimits,
|
||||
/// Take the device as an identity no measurement names, whatever its `driverID`, `vendorID`,
|
||||
/// `deviceID` and `driverVersion` are: as another GPU of its driver at its release
|
||||
/// ([`DeviceDescription::measured_gpu`] answers `None`). Every table keyed on a measured GPU
|
||||
/// then names none of its rows for it: translation takes no deviation or defect measured on
|
||||
/// one GPU alone (those measured on every GPU of the driver or vendor still hold), the Function
|
||||
/// storage a thread holds is the unmeasured floor, and the runtime takes no answer fact,
|
||||
/// assumes its driver's measured defects and says so in its `metal2vulkan-unmeasured-driver`
|
||||
/// message, as on any unmeasured identity ([`DeviceDescription::measured_identity`] is false).
|
||||
/// False by default. A diagnostic, for running a measured device on the paths an unmeasured
|
||||
/// one of its driver takes; no translation reads it but through those tables. No Metal
|
||||
/// counterpart.
|
||||
#[cfg_attr(feature = "serde", serde(default))]
|
||||
pub assumed_unmeasured: bool,
|
||||
}
|
||||
|
||||
/// A device's allocation sizes, [`DeviceDescription::allocation`]: device facts that size
|
||||
@@ -199,7 +186,6 @@ impl DeviceDescription {
|
||||
khr_format_feature_flags2: false,
|
||||
generated_commands: None,
|
||||
allocation: AllocationLimits::default(),
|
||||
assumed_unmeasured: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -142,12 +142,10 @@ pub(crate) const METAL: u64 = 192 * KIB;
|
||||
/// The Function storage a thread of `desc`'s device holds correctly: the measured value of its
|
||||
/// identity, or [`FLOOR`] for a device not measured.
|
||||
pub(crate) fn of(desc: &DeviceDescription) -> FunctionStorage {
|
||||
let gpu = desc.measured_gpu();
|
||||
let gpu = desc.canonical_device_id();
|
||||
MEASURED
|
||||
.iter()
|
||||
.find(|d| {
|
||||
desc.driver_id == Some(d.driver) && desc.vendor_id == d.vendor && gpu == Some(d.device)
|
||||
})
|
||||
.find(|d| desc.driver_id == Some(d.driver) && desc.vendor_id == d.vendor && gpu == d.device)
|
||||
.map_or(FunctionStorage::Assumed(FLOOR), |d| {
|
||||
FunctionStorage::Measured(d.bytes)
|
||||
})
|
||||
|
||||
@@ -47,13 +47,4 @@ impl DeviceDescription {
|
||||
.find(|(vendor, ids)| *vendor == self.vendor_id && ids.contains(&self.device_id))
|
||||
.map_or(self.device_id, |(_, ids)| ids[0])
|
||||
}
|
||||
|
||||
/// The GPU the tables keyed on a measured GPU look this device up by: its
|
||||
/// [`canonical_device_id`](DeviceDescription::canonical_device_id), or `None` where the
|
||||
/// description is taken as an unmeasured identity
|
||||
/// ([`assumed_unmeasured`](DeviceDescription::assumed_unmeasured)), which no row keyed on a GPU
|
||||
/// names.
|
||||
pub fn measured_gpu(&self) -> Option<u32> {
|
||||
(!self.assumed_unmeasured).then(|| self.canonical_device_id())
|
||||
}
|
||||
}
|
||||
@@ -245,15 +245,6 @@ impl DeviceProfile {
|
||||
.then_some(REGISTER_ALLOCATOR_MODULE_WORD_BOUND)
|
||||
}
|
||||
|
||||
/// The driver deviations the profile takes at a driver release newer than the last one
|
||||
/// measured, each with that release's `driverVersion` (`device::driver_facts`): a module
|
||||
/// compiled for the profile records each as
|
||||
/// [`PrecisionNote::BeyondMeasuredDeviation`](crate::pipeline::PrecisionNote::BeyondMeasuredDeviation).
|
||||
/// Empty on a measured release.
|
||||
pub fn driver_deviations(&self) -> &BTreeMap<DriverDeviation, u32> {
|
||||
&self.fields.deviations_beyond
|
||||
}
|
||||
|
||||
/// Whether the profile's device answers samples, gathers and comparisons with its own
|
||||
/// sampler, with no emulation of Metal's in the module: a device that samples through Metal's
|
||||
/// own sampler (`VkProperty::MetalSampler`, MoltenVK on Apple's GPU), whose answers are
|
||||
@@ -271,8 +262,7 @@ impl DeviceProfile {
|
||||
}
|
||||
|
||||
/// Whether the profile takes the driver deviation `deviation` (`device::driver_facts`): its
|
||||
/// driver is measured with it at the device's release, or at an older one
|
||||
/// ([`DeviceProfile::driver_deviations`] lists those), so the translation relies on it. A
|
||||
/// driver is measured with it on the device's GPU, so the translation relies on it. A
|
||||
/// profile that does not take it compiles the conservative route the deviation's
|
||||
/// documentation names. A gate lane that checks a deviation on the device asks this before
|
||||
/// expecting the deviation's answer.
|
||||
@@ -609,15 +599,10 @@ pub struct ProfileFields {
|
||||
/// not measured more ([`FunctionStorage::Assumed`]).
|
||||
pub function_storage: FunctionStorage,
|
||||
/// How the driver hands a cube sample's explicit gradients to the GPU, in a graphics and in
|
||||
/// a compute pipeline: Vulkan's cube derivative rule unless the driver's release is measured
|
||||
/// with another (`DriverDeviation::CubeGradientRoute`, `GraphicsCubeGradientRoute` and
|
||||
/// a compute pipeline: Vulkan's cube derivative rule unless the driver is measured with
|
||||
/// another (`DriverDeviation::CubeGradientRoute`, `GraphicsCubeGradientRoute` and
|
||||
/// `GraphicsCubeGradientTangents`).
|
||||
pub cube_gradients: CubeGradients,
|
||||
/// The driver's deviations the profile takes at a release newer than the last one measured
|
||||
/// (`device::driver_facts`), each with that release's `driverVersion`: taken, and recorded
|
||||
/// by every module compiled for the profile as `PrecisionNote::BeyondMeasuredDeviation`.
|
||||
/// Empty on a measured release.
|
||||
pub deviations_beyond: BTreeMap<DriverDeviation, u32>,
|
||||
}
|
||||
|
||||
/// How a driver hands a cube sample's explicit gradients to the GPU
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -444,13 +444,25 @@ fn fingerprint_covers_every_policy_field() {
|
||||
seen.push(h);
|
||||
}
|
||||
// The 8-bit linear filter's policy changes the profile, and so the fingerprint, on a device
|
||||
// measured within its bound (the RTX 5080 Laptop GPU's capture), through the property it
|
||||
// decides; on lavapipe's capture, unmeasured, it changes nothing.
|
||||
// measured within its bound (lavapipe's capture, the RTX 5080 Laptop GPU's), through the
|
||||
// property it decides; on a GPU not measured (the RTX 50 desktop GPU's capture) it changes
|
||||
// nothing.
|
||||
let accepting = DevicePolicy {
|
||||
unorm8_linear_filter: crate::device::Unorm8LinearFilterPolicy::DeviceWithinOneCode,
|
||||
..base
|
||||
};
|
||||
assert_eq!(fp(accepting), reference);
|
||||
assert_ne!(fp(accepting), reference);
|
||||
let unmeasured = profile("nvidia-rtx50-linux");
|
||||
assert_eq!(
|
||||
Device::new(unmeasured.clone(), base)
|
||||
.unwrap()
|
||||
.profile()
|
||||
.fingerprint(),
|
||||
Device::new(unmeasured, accepting)
|
||||
.unwrap()
|
||||
.profile()
|
||||
.fingerprint(),
|
||||
);
|
||||
let measured = profile("nvidia-rtx5080-laptop");
|
||||
assert_ne!(
|
||||
Device::new(measured.clone(), base)
|
||||
@@ -856,22 +868,26 @@ fn moltenvk_on_apple_carries_the_early_tests_image_write_defect() {
|
||||
desc.vendor_id = 0x106B;
|
||||
desc.driver_id = Some(vk::DriverId::MESA_RADV);
|
||||
// Every rasterizer but Apple's hands a clipped primitive's fragments other coverage than
|
||||
// Metal's pieces, and every tessellator but Apple's orders a patch's triangles its own way.
|
||||
// Metal's pieces, and every tessellator but Apple's orders a patch's triangles its own way;
|
||||
// RADV's own interpolation defect holds on any vendor.
|
||||
assert_eq!(
|
||||
workarounds(&desc),
|
||||
[W::ClippedCoverageNotMetals, W::TessellatorNotMetals]
|
||||
[
|
||||
W::InterpolationNeedsTheWholeQuad,
|
||||
W::ClippedCoverageNotMetals,
|
||||
W::TessellatorNotMetals
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/// `DriverWorkaround::BothBarycentricFormsRejected`,
|
||||
/// `DriverWorkaround::CompositeInsertsWrittenInPlace`, `DriverWorkaround::LoadsForwardedIntoLoops`,
|
||||
/// `DriverWorkaround::LocalizedLoadsForwardedPastAtomicsAndCalls` and
|
||||
/// `DriverWorkaround::FunctionsInlinedAtEveryCall`, its SPIRV-Cross's, are keyed on MoltenVK's
|
||||
/// release by the measured table (`driver_facts::DEFECTS`): carried at 1.4.1, the release
|
||||
/// measured, and at a newer one (kept until a measurement says otherwise); not at an older
|
||||
/// release, which no measurement covers, nor by another driver at the same `driverVersion`.
|
||||
/// `DriverWorkaround::FunctionsInlinedAtEveryCall`, its SPIRV-Cross's, are keyed on MoltenVK by
|
||||
/// the measured table (`driver_facts::DEFECTS`): carried at every release, and not by another
|
||||
/// driver.
|
||||
#[test]
|
||||
fn moltenvk_carries_its_spirv_cross_defects_from_their_measured_release() {
|
||||
fn moltenvk_carries_its_spirv_cross_defects_at_every_release() {
|
||||
use crate::device::profile::DriverWorkaround;
|
||||
for defect in [
|
||||
DriverWorkaround::BothBarycentricFormsRejected,
|
||||
@@ -891,13 +907,11 @@ fn moltenvk_carries_its_spirv_cross_defects_from_their_measured_release() {
|
||||
{
|
||||
let stem = "moltenvk-m3";
|
||||
let mut desc = profile(stem);
|
||||
assert_eq!(desc.driver_version, 10401, "{stem}");
|
||||
assert!(carries(&desc), "{stem} {defect:?}");
|
||||
desc.driver_version = 10500;
|
||||
assert!(carries(&desc), "{stem} 1.5.0 {defect:?}");
|
||||
desc.driver_version = 10400;
|
||||
assert!(!carries(&desc), "{stem} 1.4.0 {defect:?}");
|
||||
desc.driver_version = 10401;
|
||||
for version in [10400, 10500] {
|
||||
desc.driver_version = version;
|
||||
assert!(carries(&desc), "{stem} {version} {defect:?}");
|
||||
}
|
||||
desc.driver_id = Some(vk::DriverId::MESA_LLVMPIPE);
|
||||
assert!(!carries(&desc), "{stem} under lavapipe {defect:?}");
|
||||
}
|
||||
@@ -909,12 +923,11 @@ fn moltenvk_carries_its_spirv_cross_defects_from_their_measured_release() {
|
||||
}
|
||||
}
|
||||
|
||||
/// `DriverWorkaround::MemoryWritingFragmentsRunPerSample` is keyed on MoltenVK's release and
|
||||
/// Apple's vendor ID by the measured table (`driver_facts::DEFECTS`): carried at 1.4.1, the release
|
||||
/// measured, and at a newer one (kept until a measurement says otherwise); not at an older release,
|
||||
/// nor on another vendor's GPU, nor by another driver.
|
||||
/// `DriverWorkaround::MemoryWritingFragmentsRunPerSample` is keyed on MoltenVK and Apple's vendor
|
||||
/// ID by the measured table (`driver_facts::DEFECTS`): carried at every release, and not on another
|
||||
/// vendor's GPU, nor by another driver.
|
||||
#[test]
|
||||
fn moltenvk_on_apple_carries_the_per_sample_writer_defect_from_its_measured_release() {
|
||||
fn moltenvk_on_apple_carries_the_per_sample_writer_defect_at_every_release() {
|
||||
use crate::device::profile::DriverWorkaround;
|
||||
let defect = DriverWorkaround::MemoryWritingFragmentsRunPerSample;
|
||||
let carries = |desc: &DeviceDescription| {
|
||||
@@ -928,13 +941,11 @@ fn moltenvk_on_apple_carries_the_per_sample_writer_defect_from_its_measured_rele
|
||||
{
|
||||
let stem = "moltenvk-m3";
|
||||
let mut desc = profile(stem);
|
||||
assert_eq!(desc.driver_version, 10401, "{stem}");
|
||||
assert!(carries(&desc), "{stem}");
|
||||
desc.driver_version = 10500;
|
||||
assert!(carries(&desc), "{stem} 1.5.0");
|
||||
desc.driver_version = 10400;
|
||||
assert!(!carries(&desc), "{stem} 1.4.0");
|
||||
desc.driver_version = 10401;
|
||||
for version in [10400, 10500] {
|
||||
desc.driver_version = version;
|
||||
assert!(carries(&desc), "{stem} {version}");
|
||||
}
|
||||
desc.vendor_id = 0x1002;
|
||||
assert!(!carries(&desc), "{stem} on another vendor");
|
||||
desc.vendor_id = 0x106B;
|
||||
@@ -949,14 +960,11 @@ fn moltenvk_on_apple_carries_the_per_sample_writer_defect_from_its_measured_rele
|
||||
}
|
||||
}
|
||||
|
||||
/// `DriverWorkaround::InterpolationNeedsTheWholeQuad` is keyed on RADV's release by the measured
|
||||
/// table (`driver_facts::DEFECTS`): carried from Mesa 26.0.8 through 26.2.4, the releases measured,
|
||||
/// and at a newer one (kept until a measurement says otherwise); not at an older release, which no
|
||||
/// measurement covers, nor by another driver at the same `driverVersion`, whatever the vendor ID
|
||||
/// (the row names none).
|
||||
/// `DriverWorkaround::InterpolationNeedsTheWholeQuad` is keyed on RADV by the measured table
|
||||
/// (`driver_facts::DEFECTS`): carried at every release, whatever the vendor ID (the row names
|
||||
/// none), and not by another driver.
|
||||
#[test]
|
||||
fn radv_carries_the_whole_quad_interpolation_defect_from_its_measured_release() {
|
||||
use crate::device::driver_facts::mesa;
|
||||
fn radv_carries_the_whole_quad_interpolation_defect_at_every_release() {
|
||||
use crate::device::profile::DriverWorkaround;
|
||||
let defect = DriverWorkaround::InterpolationNeedsTheWholeQuad;
|
||||
let carries = |desc: &DeviceDescription| {
|
||||
@@ -969,23 +977,16 @@ fn radv_carries_the_whole_quad_interpolation_defect_from_its_measured_release()
|
||||
};
|
||||
let mut desc = profile("amd-780m-radv");
|
||||
assert_eq!(desc.driver_id, Some(vk::DriverId::MESA_RADV));
|
||||
assert_eq!(desc.driver_version, mesa(26, 2, 4));
|
||||
assert!(carries(&desc));
|
||||
desc.driver_version = mesa(26, 3, 0);
|
||||
assert!(carries(&desc), "26.3.0");
|
||||
desc.driver_version = mesa(26, 2, 3);
|
||||
assert!(carries(&desc), "26.2.3");
|
||||
desc.driver_version = mesa(26, 0, 7);
|
||||
assert!(!carries(&desc), "26.0.7");
|
||||
desc.driver_version = mesa(26, 2, 4);
|
||||
desc.driver_version += 1;
|
||||
assert!(carries(&desc), "at another release");
|
||||
desc.vendor_id = 0x8086;
|
||||
assert!(carries(&desc), "on another vendor's ID");
|
||||
desc.driver_id = Some(vk::DriverId::INTEL_OPEN_SOURCE_MESA);
|
||||
assert!(!carries(&desc), "under ANV");
|
||||
for (stem, text) in committed_profiles() {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let radv = desc.driver_id == Some(vk::DriverId::MESA_RADV)
|
||||
&& desc.driver_version >= mesa(26, 0, 8);
|
||||
let radv = desc.driver_id == Some(vk::DriverId::MESA_RADV);
|
||||
assert_eq!(carries(&desc), radv, "{stem}");
|
||||
}
|
||||
}
|
||||
@@ -1105,14 +1106,11 @@ fn lavapipe_carries_the_split_pixel_fragments_defect() {
|
||||
assert!(!workarounds(&desc).contains(&defect));
|
||||
}
|
||||
|
||||
/// `DriverWorkaround::MeshIndexComponentStoresMisplaced` is keyed on lavapipe's release by the
|
||||
/// measured table (`driver_facts::DEFECTS`): carried at Mesa 26.0.8, the release measured (the
|
||||
/// Linux gate's), and at a newer one (kept until a measurement says otherwise); not at an older
|
||||
/// release, which no measurement covers, nor by another driver at the same `driverVersion`,
|
||||
/// whatever the vendor ID (the row names none).
|
||||
/// `DriverWorkaround::MeshIndexComponentStoresMisplaced` is keyed on lavapipe by the measured
|
||||
/// table (`driver_facts::DEFECTS`): carried at every release, whatever the vendor ID (the row
|
||||
/// names none), and not by another driver.
|
||||
#[test]
|
||||
fn lavapipe_carries_the_mesh_index_defect_from_its_measured_release() {
|
||||
use crate::device::driver_facts::mesa;
|
||||
fn lavapipe_carries_the_mesh_index_defect_at_every_release() {
|
||||
use crate::device::profile::DriverWorkaround;
|
||||
let defect = DriverWorkaround::MeshIndexComponentStoresMisplaced;
|
||||
let carries = |desc: &DeviceDescription| {
|
||||
@@ -1125,21 +1123,16 @@ fn lavapipe_carries_the_mesh_index_defect_from_its_measured_release() {
|
||||
};
|
||||
let mut desc = profile("gate-lavapipe-x86_64");
|
||||
assert_eq!(desc.driver_id, Some(vk::DriverId::MESA_LLVMPIPE));
|
||||
assert_eq!(desc.driver_version, mesa(26, 0, 8));
|
||||
assert!(carries(&desc));
|
||||
desc.driver_version = mesa(26, 2, 4);
|
||||
assert!(carries(&desc), "26.2.4");
|
||||
desc.driver_version = mesa(26, 0, 7);
|
||||
assert!(!carries(&desc), "26.0.7");
|
||||
desc.driver_version = mesa(26, 0, 8);
|
||||
desc.driver_version += 1;
|
||||
assert!(carries(&desc), "at another release");
|
||||
desc.vendor_id = 0x8086;
|
||||
assert!(carries(&desc), "on another vendor's ID");
|
||||
desc.driver_id = Some(vk::DriverId::MESA_RADV);
|
||||
assert!(!carries(&desc), "under RADV");
|
||||
for (stem, text) in committed_profiles() {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let lavapipe = desc.driver_id == Some(vk::DriverId::MESA_LLVMPIPE)
|
||||
&& desc.driver_version >= mesa(26, 0, 8);
|
||||
let lavapipe = desc.driver_id == Some(vk::DriverId::MESA_LLVMPIPE);
|
||||
assert_eq!(carries(&desc), lavapipe, "{stem}");
|
||||
}
|
||||
}
|
||||
@@ -1327,14 +1320,10 @@ fn function_storage_is_the_measured_value_of_the_device() {
|
||||
assert_eq!(storage(desc), Assumed(16 * kib));
|
||||
}
|
||||
|
||||
/// `DriverWorkaround::VertexGroupingNotApples` is keyed on ANV from the release measured with it
|
||||
/// (Mesa 26.2.4, the Intel venue's), for every GPU it runs: both committed profiles at that release
|
||||
/// carry it, a newer release keeps it, and an older release (the committed Arrow Lake and Iris Xe
|
||||
/// profiles' 26.2.3 and 26.2.2, which no one measured) or another driver at the same
|
||||
/// `driverVersion` does not.
|
||||
/// `DriverWorkaround::VertexGroupingNotApples` is keyed on ANV, for every GPU it runs at every
|
||||
/// release: every committed ANV profile carries it, and another driver does not.
|
||||
#[test]
|
||||
fn anv_carries_the_vertex_grouping_from_its_measured_release() {
|
||||
use crate::device::driver_facts::mesa;
|
||||
fn anv_carries_the_vertex_grouping_at_every_release() {
|
||||
use crate::device::profile::DriverWorkaround;
|
||||
let fact = DriverWorkaround::VertexGroupingNotApples;
|
||||
let carries = |desc: &DeviceDescription| {
|
||||
@@ -1347,36 +1336,29 @@ fn anv_carries_the_vertex_grouping_from_its_measured_release() {
|
||||
};
|
||||
let mut desc = profile("intel-irisxe-rplp-anv");
|
||||
assert_eq!(desc.driver_id, Some(vk::DriverId::INTEL_OPEN_SOURCE_MESA));
|
||||
assert_eq!(desc.driver_version, mesa(26, 2, 4));
|
||||
assert!(carries(&desc));
|
||||
desc.device_id = 0x56a0;
|
||||
assert!(carries(&desc), "on another Intel GPU");
|
||||
desc.driver_version = mesa(26, 3, 0);
|
||||
assert!(carries(&desc), "26.3.0");
|
||||
desc.driver_version = mesa(26, 2, 3);
|
||||
assert!(!carries(&desc), "26.2.3");
|
||||
desc.driver_version = mesa(26, 2, 4);
|
||||
desc.driver_version += 1;
|
||||
assert!(carries(&desc), "at another release");
|
||||
desc.driver_id = Some(vk::DriverId::MESA_RADV);
|
||||
assert!(!carries(&desc), "under RADV");
|
||||
for (stem, text) in committed_profiles() {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let anv = desc.driver_id == Some(vk::DriverId::INTEL_OPEN_SOURCE_MESA)
|
||||
&& desc.driver_version >= mesa(26, 2, 4);
|
||||
let anv = desc.driver_id == Some(vk::DriverId::INTEL_OPEN_SOURCE_MESA);
|
||||
assert_eq!(carries(&desc), anv, "{stem}");
|
||||
}
|
||||
assert!(carries(&profile("intel-uhd770-rpls-anv")));
|
||||
assert!(!carries(&profile("intel-arl-anv")));
|
||||
assert!(!carries(&profile("intel-irisxe-anv")));
|
||||
assert!(carries(&profile("intel-arl-anv")));
|
||||
assert!(carries(&profile("intel-irisxe-anv")));
|
||||
}
|
||||
|
||||
/// `DriverWorkaround::DontInlineKeepsCalls`, a cost fact, is keyed on the identities measured with
|
||||
/// it: NVIDIA's driver at 615.71.09 on the RTX 3090 and on the RTX 5080 Laptop GPU
|
||||
/// (`scripts/making-bench`). Another GPU of the vendor (the desktop RTX 50's committed profile,
|
||||
/// Pascal's), an older release, another vendor's ID, or another driver (NVK, Mesa's, MoltenVK)
|
||||
/// does not carry it.
|
||||
/// `DriverWorkaround::DontInlineKeepsCalls`, a cost fact, is keyed on the GPUs measured with it:
|
||||
/// NVIDIA's driver on the RTX 3090 and on the RTX 5080 Laptop GPU (`scripts/making-bench`), at
|
||||
/// every release. Another GPU of the vendor (the desktop RTX 50's committed profile, Pascal's),
|
||||
/// another vendor's ID, or another driver (NVK, Mesa's, MoltenVK) does not carry it.
|
||||
#[test]
|
||||
fn nvidia_keeps_dont_inline_calls_on_its_measured_gpu() {
|
||||
use crate::device::driver_facts::nvidia;
|
||||
use crate::device::profile::DriverWorkaround;
|
||||
let fact = DriverWorkaround::DontInlineKeepsCalls;
|
||||
let carries = |desc: &DeviceDescription| {
|
||||
@@ -1389,16 +1371,14 @@ fn nvidia_keeps_dont_inline_calls_on_its_measured_gpu() {
|
||||
};
|
||||
let mut desc = profile("nvidia-rtx5080-laptop");
|
||||
assert_eq!(desc.driver_id, Some(vk::DriverId::NVIDIA_PROPRIETARY));
|
||||
assert_eq!(desc.driver_version, nvidia(615, 71, 9));
|
||||
assert!(
|
||||
carries(&desc),
|
||||
"on the RTX 5080 Laptop GPU, where it was measured"
|
||||
);
|
||||
desc.device_id = crate::device::driver_facts::NVIDIA_RTX_3090;
|
||||
assert!(carries(&desc), "on the RTX 3090, where it was measured");
|
||||
desc.driver_version = nvidia(615, 71, 8);
|
||||
assert!(!carries(&desc), "615.71.08");
|
||||
desc.driver_version = nvidia(615, 71, 9);
|
||||
desc.driver_version += 1 << 6;
|
||||
assert!(carries(&desc), "at another release");
|
||||
desc.vendor_id = 0x1002;
|
||||
assert!(!carries(&desc), "on another vendor's ID");
|
||||
desc.vendor_id = 0x10de;
|
||||
|
||||
@@ -538,9 +538,8 @@ pub enum Needs {
|
||||
}
|
||||
|
||||
/// A departure of a driver from the specifications that translation relies on, measured per
|
||||
/// driver and release (`device::driver_facts`): the profile takes it on a measured release, and on
|
||||
/// a later one with `PrecisionNote::BeyondMeasuredDeviation` recorded
|
||||
/// (`ProfileFields::deviations_beyond`); elsewhere the translation takes its conservative route.
|
||||
/// driver and GPU (`device::driver_facts`): the profile takes it on every release of a driver
|
||||
/// measured with it; elsewhere the translation takes its conservative route.
|
||||
#[non_exhaustive]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub enum DriverDeviation {
|
||||
|
||||
@@ -4275,7 +4275,7 @@ fn the_minimum_and_maximum_family_follows_the_profile() {
|
||||
}
|
||||
taken += usize::from(moltenvk);
|
||||
}
|
||||
assert!(taken >= 2, "the MoltenVK captures take it");
|
||||
assert!(taken >= 1, "the MoltenVK capture takes it");
|
||||
}
|
||||
|
||||
/// Where the library says the device's `NMin`, `NMax` and `NClamp` are Metal's
|
||||
|
||||
@@ -819,7 +819,7 @@ fn the_fused_multiply_add_route_follows_the_profile() {
|
||||
fma::FLOAT_ROUTES.into_iter().collect(),
|
||||
"every float route is some committed profile's"
|
||||
);
|
||||
assert!(f16.len() >= 2, "{f16:?}");
|
||||
assert!(!f16.is_empty(), "{f16:?}");
|
||||
assert!(checked >= 1, "{checked} profiles check OpFmaKHR");
|
||||
assert!(
|
||||
flushing >= 1,
|
||||
|
||||
@@ -2726,7 +2726,7 @@ fn half_arithmetic_on_the_device_follows_the_profile() {
|
||||
measured += usize::from(basis == Some(F16Basis::Measured));
|
||||
controlled += usize::from(basis == Some(F16Basis::Controlled));
|
||||
}
|
||||
assert!(measured >= 2, "the MoltenVK captures take it, measured");
|
||||
assert!(measured >= 1, "the MoltenVK capture takes it, measured");
|
||||
assert!(
|
||||
controlled >= 2,
|
||||
"the float-controls profiles take it, by the spec"
|
||||
|
||||
@@ -3189,8 +3189,8 @@ fn packed_sixteen_bit_formats_sit_in_the_vulkan_word_of_their_bits() {
|
||||
Err(e) => panic!("{stem}: {e:?}"),
|
||||
}
|
||||
}
|
||||
// The two MoltenVK profiles expose the pair, so the sweep is not vacuous in either direction.
|
||||
assert!(held >= 2, "held on {held} committed profiles");
|
||||
// The MoltenVK profile exposes the pair, so the sweep is not vacuous in either direction.
|
||||
assert!(held >= 1, "held on {held} committed profiles");
|
||||
assert!(
|
||||
vk_format(
|
||||
PixelFormat::BGRA4Unorm,
|
||||
|
||||
@@ -1165,19 +1165,6 @@ pub enum PrecisionNote {
|
||||
///
|
||||
/// Validation derives no tolerance and no explanation from it, as for `DeviceDenormals`.
|
||||
DeviceTexelDenormals,
|
||||
/// The module is compiled for a device whose driver release is newer than the last one
|
||||
/// measured with a deviation the profile takes (`ProfileFields::deviations_beyond`, which
|
||||
/// names each with that release): where the specifications leave the answer to the driver,
|
||||
/// the module relies on its answer being Metal's (a simdgroup's lockstep, Metal's own `float`
|
||||
/// functions, its canonical NaN, its sampler, its cube-gradient route), as measured on the
|
||||
/// earlier release. The lane that measured each runs at every master gate on the venues of
|
||||
/// that driver, so a venue upgrade that changes one fails there; a release no venue runs is
|
||||
/// taken on that measurement alone. Recorded by every module compiled for such a profile,
|
||||
/// since the deviations shape `float` arithmetic, NaNs, sampling and simdgroups broadly.
|
||||
///
|
||||
/// Validation derives no tolerance and no explanation from it, as for
|
||||
/// `FunctionStorageAssumed`: a difference stays a mismatch for review.
|
||||
BeyondMeasuredDeviation,
|
||||
/// The module places a texel offset on an axis that may repeat or mirror as Metal does in an
|
||||
/// access of an argument buffer's texture: on a device that does not sample through Metal's
|
||||
/// own sampler (one that does, `VkProperty::MetalSampler`, is Metal's texture unit itself), in
|
||||
|
||||
@@ -2836,11 +2836,6 @@ fn compile_kept<K>(
|
||||
precision.push(note);
|
||||
precision.sort_unstable();
|
||||
}
|
||||
// A driver release past its deviations' measurement: every module relies on them.
|
||||
if !p.fields().deviations_beyond.is_empty() {
|
||||
precision.push(PrecisionNote::BeyondMeasuredDeviation);
|
||||
precision.sort_unstable();
|
||||
}
|
||||
if helper_guard.exposed {
|
||||
precision.push(PrecisionNote::HelperBranchDropsSimdgroupStores);
|
||||
precision.sort_unstable();
|
||||
|
||||
@@ -2593,12 +2593,12 @@ fn multisampled_fragment_invocations_follow_metals_measured_rules() {
|
||||
// A device whose `InterpolateAtOffset` reads from the center: a driver other than
|
||||
// MoltenVK's.
|
||||
let centered_mvk = mvk_as(&|d| d.driver_id = None);
|
||||
// MoltenVK 1.4.0, whose `InterpolateAtOffset` reads off the center and which is not measured to
|
||||
// read center varyings at the pixel center itself: it refuses a per-sample function's center
|
||||
// varying naming the property it lacks; every other case links or is refused as on the same
|
||||
// device without the deviation.
|
||||
let unmeasured_mvk =
|
||||
mvk_as(&|d| d.driver_version = crate::device::driver_facts::moltenvk(1, 4, 0));
|
||||
// MoltenVK on the Apple8 family under macOS 27 (`deviceID` 0x1B00_0208), whose
|
||||
// `InterpolateAtOffset` reads off the center and which is not measured to read center
|
||||
// varyings at the pixel center itself: it refuses a per-sample function's center varying
|
||||
// naming the property it lacks; every other case links or is refused as on the same device
|
||||
// without the deviation.
|
||||
let unmeasured_mvk = mvk_as(&|d| d.device_id = 0x1B00_0208);
|
||||
let needs_centered = Error::Unsupported(Unsupported::needs(
|
||||
Feature::SampleRateShading,
|
||||
Capability::Property(VkProperty::InterpolateAtOffsetCentered),
|
||||
@@ -2611,7 +2611,7 @@ fn multisampled_fragment_invocations_follow_metals_measured_rules() {
|
||||
.contains(&VkProperty::MetalCenterVaryings));
|
||||
for (stem, p, biased) in [
|
||||
("moltenvk-m3", committed, false),
|
||||
("moltenvk-m3 at 1.4.0", unmeasured_mvk, true),
|
||||
("moltenvk-m3 as Apple8", unmeasured_mvk, true),
|
||||
("moltenvk-m3 centered", centered_mvk, false),
|
||||
("lavapipe", profile("lavapipe"), false),
|
||||
] {
|
||||
|
||||
@@ -309,10 +309,8 @@ pub(crate) fn committed_descriptions() -> Result<&'static [(String, DeviceDescri
|
||||
.map_err(String::clone)
|
||||
}
|
||||
|
||||
/// The committed MoltenVK captures, MoltenVK 1.4.1 on the Apple M3 Max and on the Apple M4: they
|
||||
/// differ in their identity and allocation sizes only, so they derive one translation key and state
|
||||
/// the same deviations, and a test that singles out MoltenVK's answers among the committed profiles
|
||||
/// expects them of each.
|
||||
/// The committed MoltenVK captures, MoltenVK 1.4.1 on the Apple M3 Max under macOS 27.0.1: a test
|
||||
/// that singles out MoltenVK's answers among the committed profiles expects them of each.
|
||||
pub const MOLTENVK_CAPTURES: [&str; 1] = ["moltenvk-m3"];
|
||||
|
||||
/// Whether the committed profile `stem` is one of [`MOLTENVK_CAPTURES`].
|
||||
|
||||
@@ -352,7 +352,7 @@ fn a_multisampled_coverage_reader_off_apples_rasterizer_announces_the_split() {
|
||||
}
|
||||
}
|
||||
assert!(
|
||||
apple >= 2 && other >= 6,
|
||||
apple >= 1 && other >= 6,
|
||||
"{apple} on Apple's, {other} on others"
|
||||
);
|
||||
}
|
||||
@@ -661,8 +661,8 @@ fn a_per_sample_driver_runs_the_natural_functions_as_written() {
|
||||
}
|
||||
assert_eq!(
|
||||
natural,
|
||||
2 * NATURAL.len() * 2,
|
||||
"the two MoltenVK profiles ran each as written"
|
||||
NATURAL.len() * 2,
|
||||
"the MoltenVK profile ran each as written"
|
||||
);
|
||||
assert!(looped >= 6 * NATURAL.len(), "{looped} pipelines looped");
|
||||
}
|
||||
|
||||
@@ -2076,7 +2076,7 @@ fn a_replacing_blend_or_a_write_that_stores_nothing_takes_the_storage_form() {
|
||||
/// switched to fast math refuses it by its gap (`ExtendedRangeBlend`). The consumer's mask blend
|
||||
/// (G345: color source factor zero over one minus the source's alpha) is computed in the shader
|
||||
/// too, for the `half4` output and for the `float4` fill (rounded to `half` first), and makes the
|
||||
/// whole pipeline on both MoltenVK profiles.
|
||||
/// whole pipeline on the MoltenVK profile.
|
||||
/// A fast-math function's source-alpha-over blend (source alpha and one minus it, added, for
|
||||
/// color and alpha, every channel written) into color 0 of `BGR10_XR_sRGB` or
|
||||
/// `RGB10A8_2P_XR10_sRGB`, beside an `R8Unorm` color 1 under the same blend (a consumer's
|
||||
|
||||
@@ -4663,8 +4663,8 @@ fn the_binder_states_a_view_s_parent_base_axes() {
|
||||
/// filter: it records `DeviceUnorm8LinearFilter` under the slot's class (and a runtime slot's
|
||||
/// word), requires `VkProperty::Unorm8LinearFilter`, and validates. A texel offset, pixel
|
||||
/// coordinates, a 1D or 3D texture, every sample under the default policy, and every sample on
|
||||
/// an unmeasured profile (lavapipe's capture, Mesa 26.2.3, below the measured 26.2.4) keep
|
||||
/// Metal's filter emulated: no note, no requirement. The plan's word estimate bounds each.
|
||||
/// an unmeasured profile (the RTX 50 desktop GPU's capture, a GPU no row names) keep Metal's
|
||||
/// filter emulated: no note, no requirement. The plan's word estimate bounds each.
|
||||
#[test]
|
||||
fn a_measured_device_filters_the_eight_bit_classes_itself() {
|
||||
let edge = linear(1, false, 0);
|
||||
@@ -4720,7 +4720,7 @@ fn a_measured_device_filters_the_eight_bit_classes_itself() {
|
||||
assert!(measured.takes_driver_deviation(D::Unorm8LinearFilter));
|
||||
let exact = profile("nvidia-rtx5080-laptop", emulated).expect("profile");
|
||||
assert!(!exact.takes_driver_deviation(D::Unorm8LinearFilter));
|
||||
let unmeasured = profile("lavapipe", accepting).expect("profile");
|
||||
let unmeasured = profile("nvidia-rtx50-linux", accepting).expect("profile");
|
||||
assert!(!unmeasured.takes_driver_deviation(D::Unorm8LinearFilter));
|
||||
for (name, sampler, form, float, native) in cases {
|
||||
let Some(bc) = assemble(name, &kernel_of(sampler, form, float)) else {
|
||||
@@ -4729,7 +4729,7 @@ fn a_measured_device_filters_the_eight_bit_classes_itself() {
|
||||
for (stem, p, want) in [
|
||||
("nvidia-rtx5080-laptop accepting", &measured, native),
|
||||
("nvidia-rtx5080-laptop by default", &exact, false),
|
||||
("lavapipe accepting", &unmeasured, false),
|
||||
("nvidia-rtx50-linux accepting", &unmeasured, false),
|
||||
] {
|
||||
let what = format!("{name} on {stem}");
|
||||
let a = compile(&bc, "k", p).unwrap_or_else(|e| panic!("{what}: {e}"));
|
||||
|
||||
@@ -243,12 +243,12 @@ fn centered_moltenvk() -> DeviceDescription {
|
||||
desc
|
||||
}
|
||||
|
||||
/// `moltenvk-m3` at MoltenVK 1.4.0, a release none of MoltenVK's deviations is measured with:
|
||||
/// its `InterpolateAtOffset` reads off the center (the driver's), and it does not take
|
||||
/// `DriverDeviation::MetalCenterVaryings`.
|
||||
/// `moltenvk-m3` as the Apple8 family under macOS 27 (`deviceID` 0x1B00_0208), a GPU no row of
|
||||
/// MoltenVK's center varyings names: its `InterpolateAtOffset` reads off the center (the
|
||||
/// driver's), and it does not take `DriverDeviation::MetalCenterVaryings`.
|
||||
fn unmeasured_moltenvk() -> DeviceDescription {
|
||||
let mut desc = description("moltenvk-m3");
|
||||
desc.driver_version = crate::device::driver_facts::moltenvk(1, 4, 0);
|
||||
desc.device_id = 0x1B00_0208;
|
||||
desc
|
||||
}
|
||||
|
||||
@@ -633,8 +633,8 @@ fn the_interface_states_the_pixel_reads() {
|
||||
}
|
||||
}
|
||||
|
||||
/// On `moltenvk-m3` at a release whose driver is not measured to read center varyings at the
|
||||
/// pixel center itself, a per-sample function's center varying has a pixel form only where both a
|
||||
/// On `moltenvk-m3` as a GPU whose driver is not measured to read center varyings at the pixel
|
||||
/// center itself, a per-sample function's center varying has a pixel form only where both a
|
||||
/// centered `InterpolateAtOffset` and the portability member allow it, and is refused naming what
|
||||
/// the device lacks of the two: as a device whose offset reads from the center the pipeline
|
||||
/// compiles, requires the member, and converts to MSL that Metal compiles; whatever the device, the
|
||||
@@ -703,9 +703,9 @@ fn a_center_varying_at_sample_rate_needs_a_centered_offset_and_the_interpolation
|
||||
|
||||
/// A MoltenVK device is biased by its driver alone, as `vulkaninfo --json` describes it on a
|
||||
/// MoltenVK host, so no translation for it emits `InterpolateAtOffset` 1/16 pixel off the center.
|
||||
/// At a release measured to read center varyings at the pixel center itself (MoltenVK 1.4.1) a
|
||||
/// per-sample center varying is read as it is; at an unmeasured one (1.4.0) it is refused naming
|
||||
/// the property. A pixel-rate one reads as it is at either.
|
||||
/// On a GPU measured to read center varyings at the pixel center itself (the M4's identity) a
|
||||
/// per-sample center varying is read as it is; on an unmeasured one (the Apple8 family) it is
|
||||
/// refused naming the property. A pixel-rate one reads as it is on either.
|
||||
#[test]
|
||||
fn a_moltenvk_device_is_biased_by_its_driver() {
|
||||
let Some(lib) = fixture() else { return };
|
||||
|
||||
@@ -670,15 +670,20 @@ fn float_sums_record_their_precision() {
|
||||
/// A vertex function of simdgroup operations (`rvc_simd_vertex`: a sum, shuffles and a ballot;
|
||||
/// `rvc_simd_vertex_fill`: a fill with an explicit width) records
|
||||
/// `PrecisionNote::VertexSimdgroupGrouping` exactly where the vertex stage takes no required
|
||||
/// subgroup size and the driver is measured to group vertices otherwise than Apple's GPUs (ANV
|
||||
/// from Mesa 26.2.4: both profiles of the Intel venue); RADV, whose vertex stage cannot be pinned
|
||||
/// subgroup size and the driver is measured to group vertices otherwise than Apple's GPUs (ANV, on
|
||||
/// every GPU at every release: each committed ANV profile); RADV, whose vertex stage cannot be pinned
|
||||
/// either but groups as Apple's GPUs do, and NVIDIA, which pins it, do not, and a profile without
|
||||
/// subgroup operations in the vertex stage refuses the function. On ANV a kernel of simdgroup
|
||||
/// operations and a vertex function of none record no such note.
|
||||
#[test]
|
||||
fn vertex_simdgroup_functions_record_the_grouping_where_the_driver_regroups_vertices() {
|
||||
let note = PrecisionNote::VertexSimdgroupGrouping;
|
||||
let anv = ["intel-irisxe-rplp-anv", "intel-uhd770-rpls-anv"];
|
||||
let anv = [
|
||||
"intel-arl-anv",
|
||||
"intel-irisxe-anv",
|
||||
"intel-irisxe-rplp-anv",
|
||||
"intel-uhd770-rpls-anv",
|
||||
];
|
||||
for (stem, entry) in [
|
||||
("rvc_simd_vertex", "simd_functions_in_a_vertex_function"),
|
||||
(
|
||||
@@ -776,15 +781,15 @@ fn vertex_simdgroups_compile_where_the_driver_runs_them_unadvertised() {
|
||||
}
|
||||
}
|
||||
assert_eq!(
|
||||
unadvertised, 8,
|
||||
"the four functions on both MoltenVK captures"
|
||||
unadvertised, 4,
|
||||
"the four functions on the MoltenVK capture"
|
||||
);
|
||||
}
|
||||
|
||||
/// `gsm2_vertex_quad_permutes`' quad broadcasts and shuffle-xors by a constant lane or mask in
|
||||
/// vertex functions are shuffles through the ballot of the live lanes on every committed profile,
|
||||
/// since a vertex quad may lack a lane past the draw's vertex count: each function compiles,
|
||||
/// declares no quad capability, and validates, on both MoltenVK captures too, whose vertex stage
|
||||
/// declares no quad capability, and validates, on the MoltenVK capture too, whose vertex stage
|
||||
/// runs unlisted without the quad class. A profile whose vertex stage has no subgroups refuses
|
||||
/// them.
|
||||
#[test]
|
||||
@@ -824,13 +829,13 @@ fn vertex_quad_permutes_shuffle_through_the_live_lanes() {
|
||||
shuffled += usize::from(name.starts_with("moltenvk-"));
|
||||
}
|
||||
}
|
||||
assert_eq!(shuffled, 6, "the three functions on both MoltenVK captures");
|
||||
assert_eq!(shuffled, 3, "the three functions on the MoltenVK capture");
|
||||
}
|
||||
|
||||
/// A fragment function of simdgroup operations (`fragment_discard_counts`: sums before and after a
|
||||
/// discard) records `PrecisionNote::FragmentSimdgroupGrouping` on every committed profile that
|
||||
/// compiles it and does not take `MetalFragmentSimdgroups`, and on the two MoltenVK profiles, which
|
||||
/// take it, records none. A fragment that reads only its quad lane (`simd_masks`' `quad_lane_f`)
|
||||
/// compiles it and does not take `MetalFragmentSimdgroups`, and on the MoltenVK profile, which
|
||||
/// takes it, records none. A fragment that reads only its quad lane (`simd_masks`' `quad_lane_f`)
|
||||
/// records none anywhere, and neither does a vertex function of simdgroup operations
|
||||
/// (`rvc_simd_vertex`).
|
||||
#[test]
|
||||
@@ -1632,8 +1637,8 @@ fn fragment_group_operations_run_full_quads() {
|
||||
|
||||
/// MoltenVK 1.4.2 drops `VK_KHR_shader_quad_control` (`shaderQuadControl`) on Apple's GPUs, where
|
||||
/// it still hands the fragment function to Metal, whose helpers take part in every simdgroup
|
||||
/// operation (`DriverDeviation::MetalFullQuads`). The committed `moltenvk-m3` description at
|
||||
/// 1.4.2 without the feature and its extension (the device as it now reports itself) compiles
|
||||
/// operation (`DriverDeviation::MetalFullQuads`). The committed `moltenvk-m3` description
|
||||
/// without the feature and its extension (the device as 1.4.2 reports itself) compiles
|
||||
/// each fragment function whose group operations observe other lanes: it declares no
|
||||
/// `RequireFullQuadsKHR` and no `QuadControlKHR`, requires `VkProperty::MetalFullQuads` and not
|
||||
/// the feature, still reads every lane through the ballot of the live lanes, and passes L3. The
|
||||
@@ -1648,7 +1653,6 @@ fn a_device_that_runs_metal_s_helpers_runs_full_quads_without_quad_control() {
|
||||
.join("../metal2vulkan-validation/profiles/moltenvk-m3.json");
|
||||
let text = std::fs::read_to_string(&path).expect("read the MoltenVK description");
|
||||
let mut desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
desc.driver_version = crate::device::driver_facts::moltenvk(1, 4, 2);
|
||||
assert!(desc.features.remove(&VkFeature::ShaderQuadControl));
|
||||
assert!(desc.extensions.remove(&VkExtension::KhrShaderQuadControl));
|
||||
let device = |taken: bool| {
|
||||
|
||||
@@ -340,5 +340,5 @@ fn a_half_fused_multiply_add_is_inline_on_moltenvk() {
|
||||
inline += usize::from(moltenvk);
|
||||
compiles_as_moltenvk_msl(&stem, words, &what);
|
||||
}
|
||||
assert_eq!(inline, 2, "both MoltenVK captures");
|
||||
assert_eq!(inline, 1, "the MoltenVK capture");
|
||||
}
|
||||
@@ -1979,7 +1979,7 @@ fn metals_own_srgb_decode_converts_to_half_as_metal_does() {
|
||||
});
|
||||
assert!(held, "{stem}: {:?}", p.stage.specialized_notes);
|
||||
}
|
||||
assert_eq!(seen, 3);
|
||||
assert_eq!(seen, 2);
|
||||
}
|
||||
|
||||
/// Under the variant, a form the raw codes do not serve (a runtime sampler's sample) states
|
||||
|
||||
@@ -201,7 +201,6 @@ fn notes() -> Vec<(&'static str, Ledger)> {
|
||||
CubeFaceReciprocal,
|
||||
QuadsCountedBeforeDiscard,
|
||||
DeviceDepthComparison,
|
||||
BeyondMeasuredDeviation,
|
||||
ViewBaseTexelOffset,
|
||||
DeviceColorConversion,
|
||||
QuadsSplitByClipping,
|
||||
|
||||
@@ -2083,7 +2083,6 @@ field metal2vulkan-runtime::DeviceHandles.physical_device pub physical_device: v
|
||||
field metal2vulkan-runtime::DeviceHandles.queue_families pub queue_families: &'a [u32]
|
||||
field metal2vulkan-runtime::DeviceHandles.queue_family pub queue_family: u32
|
||||
field metal2vulkan-runtime::DeviceOptions.announce_each pub announce_each: BTreeSet<crate::Degradation>
|
||||
field metal2vulkan-runtime::DeviceOptions.assume_unmeasured_identity pub assume_unmeasured_identity: bool
|
||||
field metal2vulkan-runtime::DeviceOptions.device_extensions pub device_extensions: Vec<CString>
|
||||
field metal2vulkan-runtime::DeviceOptions.fail_in_place_check pub fail_in_place_check: bool
|
||||
field metal2vulkan-runtime::DeviceOptions.gpu_times_from_host pub gpu_times_from_host: bool
|
||||
@@ -2110,7 +2109,6 @@ field metal2vulkan-runtime::DeviceProperties.device_id pub device_id: u32
|
||||
field metal2vulkan-runtime::DeviceProperties.device_uuid pub device_uuid: [u8; 16]
|
||||
field metal2vulkan-runtime::DeviceProperties.driver_defects pub driver_defects: BTreeSet<RuntimeDriverDefect>
|
||||
field metal2vulkan-runtime::DeviceProperties.driver_facts pub driver_facts: BTreeSet<DriverFact>
|
||||
field metal2vulkan-runtime::DeviceProperties.driver_facts_withheld pub driver_facts_withheld: BTreeSet<DriverFact>
|
||||
field metal2vulkan-runtime::DeviceProperties.drm_render pub drm_render: Option<(i64, i64)>
|
||||
field metal2vulkan-runtime::DeviceProperties.gpu_core_count pub gpu_core_count: Option<u32>
|
||||
field metal2vulkan-runtime::DeviceProperties.has_unified_memory pub has_unified_memory: bool
|
||||
@@ -3728,7 +3726,6 @@ field metal2vulkan::device::DescriptorCaps.update_unused_while_pending pub updat
|
||||
field metal2vulkan::device::DescriptorCaps.variable_descriptor_count pub variable_descriptor_count: bool
|
||||
field metal2vulkan::device::DeviceDescription.allocation pub allocation: AllocationLimits
|
||||
field metal2vulkan::device::DeviceDescription.api_version pub api_version: ApiVersion
|
||||
field metal2vulkan::device::DeviceDescription.assumed_unmeasured pub assumed_unmeasured: bool
|
||||
field metal2vulkan::device::DeviceDescription.device_id pub device_id: u32
|
||||
field metal2vulkan::device::DeviceDescription.device_name pub device_name: String
|
||||
field metal2vulkan::device::DeviceDescription.device_type pub device_type: Option<vk::PhysicalDeviceType>
|
||||
@@ -5012,7 +5009,6 @@ macro-member metal2vulkan-runtime::Degradation::AmplificationDraws Amplification
|
||||
macro-member metal2vulkan-runtime::Degradation::AnisotropicFilter AnisotropicFilter = "anisotropic-filter";
|
||||
macro-member metal2vulkan-runtime::Degradation::ArgumentPixelSamplerScaling ArgumentPixelSamplerScaling = "argument-pixel-sampler-scaling";
|
||||
macro-member metal2vulkan-runtime::Degradation::AttachmentReadInPlace AttachmentReadInPlace = "attachment-read-in-place", Precision,
|
||||
macro-member metal2vulkan-runtime::Degradation::BeyondMeasuredDeviation BeyondMeasuredDeviation = "beyond-measured-deviation";
|
||||
macro-member metal2vulkan-runtime::Degradation::BiasedDepthPastUnitRange BiasedDepthPastUnitRange = "biased-depth-past-unit-range", Precision,
|
||||
macro-member metal2vulkan-runtime::Degradation::BicubicFilterArithmetic BicubicFilterArithmetic = "bicubic-filter-arithmetic";
|
||||
macro-member metal2vulkan-runtime::Degradation::BlendedWriteRounding BlendedWriteRounding = "blended-write-rounding";
|
||||
@@ -7853,7 +7849,6 @@ method metal2vulkan-runtime::DeviceProperties::supports_texture_write_rounding_m
|
||||
method metal2vulkan-runtime::DeviceProperties::supports_vertex_amplification_count pub fn supports_vertex_amplification_count(&self, count: u64) -> Result<bool, RuntimeGap>
|
||||
method metal2vulkan-runtime::DrawPrimitiveType::from_raw pub fn from_raw(raw: u64) -> Result<DrawPrimitiveType, Error>
|
||||
method metal2vulkan-runtime::DrawPrimitiveType::raw pub fn raw(self) -> u64
|
||||
method metal2vulkan-runtime::DriverFact::assumed_where_unmeasured pub const fn assumed_where_unmeasured(self) -> bool
|
||||
method metal2vulkan-runtime::DriverFact::pipeline_creation_diagnostics pub fn pipeline_creation_diagnostics(self, dynamic_states: &[DynamicState], topology: PrimitiveTopology, blendless_colors: &[Format]) -> Vec<DriverDiagnostic>
|
||||
method metal2vulkan-runtime::DriverFact::unreliable_linear_tiling pub const fn unreliable_linear_tiling(self) -> FormatFeatureFlags2
|
||||
method metal2vulkan-runtime::DynamicLibrary::device pub fn device(&self) -> &Device
|
||||
@@ -8829,12 +8824,9 @@ method metal2vulkan::device::Device::tile_pipeline_key pub fn tile_pipeline_key(
|
||||
method metal2vulkan::device::DeviceDescription::blendless_color_formats pub fn blendless_color_formats(&self) -> Vec<Format>
|
||||
method metal2vulkan::device::DeviceDescription::canonical_device_id pub fn canonical_device_id(&self) -> u32
|
||||
method metal2vulkan::device::DeviceDescription::driver_facts pub fn driver_facts(&self) -> BTreeSet<DriverFact>
|
||||
method metal2vulkan::device::DeviceDescription::driver_facts_withheld pub fn driver_facts_withheld(&self) -> BTreeSet<DriverFact>
|
||||
method metal2vulkan::device::DeviceDescription::from_khronos_json pub fn from_khronos_json(json: &str, profile: Option<&str>) -> Result<DeviceDescription, Error>
|
||||
method metal2vulkan::device::DeviceDescription::has pub fn has(&self, feature: VkFeature) -> bool
|
||||
method metal2vulkan::device::DeviceDescription::has_format_feature_flags2 pub fn has_format_feature_flags2(&self) -> bool
|
||||
method metal2vulkan::device::DeviceDescription::measured_gpu pub fn measured_gpu(&self) -> Option<u32>
|
||||
method metal2vulkan::device::DeviceDescription::measured_identity pub fn measured_identity(&self) -> bool
|
||||
method metal2vulkan::device::DeviceDescription::new pub fn new(api_version: ApiVersion) -> DeviceDescription
|
||||
method metal2vulkan::device::DeviceDescription::query pub unsafe fn query(instance: &ash::Instance, physical_device: avk::PhysicalDevice, instance_api_version: ApiVersion) -> Result<DeviceDescription, Error>
|
||||
method metal2vulkan::device::DeviceDescription::recommended_enables pub fn recommended_enables(&self, policy: &DevicePolicy) -> EnableSet
|
||||
@@ -8851,7 +8843,6 @@ method metal2vulkan::device::DeviceProfile::containment pub fn containment(&self
|
||||
method metal2vulkan::device::DeviceProfile::descriptors pub fn descriptors(&self) -> &DescriptorCaps
|
||||
method metal2vulkan::device::DeviceProfile::device_drops_texel_writes pub fn device_drops_texel_writes(&self, texel_buffer: bool) -> bool
|
||||
method metal2vulkan::device::DeviceProfile::device_reads_texels pub fn device_reads_texels(&self, texel_buffer: bool) -> bool
|
||||
method metal2vulkan::device::DeviceProfile::driver_deviations pub fn driver_deviations(&self) -> &BTreeMap<DriverDeviation, u32>
|
||||
method metal2vulkan::device::DeviceProfile::enabled pub fn enabled(&self) -> &EnabledCaps
|
||||
method metal2vulkan::device::DeviceProfile::fingerprint pub fn fingerprint(&self) -> Hash256
|
||||
method metal2vulkan::device::DeviceProfile::fragment pub fn fragment(&self) -> &FragmentCaps
|
||||
@@ -8873,7 +8864,6 @@ method metal2vulkan::device::DeviceProfile::ulong_atomic_gaps pub fn ulong_atomi
|
||||
method metal2vulkan::device::DeviceProfile::union_requirements pub fn union_requirements(&self, a: &Requirements, b: &Requirements) -> Requirements
|
||||
method metal2vulkan::device::DeviceProfile::vertex_entry_inputs pub fn vertex_entry_inputs(&self, d: &EntryDescriptor<'_>, vertex: Option<&VertexDescriptor>, budget: &Budget) -> Result<LoweringInputs, Error>
|
||||
method metal2vulkan::device::DeviceProfile::workarounds pub fn workarounds(&self) -> &[DriverWorkaround]
|
||||
method metal2vulkan::device::DriverFact::assumed_where_unmeasured pub const fn assumed_where_unmeasured(self) -> bool
|
||||
method metal2vulkan::device::DriverFact::pipeline_creation_diagnostics pub fn pipeline_creation_diagnostics(self, dynamic_states: &[DynamicState], topology: PrimitiveTopology, blendless_colors: &[Format]) -> Vec<DriverDiagnostic>
|
||||
method metal2vulkan::device::DriverFact::unreliable_linear_tiling pub const fn unreliable_linear_tiling(self) -> FormatFeatureFlags2
|
||||
method metal2vulkan::device::EnableSet::new pub fn new() -> EnableSet
|
||||
@@ -13634,7 +13624,6 @@ variant metal2vulkan::pipeline::PatchDomain::Quad Quad
|
||||
variant metal2vulkan::pipeline::PatchDomain::Triangle Triangle
|
||||
variant metal2vulkan::pipeline::PrecisionNote::AnisotropicFilter AnisotropicFilter
|
||||
variant metal2vulkan::pipeline::PrecisionNote::ArgumentPixelSamplerScaling ArgumentPixelSamplerScaling
|
||||
variant metal2vulkan::pipeline::PrecisionNote::BeyondMeasuredDeviation BeyondMeasuredDeviation
|
||||
variant metal2vulkan::pipeline::PrecisionNote::BicubicFilterArithmetic BicubicFilterArithmetic
|
||||
variant metal2vulkan::pipeline::PrecisionNote::BlendedWriteRounding BlendedWriteRounding
|
||||
variant metal2vulkan::pipeline::PrecisionNote::ClippedCoverageSplit ClippedCoverageSplit
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1529,9 +1529,9 @@ fn a_signed_integer_attachment_compiles_the_fragment_for_it() {
|
||||
/// its center varyings where Vulkan shades, is refused as needing the input. A pipeline of one
|
||||
/// sample keeps the fragment's common-path key. `moltenvk-m3`, whose `InterpolateAtOffset` reads
|
||||
/// off the pixel center, reads the center varyings at the pixel center itself, as Metal does, so
|
||||
/// its pipeline is as lavapipe's. At MoltenVK 1.4.0, not measured so, the key is the same and the
|
||||
/// sample-rate function's center varyings have no pixel form: the pipeline is refused naming the
|
||||
/// property it lacks, compiled under the input or not.
|
||||
/// its pipeline is as lavapipe's. As the Apple8 family under macOS 27 (`deviceID` 0x1B00_0208), not
|
||||
/// measured so, the key is the same and the sample-rate function's center varyings have no pixel
|
||||
/// form: the pipeline is refused naming the property it lacks, compiled under the input or not.
|
||||
#[test]
|
||||
fn a_multisampled_pipeline_compiles_the_fragment_for_it() {
|
||||
let Some(bc) = fixture("multisample") else {
|
||||
@@ -1554,23 +1554,23 @@ fn a_multisampled_pipeline_compiles_the_fragment_for_it() {
|
||||
mantissa: 10,
|
||||
signed: true,
|
||||
}); 4];
|
||||
// MoltenVK 1.4.0 as its `driverVersion` encodes it.
|
||||
const MOLTENVK_1_4_0: u32 = 10400;
|
||||
// The Apple8 family under macOS 27, as MoltenVK's `deviceID` encodes it.
|
||||
const APPLE8_MACOS_27: u32 = 0x1B00_0208;
|
||||
for (stem, release) in [
|
||||
("moltenvk-m3", None),
|
||||
("moltenvk-m3", Some(MOLTENVK_1_4_0)),
|
||||
("moltenvk-m3", Some(APPLE8_MACOS_27)),
|
||||
("lavapipe", None),
|
||||
] {
|
||||
let dev = match release {
|
||||
None => device(stem),
|
||||
Some(version) => {
|
||||
Some(device_id) => {
|
||||
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles")
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(&path).expect("profile");
|
||||
let mut desc =
|
||||
DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
desc.driver_version = version;
|
||||
desc.device_id = device_id;
|
||||
Device::new(desc, DevicePolicy::default()).expect("device")
|
||||
}
|
||||
};
|
||||
|
||||
+2777
-2778
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+9
-20
@@ -206,19 +206,15 @@ println!(" Metal properties: {:?}", device.metal_properties());
|
||||
|
||||
Where Vulkan leaves an answer to the driver and a driver's answer is Metal's, the profile relies on
|
||||
it only where that driver was measured to give it, keyed on the description's driver identity
|
||||
(`driver_id`, `vendor_id`, `driver_version`, and `device_id` where one GPU differs from another;
|
||||
MoltenVK's `device_id` is the macOS release and the Apple GPU family, so the M3 Max and the M4 share
|
||||
one under macOS 27 and a macOS release not measured is another identity), never on a claim of the
|
||||
description itself. A GPU that reports more than one `device_id` is read by the one it was measured
|
||||
under (`DeviceDescription::canonical_device_id`): the Radeon 780M of Hawk Point (`0x1900`) as
|
||||
Phoenix's (`0x15bf`), at the releases measured there. A release measured on one GPU of a shared
|
||||
`device_id` alone names that GPU by its `device_name`: MoltenVK 1.4.2 under macOS 27 was measured
|
||||
on the M3 Max, so the M4 at 1.4.2 is no measured identity. These are `DriverDeviation`s (simdgroups
|
||||
that run in lockstep, Metal's own `float` functions, sampler and canonical NaNs, color writes,
|
||||
...), measured on MoltenVK 1.4.1 on Apple's M3 Max and M4 and on MoltenVK 1.4.2 on the M3 Max,
|
||||
with a few per-GPU facts measured elsewhere. A driver, GPU or release that was not measured takes
|
||||
the conservative, exact route. A newer MoltenVK release
|
||||
takes the measured facts and records `PrecisionNote::BeyondMeasuredDeviation`.
|
||||
(`driver_id`, `vendor_id`, and `device_id` where one GPU differs from another; MoltenVK's
|
||||
`device_id` is the macOS release and the Apple GPU family, so the M3 Max and the M4 share one under
|
||||
macOS 27), never on its `driver_version` and never on a claim of the description itself. A row holds
|
||||
at every release of its driver. A GPU that reports more than one `device_id` is read by the one it
|
||||
was measured under (`DeviceDescription::canonical_device_id`): the Radeon 780M of Hawk Point
|
||||
(`0x1900`) as Phoenix's (`0x15bf`). These are `DriverDeviation`s (simdgroups that run in lockstep,
|
||||
Metal's own `float` functions, sampler and canonical NaNs, color writes, ...), measured on MoltenVK
|
||||
on Apple's M3 Max and M4, with a few per-GPU facts measured elsewhere. A driver or GPU that was not
|
||||
measured takes the conservative route.
|
||||
|
||||
Metal semantics the translation keeps on every device, beyond Vulkan's: Metal's 32-lane
|
||||
simdgroups (including lockstep races on threadgroup memory within a barrier interval), and the
|
||||
@@ -2862,13 +2858,6 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
|
||||
- `metal2vulkan-degrade-device-texel-denormals` (precision). `PrecisionNote::DeviceTexelDenormals`:
|
||||
A `float` sample or gather, a comparison's included, whose texels the device reads, on a device
|
||||
that does not sample through Metal's own sampler.
|
||||
- `metal2vulkan-degrade-beyond-measured-deviation` (precision).
|
||||
`PrecisionNote::BeyondMeasuredDeviation`: The module is compiled for a device whose driver release
|
||||
is newer than the last one measured with a deviation the profile takes
|
||||
(`ProfileFields::deviations_beyond`, which names each with that release): where the specifications
|
||||
leave the answer to the driver, the module relies on its answer being Metal's (a simdgroup's
|
||||
lockstep, Metal's own `float` functions, its canonical NaN, its sampler, its cube-gradient route),
|
||||
as measured on the earlier release.
|
||||
- `metal2vulkan-degrade-view-base-texel-offset` (precision). `PrecisionNote::ViewBaseTexelOffset`:
|
||||
The module places a texel offset on an axis that may repeat or mirror as Metal does in an access
|
||||
of an argument buffer's texture: on a device that does not sample through Metal's own sampler (one
|
||||
|
||||
Reference in new issue
Block a user