The steps this packet landed as, in order:
- Read the coverage after the early depth test for [[sample_mask, post_depth_coverage]]
- Copy a stencil view's texels by the CPU as plain Metal does
- Give multisampled fragment imageblocks a block per sample, and test before writes a test may drop
Content: the tree of `development` at becd3e74a9, unchanged.
The steps this packet landed as, in order:
- Leave a resolve texture untouched where Metal's tile is not stored into its format
- Take setDepthCleared, setStencilCleared and setVertexAmplificationMode as Metal does
- Run the private alpha test in the fragment function as Metal tests it
- Clamp depth comparison references as Metal's fragmentDepthCompareClampMask says
- Take vertexAmplificationMode and explicitVisibilityGroupID as Metal does
- Record no restricted depth range where the driver keeps depth values outside [0, 1]
- Draw Metal's private logic operation: copy and no-op everywhere, the rest through logicOp
- Leave the default alpha test and clamp mask out of the inputs encoding test's derived Debug
- Clamp the reference of a depth comparison the shader makes under the clamp mask
- Key each Vulkan logic operation's pipeline apart
- Refuse a multisampled extended-range resolve naming its format and Metal's rule
Content: the tree of `development` at 0231dbbd54, unchanged.
The steps this packet landed as, in order:
- Refuse the private option bit where Metal ends the process, and take it where Metal ignores it
- Drop the GPU's writes to no-copy memory of the private option bit on macOS
- Let a host step ask the driver for a heap set's layout support
- Run a command that leaves a live sampler state out, announced, instead of failing it
- Record what a read-only view of no-copy pages costs
Content: the tree of `development` at abc094a6c3, unchanged.
The steps this packet landed as, in order:
- Give the 3D two-plane heap texture test a Private descriptor
- Lay a heap's depth and stencil textures out in Metal's tiles on MoltenVK
- Answer Metal's heap size for PVRTC textures and tile them under 27.0.1
- Lay a heap's Depth32Float_Stencil8 texture out in Metal's two tiled planes
- Make a host heap's uncompressed multisample texture in memory of its own
- List the two-plane array fixture in the engine inventory, with its printout
- Let the no-copy heap lane find a compressed texture's texels in Metal's tiles
- Name the depth heap lane's aspect list type for clippy
- Announce a device heap's textures whose bytes are not Metal's layout
- Lay a heap's X32_Stencil8 texture out in a Stencil8 texture's tiles
Content: the tree of `development` at b3c694ad82, unchanged.
The steps this packet landed as, in order:
- Hold RGB10A2Unorm_sRGB textures with Metal's conversions
- Name the runtime's gap, not a missing feature, for fetch on interlock devices
- Take clippy's forms in the RGB10A2Unorm_sRGB tests
- Fill multisample textures' samples as Metal's private fills write them
- Check fill units only for the formats the crate holds textures of
- Hold a two-plane texture's bytes between rows, which Metal's buffer blits read back
- Fill texture buffers as Metal does: bytes of the buffer, the pattern streamed
- Drop the multisample fill from apple_only's refusals, which fills it
- Meet the rows of a two-plane buffer blit into the texture in Metal's order
- Announce narrow two-plane row meetings across groups of 32 rows as one of Metal's
Content: the tree of `development` at 9d3447dec9, unchanged.
The steps this packet landed as, in order:
- Time indirect commands' CPU setters and getters in host_ab
- Read and write one field of an indirect command's record
- Set and read an indirect command's fields one at a time
- Call an indirect execution's check where it may see something, and run the CPU's later writes
- Load vkGetDescriptorSetLayoutSupport inside the exit guard's sections
- Hand out indirect command buffer IDs to 2^31 - 1 and place every one's records, as an M3 Max does
- Refuse an indirect command buffer reservation Metal hangs at as such
- Place an indirect command buffer's records at any length, found only at their start
- Leave a resource ID pool made after a reservation of 0 alone, as Metal does
- Ignore a late reservation call before looking at what it holds, as Metal does
- Expect the merged-draw tests' pipeline makings' notices on every device
- Keep an indirect compute command's threadgroup lengths where Metal keeps them
- Take the pieces of the ICB identifier range Metal's encoders take
- Answer a GPU-written command's state identifier as the state its ID named then
- Run a GPU-written record's released state as Metal does, from the buffer's kept programs
- State and test the bound on the programs a GPU-writable buffer keeps
- Record the earlier-window record of a re-held ID as a known gap
Content: the tree of `development` at 7d31ebb207, unchanged.
The steps this packet landed as, in order:
- Answer command predication as Metal does on an M3 Max under macOS 27.0.1
- Probe Metal's command predication from the validation crate's Metal platform
- Wait for the predication probe's command buffers through the bounded wait
- Name the record a predication block left open came from in its command buffer's failure
- Refuse a run's first indirect dispatch of another dispatch type at Metal level 26.7
- Read an encodeEndDoWhile's word only where it closes a live DoWhile
- Run command predication on devices without buffer device addresses
- Nest predicated loops to any depth, their copies bounded by what they lay down
- Read a predication word past its buffer as Metal reads it
- Halt a predication unit where a loop runs past its copies
- Name the lane's fixed loop case type, which clippy found too complex
Content: the tree of `development` at ef8b74ec1b, unchanged.
The steps this packet landed as, in order:
- Write the index rewrite pass's primitives in either provoking vertex order
- Draw Apple's last provoking vertex: a last-vertex pipeline, else lists led by it
- Test Apple's provoking vertex modes against Metal's on the device
- Describe the provoking third way as pipeline-dependent; fix the table test
- Check the last provoking vertex through a geometry stage; key its slice notice on stages
- Test that executions keep the first vertex; scale the weights check by the values
- Register rt6_provoking in the engine inventory and golden printouts
- Add host_ab's provoking workload: flat-shaded draws at provoking vertex modes 0 and 1
- Add the index gather pass: one dispatch for a run of direct draws' lists
- Gather direct indexed draws' lists in runs: one dispatch per run, not three per draw
- Add the rotated-weights variant: Metal's barycentric weights from a rotated triangle
- Count private lists' gathers under a last-vertex pipeline; take the open runs whole
- Draw listed triangles' barycentric weights through the rotated-weights variant
- Draw every provoking vertex mode past 1 the third way, its top bit set or not
- Announce nothing for a provoking-mode draw that makes no primitive
Content: the tree of `development` at 91b1df7b21, unchanged.
The steps this packet landed as, in order:
- Test the private primitive types' draws against Metal's lists on the device
- Check the private draws through the weights' geometry stage too
- Use is_multiple_of and as_chunks in the private lists
- Fail a draw of primitive type 9 as Metal's GPU does
- Give the private-types fixture its golden printout and inventory rows
- Discard what a hang's queue schedules during it, and time the hang as measured
- Regenerate REFUSALS for the type-9 runtime changes
- Read Metal's quad primitive ID under private quads and quad strips
- Read a type-9 hang's Scheduled at Metal's time, not at its held last batch
- Schedule a hang's queue's command buffers from the hang's Scheduled on
- Stop a hang's thread waiting on a failed command buffer; keep storage-form commits on their last batch
- Hold a hang's joined command buffers behind a closure, so Rustdoc ends
Content: the tree of `development` at 5441a97bda, unchanged.
The steps this packet landed as, in order:
- Answer a kept heap texture requirement before asking the device's limits
- Answer whether a command buffer or submission uses given objects, cloning nothing
- List devices' registry IDs without making devices, and open one by its ID
- Give a made pipeline state's reflection from its compile, after its creation
- Enable optional device extensions where each device can, and say which it enabled
- Let a caller vouch for its host pages' write permission, skipping the kernel's answer
- Import read-only host pages from the caller's dma-buf source, and say whether a device takes shared pointers
- Hold a texture of Apple's private usage 0x8 alone to what Metal does with it
- Measure RADV 26.2.4 on the RX 7900 XTX: its pointer imports follow their address
- Free a no-copy buffer's dma-buf imports before its keep-alive goes
- Measure a file's pages mapped under a live RADV pointer import, a known gap
- Let what waits for a dma-buf import's free go as its fields drop
Content: the tree of `development` at 0a38130573, 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:
- 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:
- 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 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:
- 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 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.
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
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).
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.
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.
Metal makes a pipeline state at its creation, so no Metal submission waits for a making. Ours
waited in four places, and this packet removes each wait without changing which pipelines, keys,
memo entries or notices are made:
- A queue's head ranks first. The process's budget of pipeline makings gains a rank,
Urgency::Head, between a host step's making and a committed command buffer's. Once a batch is
first in its command queue's line, the scheduler raises the makings its host step records to it
(CommandBufferShared::hasten_head), so a head's making goes before aged makings, earlier
committed ones and a program's. The budget still decides only the order of driver calls: no
turn past the budget, no preemption.
- A caller waiting for another's library lends its turn. Library::made, where another caller is
making the same pipeline library, gives its thread's budget turn back for the wait
(budget::without_turn) and takes one again at its rank after, so idle waiters no longer hold
every turn while one of them compiles.
- Draws take the key's residual form while their own pipeline is made. A state's creation now
makes its predicted key's residual form (every SpecKey::RangeAtBindOffset at 0), which reads
the same bytes as the key at every bind offset inside the buffer. A draw whose own key's
pipeline is not made, while its residual form's is, draws with the residual form at once
(pipeline/render/residual.rs); its own key's making goes to the pool at Urgency::Ahead and
later draws take it once made. An unbound constant slot now reads at its residual (pushed 0),
so a draw that leaves such slots unbound takes the creation's key itself and makes nothing;
the only cost is that such a read is no longer a constant ANV can push.
- A tile dispatch's pipelines are made on the pool. A render encoder's tile dispatch
(dispatchThreadsPerTile and its region forms) hands each region's making to the device's pool,
as a compute dispatch does, hastened to a committed command buffer's rank; its pass records
later where a making is still in flight (render/pending_tile.rs). A failed making is made
again by the recording, and where that fails the command buffer fails with
CommandBufferError::PipelineCreation and failed_pipeline names the dispatch, as for a compute
dispatch; the call no longer returns the driver's error. A pass whose first command is a tile
dispatch executes an empty secondary where it met an internal error, and a dispatch after a
pass's inline instances records in the pass's segment before its later instances.
With METAL2VULKAN_LOG_PIPELINES set (a default-off diagnostic), each render pipeline's creation
log line now splits its time: the digests, each part's library (made by this making, with its
record loaded or missed, or another caller's), and the link. Nothing is timed while the log is
off.
The pool's test hold counts its holders, so one test's drop no longer releases another test's
held makings.
New WorkCounts fields: residual_form_draws, residual_form_makings, pipeline_pool_busy and
tile_pipelines_pooled. Docs: docs/API.md (section 10 and the accepted differences),
FailedPipeline's docs, the METAL2VULKAN_LOG_PIPELINES entry in env_vars.rs. Exact either way, so
no FAST-PATHS row.
Why: on the consumer's cold boots on ANV's Iris Xe, the guest's command buffers were held 1.7 to
7.9 s between commit and submission while a queue's head waited for its pass's lazily made
pipeline behind makings no submission needed first. In one cold boot 413 of 565 draw makings
differed from a made pipeline only in RangeAtBindOffset (17.2 of 20.0 s of draw making), and one
tile dispatch's making blocked the guest's encoding thread for 3.46 s.
Verified, as the commits state:
- Budget tests: the ranks with a head's making, and a head's making ahead of aged and earlier
committed ones (it was aged, committed, head); a waiter lends its turn (without the change the
turn stays held). Device test tests::pipeline_wait_order: a queue's first held batch's making
goes first in the pool; a hold of the pool lives until its own drop (fails with the old bool).
With the shared hold, tests::dispatch_pending failed 3 of 3 runs on lavapipe and passed 3 of 3
with the counted one.
- tests::uniform_bind_offsets (4, including draws taking the residual form with the pool held,
exact pixels, two makings once released) and tests::inline_continues pass on lavapipe, the
RTX 3090 and the UHD 770 (ANV); the validation lanes draw_work and made_at_creation (8) pass on
lavapipe. With the residual form off, the new test's command buffer times out. A draw leaving
constant slots unbound takes the creation's pipeline with no making (device test), and the
slot-plan test expects the residual on every committed profile.
- tests::tile_pending: a tile dispatch hands one making to the pool and its command buffer
completes after it with the fixture's exact stores; a released state stops its making and a
dispatch that took it remakes its own. Both fail when the pipelines are made at the call.
- pipeline::creation_log's test of a making's split (no device).
- Lane and budget tests that counted while the pool still worked (framebuffer_fetch on the 780M,
draw_work on the M3, the head-ranking test on the 780M) now wait for the pool to settle.
- fmt and clippy, plain, --cfg m2v_gpu and --cfg m2v_cpu_icd.
Two fast paths that broke Metal's contract are gone: the posted deallocator of a released host
import and the shadow copy back over bytes the CPU may write. A released import is freed in the
call, as Metal frees it, and a shadow merges back only the bytes the GPU changed. The notice codes
of the two retired kinds are retired too, and the runtime holds the list of every notice code ever
issued so a retired code is never reused. The keep-alive lanes wait for the keep-alive that goes
with an import's free.
Folds in:
- Free a released host import on a handler thread by default (later removed)
- Copy a shadow back over bytes the CPU may write by default (later removed)
- Remove the shadow copy back over CPU-written bytes and the posted deallocator, which broke Metal's
contract
- Wait for a keep-alive that goes with its import's posted free in the keep-alive lanes
- Retire the codes of the two removed notice kinds, and hold every code ever issued
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).
Extended-range textures sample as Metal does at every mip level and array layer and in 3D under no
mip filter or a nearest one. The emulated sample is one routine per shape, its constant texel offset
passed as an argument; a linear sample takes its exact sum from each tap's codes, undecoded, and its
value on the grid by a multiplication by 1/255 with an exact correction. Draws whose variant takes a
two-plane extended-range texture slot are counted.
Folds in:
- Sample extended-range textures' mip levels and array layers as Metal does
- Sample extended-range 3D textures as Metal does under no mip filter or a nearest one
- Emulate an extended-range sample as one routine per shape where the driver keeps calls, its
constant texel offset the call's argument
- Hand a linear extended-range sample's exact sum each tap's grid steps from its codes, undecoded
- Take a linear extended-range sample's value on its grid by a multiplication by 1/255 and an exact
correction
- Count draws whose variant takes a two-plane extended-range texture slot
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).