SEMANTICS 2142 / RUNTIME 2495: View facts from the device's own check: the runtime's view check, measured workarounds in the description
What: the two constant-window view cost facts no longer come from a GPU identity. - metal2vulkan: DeviceDescription::measured (a set of DriverWorkaround, serde default) is a profile input: the profile takes those workarounds beside its identity's, so the fingerprint and every cache key follow it. The identity rows of UniformBufferPerLaneReadsSerialize (RTX 3090, RTX 2080, RTX 5080 Laptop) and ExternalUniformReadsSkipACache (ANV on the Iris Xe RPL-P) are gone, and NVIDIA_RTX_2080 with them (nothing else used it). - The texel form now applies only to a slot with an indexed read (SlotPlan::indexed_read, from Provenance::indexed_constant_reads, marked on a profile with the texel fact): a slot read at constant offsets alone keeps its uniform buffer, whose ranges ANV pushes into registers (Mesa's brw_nir_analyze_ubo_ranges; read, not measured), as reims's Iris Geekbench pair 2 suggested. With both facts, view_kind gives a per-lane slot storage, an indexed-uniform slot the texel view, a constant-offset slot the uniform buffer: no conflict. - bind::view_check_module (CheckView x CheckReads): the check's kernels, built and verified like any crate module (push-constant window mask, uvec4 reads, uniform / per-lane / fields). - metal2vulkan-runtime: view_check.rs, a device check on its own thread, started as the device is made, once per driver + release + runtime, its medians kept in the shader cache's directory: 8 kernels x 1 KiB / 4 KiB windows in device memory, and UBO / texel uniform reads over imported host pages; 7 interleaved rounds after a warm-up, medians of timestamps x timestampPeriod. Facts: per-lane where storage/UBO per-lane < 0.3 at both windows (NVIDIA 0.011-0.107, RADV 0.96-1.00); texel where texel/UBO uniform over imported pages < 0.7 at both (Iris 0.40-0.49). Unchecked (no fact) without timestamps or on any refusal. Device::settle_view_check, view_costs (ViewCosts, ViewVerdict), view_check_report. - Timing: creation never waits. Device::compile_device returns the description's compile device until the check answers with a fact, then the one with the facts measured (made before the answer is published, held in the line's Invariant); a recorded answer applies from the first pipeline. pipeline::Sources reads the compile device once per creation or variant, so one compile and its link never straddle the answer. The runtime's own tests fix the facts (DeviceOptions::view_facts, cfg(test), default none) unless a test runs the check; it replaces compile_as. Tests: device::tests::profile view_facts_come_from_the_measured_set_alone (no committed profile nor the 3090/2080 IDs carries either fact by identity; each measured set its own fingerprint); engine_lane_reads (the fact from the measured set on NVIDIA's and RADV's captures; NVIDIA identities without it keep UniformWords; both facts compose: Storage / UniformTexel / UniformWords); engine_access (the texel form for an indexed read, a constant offset keeps the uniform buffer, nothing measured keeps it); bind::view_check validity on every committed profile; runtime view_check::tests (facts on both sides of each bound, the measured GPUs' ratios, the record round trip, the measured compile device and its fingerprint); view_check_device (lavapipe: settles Measured with its medians, the compile device carries exactly its facts, a later device reads the record); uniform_texels on indexed inline kernels under fixed facts. Docs: API.md (DeviceDescription::measured, the texel form's indexed-read rule), runtime README (the check, its cost, its verdicts, when translation takes them), FAST-PATHS known gap, api signatures blessed, api_surface entries, REFUSALS regenerated (unchanged). Verified so far: msi job m3-max-38239 at 5d493d44f7: clippy -p metal2vulkan -p metal2vulkan-runtime --all-targets --all-features -D warnings CLIPPY=0. With it (folded): View check: the inline kernels' module metadata llvm-as takes; the windows' descriptor alignment checked The engine_access and uniform_texels inline kernels named llvm.module.flags and air.version with the version tuples of air.version and air.language_version, which llvm-as rejects (msi job m3-max-38254: engine_access's texel test panicked in assemble_text). The view check refuses a window or out buffer whose VkBuffer offset lies off 256 bytes, the most any descriptor offset alignment Vulkan bounds may ask, rather than write such a descriptor. Verified: m3-max-38239 (msi) at 5d493d44f7: clippy -p metal2vulkan -p metal2vulkan-runtime --all-targets --all-features 0. m3-max-38262 at f941e38fab: clippy --cfg m2v_cpu_icd (runtime) 0; lavapipe 21/21 (uniform_texels, uniform_bind_offsets, view_check_device, view_check unit tests); lavapipe verdict Measured, no facts (per-lane storage/UBO 1.17-1.44, texel/UBO over imported pages 1.99-2.30, fields texel/UBO 1.99-2.09; the check took 267-487 ms; a second device read the record). m3-max-38254 at 46e4aaab03: translator 146/147 (engine_access's inline IR, fixed in the second commit). clippy --cfg m2v_gpu, rustdoc, the translator rerun and the device verdicts (2080, 780M, XTX, 3090, Iris) run after the merge.
This commit is contained in:
1 parent
037f1959bf
commit
f2367d8956
33 files changed
+2063
-300
No files matched your search
+13
-2
@@ -353,6 +353,14 @@ println!(" Metal properties: {:?}", device.metal_properties());
|
||||
includes it, so an artifact never serves another device. Facts that follow the machine's memory
|
||||
(`DeviceDescription::allocation`: `maxMemoryAllocationSize`, `maxBufferSize`) are not profile
|
||||
fields, so two machines that differ only there share artifacts.
|
||||
- `DeviceDescription::measured`: the driver workarounds you measured on the device itself, which
|
||||
the profile takes beside those its driver's identity names. Two cost facts come from such a
|
||||
measurement alone, never from an identity: `DriverWorkaround::UniformBufferPerLaneReadsSerialize`
|
||||
(a uniform buffer read at an address that differs between lanes costs many times a storage
|
||||
buffer's) and `DriverWorkaround::ExternalUniformReadsSkipACache` (uniform reads of imported memory
|
||||
are faster through a uniform texel buffer). The runtime's view check measures both
|
||||
(`crates/metal2vulkan-runtime/README.md`); `bind::view_check_module` gives its kernels. The set is
|
||||
a profile field, so the fingerprint and every cache key follow it.
|
||||
- `profile().spirv_validation()`: the `spirv-val` environments and relaxations every module for
|
||||
the device is valid under. The command line runs exactly these.
|
||||
- The profile's facts: `enabled()`, `limits()`, `images()`, `fragment()`, `descriptors()`, the
|
||||
@@ -1463,8 +1471,11 @@ for dependency in &pipeline.dependencies {
|
||||
dynamic buffer an entry point uses through more than one variable.
|
||||
- A buffer slot's uniform view is a `Uniform` block (`DescriptorView::UniformWords`, or
|
||||
`UniformVec4` without `uniformBufferStandardLayout`), but on a profile that takes
|
||||
`DriverWorkaround::ExternalUniformReadsSkipACache` (ANV on the Iris Xe RPL-P) a slot whose window
|
||||
is `Bounded` and at most 4 KiB long takes a uniform texel buffer instead
|
||||
`DriverWorkaround::ExternalUniformReadsSkipACache` (measured: `DeviceDescription::measured`; on
|
||||
the Iris Xe RPL-P under ANV the runtime's view check finds it) a slot with an indexed read whose
|
||||
window is `Bounded` and at most 4 KiB long takes a uniform texel buffer instead; a slot read at
|
||||
constant offsets alone keeps its `Uniform` block, whose words a driver may load ahead into
|
||||
registers as it cannot a texel fetch
|
||||
(`DescriptorView::UniformTexel`: a `UniformConstant` image of `Dim` `Buffer`, `Sampled` 1, `u32`
|
||||
texels, read with `OpImageFetch`), its binding `VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER`. Write a
|
||||
view of the planned range in `R32G32B32A32_UINT`, from the range's buffer, offset and length,
|
||||
|
||||
Reference in new issue
Block a user