The steps this packet landed as, in order:
- Take the compute dispatch memo while the encoder's residency is unchanged
- Start a shared event listener's thread at its first notification
- Add a command buffer's scheduled event signal (encodeSignalEventScheduled:value:)
- Count the scheduler's passes, and measure signals, bursts and moving offsets in host_ab
- Hash the pipeline memos with the runtime's key hasher
- Let a dispatch take what its pipeline state last planned for the same shape
- Drop two casts clippy flags in completion_here's scheduled signal check
- State host_ab's dispatches taken as settled and as planned before
Content: the tree of `development` at f9d39326a3, unchanged.
The steps this packet landed as, in order:
- Refuse buffer-texture copy layouts whose rows pass u64::MAX instead of wrapping
- Wait without a deadline for a timeout past the host's clock, and test copies at the buffer's edge
- Place a multisampled buffer copy's rows where plain Metal does, staging off-texel rows
- Say that Metal copies the multisampled layouts the runtime still refuses
- Count the rows a compressed-texture blit rewrites, and test a copy out off the texel
Content: the tree of `development` at e5ff75b136, unchanged.
The steps this packet landed as, in order:
- Pin the runtime sources with a refused queued commit's completion
Content: the tree of `development` at a62e8a365f, unchanged.
The steps this packet landed as, in order:
- Pin the runtime sources with the lowering slot's auto-trait boundary
Content: the tree of `development` at a6fba3966c, unchanged.
The steps this packet landed as, in order:
- Regenerate the refusal surface and pin the runtime sources with commits behind the lowering thread
Content: the tree of `development` at 770f8bce10, unchanged.
The steps this packet landed as, in order:
- Set the artifact format and runtime versions and pin the runtime sources for MoltenVK 1.4.2
- Bless the census's product line and regenerate the refusal surface at the MoltenVK 1.4.2 tree
Content: the tree of `development` at 6267cde0be, unchanged.
The steps this packet landed as, in order:
- Withhold MoltenVK 1.4.2's blend warning of attachments it cannot blend
- Measure the M3 Max at MoltenVK 1.4.2, named apart from the M4
- Say what queue_storms measured at MoltenVK 1.4.2 plainly
- Make a heap's set layout MoltenVK's support query refuses only where it runs it, announced
Content: the tree of `development` at 285be2f493, unchanged.
The steps this packet landed as, in order:
- Regenerate the refusal surface and pin the runtime sources with the end on the lowering thread
Content: the tree of `development` at bf576119ea, unchanged.
The steps this packet landed as, in order:
- Regenerate the refusal surface and pin the runtime sources with the lowering thread
Content: the tree of `development` at e282080dd5, unchanged.
The steps this packet landed as, in order:
- Regenerate the refusal surface and pin the runtime sources with the logged render encoder
Content: the tree of `development` at f3cfaa3feb, unchanged.
The steps this packet landed as, in order:
- Draw GPU-written render executions on the device in the validation executor
- Shard the M3 Max pass-chain tables so no test nears nextest's limit
- Set the semantics and runtime versions and pin the runtime sources at the merged tree
- Bless the golden hashes for the merged-draw ICB fixture
- Bless the authored compile census at semantics 1809
- Regenerate the refusal surface at the merged tree
Content: the tree of `development` at 3bb4f250ea, unchanged.
The steps this packet landed as, in order:
- Run GPU-written render executions on the GPU alone in passes with shadowed textures
Content: the tree of `development` at 3349566ac4, unchanged.
The steps this packet landed as, in order:
- Draw a GPU-written render execution of one list type or points as one merged draw
- Reset an indirect command buffer's records on the GPU with one fill
- Regenerate the refusal surface after the merged draws, rebased onto development
- Regenerate the refusal surface over the host-step cause
Content: the tree of `development` at 99ae896ad5, unchanged.
The steps this packet landed as, in order:
- Set the runtime version and pin the runtime sources at the merged tree
- Set the semantics version and pin the runtime sources after the render GPU form
- Bless the golden hashes at the merged tree
- Bless the authored compile census at the merged tree
- Regenerate the refusal surface at the merged tree
- Pin the runtime sources after the compute indirect command cost rule
- Regenerate the refusal surface after the compute indirect command cost rule
Content: the tree of `development` at f4a0642491, unchanged.
The steps this packet landed as, in order:
- Run GPU-written render commands on the GPU alone, and let a check state what it looks for
- Say that a check of every kind runs on the GPU alone where the records rule out both kinds
- Pass what the check looks for in the compute lane's checked execution
- Add host_ab's icb_draws workload: a kernel writes the draws of Apple's GPU-encoded ICB sample
Content: the tree of `development` at 665d587ae2, unchanged.
The steps this packet landed as, in order:
- Run GPU-written compute executions on the GPU alone by indirect dispatches where the device has no generated commands
- Run a concurrent encoder's GPU-alone execution with no barrier between its commands
Content: the tree of `development` at 343b1abcb4, unchanged.
The steps this packet landed as, in order:
- Keep the recycler's proven parked objects through a run of one-off makings
- Remember usage answers by hash, 1024 of them, least recently asked going first
- Pin the runtime sources after the recycler's protected eviction and the usage answers' LRU
- Regenerate the refusal surface at the merged tree
Content: the tree of `development` at bde1abe95b, unchanged.
The steps this packet landed as, in order:
- State what an indirect command buffer's records may hold, from every route that writes them
Content: the tree of `development` at 9a885fa69c, unchanged.
The steps this packet landed as, in order:
- Pin the runtime sources after the blit commands' byte-range order
- Regenerate the refusal surface at the merged tree
Content: the tree of `development` at 1f2b48f345, unchanged.
The steps this packet landed as, in order:
- Count render encoders' render pass instances by where they began, and their splits by cause
- Set the runtime version and pin the runtime sources at the merged tree
- Bless the golden output hashes at the merged tree
- Bless the authored compile census at the merged tree
- Regenerate the refusal surface at the merged tree
Content: the tree of `development` at effa414f26, unchanged.
The steps this packet landed as, in order:
- Pin the runtime sources after the typed threadgroup step's doc edit
- Take the device's sin and cos as Metal's fast ones in a fast-math module on MoltenVK
- Write the typed threadgroup region test's module as a plain string
- Convert a plain class's half texel by the device's conversion on MoltenVK
- host_ab: compare each gpu kernel's output between the sides
- Share an imageblock slice write out to the whole threadgroup where one invocation writes it
- Copy a half slice's cell bits straight to a half-bits slot
Content: the tree of `development` at b0e2bd6190, unchanged.
The steps this packet landed as, in order:
- Pin the runtime sources at the switch on the development base
- Blend fast-math colors into BGR10_XR_sRGB and RGB10A8_2P_XR10_sRGB as the linear forms do
- Name a placement heap texture the heap does not make at an offset inside it
Content: the tree of `development` at 3386fdcac8, unchanged.
The generated and blessed files, and the three version constants, as of the tree this series ends
on. They come last so that no packet commit before this one claims a version or a table, and so
the final tree is exactly the tree verified at the tip.
- docs/REFUSALS.md regenerated.
- crates/metal2vulkan/tests/golden_hashes.tsv and the air_input printouts as blessed (the table
tests 25 of 25 on the M3 Max host, with xcrun metal-as for the typed-pointer fixtures).
- crates/metal2vulkan-validation/corpus/authored-compile.tsv as blessed: 2256 authored cases on 21
profiles, 47376 cells, 46245 compiled and 1131 refused, 0 failed, 0 differences, 0 regressions.
- crates/metal2vulkan-validation/runtime-sources.sha256 recomputed.
- SEMANTICS_VERSION 1798, RUNTIME_VERSION 1496, ARTIFACT_FORMAT_VERSION 431.
Verified at this tree: the full suites on the RTX 5080 Laptop, RTX 3090, RX 7900 XTX, Radeon 780M,
Iris Xe and the M3 Max through MoltenVK, the CPU suites (product, validation, lavapipe's CPU ICD),
fmt, clippy in every configuration, rustdoc, the API reference and refusal-surface checks,
packaging and doctests; the failures those runs found were fixed in this series and their lanes
run again green.
On ANV a pipeline whose largest stage module passes 400,000 words under the exact forms is
retranslated with those forms dropped until it fits; render pipelines already were, and now mesh,
compute and tile pipelines are too, announced as exact-forms-over-compiler-limit with the kind of
pipeline state named. New Device::fit_mesh_variant, fit_compute_pipeline and fit_tile_pipeline for
pipelines linked from stages compiled ahead. The known gap is gone from docs/FAST-PATHS.md.
Verified: the fit tests for every kind, 188 translator and runtime tests and the device notice tests
on ANV, and 7 of 7 on RADV.
Folds in:
- Fit mesh, compute and tile pipelines to ANV's compiler word bound
A fragment function that runs per sample (programmable blending reads its attachment) and also reads
[[position]] z or w, [[point_coord]], [[barycentric_coord]] or a centroid varying was refused at
link; Metal accepts it and reads each as the pixel's in every sample's run (M3 Max at 4x, measured).
These reads now read where Vulkan evaluates them for the sample, with
PrecisionNote::MultisamplePosition and its bound (the value's change over half the pixel's diagonal,
or across the covered area for a centroid varying). Chromium's Skia Graphite on Dawn (Claude
Desktop) made such pipelines. The new test shader is its own fixture, engine/multisample_fetch;
engine/multisample is unchanged.
Verified: the guest's pipelines compile on six profiles and Claude Desktop draws in the macOS guest
on the RTX 5080 with no fatal line; the multisample, point_coord and link tests fail without the
change and pass with it.
Folds in:
- Read a per-sample fragment function's pixel reads where Vulkan evaluates them, noted, as Metal
accepts them
- Move the programmable-blending fixture entry out of engine/multisample into a fixture of its own
Comments, fixture notes and docs lose their design-record numbers, work-package codes and evidence
codes; lines that earlier commits of this series added carry their cleaned text there, so this
commit holds the cleanup of lines that predate the series, the retired vk12-bare profile's corpus
rows (a rationale and two observation rows), and docs/FAST-PATHS.md's measurements stated as they
stand. Thirteen hash-keyed files keep their citations, because their bytes are case or record
identities: eight case-keyed .ll fixtures and five parity sources.
Verified: the CPU suites (4997 of 4997 and 1328 of 1328), clippy, rustdoc and doctests.
Folds in:
- Drop evidence codes, design-record numbers and work-package codes from comments and fixture notes
- Drop the retired vk12-bare profile from the corpus
- Say the fast-path ledger's measurements as they stand, without commits, rounds or host incidents
- Keep the case-keyed .ll fixtures byte for byte
- Keep the parity lanes' fingerprinted sources byte for byte
The UHD 770's cost fact said an interlocked pass ran faster kept whole; measured again, splitting at
the fetch wins on every measured GPU (UHD 770, Iris Xe, Radeon 780M, RTX 3090, RTX 5080 Laptop) on
the window server's passes, so the UHD 770 carries InterlockedPassSplitNoSlower like the rest. With
no device keeping a pass whole, the whole-pass reroute is deleted:
DriverFact::InterlockedPassWholeFaster, RenderCommandEncoder::reroute()'s whole branch and
interlocked_colors(). The extended-range half shadow's draw keeping stays.
Verified: the framebuffer_fetch, extended_range and multisample lanes on all seven GPUs, 271 of 271
each.
Folds in:
- Run an interlocked pass split on the UHD 770 as on every GPU measured, by the corrected cost fact
- Delete the whole-pass reroute, which no device reaches since the UHD 770's fact was corrected
On drivers that park freed memory (MoltenVK among them), memory freed while the program's own
with_vk_queue submissions may still use it now waits for them, by a mark each use signals. The watch
of those marks and the release of freed memory hold only the device parts they use, never the
device, and teardown closes the parking first and waits for the handler threads: the program's last
drop tears the device down on its own thread before it returns, as Metal's last release does
(vkDestroyDevice needs external synchronization and every child object destroyed first).
freed_memory.rs is listed among the modules that may keep the device's functions, with that reason.
Verified: the freed-memory and teardown tests on ANV, lavapipe and the M3 through MoltenVK (14 of 14
each), the two teardown tests fail without the fix, and the presenting test that crashed in the
batch passed 20 of 20 on the M3.
Folds in:
- Hold MoltenVK's freed memory for the program's own with_vk_queue submissions, by a mark each use
signals
- Hold nothing of the device in the watch of the program's marks and the releases of freed memory
- List freed_memory.rs among the modules that keep the device's functions
On a driver whose fragment depth is unmeasured, a multisampled Depth32Float copy is drawn and
announced rather than refused.
Folds in:
- Draw a multisampled 32-bit float depth copy, announced, on a driver whose fragment depth is
unmeasured
Verified by each folded change's own checks; the tree this series ends on is the one verified
at the tip on six GPUs, the CPU suites and lint (see the tables commit).
A fetched merge keeps its texels in an image copy of its shadow where the copy in takes no keep, and
kept images are held per queue and taken by any later keep of the same shape once its encoder ended,
so merges stop making a new image each time.
Folds in:
- Keep a fetched merge's texels in an image copy of its shadow where the copy in takes no keep
- Keep merges' kept images per queue, taken by any later keep of the shape once its encoder ended
Verified by each folded change's own checks; the tree this series ends on is the one verified
at the tip on six GPUs, the CPU suites and lint (see the tables commit).
The Radeon 780M of Hawk Point (PCI device 0x1900) takes the driver facts measured on the Phoenix
780M (0x15bf), the same GPU, and gets its own committed device profile.
Folds in:
- Read the Radeon 780M of Hawk Point (0x1900) as the measured Phoenix 780M (0x15bf)
Verified by each folded change's own checks; the tree this series ends on is the one verified
at the tip on six GPUs, the CPU suites and lint (see the tables commit).
A copy of rows between two buffers whose rows lie apart is one vkCmdCopyBuffer with a region per
row, and ANV records each region as a blit operation of its own. In a guest frame's profile on
the Iris Xe one such copy a frame took about 15.7 of the recorder thread's 19 ms. ANV's recording
time for a single region also grows with the region's size at some sizes: one two-plane YCbCr
texture's planes copied into its staging buffer cost about 15 ms of the recorder's time a frame.
Row copies:
- Every copy of rows between buffers goes through one place, row_copies.rs (RowCopies): a blit
between a buffer and a texture over a buffer or between two textures over buffers (through its
overlap scratch too), a buffer-texture copy's rows through its staging buffer, and every
shadow's copy back out of its staging buffer, wherever it records: a render pass's steps
between instances and before tile dispatches, a rotated texture's store, and a heap's
two-plane and tiled textures' copies back.
- RowCopies makes the copy one dispatch of the new translator kernel bind::rows_copy_module
(RowsCopyModule) where the device is measured to run it faster (new
DriverFact::RowCopiesDispatchFaster), the copy has 2 or more regions of the same size in whole
4-byte words, 4-byte aligned, evenly spaced with destination rows at least a row apart, and it
fits the device's storage buffer range and workgroup counts. Invocation (x, y) stores word x
of source row y at word x of destination row y and writes nothing else, so the bytes are the
copy's. Every other copy stays regions. The kernel's set 0 is pushed through the device's
checked push command where VK_KHR_push_descriptor exists, else allocated from a pool the
command buffer keeps; the callers name the dispatch's accesses so the tracker orders it.
- The fact holds on ANV (Mesa 26.2.4, keyed on the driver, so it covers the measured Iris Xe and
UHD 770 identities) and on NVIDIA 615.71.09 on the RTX 5080 Laptop GPU. RADV is not listed: its
GPU time rose 3 to 5% at 1080 rows.
Long copy regions: every vkCmdCopyBuffer the runtime records goes through Vk::cmd_copy_buffer,
which records each region over 16 KiB whose size is no multiple of 4 KiB as two regions of the
same command, its bytes up to the last whole multiple of 4 KiB and the rest. The same bytes are
copied by the same command, so the split is exact on every device and is not keyed to a driver;
five helpers that recorded copies through a bare ash::Device now take the device's functions.
Counters: WorkCounts::row_copies, row_copy_regions, row_copy_regions_most, row_copies_dispatched,
copy_regions_split, and copy_sites, which names the places in the runtime that recorded buffer
and image copies with their calls and regions (the device's checked functions record them
through #[track_caller] methods). The runtime re-exports CopySite. Docs: docs/HOWTO.md's copies
section, row_copies.rs, device/functions.rs, WorkCounts.
Verified, as the commits state:
- runtime_lane::row_copies::row_copies_cost (release, one blit a frame of 1920 BGRA8Unorm rows
into rows 8192 bytes apart): 1080 rows on the Iris Xe CPU 3.1-3.3 -> 0.28-0.40 ms and GPU
5.3-7.8 -> 1.13 ms; on the UHD 770 CPU 0.77-0.83 -> 0.04-0.11 ms and GPU 3.3-5.3 -> 0.59-0.91
ms; on the RTX 5080 Laptop GPU 2.03-2.05 -> 0.42-0.43 ms.
- rotated_textures::rotated_surface_frame_costs (1920x1080 BGRA8Unorm, release, UHD 770): rotation
1 clear+draw 4.41/4.43 ms against 7.24-8.24 ms, rotation 2 3.59-3.88 against 5.11-5.73 ms.
- span_copy_cost on the UHD 770: one region of 8,294,411 bytes recorded in 0.018-0.020 ms against
28.4-35.1 ms, its GPU time 0.64-0.66 against 5.97-5.99 ms; the YCbCr frame 2.89-2.98 against
6.80 ms of GPU. On RADV and NVIDIA the split recorded in the same CPU time and ran within about
10 us of GPU time where one region was already quick, and faster where it was not (8,294,411
bytes on the RTX 3090: 1520 against 6051-6061 us).
- Copy lanes with every byte checked under the validation layer (rows between buffers, a shadow's
staged rows going back as one dispatch, blits of textures over buffers, textures over bytes
past their VkBuffer) pass as dispatches on the UHD 770 and the RTX 5080 Laptop GPU and as
regions on lavapipe; the rotated, tile-shadow, two-plane heap and heap-layout lanes pass on the
UHD 770 with each rotated store's rows going back as a dispatched copy of rows.
long_copies_of_any_size_copy_metals_bytes (prime sizes and offsets) passes on the UHD 770, the
RX 7900 XTX, the 780M and the RTX 3090, and the YCbCr, blit, pitched-surface, no-copy,
first-use, fill and frame-cost lanes pass on the UHD 770.
- tests::exit_guard::only_the_listed_modules_keep_the_device_s_functions (the push goes through
the checked functions), bind::rows_copy, the driver_facts tests, owned_divisions, api_surface,
and the runtime unit tests named row_copies, work_counts, functions, copy, shadow, first_move
and ycbcr; clippy in every configuration and Rustdoc.
On a device whose half roundings take the 16-bit float controls (RoundingModeRTE, DenormPreserve
and SignedZeroInfNanPreserve for 16 bits with shaderFloat16: ANV and RADV among the committed
profiles), a half + - * is now the device's 16-bit OpFAdd, OpFSub or Fma(a, b, -0.0), kept apart,
between exact conversions (ops::f16_binary, the form the measured MoltenVK fact already takes).
Where shaderFmaFloat16 is enabled too, a half fused multiply-add is OpFmaKHR on 16 bits (new
fma::Route::F16Khr), under either policy. Elsewhere the f32 operation and its rounding pair, the
round-to-odd routine and native device maths' Fma stay as they were.
Exact: Vulkan's precision table lists OpFAdd, OpFSub and OpFMul for half precision, and OpFmaKHR,
as correctly rounded, to nearest even under RoundingModeRTE, with denormals kept under
DenormPreserve and zero signs under SignedZeroInfNanPreserve, the modes the entry declares where it
computes in 16 bits (narrow::computes_in_16_bits). That is Metal's half arithmetic and Metal's
half fma, which the round-to-odd routine emulated. A NaN's bits are the device's, as the
controlled rounding's already are; Metal's NaN is selected around the instruction where the
profile asks for it. The half fma under native device maths no longer records NativeFma there.
Why: the device's compiler spent most of a large half fragment function's making on the f32 ->
f16 -> f32 rounding pairs, most of which follow a + - * or a fused multiply-add. On ANV a
consumer's largest fragment library made in about 4 s, and about 2.2 s without its rounding pairs.
New: VkFeature::ShaderFmaFloat16 (the Khronos table, enables, the ash and runtime feature chains,
derivation, the codec), OpFmaKHR's feature by its operands' width, the builder's OpFmaKHR on 16-bit
floats, and the owned fixture engine/hfb_filter_bank (a 32-case switch of runtime-sampler tap
loops and half arithmetic chains) with its engine inventory rows. The validation engine's enable
list enables shaderFmaFloat16 from VkPhysicalDeviceShaderFmaFeaturesKHR beside shaderFmaFloat32,
and the opened-chains pin records it for the profiles that list it. Docs: docs/FAST-PATHS.md's half
rounding row, and the NativeFma notice in artifact.rs and docs/API.md.
Verified, as the commits state:
- On the UHD 770 (ANV, Mesa 26.2.4) the fixture's fragment library made in 1.74-1.89 s against
4.64-5.26 s before (3 alternating rounds, no driver caches), SIMD8 instructions 25,902 ->
18,736, translation 0.17 s release; driver_deviations::half_arithmetic_answers_as_metal passes
there.
- On the UHD 770 in the release m2v_gpu build, the groups that failed before the engine enabled
the feature pass: candidate engine runs, platform enables and device, engine_render,
engine_compute, engine_textures, acceptance_pipelines, the runtime lanes kernel_textures,
sparse_textures, renders, argument_buffers and runtime_probe, and the half and fma driver
deviations.
- Debug translator tests: engine_arith, lower::arith, the fma, derivation, device, ash_interop,
cache and fast_paths tests, and the engine inventory's llvm_as parts; engine_native_half
(counting the 16-bit operations and their exact conversions) and engine_spirv_cross_forms (no
NativeFma where the half fma route is F16Khr), with fused and engine_arith, 213 passed.
- clippy of metal2vulkan.
Vulkan enables the SPIR-V capabilities StorageImageReadWithoutFormat and
StorageImageWriteWithoutFormat by shaderStorageImage{Read,Write}WithoutFormat, by Vulkan 1.3, or
by VK_KHR_format_feature_flags2; under the last two each format's own
STORAGE_{READ,WRITE}_WITHOUT_FORMAT bit (VkFormatProperties3) says whether it may be accessed so.
Intel's ANV and SwiftShader lack shaderStorageImageReadWithoutFormat, and the translator took the
feature as the only route, so a storage read the shader cannot declare with a SPIR-V format was
refused there even where the format's own bit grants it. Metal accepts such reads: an A8Unorm
storage texture read, and a fetch of an A8Unorm color attachment through the pixel interlock.
Now:
- VkExtension::KhrFormatFeatureFlags2 joins the Khronos name table, the cache codec, the
runtime's and the validation platform's extension tables and the enable facts (core in 1.3, no
feature member). The runtime enables it below Vulkan 1.3 where the device lists it.
- A module's Requirements list the two capabilities without their feature
(device::requirements::WITHOUT_FORMAT_CAPABILITIES), and DeviceProfile::check and
DeviceDescription::required_enables resolve them on the device: the feature where the device has
it, else nothing at Vulkan 1.3, else the extension. A device with none is refused naming the
feature, as before.
- metal::format: a typed declaration stays preferred wherever SPIR-V names the format; the
declarations SPIR-V cannot name (the storage choice, the fetch's storage form, the depth and
stencil fallbacks, the slot's formatless refusal, the ulong form) go by the features or by the
format's own bit.
- A heap stays on the features: a per-pipeline check of each member's bit is not built, and
docs/FAST-PATHS.md's known gap says what the formats' bits leave refused on ANV.
Effect on the committed profiles, read at the runtime's Vulkan 1.2 with and without the
extension over every PixelFormat: on intel-irisxe-rplp-anv and intel-uhd770-rpls-anv an A8Unorm
storage texture read and read-write, and an A8Unorm color attachment fetch read and written,
single and multisampled, now compile (an A8_UNORM view declared without a format), and an A8Unorm
texture buffer takes the A8_UNORM view in place of R8_UNORM holding alpha in red (both Metal's
texels). On intel-irisxe-anv and swiftshader nothing lifts. Every other changed cell on the four
profiles (1280) keeps its refusal and now names the format's missing bit in place of the feature.
The engine fixture tables do not change on any profile. The validation platform's Vulkan 1.2
device contexts enable the extension where a profile lists it, and the opened-chains pin records
it (32 contexts on 16 profiles, one more extension each).
Verified, as the commits state: the unit tests device::tests::enables (the feature, the version or
the extension), metal::format (access by the format's bits with the extension),
lower::fragment::fetch (an A8Unorm attachment fetched by its own bit, the fetch tests at Vulkan 1.2
with and without the extension), spirv::requirements and spirv::serialize, and the
framebuffer-fetch compile test all pass; public_fixtures_engine parts 1-8 unchanged; the
per-profile census above, run as a temporary test; candidate::platform::enables::tests 21 of 21;
clippy. New lane runtime_lane::alpha_in_red::a8_storage_reads_without_the_feature_go_by_the_format_s_bit
(a device made without shaderStorageImageReadWithoutFormat, as ANV is, reads its own A8_UNORM by
the format's bit under the extension: Metal's (0, 0, 0, 0.6) and 178).
Three changes to framebuffer fetch and the pixel interlock.
1. An unordered framebuffer fetch is refused; FramebufferFetchPolicy is deleted. Metal orders a
fragment function's read of its color attachment after every earlier fragment of the pixel,
within a draw and across draws. Where a device offers neither ordered form
(rasterization-order attachment access, or the pixel interlock's storage form where the
pipeline's state lets it be exact), the opt-in FramebufferFetchPolicy::AcceptUnordered
compiled the read as an unordered input attachment with a precision note. An unordered read
can return the attachment before an earlier overlapping fragment's write: a different value
in memory, not a rounding, which the owner's rule allows neither as a default nor as a
switch. No exact form exists on such a device, so the fetch is refused there, as the default
already did. The runtime never ran the unordered form, so no runtime behaviour changes.
- Removed: DevicePolicy::framebuffer_fetch, the enum FramebufferFetchPolicy and its
re-export (and its api_surface row), ProfileFields::framebuffer_fetch,
PrecisionNote::UnorderedFramebufferFetch, and the runtime's note kind of that name, whose
code metal2vulkan-degrade-unordered-framebuffer-fetch is retired; the runtime's
framebuffer_fetch::ordered check; validation's --accept-unordered-fetch on corpus-vulkan,
corpus-moltenvk and corpus-pipeline, and the device worker's framebuffer_fetch field.
- lower::fragment::color refuses a read no ordered form serves (Unsupported{FramebufferFetch},
naming both forms); lower::fragment::fetch refuses a blocked storage form with its blocker.
- The profile's fields change, so every profile fingerprint does.
2. No barrier between interlocked draws' colors on a driver measured to order them. Between two
draws of a render pass instance where the later one reaches a color in the fetch's
interlocked storage form (or an extended-range color's half shadow) that the earlier one
wrote, the runtime recorded a fragment-to-fragment storage barrier on every device. Vulkan
orders such draws by the interlock alone (ordered interlock modes follow rasterization
order, which follows primitive order through a subpass, and the interlocked storage image is
decorated Coherent). A new answer fact, DriverFact::InterlockOrdersDraws, measured on ANV on
the Iris Xe of Raptor Lake-P, drops that barrier there for these colors alone. The fragment
imageblock's storage and the depth stand-in keep their barrier everywhere, as does every
unmeasured driver. RADV on the Radeon 780M still needs the barrier: without it one blend
table case leaves 19 of 495 band results wrong over 5 runs. New lanes:
runtime_lane::interlocked_draw_order (every device, with its owned fixture ido_draw_order) and
the ignored release bench runtime_lane::tile_path_costs (a window server's composite on
Metal's tile path, fixture tgp_composite), with their engine inventory rows. A FAST-PATHS
bullet records the barrier and the fact.
3. A left-out interlock color's framebuffer slot holds a placeholder image. A color attachment
the draws read and write as a storage image in the interlock is left out of their subpass,
but its framebuffer slot held a view of the very image the draws write, which the validation
layer reads as VUID-vkCmdDraw-None-06537 for a draw recorded inline. The slot now holds a view
of a placeholder that nothing reads or writes (DONT_CARE load and store, GENERAL layouts): the
device keeps one for each format and sample count, plus one for each further color of that
shape in the same framebuffer, grown to cover a larger framebuffer and freed once no
framebuffer holds it; none is made per frame. A color whose draws use sample planes, and the
planes' anchor, keep their own image's view. New WorkCounts fields
storage_placeholders_made and storage_placeholder_attachments.
Verified, as the commits state:
- The translator's fetch tests (pipeline::compile ordering, engine_fragment, engine_moved_writers,
device profile fingerprints and serde, fast_paths) keep the refusals; the raster-order-group
read on a device with neither ordered form expects the fetch's own refusal naming both forms.
Validation checks every public fetch case is refused on lunarg-desktop-baseline-2023 and
vk12-floor, and that the command-line flag is gone.
- Iris Xe (ANV) with the fact in place: interlocked_draw_order 3 runs with every texel right,
extended_range_blend_table 17 passed (0 of 495 bands wrong), framebuffer_fetch 49 passed. A
1080p pass of 27 interlocked draws took about 1.08 million GPU cycles with the fact against
1.46 million with the barrier forced (about 9 to 20 us a draw).
- The placeholder lane test (two RGBA32Uint colors over four passes and sizes): placeholders and
slots (2, 2), (2, 4), (4, 6), (4, 8) through the interlock on the RX 7900 XTX (RADV) and the
UHD 770 (ANV), none through input attachments, no validation message. On lavapipe 122 lane
tests and 47 runtime render unit tests passed; on the RX 7900 XTX 94 lane tests passed.
- The engine inventory and llvm_as parts pass for the new fixtures; clippy in every
configuration and Rustdoc -D warnings.
A pass that renders a memoryless color attachment into an image of its own (a framebuffer fetch
through the pixel interlock reads it, or the pass splits) made a fresh backing image for each
pass, held by its command buffer and freed when that completed. On a device without lazily
allocated memory (ANV), a 1920x1080 RGBA16Float attachment fetched by about ten passes a frame
made and freed a 16.8 MB image each pass, and the runtime's memory log on an Iris Xe showed a 64
MiB image block made and freed up to three times a second, each a fresh allocation the kernel
zeroes.
Now each command queue keeps those backings (attachment_stand_in::pooled_backing), keyed by the
attachment's pixel format, render format, samples, layers and extent. A pass takes a kept one
that backs no other attachment of the pass, else makes one and keeps it. The pool keeps at most
32 backings and at most 256 MiB beyond the one just made, the one taken least recently going
first, and goes with the queue; each command buffer still holds the backings it rendered into
until it completes. The count bound covers a compositor's frames on the consumer's macOS guest,
which render 11 to 14 extents of one memoryless RGBA16Float attachment a frame (about 40 MB
together): a bound of 8 evicted each backing before its next take. A memoryless depth or stencil
backing is still the pass's own.
Exact: Metal refuses a Load and a Store of a memoryless attachment, and a pass gives every texel a
draw can read a value before its draws (its Clear, or the zero its DontCare load clears to), so
no pass reads what another left in a backing. The passes of one queue that take a backing are
ordered by their uses of it.
New WorkCounts field pooled_backings_made. The memoryless-backed notice's cost text and its
docs/API.md catalogue entry say a color's backing is kept by its command queue.
Verified, as the commits state: clippy -D warnings for the runtime and validation crates, plain,
--cfg m2v_gpu and --cfg m2v_cpu_icd. The lane cases
framebuffer_fetch::a_queue_keeps_one_memoryless_backing_for_its_passes (three command buffers of
two passes over fresh memoryless attachments, the second loaded DontCare and read as zero: one
backing where the device announces memoryless-backed, none elsewhere) and
a_queue_keeps_a_memoryless_backing_for_each_shape_it_renders (12 sizes twice in turn, every texel
checked: 12 backings, where a bound of 8 makes 24) were added for the device batches.
A texture over a buffer could be an image bound to the buffer's bytes: a padded texture that only
read (PaddedReadsPolicy::Alias, the default), and any 2D texture over a no-copy buffer's host
pages (a linear image, a DRM_FORMAT_MOD_LINEAR image at Metal's row pitch, or on MoltenVK a Metal
texture over the import's MTLBuffer). An image bound to imported memory starts UNDEFINED, and a
layout transition "may perform read and write accesses on all memory bound to the image
subresource range", so such an image kept Metal's bytes across its first move only through a
host keep (read the bytes, submit the move alone, wait, write back what changed), which undid a
CPU write made inside that window. Metal keeps every CPU write to bytes a command buffer does not
write: on the M3 Max, a kernel reading half a padded no-copy texture while the CPU rewrote the
bytes between its rows and its other rows kept every CPU byte in 10 of 10 rounds. Changing bytes
in memory is not a precision note, so under the owner's rules it may be neither a default nor a
switch; exact is the default, and cost chooses only among exact forms.
Now a padded texture over a buffer, and every 2D texture (or array) over a no-copy buffer's host
pages, imported by pointer or as dma-bufs, is a shadow on every device, whatever its usage: an
optimal image of the runtime's memory, copied in from the bytes before a use and merged back
after a write. Texture::vk_image answers None for such a texture.
Removed:
- DevicePolicy::padded_reads and the enum PaddedReadsPolicy (Alias, Shadow); its FAST-PATHS row,
its tests::fast_paths choice and its api_surface row.
- The images over host pages: the linear image for host allocations, the DRM_FORMAT_MOD_LINEAR
image over host allocations with its refusal memo, the modifier image over a buffer texture's
own dma-buf, the Metal texture over the import's MTLBuffer on MoltenVK (VK_EXT_metal_objects is
no longer enabled for it), and the one image shared by textures of one plan over one import.
- The first move's host keep, and its notice unrestored-first-move-bytes (Degradation
UnrestoredFirstMoveBytes), retired.
- WorkCounts fields first_move_keeps, first_move_kept_bytes, first_move_restored_bytes,
pitched_host_images, pitched_host_image_refusals, pitched_host_image_refusals_recalled,
shared_alias_images and shared_alias_moves_waited.
Kept: the buffer's dma-buf import as the last resort where the pointer is refused, on any device;
the images of heap textures over host pages, including over dma-bufs (a heap resource's contents
are undefined until written, in Metal too); a linear image over a buffer of the runtime's own
memory (PREINITIALIZED), whose first move FAST-PATHS records as a one-line known gap.
ShadowedTexture (shadowed-texture) now also covers read-only padded textures.
Also: a staged shadow's copy back merges rows that lie one after another into one region (a
packed 1080p surface takes one region, not 1080), and two new counters size what a shadow kept
across a command buffer's passes could save: WorkCounts::shadow_attachment_passes and
shadow_attachment_textures.
Docs: docs/FAST-PATHS.md (the shadow bullet with its costs, the known gaps), docs/API.md
(section 1's texture paragraph, the shadowed-texture and dont-care-stand-in entries, the retired
code), docs/HOWTO.md section 6, the runtime README, linear_attachment.rs's module doc.
Cost, as measured: on the Iris Xe a frame sampling four BGRA8Unorm tiles over no-copy pages took
3.2-5.3 ms as shadows against 3.0-6.1 ms as images (textures made once) and 3.4-7.1 against
4.6-8.6 ms (made each frame). On the UHD 770 (ANV, release, alternated), one Load/Store pass into
the guest's 1080p surface took 1.89-1.97 ms as a shadow against 2.56-3.09 ms as the linear alias,
whose draws ran slowly in host memory; 12 passes 20.9-21.1 ms against 27.4-27.8 ms, at about 40 us
more CPU a pass.
Verified, as the commits state:
- runtime_lane::first_use_writes (new: another thread writes bytes of a texture over host pages
that its first use does not read, from 2 ms before to 2 ms after the commit; every write stays)
passes on the RTX 3090, the Radeon 780M and the UHD 770.
- runtime_lane::pitched_surfaces asserts a shadow for every surface (counted, vk_image None),
including the CPU write beside a padded texture during its first use and the new counters;
no_copy_textures asserts a shadow and no modifier queries; the keep, pitch-refusal and
shared-image tests go with what they tested.
- The lanes restated for the shadows pass whole: dma_buf_imports 13, resource_ids 38,
rotated_textures 7 and linear_attachments 20 on the RX 7900 XTX and the 780M (RADV), the UHD
770 (ANV, with row_copies 2) and the RTX 3090.
- linear_attachments renders over a Shared buffer of the runtime's memory, so the linear
attachment paths stay covered, each test asserting the way its passes took; 21 pass on the RTX
3090, the 780M, the RX 7900 XTX and the UHD 770.
- Runtime and validation nextest without a device, 2306 passed; the translator's fast_paths,
api_surface, published_crates, refusal and driver_facts tests, 34 passed; clippy in every
configuration and Rustdoc -D warnings.
A pass that resolves a color attachment whose format has Metal's resolve rule at its sample count
drew the runtime's exact resolve after the pass on every device whose AVERAGE is not measured to
be Metal's (everything but MoltenVK): one more render pass instance per resolved attachment,
between full barriers, reading the stored samples as an input attachment. That form is exact
and costly in GPU time. By the owner's rule (fast by default, exact on request, both kept), the
device's resolve becomes the default, announced, and the exact resolve a switch.
- DevicePolicy gains resolve: ResolvePolicy { Device (default), Exact }, a runtime choice alone
(no emitted code changes, no profile carries it). exact_answers() selects Exact.
- Under Device the attachment resolves in its pass by Vulkan's AVERAGE, announced as
device-rounded-resolve (precision), whose reason names ResolvePolicy::Exact: no extra pass, and
a render target needs no input attachment usage for the resolve. Under Exact everything is as
before.
- Unchanged under both: a driver with DriverFact::ColorResolveAverageIsMetals (MoltenVK on
Apple's GPUs) resolves in the pass with no notice, and an attachment a fetching pass's sample
planes hold as it ends resolves from them by Metal's rule.
- device-rounded-resolve's docs and cost state the measured bound: one code for a unorm, snorm or
packed 16-bit unorm channel, two for an sRGB channel; a float channel's last bits are counted,
not bounded.
- Docs: a new docs/FAST-PATHS.md row for the switch; docs/API.md's policy bullet and the
device-rounded-resolve and shader-resolve catalogue entries; color_resolve.rs, policy.rs and
driver_facts.rs state both values. The api_surface table lists ResolvePolicy.
Why: the exact form's extra pass costs GPU time on every device but MoltenVK (a resolved pass's
command buffer 73-77 us against 51 us on the Iris Xe, 63-75 us against 45-48 us on the 780M), and
no driver measured matches Metal's rule, so none gains ColorResolveAverageIsMetals.
Measured, as the commit states (release builds, 1920x1080 frames of 97 command buffers, every
fourth pass resolving an RGBA8Unorm x4 attachment, the exact form against the device's,
alternated): GPU busy a frame on the Iris Xe (ANV) 2.52 and 2.41 ms -> 1.92 ms (the guest's
shape 3.04, 2.77 -> 2.44, 2.43 ms); on the Radeon 780M (RADV) 2.33 to 2.78 -> 2.00 to 2.13 ms; on
the RX 7900 XTX 1.38 -> 1.36 ms.
The device's average against Metal's rule: on RADV (780M and RX 7900 XTX), ANV (Iris Xe),
lavapipe and NVIDIA (RTX 5080 Laptop), unorm and snorm channels land one code below Metal's at a
tie (16-bit channels exact on NVIDIA), sRGB within one code both ways (up to two at 4 samples on
NVIDIA), packed formats within one, float channels differ in value.
Verified, as the commit states:
- The new lane runtime_lane::resolve_rounding::the_device_resolve_rounds_as_announced (default
policy) passes on lavapipe, the RTX 5080, the 780M, the RX 7900 XTX and the Iris Xe: every
closed format at 2 and 4 samples resolved by the device, device-rounded-resolve exactly where
the fact is absent, and every difference against Metal's rule within the notice's bound.
- The exact form keeps its lanes: the validated options take exact_answers(), so
resolve_rounding's other tests, degrade_notices, nan_resolves and framebuffer_fetch run under
ResolvePolicy::Exact as before.
- tests::fast_paths (the switch, and that the choice keys no profile), the driver_facts tests,
api_surface, the runtime's degradation and driver_defects tests; fmt, clippy in the three
configurations, rustdoc.
A draw that reads the texture its pass renders, at its own pixels after a barrier, takes a
snapshot drawn in its subpass, or splits the pass instance and reads a copy; both are exact. The
snapshot was open only to a texture of its own image, so a texture over a buffer's bytes always
split, and each split copies the bytes into the shadow before every instance after a barrier.
The consumer's guest renders its 1080p framebuffer, an IOSurface over host pages, this way.
Now:
- Device::storage_over_buffer tries the linear image that aliases a buffer's bytes with
ATTACHMENT_FEEDBACK_LOOP_EXT usage first (it costs a linear image nothing; its memory is the
buffer's), then makes it without where the driver refuses, and counts each image made with the
usage in the new WorkCounts::feedback_loop_alias_images.
- Texture::snapshot_color reads such an aliasing image through a snapshot, as an image of its
own, and a reader of a texture over bytes takes the snapshot at any area. The area rule for a
texture of its own image is unchanged.
- Where the image lacks the usage (NVIDIA's drivers make it without), the surface's readers
split, exactly as before.
- A pass with a depth or stencil attachment keeps every attachment reader on the split: the
binder makes no snapshot variant for it, and a snapshot draw would write depth or stencil before
the drawing draw. render/snapshot.rs's docs say so, and a lane case holds the behaviour.
- The attachment-read row of docs/FAST-PATHS.md states the crossover and the feedback loop
condition.
Why: in the guest's frames the split's copies dominated (66 splits, 68.2 own-pixel reads and
16.6M texels of bounded copies a frame), while the readers' fragments touch about 1.5% of the
texels a split copies.
Verified, as the commits state:
- On the Iris Xe (release, the new ignored lane attachment_read_costs::snapshot_crossover, a 1080p
surface over host pages, snapshot and split forced and alternated): the snapshot's GPU time per
pass is 0.56x to 1.2x the split's; its worst case is a small scissor covered half or more,
about 10 us a reader, and it is cheapest for sparse readers in big scissors, where the guest's
readers sit.
- runtime_lane::snapshot_reads: readers over a surface take the snapshot where the image took
the usage and the split elsewhere, with Metal's bytes either way. RTX 3090 and RTX 5080
(aliased, no feedback usage) split and pass; the Iris Xe (aliased, feedback usage) takes the
snapshot and passes; the other snapshot_reads tests pass on all three.
- The depth/stencil case (Less depth with and without writes, a stencil test that blends each
pixel once): every reader splits and leaves Metal's texels on the Iris Xe, the RTX 3090 and
the RTX 5080; all 7 snapshot_reads tests pass on the RTX 5080.
- clippy plain, m2v_gpu and m2v_cpu_icd.