The steps this packet landed as, in order:
- Bump the semantics and runtime versions for the sixth stack
- Pin the runtime sources of the sixth stack
Content: the tree of `development` at 13f38b8d42, unchanged.
The steps this packet landed as, in order:
- Gather the lists of indirect draws in runs, planned on the GPU
- Regenerate the refusal surface over the indirect gather
Content: the tree of `development` at 9aa8e75be9, unchanged.
The steps this packet landed as, in order:
- Say that a resource state encoder takes no pages a rebind could leave behind
- Encode an encoder with a call refused at its encoding again at a rebind
- Bump the semantics and runtime versions for the fifth stack
- Pin the runtime sources of the fifth stack
- Bless the golden hash tables over the fifth stack
Content: the tree of `development` at 42b1caf8ed, unchanged.
The steps this packet landed as, in order:
- Regenerate docs/REFUSALS.md after the second-source blend of a fetched attachment
- Bind the generic blend lane's buffers at a u32 index
Content: the tree of `development` at d556610e9d, unchanged.
The steps this packet landed as, in order:
- Bump the semantics and runtime versions for the fourth stack
Content: the tree of `development` at ba2f154591, unchanged.
The steps this packet landed as, in order:
- Run an executed command's mesh draw with the object threadgroup lengths it set
- Expect the untiled heap layout notice in the ID lanes where images lie in the driver's layout
Content: the tree of `development` at df4df1719c, unchanged.
The steps this packet landed as, in order:
- Bump the semantics, artifact format and runtime versions for the third stack
- Pin the runtime sources of the third stack
- Bless the golden hash tables over the third stack
Content: the tree of `development` at 2fde63f27f, unchanged.
The steps this packet landed as, in order:
- Regenerate the refusal surface after the indirect mesh draws
- Read the task limits through the profile's public limits in the mesh draws lane
- Name VK_EXT_post_depth_coverage in the candidate's enable list
- Re-bless the opened chains, and let a late depth test behind an imageblock writer link
- Withhold the mesh shader extension's features with it in the mesh lane
Content: the tree of `development` at 3e1d7fbbe1, unchanged.
The steps this packet landed as, in order:
- List the provoking notices among the kinds a lane test takes
- Take only the provoking kinds in the no-primitive lane test
- Fit the second stack's draw forms together, and regenerate docs/REFUSALS.md
- Pin the runtime sources of the second stack
- Bless the golden hash tables over the second stack
Content: the tree of `development` at b1ea97c5cf, unchanged.
The steps this packet landed as, in order:
- Detach lane: take a split's first submission as done as Metal's probe did
- Run protection options as Metal's GPU runs them
- Make compute encoders of raw dispatch types as Metal makes them
- Answer a patch draw's nil buffers as Metal's getters do
- Measure Metal's handler thread cap: the runtime's refusal is where Metal hangs
- Regenerate docs/REFUSALS.md over the second stack
Content: the tree of `development` at e6e5d4b99a, unchanged.
The steps this packet landed as, in order:
- Draw private types in a pulled list form where the indexed list differs from Metal
Content: the tree of `development` at d3fc3a5794, unchanged.
The steps this packet landed as, in order:
- List the predication word-past-buffer notice with the lane test that takes it
Content: the tree of `development` at 306e89f59b, unchanged.
The steps this packet landed as, in order:
- Bump the semantics, artifact format and runtime versions for the second stack
Content: the tree of `development` at 7b22e87450, unchanged.
The steps this packet landed as, in order:
- Let a host step make the images, render passes, framebuffers and neutrals it needs
- Order a command after a barrier the CPU set once its encoder ended
Content: the tree of `development` at 6584b0e93d, unchanged.
The steps this packet landed as, in order:
- Bump the semantics, artifact format and runtime versions for the stacked review round
- Pin the runtime sources of the stacked review round
- Bless the golden hash tables over the stacked review round
Content: the tree of `development` at 06fe802723, unchanged.
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:
- 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:
- 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:
- 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 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 Intel's ANV, CoreAnimation's A2Xghfc fragment shader (313k words) took
about 14 s to make cold, for each of three states. The consumer's x86 macOS
guest stalled with "no completion in 10 s" on its first boot. Native Metal
makes it in 0.48-0.56 s on the M3. brw (Mesa's Intel backend) spends that
time in its register allocator. Its interference build is quadratic in
instruction count, it spills, and it retries several scheduling modes. Most
of its input was our half arithmetic. Two cuts, each the cheaper form, are
taken on ANV and RADV.
1. A half result computed in float rounds through the device's conversion
pair under the float controls (QuantizeForm::Controlled). It replaces
OpQuantizeToF16 plus a denormal arm, about 11 NIR operations per lane.
- The form: an OpFConvert to 16 bits and back, each decorated
NoContraction, in an entry that declares RoundingModeRTE,
DenormPreserve and SignedZeroInfNanPreserve for 16 bits, plus the
modes the device's independence ties to them (ANV: RTE for 32 and 64
bits; RADV: RTE and DenormPreserve for 64 bits). The modes are
declared post-lowering (new ExecMode kinds), and the requirements
carry the FloatControl properties.
- Exact by the Vulkan spec under either HalfRoundingPolicy: conversions
are correctly rounded, and NoContraction forbids folding the pair. No
fact, no note.
- A new DriverWorkaround, HalfConversionPairFolded, keyed on NVIDIA's
proprietary driver, keeps NVIDIA on its previous forms. NVIDIA
615.71.09 on the RTX 3090 folds the pair even under NoContraction and
every mode combination, and the PackHalf2x16 and u16-bitcast forms
fold the same way: 2,231,288,832 of 2^32 narrowings unrounded. A
plain-Vulkan repro gives 16,775,680 of 2^24 unrounded on the 3090 and
0 on ANV.
2. A half read from its bits (a load, a reinterpretation, a texel's bits) is
the device's widening under NanMinMaxPolicy::Native, the default: each
u32 lane is bitcast to f16x2 and converted to 32 bits, in place of a
12-op integer decode. A half texel takes that conversion's NaN (no keep).
- Every non-NaN half is exact by the spec: DenormPreserve covers
"values obtained via unpacking an integer into a vector of values
with smaller bit width".
- A NaN's bits are the device's, recorded as NativeNanEncoding
(native-nan-encoding), now also announced on ANV and RADV pipelines
that decode halves. A half stored back unchanged keeps its bits.
- NanMinMaxPolicy::Exact keeps the integer decode and the keep. There,
every half widened to float answers Metal's 0x7fc00000 for a NaN, as
the M3 does over every pattern from memory, constant memory, selects
and texels.
Where brw's time went, measured on A2X (a2x-s96): after cut 1, 49.6k NIR
operations, of which the rounding pairs were about 10.7k, half decodes from
memory 8.6k and texel NaN keeps 2.6k. The rest was below 5% each.
Exactness probes:
- Cut 1 (candidate half(x) over all 2^32 f32, and half + - * over every
pair): 0 non-NaN mismatches on ANV Iris Xe (Mesa 26.2.4), RADV 780M
(Mesa 26.2.4), and the 780M and RX 7900 XTX (Mesa 26.0.8).
- Cut 2 (every half pattern): 0 non-NaN differences on ANV and RADV.
- The M3 confirms Metal equals the integer reference everywhere.
Cold making (A2X, base against each cut):
- ANV Iris Xe: 13.6-14.3 s, then 5.75-6.16 s, then 4.06-4.36 s. Peak RSS
1.28 GB, then 0.50, then 0.35. GPU time per draw 4.62 -> 4.48 ms.
- RADV 780M: 0.80-0.84 s, then 0.53-0.55 s, then 0.38-0.47 s. GPU time per
draw 4.05 -> 3.43 ms after cut 1, then within its clock states' spread.
In the consumer's cold boots on ms01 (Iris Xe), A2X went from 14 s per
state, plus two 38 s remakes, to 4.0-4.3 s. The suite's pipeline making went
from 126 s to 16.7 s, with no stall. Repeat boots show metalwin unaffected:
its frame rate follows other GPU work at session start, not this change.
Tests:
- engine_native_half: the controlled conversion, and a half read from memory
under both NaN settings, NaNs stored back.
- device::tests::profile::nvidia_carries_the_folded_half_conversion_pair.
- lower::arith::tests: narrow, round_texel, half_texel, texel_round.
- spirv::requirements; spirv::builder::ops.
- Updated expectations: engine_arith half rounding, engine_spirv_cross_forms
fma, engine_metal_routines frexp (the device's NaN under the default,
Metal's under Exact).
- The validation lanes driver_deviations and native_maths expect the
controlled form.
Docs: the FAST-PATHS half-rounding row (scope) and a new row for the
widening; the NativeHalfConversion and NativeNanEncoding entries in API.md and
their rustdoc; HalfRoundingPolicy and NanMinMaxPolicy rustdoc; HOWTO's driver
note; REFUSALS regenerated. A known gap is added to the texel-NaN row: on
ANV a 16-bit float NaN texel kept as half reads back 0xFE00 from ANV's image
decode, even under Exact (announced as device-nan-encoding). SEMANTICS_VERSION
1759, runtime pin recomputed, RUNTIME_VERSION unchanged.
Tables: the golden hashes, 274-389 cells on each ANV and RADV column across
both cuts, and NVIDIA's profile fingerprints, whose words are unchanged. The
authored compile census: artifact hashes on the 780M and RPL-P ANV columns,
with no status change. No MoltenVK, lavapipe or floor cell moves.
Verified on development-fast (batches f18-f24): every lane green on the RTX
3090, ANV Iris Xe, RX 7900 XTX, both 780Ms, lavapipe and the M3 Max, plus the
CPU suites, case qualification, clippy in every configuration, docs and
packaging. Not run on the RTX 5080 Laptop (host offline; whether its driver
keeps the pair is unmeasured).
A draw that bound a two-plane YCbCr texture (YCBCR8_420_2P and its kin) at a
linearly sampled slot made a second VkPipeline at the draw. The slot's YCbCr
variant (RuntimeFact::YCbCrTexture) emulated Metal's filter of the format, and
the state's creation never predicts it, since the predicted key binds no
texture. On ANV, CoreAnimation's A2Xghfc paid 37.8 s for that second making,
inside a command buffer, past the x86 guest's 10 s watchdog.
Under the owner's rule (fast by default, exact on request, both kept, the
difference logged), the default is now the device's own filter. A new
DevicePolicy field, ycbcr_filter, selects the form:
- YCbCrFilterPolicy::Device, the default.
- On a device that samples natively (ANV, RADV, NVIDIA, lavapipe),
ProfileFields::ycbcr_variant is false. The slot records no fact and is
filtered by the device like any other, and a draw takes the pipeline its
state's creation made. The module's PrecisionNote::DeviceSampling
(device-sampling) states the bound.
- On MoltenVK, Metal's own sampler filters the slot's converted view
(RGBA16Float on the 1/2048 grid, RGBA32Float on 1/8192).
lower::sampler::linear::metal_filtered_ycbcr records the
HalfSampleFilter/FloatSampleFilter note under the bound format alone
(SpecKey::BoundTexelFormat). The runtime's degrade_bound_formats
announces it as ycbcr-filter-not-exact, naming the slot and the format.
A one-texel half sample on the 8192 grid records HalfTexelConversion
under that format and is announced at the draw.
- YCbCrFilterPolicy::Exact keeps the variant: Metal's filter, through one
pipeline made at the first draw binding such a texture.
DevicePolicy::exact_answers() sets it. On MoltenVK, SamplingPolicy::Exact
takes the variant too. Over a compiler limit, the native-sampling fallback
(ReducedForms) drops it with sampling and reports it.
Bound of the default, in codes of 1/255. Each figure is the largest
difference of any channel over five surfaces (420v/420f; BT.601, BT.709,
BT.2020), 65,536 random coordinates and 960 on the 1/256 grid, float and half
results. Measured against Metal's sum (checked equal to metal_step):
- NVIDIA RTX 3090 (615.71.09): 1.183
- ANV Iris Xe RPL-P (Mesa 26.2.4): 1.058
- RADV 780M and RX 7900 XTX (Mesa 26.0.8): 0.877
- lavapipe (Mesa 26.2.4): 0.872
- MoltenVK against Metal's own YCbCr filter (M3 Max, macOS 27.0.1, plain
Metal): 0.1245 for RGBA16Float and half results; 0.0157 for RGBA32Float
float results.
Reproducer (corpus-draw-ab on ANV, cold, a2x-s96 with
RGBA8Unorm:linear@3=YCBCR8_420_2P): before, two pipelines (13.9 s at
creation, 37.8 s at the draw), 52.3 s wall, 3.23 GB. After, one pipeline
(13.9 s), 14.3 s wall, 1.30 GB.
Tests of both settings:
- a_device_takes_the_ycbcr_variant_only_under_the_exact_filter (lavapipe and
MoltenVK).
- The runtime lane's default tests on native-sampling devices and on
MoltenVK: no pipeline at the YCbCr draw, bit for bit the RGBA16Float twin's
draw, the expected announcements once. The exact twins expect the variant.
- fingerprint_covers_every_policy_field.
- metal_s_own_answers_key_the_same_under_either_choice.
- The notes test helper (engine_linear_half::notes_bound) now gives
BoundTexelFormat the bound texture's class, as the runtime does.
Docs: the FAST-PATHS row and its MoltenVK bound, the API.md
ycbcr-filter-not-exact, device-sampling and half-texel-conversion entries,
the policy, profile-field, fact, lowering and runtime-kind rustdoc, and
REFUSALS regenerated. SEMANTICS_VERSION 1757, RUNTIME_VERSION 1314, runtime
pin recomputed.
Tables: the golden hashes (38 cells per natively sampling column, both tables;
every profile's fingerprint for the new policy field, MoltenVK's again for its
default) and the authored compile census (187 cases on 10 native-sampling
columns, 193 on moltenvk-m3). All are artifact hashes, with no status change.
Verified on development-fast (batches f15-f19, f24): every lane green on the
RTX 3090, ANV Iris Xe, RX 7900 XTX, both 780Ms, lavapipe and the M3 Max
(MoltenVK), plus the CPU suites, case qualification, clippy in every
configuration, docs and packaging. Not run on the RTX 5080 Laptop (host
offline). The consumer measured YCbCrFilterPolicy::Exact on MoltenVK as byte
for byte the previous variant (80 of 80 tests on the M3).
Through the pixel interlock (RADV, ANV, NVIDIA, MoltenVK) a fetched attachment is a storage image,
so the shader computes Metal's blend. For R8Unorm, RG8Unorm, RGBA8Unorm and BGRA8Unorm only
premultiplied source-over with every channel written was built; every other blend, any write mask
that keeps a channel, and the blend color stayed FramebufferFetch / NotImplemented at the color.
What: Blend::unorm8 now plans every factor and operation but the second source's, under any write
mask, with the blend color, through the 16-bit planner's forms as Metal's compiler builds them for
an 8-bit unorm attachment (Family::Unorm8, measured, below):
- an inner sum adds the destination's atoms before the source's (Order::Destination);
- a lerp takes y from the destination's product first; alpha takes no lerp of the destination
alpha beside itself or held by both products;
- of an added pair, the destination's product is rounded first where unorm8_rank(fs) >= rank(fd)
(tables per half/float arithmetic and color/alpha);
- alpha shares the one minus the blend alpha, source alpha and destination alpha (SourceAlpha-
Saturated's too) that stored color lanes compute; with no color channel stored, the one minus
an alpha the color channels' destination factor is; a min or max computes no factor. A shared
one minus blocks a lerp of the blend or destination alpha and stays whole where added from the
destination's product;
- a write mask of one color channel plans that channel as a scalar (Order::Scalar: Da, D, Sa,
S): no splat rules, but a one minus an alpha that its destination factor is, or that alpha's
factors compute (alpha stored or not), stays whole and takes no lerp.
blend_unorm8 reads the blend color from PushField::HalfBlendColor's f32 words: NaN to 0, clamped
to [0, 1], rounded to half in half arithmetic; OneMinusBlendColor reads h(1 - h(c)) (f(1 - c) in
float) under either math. fetch.rs pushes the field where the blend reads it and merges the
channels the mask leaves out after the blend, as the 16-bit form does. Because Metal's forms depend
on the mask, compiled_write_mask splits a blended RGBA8Unorm/BGRA8Unorm attachment's partial-mask
class in three (alpha alone, one color channel with or without alpha, two or more color channels);
other formats keep one partial class. Without that split a one-channel mask compiled under the
two-channel class and missed Metal's code in 64 of 4096 texels on the 3090 and the 780M. Without fast math every
state takes the rounded forms. Refused, NotImplemented(FramebufferFetch): a second-source factor;
under fast math a lerp, common factor or contracted pair into R8Unorm or RG8Unorm (Metal sums
those in forms of their own, EV FB8-r8-m3); every other format, now named in FAST-PATHS' known
gap with the source-over survey's result (10-bit unorm and RGBA8Snorm fit the 8-bit model with
their clamps; the 16-bit norms and RGBA32Float blend in float even for half4; their factor sets
are not measured). No PrecisionNote or DevicePolicy kind is added: every built blend is exact.
Metal's arithmetic, plain Metal on the M3 Max (macOS 27.0.1), our own MSL, 512 x 512 targets: every
destination code against every source alpha code (two blocks) plus random blocks with sources out
of range, infinite or NaN; half4 and float4, fast and safe; BGRA8Unorm unless named:
- EV FB8-sw2-m3 (seed 388824, blend color 0.3/0.6/0.9/0.45): every factor/operation pair for color
beside source-over alpha (676), the reverse (676), and the same pair for both (677).
- EV FB8-rnd1-m3 (seed 424242, color 0.7/0.15/0.55/0.8): 600 random state pairs.
- EV FB8-mk1-m3 (seeds 1000 + mask): masks 1 to 14, 300 random states each.
- EV FB8-bc1-m3 (seeds 2001-2003): blend colors past both ends of every channel.
- EV FB8-sc1-m3 (seed 7): one color channel: all 153 color keys with a lerp or common-factor
candidate beside 13 alpha keys (none, OMSA, OMDA, OMBA, OMSC, OMDC, OMBC, mixes), masks B and B+A.
- EV FB8-ao1-m3 (seed 9): alpha alone: all 432 alpha keys with a lerp, common or contracted form
beside 8 color keys.
- EV FB8-mk3-m3 (seeds 1000 + mask): masks 1, 2, 3, 4, 5, 8, 9 under two random sets of 300.
- EV FB8-mm1-m3: a min or max beside one-minus factors, full mask, one channel and alpha alone.
- EV FB8-r8-m3 (seed 3001): R8Unorm and RG8Unorm, same/color/random400: safe math exact in every
state; fast-math misses only lerp, common and contracted forms; single, fused, zero and min/max
forms exact in every state.
The model fits every state of each EV (0 mismatched channels), and the Rust planner's plans equal
the model's on 240,480 states (each sweep state under ten masks with and without alpha, plus the
explorer states, half/float x fast/safe), compared through a scratch dump.
Tests: arith::tests::blend8 adds the interpreter over a state of each rule (source alpha over,
the blend color's lerps with a color past both ends, blue alone, alpha alone; half and float, fast
and safe) against hand-written Metal arithmetic, and the no-alpha refusals; tests::engine_fetch_blend8
compiles eight other blends and masks (blend color pushes HalfBlendColor, nothing announced) on
every interlock committed profile and keeps second-source factors refused; engine_fragment's
interlock test now expects RGBA8Unorm's blend computed. runtime_lane::framebuffer_fetch::blend8
adds other_blends_masks_and_the_blend_color_store_metals_blend: the four states into BGRA8Unorm
through each fixture's half4 and float4 loads on the device, every texel against the model.
Verified on gem10 at the content of this commit (WIP a395835, plus REFUSALS regenerated):
- cargo fmt --check; clippy --workspace --all-targets --all-features -D warnings in plain,
--cfg m2v_gpu and --cfg m2v_cpu_icd; rustdoc -D warnings.
- metal2vulkan nextest -E 'test(/eight_bit|blend8|blend16|fetch/)': 90 of 90 passed.
- metal2vulkan-validation -E 'test(/eight_bit|framebuffer_fetch/)' (release, m2v_gpu) on the RTX
3090: 56 of 56. Every draw went through the pixel interlock with Metal's 4096/4096 texels and
nothing announced: the 24 source-over draws and the 16 new ones (four states x two fixtures x
half4/float4). On lavapipe (m2v_cpu_icd): 56 of 56; the device blends through input attachments
and announces HalfOutputFastMathBlend and DeviceColorConversion.
- The 780M was held by reims-vgpu at the final run. One run earlier, before the mask-class split,
it agreed texel for texel with the 3090, including the one-channel miss the split fixes.
SEMANTICS_VERSION 1754 -> 1755: the translation of these blends and the mask classes changes.
RUNTIME_VERSION and the runtime-sources pin are unchanged. docs: the FAST-PATHS known gap (what is
built, what is refused, and the other formats' survey), the API.md degrade catalogue, and
REFUSALS.md regenerated.
The x86 macOS guest refused a render pipeline on every interlock device (RADV, ANV, NVIDIA,
MoltenVK): framebuffer fetch of a BGRA8Unorm color 0 blended One / OneMinusSourceAlpha (add,
color and alpha, mask 0xf) beside an RGBA16Float color 1 of mask none was
FramebufferFetch / NotImplemented at Color(0). Through the pixel interlock the fetched attachment
is a storage image, so no Vulkan blend applies and the shader must compute Metal's blend; only
the extended-range and 16-bit float blends were built.
What: Blend::unorm8 plans premultiplied source-over into R8Unorm, RG8Unorm, RGBA8Unorm and
BGRA8Unorm storing every channel, half4 and float4 outputs, fast and safe math, through the 16-bit
float planner's forms. blend_unorm8 clamps the output to [0, 1] (NaN to 0), reads the texel's code
exactly (RoundEven(texel * 255), then the existing exact division to f32, then half for a half4
output), and blends in the output's type: fast math fuses (h(fma(d, h(1 - a), s))), safe math
rounds each step (h(s + h(d * h(1 - a))), likewise in float). fetch::unorm8_blended then rounds the
result's code by Metal's 8-bit unorm write (color_write's Unorm{8} rule). The blend takes channels
in Metal's order from read_texel and hands them to emit_return's metal_order exchange, so ANV's
RGBA twin of a BGRA8Unorm attachment takes it unchanged. Any other blend of an 8-bit unorm
attachment, a write mask that keeps one of its channels, and every other format stay refused as
before (FramebufferFetch / NotImplemented). The color write plan treats a shader-blended 8-bit
channel as rounded in the shader, so it records no device-conversion note. No PrecisionNote or
DevicePolicy kind is added: the blend is exact.
Metal's arithmetic, measured with plain Metal on the M3 Max (macOS 27.0.1), our own MSL of the
guest's shape:
- EV FB8-dec1-m3 (seed 1): a fetch of every code reads h(c / 255) as half4 and f(c / 255) as
float4, every channel of every format. A plain write stores the code of the value clamped to
[0, 1] (NaN to 0) times 255, the exact product rounded half up.
- EV FB8-sw1-m3 (seeds 1000 * run + (output is float), runs 0 to 3; 4096 x 961 targets): every
half alpha in [0, 1] (15,361) against every destination code of each channel, four source draws
per pair (aimed within four ulps of a code midpoint, 2% out of range, infinite or NaN). That is
63 million channels per variant (BGRA8Unorm, RGBA8Unorm, RG8Unorm, R8Unorm x half4, float4 x
fast, safe), and the model above gives Metal's code in every channel: 0 mismatches.
- EV FB8-fold1-m3 (seed 7, 2048 x 2048): nine products and sums of the output, the fetched color
among them, half4 and float4, fast and safe. The clamp keeps all of them out of the blend, so
fbl8_over_product is exact too (16-bit float folds it).
Tests: arith::tests::blend8 runs the interpreter over every alpha code's value against every
destination code (half and float, fast and safe, BGRA8Unorm and R8Unorm), and checks that another
blend, mask or format is refused. tests::engine_fetch_blend8 compiles the guest's shape on every
interlock committed profile (BGRA8Unorm on each, the ANV profile asserted, no skip) for four
formats and six entries, plus the whole guest pipeline. It asserts the storage form, no note,
link and validation, and that other blends stay refused at Color(0). At d188d8b771 (before this
change) a_blended_eight_bit_unorm_fetch_computes_metals_blend fails with the guest's refusal
("unsupported: FramebufferFetch; needs NotImplemented ... color attachment 0", amd-780m-radv
BGRA8Unorm). The fixtures fbl_fetch_blend8 and fbl_fetch_blend8_safe (our own MSL, regenerated
by scripts/regen-air-fixtures) feed runtime_lane::framebuffer_fetch::blend8, which draws each
entry into the four formats on the device and compares every texel with the model; their
golden printouts (tests/air_input) come from bless_engine_goldens under the pinned LLVM 21.
Verified (gem10, release where a GPU runs):
- clippy --workspace --all-targets --all-features -D warnings in plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd; rustdoc -D warnings.
- metal2vulkan nextest -E 'test(/eight_bit|blend16|fetch/)': 87 of 87 passed; -E 'test(/air_input/)'
with METAL2VULKAN_TEST_REQUIRE_PINNED_LLVM=1: 7 of 7 passed.
- metal2vulkan-validation -E 'test(/eight_bit|framebuffer_fetch/)', 55 of 55 passed, on the RTX
3090 (NVIDIA ICD) and on lavapipe (m2v_cpu_icd, LP_NUM_THREADS=1). On the 3090 every one of
the 24 fixture x format draws went through the pixel interlock with Metal's 4096/4096 texels
and nothing announced.
SEMANTICS_VERSION 1753 -> 1754 (translation of this shape changes). RUNTIME_VERSION and the
runtime-sources pin are unchanged. docs: FAST-PATHS known gaps (the interlock blend's coverage),
the API.md degrade catalogue (HalfOutputFastMathBlend), REFUSALS.md regenerated.
The blessed tables come in the same commit: golden_hashes.tsv gains 16 rows for
fbl_fetch_blend8 and fbl_fetch_blend8_safe, public_fixture_expectations_engine.tsv their 16
inventory rows in fixture order, and authored-compile.tsv only its product fingerprint (no cell
moves). Batch verification on development-fast: the fetch and blend filters green on the RX 7900
XTX, the 780M, the Iris Xe, the RTX 3090, lavapipe and the M3; the full suites at the bless green
on the Iris Xe, the XTX, the 780M and the M3 (7259 and 7274 tests). The RTX 5080 was not run.