Commit Graph
3401 Commits
Author SHA1 Message Date
Anees Iqbal fcf1219b03 Runtime lane: the heap decode's stage-note test takes the plan through its adjust
a_heap_decode_s_stage_note_is_announced_where_its_command_can_name_a_raw_texture landed after
the queue limits' discovery run. Its two dispatches each make a command queue (dispatch_with), so
at the lane's limits its second command queue shares the round robin's one VkQueue where the plan
gives it its own, and the device says so (metal2vulkan-queue-limits-reached), which fails the
test. Its adjust closure now ends in at_plan, as the module's other dispatching tests' do. The
other lane tests landed since the discovery run (color_groups' dead-read scene,
framebuffer_fetch's dead_reads) draw on their lane's one command queue.

Verified on the RTX 5080 Laptop GPU (NVIDIA's manifest alone, --cfg m2v_gpu): heap_extended_reads,
color_groups and framebuffer_fetch::dead_reads, 12/12, no limits' message. Without the at_plan
line, the test fails on the message ("the program's command queue 2 on a round robin of 1
VkQueue(s)"). The Radeon 780M passes it either way: its plan gives a second command queue no
VkQueue of its own, so only the 5080 shows the difference.

(cherry picked from commit a5c7e5184ba2cdbc157f019f32142351fbdff4e9)
2026-11-10 02:05:55 -08:00
Anees Iqbal f2be42c229 RUNTIME_VERSION 2003 and the runtime-sources pin for DeviceOptions::queue_limits
What: the seven commits before this one (nvreds, steelbrain/nvreds-queue-limits
589b66d57d): DeviceOptions::queue_limits (None, the default, is the product's queue
plan, unchanged) lets a device take fewer VkQueues than the plan, and says each
placement that changes (an informational message, metal2vulkan-queue-limits-reached).
The runtime lane's devices take one round-robin VkQueue and none for presenting, and
fail a test on the limits' message; the 547 tests whose placement changes take the
plan through their own adjust (at_plan). RUNTIME_VERSION 2002 -> 2003 (the runtime's
new option and message). The pin follows.

Why: the 5080 pin legs' long pole was the lane's 17-queue devices (~450 ms a make).

Verified (nvreds): the pin's 5080 lane command in its 12 parts at tree 32e0adc2:
1927/1927, no limits message, wall 27.7 min (span 28.4) against 51.4 (52.1) at
63ccc9da0d for the same 1927 tests (summed part time 3119 s vs 5977 s); 780M (RADV
PHOENIX) 1941/1941 in 433 s; Iris Xe (Intel manifest alone) 1941/1941 in 365 s;
gem10 clippy (plain, m2v_gpu, m2v_cpu_icd) and rustdoc clean. Rebased tip on um790:
clippy (three configurations), rustdoc, 68 unit tests and the m2v_gpu lane build
clean. Expected on development's 5080 lane: lane tests landed since the discovery run
that place a second command queue fail on the limits' message until flagged (nvreds
fixes forward). Generators and api-signatures --check unchanged at landing.
2026-11-10 01:49:26 -08:00
Anees Iqbal ad5648eaa9 Runtime lane: the queue limits' doc gives the lane's measured wall
The RTX 5080's lane at the pin's command, in 12 parts: 27.7 minutes (the parts' union) at the
lane's limits with the 547 tests whose work needs the plan making their devices at it, against
51.4 with every device at its plan (63ccc9da0d). The doc said 18, a projection from before those
tests took the plan.

(cherry picked from commit 589b66d57dbc8540e61d547f2c96cff2b3e8e562)
2026-11-10 01:48:31 -08:00
Anees Iqbal 9c88d5c219 Runtime lane: the tests the queue limits change take the plan through their own adjust
At the lane's limits (one round-robin VkQueue, none for presenting) the RTX 5080's lane flagged
547 tests with metal2vulkan-queue-limits-reached: each placed a command queue (3606 of 3616
messages: a program's second or later), a presenting or unshared queue off the plan, or read the
device's queue sharing. Each of them now makes its devices with at_plan through its own adjust,
by the test's structure alone:
- validated_device(..) becomes validated_device_with(.., at_plan); an adjust closure ends in
  at_plan(options); validated_options becomes validated_plan_options;
- a helper that makes the device gets a form taking `adjust: fn(&mut DeviceOptions)`
  (on_device_with and the like) beside it where unflagged tests still call it, takes that form
  alone where none does, and takes at_plan in place where only flagged tests call it;
- a test split into shards (census_shards!) is its function's, every shard flagged.
No test names a test; the flagged set is what the 5080 run reported, applied once.

Verified on this tree:
- RTX 5080 Laptop GPU, the pin's lane command in its 12 parts (-j 6): 1927 tests passed, none
  failed, and no device sent the limits' message. The parts' union took 27.7 minutes (span
  28.4); 63ccc9da0d's, every device at its plan, 51.4 (span 52.1). Summed part time 3119 s
  against 5977 s, the same 1927 tests.
- Radeon 780M (RADV PHOENIX): the lane 1941/1941 in 433 s.
- Iris Xe, Intel's manifest alone: the lane 1941/1941 in 365 s.
- clippy (no cfg, m2v_gpu, m2v_cpu_icd; all targets and features) and the Rustdoc: clean.

(cherry picked from commit 74fcfe6082d7510250aba5091378237eead36935)
2026-11-10 01:48:31 -08:00
Anees Iqbal 153317f517 Runtime lane: at_plan, the adjust that gives a lane device its queue plan
A lane device takes the lane's queue limits (one round-robin VkQueue, none for presenting).
at_plan clears them, for the tests whose work the limits change; validated_plan_options is
validated_options with it.

(cherry picked from commit ab7f57dcc43758c11b3057e39748e72e888e6bc7)
2026-11-10 01:48:31 -08:00
Anees Iqbal 5592616360 Queue limits: the program's command queues alone are noted, counted among themselves
A command queue the runtime makes for itself (the in-place check's, in_place_check.rs) is no
placement the program asked for, so the limits' message leaves it out: Device::next_queue takes
the queue's name only for a queue the program made (place_queue passes MadeFor), and decides on
the program's own count of round-robin queues (DeviceShared::program_queues_made, counted only
where the limits changed the plan): its k-th queue past the limits' VkQueues, where the plan's
give it one of its own, is noted. DeviceOptions::queue_limits' doc says so; the device test
matches the message's new words.

Verified on the RTX 5080 (a scratch of this tree with a lane switch to the plan, NVIDIA's
manifest alone): the runtime's queue_limits tests 7/7, every case sending (reserved 1, extra 1,
command 2, unshared 1, presenting 1, reads 2). The lane at the limits, in four parts, flagged 547
tests, every one failing on the message but a test that checks no layer claim and the exits
tests' child; 3606 of its 3616 messages were the program's own second or later command queues.
The first part failed 153 tests before this change and 147 after it: the runtime's queue
accounted for 6, the rest are tests that make more than one command queue.

(cherry picked from commit 735be65ec4ddfd0856d3ff50f70d32c71eb7d412)
2026-11-10 01:48:31 -08:00
Anees Iqbal 8417d981bb Queue limits: then_some for the planned queues; the API signatures of QueueLimits
clippy (unnecessary_lazy_evaluations, job 12989 on ms01) took the closure building the planned
queues for a lazy one; it builds a value of what is already computed, so then_some. The signature
table gains the four records scripts/api-signatures/signatures.py --bless added
(DeviceOptions::queue_limits, QueueLimits and its two fields), nothing else moved.

Verified at the parent's tree on gem10 (job 12990, Radeon 780M, RADV PHOENIX, Mesa 26.2.6):
tests::queue_limits and tests::queue_limits_device, 7 of 7; the device's families have one
graphics queue, so the limits changed nothing and no message was expected or sent, and without
limits none was sent.

(cherry picked from commit 3c8dcdb96b8ae90e203b3a74e433421ddcf3531c)
2026-11-10 01:48:31 -08:00
Anees Iqbal 5017642c6d Runtime lane: devices at one round-robin VkQueue and none for presenting; the limits' message fails
runtime_lane::validated_options gives every lane device LANE_QUEUE_LIMITS (one VkQueue for the
round robin, none reserved for presenting, beside the staging queue), which leaves a device whose
families have no queue to spare as it is and cuts what an RTX 5080's device costs to make and drop
(17 queues to 2). The lane's sink (runtime_case::Messages::sink) takes the device's
metal2vulkan-queue-limits-reached message as it takes the validation layer's errors: kept among
the failing messages, which the lane's claims fail on, and printed (QUEUE-LIMITS-REACHED) with the
test's name. So a test whose work the limits change (a second command queue, a presenting,
unshared, reserved or extra queue, a read of the queue sharing) fails on a device with queues to
spare until it makes its device with the plan through its own adjust closure.

Verified: not yet compiled; the 5080 lane run that finds the tests to convert follows.
(cherry picked from commit 71953758d46f25bccd7055ed678887979e5735bd)
2026-11-10 01:48:30 -08:00
Anees Iqbal 6183fbea8e DeviceOptions::queue_limits: fewer VkQueues than the queue plan takes, each changed placement said
A device's VkQueues are made and destroyed with it, and on NVIDIA they cost: on an RTX 5080
Laptop GPU (615.71.09), one device at a time, the plan's 17 queues (14 for the round robin, 2 for
presenting, the staging queue) took 445 ms in vkCreateDevice and 110 ms in vkDestroyDevice, 2
queues 145 ms and 44 ms, and the driver makes devices one at a time across processes, so a suite
that makes thousands of devices is bound by them (the runtime lane: about 51 minutes on the 5080
at the plan, about 18 at one round-robin queue and none for presenting). The product's plan is
unchanged: one QEMU process holds one device for its life.

DeviceOptions::queue_limits (QueueLimits: round_robin, at least one and at most the plan's 16;
presenting, at most the plan's 2) gives each device fewer: queue_plan_within takes the plan's
arithmetic with those ceilings (the floor of four no more than the round robin's limit). None, the
default, is queue_plan as before; limits at the plan's or past them are the plan.

Where the limits change a placement from what the plan gives, the device sends an informational
message through its sink (metal2vulkan-queue-limits-reached): a command queue, unshared or not,
that takes a VkQueue another took where the plan gives it one of its own (the round robin's made
count at or past the limits' VkQueues and below the plan's); a presenting queue past the limits'
reserved ones where the plan reserves it one; the reserved or extra queues placed otherwise than
the plan places them (compared as the device is made, planned_queues); and each read of the
queue sharing through Device::settle_queue_switch_check or Device::queue_switch_check_report on
a device whose round robin or presenting queues the limits changed. A device whose families have
no queue to spare (RADV's and lavapipe's one graphics queue) takes its plan under any limits and
sends nothing. The device keeps the plan's counts only where the limits changed them
(DeviceShared::planned), so a device without limits takes no new branch but the None checks.

Tests: tests::queue_limits (no device) holds that limits at or past the plan's are the plan on
every shape the plan's tests use, that one queue takes its plan under limits, that a round robin
of none is one, and each case's decision on NVIDIA's shape (13 of 16 command queues noted, the
first two presenting queues, the reserved queue at (0, 1) against the plan's (0, 15), the extra
graphics queue at (0, 2) against presenting's (0, 14)). tests::queue_limits_device holds on a
device that each case sends exactly as many messages as its own families' plan says, and that
without limits nothing is sent. The runtime README's options table gains the row.

Verified: not yet compiled; the clippy, Rustdoc, signature and device runs follow.
(cherry picked from commit 8e037c4d2ea125969f7e23a64d0dce263644d193)
2026-11-10 01:48:30 -08:00
Anees Iqbal 632064ab46 Re-bless the authored compile census at f1d9bfd6eb
SEMANTICS 2014 / RT 2002 (f1d9bfd6eb): blends into padded and bfloat attachments; the golden check after readoffset's re-bless, and the census at the new product fingerprint.

Its product fingerprint follows development's versions at f1d9bfd6eb. Blessed on the
M3 (s37-pl.sh censusbless --bless).

(cherry picked from commit a4689f99fa82d66f565c939473f83f293bf07322)
2026-11-10 01:44:21 -08:00
Anees Iqbal f1d9bfd6eb Re-bless the engine inventory and golden tables at 3257c8886c
SEMANTICS 2013 / ARTIFACT_FORMAT 499 / RT 2001 (3257c8886c): Metal 4.1 reads through a sampler; the clamp-to-edge read's SPIR-V changed (kernel_block_read br_edge and br_edge_1x2, 38 golden cells over 19 profiles), the new kernel_read_through fixture's 50 inventory rows (blessed on the branch); the census follows the new product fingerprint.

Blessed on the M3 (s37-pl.sh bless: bless_engine_inventory, the air_input printouts,
bless_golden_hashes, then the check step).

(cherry picked from commit 5c46da23db6f7799a761f9a1da5d95222fb806c6)
2026-11-10 01:38:05 -08:00
Anees Iqbal 9f4c95f3f5 SEMANTICS_VERSION 2014, RUNTIME_VERSION 2002 and the pin for blends into padded and bfloat attachments
What: the sixteen commits before this one (xrblend, steelbrain/xrblend a477689194; its
SEMANTICS-only commit d4514fea3f skipped as empty here): a blended bfloat attachment
is refused InvalidDescriptor(ColorAttachment), as Metal's pipeline validation refuses
it (was NotImplemented(Format)); blends into the padded 10-bit formats (R10Unorm_X6,
RG10Unorm_X12, their sRGB twins, RGB10A2Unorm_sRGB), dual-source included, are built
through the extended-range in-shader blend with no input clamped, as the M3 measured;
the runtime announces extended-range-blends-stored-codes for padded attachments (an
announcement: RUNTIME_VERSION 2001 -> 2002). SEMANTICS 2014 (the branch's 2013
collided with readoffset's). Conflicts resolved at landing: the cost bill's
AFTER_THE_LAST_RUN takes both families (30 names), known-gaps.tsv keeps both sets of
rows, docs/CONFORMANCE-COVERAGE.md regenerated. The pin follows.

Verified (xrblend): Metal on the M3 (probe padded_and_bfloat_blends.m, macOS 27.0.1);
17 new conformance cases (padded_blends) recorded and timed on the M3; replays with
their 17 known-gaps rows per venue exit 0 on the M3 (m3-max-13310), the 780M (RADV
PHOENIX, 13311) and lavapipe (13307), linear forms within 1-2 codes, sRGB within 5-6,
the M3's dual-source infinite second source an end code (MoltenVK's regrouping);
clippy plain/m2v_gpu/m2v_cpu_icd and rustdoc clean, 123 touched tests (13307);
conformance 1031/1031 and api-docs (13343); release: the padded sweep 21.9 s for
~1,700 attempts, peak 45 MiB (13369). Not yet: rows for the 5080, Iris and the XTX
(their replays will list the 17 cases until added).
2026-11-10 01:37:27 -08:00
Anees Iqbal 2b5b294753 Conformance: time the padded-blend cases on the M3 Max
conformance times --runs 8 --write over the 17 padded-blend cases (potluck job
m3-max-13329, Apple M3 Max, macOS 27.0.1, both legs): "17 case(s) carry their
timing", every one unmeasured since our leg announces extended-range-bits-kept
(and half-output-fast-math-blend for the half premultiplied draws). Only the
recordings' times change; their answers are byte-identical.

every_case_carries_its_timing failed without them (gem10 job m3-max-13307).

(cherry picked from commit a4776891947c09e0955b7c56716b8ba9aeaad580)
2026-11-10 01:36:29 -08:00
Anees Iqbal e5fffbf611 Known gaps: the padded-blend cases on lavapipe
Seventeen rows for the 256-bit llvmpipe venue, the counts its replay printed at
31d3ac25a2 (job m3-max-13288). lavapipe computes the second-source blend as
written with a product fused into the sum (native-fma), so an infinite second
source's NaN stores code 0 as Metal's does and no linear element is more than two
codes from Metal's.

CONFORMANCE-COVERAGE.md regenerated for the ledger's row count.

(cherry picked from commit 37237c7c805a19a814c809d13a1b2c196fd148b2)
2026-11-10 01:36:16 -08:00
Anees Iqbal 54e0d91b2c Known gaps: the padded-blend cases on the M3 Max and RADV PHOENIX
Seventeen rows per venue, the counts the replays printed at 31d3ac25a2 (M3 under
MoltenVK, job m3-max-13278; the 780M under RADV, job m3-max-13289). Each blend runs
in the shader in the device's arithmetic, unclamped, and lands a code or two from
Metal's on a linear format, up to six near zero on an sRGB twin. The second-source
blends differ by venue: the M3's compiler computes S·a + D·(1 - a) as D + a·(S - D),
so an infinite second source stores an end code where Metal's IEEE sum is NaN,
stored as 0; RADV computes the sum as written and stores 0. A model of each form
reproduces the replay's count exactly on R10Unorm_X6 and RG10Unorm_X12.

CONFORMANCE-COVERAGE.md regenerated (the new case module, its recordings and rows).

(cherry picked from commit e117b085632700b586e56d043b91b16b2365a524)
2026-11-10 01:35:57 -08:00
Anees Iqbal 3fc51b0c78 Padded blend cases: as_chunks for the second outputs; the layout check before the set takes the bytes
Clippy's chunks_exact_to_as_chunks lint failed the conformance crate in every
configuration, and the inputs test moved the destination's bytes into the set
before the layout check read their length (E0382), so the crate's tests did not
compile. Found by the gem10 clippy and test job at b9a7f3425a.

(cherry picked from commit c0b04f478b7a1aa285a944e84cfa914b278f90bc)
2026-11-10 01:35:34 -08:00
Anees Iqbal b23928b1f7 Record the padded blend cases on the M3 Max; the blend door's bfloat answer documented
Seventeen recordings of padded_blends, Metal on the Apple M3 Max under macOS
27.0.1 (26A434), three plain runs each and the validated leg. A Python rebuild
of each case's inputs reproduces the recorded input digests (the destination
words and the half4 outputs), and an f32 model of the blend unclamped matches
Metal's stored codes within one code at every texel of the linear forms but
for NaN and infinite operands.

metal::format::extended_range_blend's doc names the padded forms and the bfloat
forms' NotRepresentable answer.

(cherry picked from commit 31d3ac25a223d5372f2fe49898bc54ca7f79952b)
2026-11-10 01:35:34 -08:00
Anees Iqbal 0e76f55569 Padded clear read-back: RG10Unorm_X12_sRGB's one; comments on padded shadows and fetches
ExtendedRange::clear_read_back's test expected a clear of 1 into
RG10Unorm_X12_sRGB to read back, but Metal's write table stores 1 as code 137,
which reads 137/1023: the clear is off its codes, as the function answers (the
gem10 run of 5750641750 failed the test there and nowhere else).

Comments: the runtime's half shadow and the translator's leave out a padded
color because the shadow is not built for it (its tile is measured now), and a
fetch's read of a padded tile is what stays unmeasured.

(cherry picked from commit b9a7f3425a802b2107b4f48631b24657637016c4)
2026-11-10 01:35:34 -08:00
Anees Iqbal c6d18a11eb Conformance: blends into the padded 10-bit formats
Seventeen cases, padded_blends: each of R10Unorm_X6, RG10Unorm_X12, their sRGB
twins and RGB10A2Unorm_sRGB blended by rt6_samples' half4 fill under
premultiplied source-over, its float4 fill under one plus one, and xrb_dual's
half4 output and second output under Source1 over its complement; and the
premultiplied blend under a mask of red (RG10Unorm_X12) and of the color
channels (RGB10A2Unorm_sRGB). Each target is 128x64 of random raw words, shared
and of shader-write usage so replaceRegion and the blit out move every word
(a texture Metal keeps in its optimized layout moved only some of a padded
target's texels in the probe), loaded, drawn once full-screen, and read back
whole. The outputs are extended_range_targets' 8,192 (values past [0, 1] on
both sides, NaN, the infinities and both zeros), which the unclamped padded
blend reads as they are.

Recorded on Metal in a later commit; their cost records are named as a bill for
the next whole-set cost run.

(cherry picked from commit a2b0697740657a47c171f8cb5656271b7645b9b4)
2026-11-10 01:35:34 -08:00
Anees Iqbal 880b03cb2b Blend into a padded attachment over unclamped operands; padded tiles announced
Measured on the M3 Max under macOS 27.0.1 (probes/padded_and_bfloat_blends.m,
targets without Metal's optimized layout, whose blits moved every texel):
- Metal clamps nothing before a blend into a padded attachment (R10Unorm_X6,
  RG10Unorm_X12, their sRGB twins, RGB10A2Unorm_sRGB): sources, second
  sources and blend colors past both ends of [0, 1], alpha among them, blend
  as they are. With the operands unclamped, the stored codes of 18 blend states
  under fast and safe math, half and float outputs, match the f32 model within
  one code for the linear forms (16-bit safe-math half outputs exactly in half
  arithmetic), apart from NaN and infinity results; clamped to [0, 1], up to
  1023 codes off in 30-50% of channels.
- A padded attachment's tile holds half through the pass: a premultiplied blend
  of (0, 0, 0, 0.5) over a clear of 0.33371 stored code 171 (the half's), not
  170 (code 341's), and over an unblended draw of values in [-0.5, 1.5] it
  matched the unclamped half in every channel (65,536 texels of R10Unorm_X6,
  131,072 channels of RG10Unorm_X12).

So blend::extended_ranges is None for a padded form (native() clamps nothing),
source_range drops its padded arm, and the model test clamps no padded lane:
every_blend_is_the_devices_arithmetic's random sources past the range fail it
with the clamp. The runtime's extended-range-blends-stored-codes now covers
padded colors (render.rs extended_colors), and ExtendedRange::clear_read_back
answers a padded form's clear by its codes' values (c / 1023, the sRGB twins'
transfer, RG10Unorm_X12_sRGB linear), so a blend over a clear between two codes
is announced as for the extended-range forms. Docs: the blend-source notes, the
stored-codes kind and its catalogue entry, ExtendedRangeColor.

(cherry picked from commit 5750641750642bdb7800da8e9618f98919d2cc9f)
2026-11-10 01:35:19 -08:00
Anees Iqbal 17cf2bf636 Bfloat blend refusal: tests, docs, refusal surface; SEMANTICS 2012
The translator test of bfloat targets expects Metal's pipeline error for a
blended bfloat attachment, in the translation and at link with no fragment
function, with the unblended unwritten pipeline as its negative control. A new
engine test (engine_padded_blends) checks the same on every committed profile
through compile_render_pipeline, under a full mask and a mask of no channel, and
without a fragment function, with the unblended pipeline made as its control.

Docs: stage_io::extended_color, input_blend, ExtendedRangeColor::blended (any
blend now, not factors one and zero), DescriptorError::ColorAttachment (a
blended bfloat attachment). docs/REFUSALS.md regenerated. SEMANTICS_VERSION
2012 (a refusal's class changed, padded blends translate). A clippy literal in
extended_range's tests grouped.

(cherry picked from commit 8ef001f0a0eeed4c1b51a31df2ae093285dfbe9c)
2026-11-10 01:35:19 -08:00
Anees Iqbal ebaf3554ca Refuse a blend into a bfloat attachment as Metal does; padded blends at the format door
Metal makes no render pipeline that blends into an R16Bfloat, RG16Bfloat or
RGBA16Bfloat attachment: its pipeline validation asserts that the format is not
blendable (an Apple M3 Max under macOS 27.0.1, plain and under the validation
layer, with a fragment function writing the attachment, under a mask of no
channel, and with no fragment function; probes/padded_and_bfloat_blends.m).
Link, stage_io::extended_color and fetch::plan now refuse such a blend
InvalidDescriptor(ColorAttachment) instead of NotImplemented(Format). A second
output planned to an extended-range attachment is an invariant (stage_io
consumes it as the blend's second source or stores it nowhere).

metal::format::extended_range_blend answers a padded form as it answers the
others now that the function blends one (storage form and input attachment),
and a bfloat form NotRepresentable(Format), as the runtime's formats answer what
Metal refuses. The runtime's Blend answer for the padded formats follows it.

Tests: fetch's door test over the padded and bfloat forms; the runtime's
padded and bfloat Blend answers.

(cherry picked from commit 7e68307bc7cc6dbac926132502b2a0d2189734a0)
2026-11-10 01:35:13 -08:00
Anees Iqbal 13467f9bca Probe: padded targets without Metal's optimized layout
Blits moved only some texels of a private padded target in Metal's optimized
(compressed) layout: a write mask of no channel stored the uploaded word in 36%
of an R10Unorm_X6 target, in blocks. The targets now set
allowGPUOptimizedContents to NO, which changes the memory layout alone.

(cherry picked from commit 8e418e5df5a36114ad13b30c86d85efa913a2b3a)
2026-11-10 01:35:13 -08:00
Anees Iqbal 00e16d8612 Probe: render the padded blends into private targets
The rerun's blits brought back words no write makes (0xFFFF, 0xABAB, whole rows of zeros) from
the shared padded 10-bit targets, while the shared RGB10A2Unorm_sRGB and BGR10_XR targets came
back sound. Private storage, a render target's usual storage, is what the probe's targets take
now, and the round trip reports the texels whose codes came back other.

Verified: not yet; the M3 run follows.
(cherry picked from commit 4c16b29b2ba547553921ca4b1d1b299a8c1201e5)
2026-11-10 01:35:13 -08:00
Anees Iqbal 2f3d297a49 Probe: a blended bfloat attachment of mask none, and without a fragment function
Whether Metal's assertion on a blended bfloat attachment is the descriptor's alone: the same
pipeline under a write mask of no channel, and with no fragment function at all.

Verified: not yet; the M3 run follows.
(cherry picked from commit ace344e3795446947bc899f2c9270947d0e61799)
2026-11-10 01:35:13 -08:00
Anees Iqbal 7b3ced8eed Probe: move the padded blends' texels in and out by blits
A host copy of a padded 10-bit texture is a silent no-op where Metal keeps it in its compressed
layout, which the probe's 256 x 256 render targets took: the first run's destinations went in as
zeros and its stored texels never came back. Every texel now goes up and back by a blit in the
draw's command buffer, the read-back buffer is filled with a pattern before each draw, and a
round trip of each format's destination is checked before its sweep.

Verified: the first run's outputs were all zero for R10Unorm_X6 and matched no model for the
other forms; the rerun follows.

(cherry picked from commit 6f9b0732813f3aa1e0b7e70653c38d13e9803fc7)
2026-11-10 01:35:13 -08:00
Anees Iqbal bab3e9b1f9 Blend into a padded 10-bit attachment over an ordered read of it
A blended R10Unorm_X6, RG10Unorm_X12, their sRGB twins or RGB10A2Unorm_sRGB attachment was
refused NotImplemented(Format). No device blends the raw words such an attachment holds, so the
function now computes the blend itself over an ordered read of the attachment, as it does for the
extended-range forms: the interlocked storage form takes a padded attachment (its blend, an
unblended write and a write under a mask of some channels), and on a device that orders fetch
through rasterization-order input attachments the blend is computed over the input attachment.
A device that orders fetch in neither way refuses it naming the two orderings.

The blend's destination is the tile value: each code decoded and narrowed to half, code 1023 one
(an extended-range form's tile clamps at 1022, a padded form's does not). The source, the second
source and the blend color are clamped to [0, 1], and the result is stored by the write's encode,
a masked channel's code kept (encode_keeping now packs the padded words). What a fetch reads of a
padded attachment is not measured and stays refused in the storage form too.

Verified: not yet; the Linux build and the touched tests follow, and the M3 probe decides the
model's details.

(cherry picked from commit 0d835f245740d2436f566ec27d5bfccf8e1da0a4)
2026-11-10 01:35:12 -08:00
Anees Iqbal 04b9e87919 Probe: what plain Metal does with a blend into a padded or bfloat attachment
A probe of our own MSL that makes blended pipelines into the padded 10-bit forms, the bfloat forms
and (for a second output) the extended-range forms, sweeps blend states over random raw texels for
half4 and float4 outputs under fast and safe math, and reads what a blend sees as its destination
after a clear and after an earlier draw of the same pass. Its answers decide the model the
translator builds for these blends.

Verified: not yet run; the M3 run follows.
(cherry picked from commit 8b5c01879867e53d4321824a29cec117cd405475)
2026-11-10 01:35:12 -08:00
Anees Iqbal 3257c8886c SEMANTICS_VERSION 2013, RUNTIME_VERSION 2001 and the pin for Metal 4.1 reads through a sampler
What: the fifteen commits before this one (exitcrash, steelbrain/readoffset 3514ac3e7a):
Metal 4.1 read(sampler, coord[, offset][, lod]) builds for every constexpr sampler
state, a runtime [[sampler(n)]] (SamplerWord::READ_STATE) and an argument buffer's
sampler, with the border texel a new spec (SpecKey::BorderTexels, set by the binder
from the bound texture's format and swizzle). The M3's measured rules: the level is
the read's under a mip filter, else 0; a level or layer past the texture reads zero;
border modes read the border texel through the swizzle, edge modes clamp; a texture
buffer's index past its end reads the border texel where t is a border mode, else
texel 0, except a runtime sampler whose s is clamp_to_edge clamps. Still refused
(typed): an argument buffer's texture read through an opaque border or a runtime
sampler (no handle room for its border texels). Known gap recorded: an argument
buffer's swizzled texture through a transparent-black border reads (0,0,0,0) where
Metal reads (0,0,1,0). SEMANTICS 2013 (the branch's 2012 collided with deadrog's),
ARTIFACT_FORMAT 499 (two encoded variants), RUNTIME_VERSION 2000 -> 2001 (the
runtime's sampler words and binder). The pin follows.

Verified (exitcrash): new conformance family read_through, 13 cases recorded on the
M3; M3 MoltenVK replay REPLAY_RC 0 (job 13305), lavapipe replay REPLAY_RC 0 (13302;
96 of its 98 ledger rows are llvmpipe's unorm conversion, one ulp); negative control
at base: all 13 refused (13272); Linux core 5352/5353 (the 38 golden rows, re-blessed
next), conformance 1034/1034; clippy plain/m2v_gpu/m2v_cpu_icd and rustdoc clean
(13303). Generators and api-signatures --check unchanged at landing.
2026-11-10 01:31:09 -08:00
Anees Iqbal 848c072b8f CONFORMANCE-COVERAGE.md with read_through's ledger rows
Regenerated by scripts/conformance-coverage/coverage.py after the 96 llvmpipe
rows and the three read_through gap rows: 3410 ledger rows.

Verified: the conformance suite on msi (job m3-max-13292) failed only
the_conformance_coverage_document_is_what_the_sources_derive before this.

(cherry picked from commit 3514ac3e7a91a8245325939db06bbec5e950a63a)
2026-11-10 01:30:12 -08:00
Anees Iqbal b70ff4e4d1 Test: a texture buffer's border by t through runtime sampler words
Five words the M3 answered in the conformance case read-through-buffer:
s border alone reads texel 0, s and t border the border, t zero under s
repeat the border, s clamp_to_edge clamps whatever t and r are, and t
repeat under s border reads texel 0. With the border taken from s, the
first and fifth read the border instead.

Verified: next, with the suite on msi.
(cherry picked from commit 158acdd959bd9e492e399e974e516e03cdcf01d7)
2026-11-10 01:30:12 -08:00
Anees Iqbal 9721752f1b read_through: lavapipe's ledger rows, and the timings already in
96 llvmpipe rows for the 8-bit unorm cases (rgba8, its swizzled twin, a8):
every one is llvmpipe's own conversion of an 8-bit code, one f32 ulp high of
Metal's (0x3ec2c2c4 for 0x3ec2c2c3), at reads inside the texture; the
addressing and the border texels agree. The swizzled case's argument-buffer
texture holds the swizzle gap and two such ulps.

The previous commit (4d0220258d) also carried the thirteen cases' Metal and
MoltenVK timings, written by conformance times --runs 8 --write on the M3
(job m3-max-13280), which its message does not say.

Verified: the lavapipe replay on msi (job m3-max-13284) named exactly these 96
rows as unlisted and no other gap; the conformance suite passed there (1034
tests).

(cherry picked from commit 9361a740d86d056d1a3799f88c909d18df62b718)
2026-11-10 01:30:12 -08:00
Anees Iqbal a081c07646 through.rs: no indexing in the lowering
The lowering denies clippy::indexing_slicing: the sampler word's s mode is kept
as the loop meets it, the border flags are written through the array's
iterator and read with get, and the one-lane border texel is the slice's one
element.

Verified: clippy -D warnings on msi (job m3-max-13267) named these four sites
and nothing else in plain, m2v_gpu and m2v_cpu_icd; rustdoc -D warnings passed.

(cherry picked from commit 8a43b4e2be910dbfede95b974b7dfe17acb6360f)
2026-11-10 01:30:12 -08:00
Anees Iqbal 5ba7e93356 read_through: the cost bill, and the swizzle row scoped to the M3
The thirteen cases join AFTER_THE_LAST_RUN: a case's counts depend on what ran
before it, so only a whole-set cost --write pays their records. The argument
buffer texture's swizzled-border row names the M3: lavapipe's answer at the
same site also holds its unorm conversion's ulp, so it is a row of its own.

Verified: the conformance suite on msi (job m3-max-13266) failed
every_case_carries_a_cost_recording on these names alone.

(cherry picked from commit 36d078c3e637555a8a36cab8099b726208c19dc8)
2026-11-10 01:30:12 -08:00
Anees Iqbal 0fcb724d2c CONFORMANCE-COVERAGE.md with the read_through family
Regenerated by scripts/conformance-coverage/coverage.py: 13 more recordings,
162 case modules, three ledger rows, and read_through among the families that
compare MTLSamplerState and the texture and buffer items it calls.

Verified: coverage.py --check reported the doc stale before and is the
generator's output now.

(cherry picked from commit b2b166a2d4b03ed957824bc8290b214d4c78c66b)
2026-11-10 01:30:11 -08:00
Anees Iqbal f831d5bd2f Engine inventory: kernel_read_through's rows
The 25 kernels of kernel_read_through under every committed profile, for its
llvm-as and metal-as forms alike, blessed on the M3 (which has both
assemblers): every one translates but rt_heap_ow and rt_heap_arg
(NotImplemented(ArgumentBufferTextures)), rt_heap_zero on the profile without
descriptor indexing, and rt_rw where the storage format is an input.

Verified: bless_engine_inventory on the M3 (job m3-max-13265) added these 50
rows and changed none.

(cherry picked from commit 7ef4c2d54ca5f006678d548fa83ee35ac9bf5e81)
2026-11-10 01:30:11 -08:00
Anees Iqbal 34310d93f7 Reads through a sampler: a texture buffer's border by its t axis, the ledger rows
The read_through conformance family's per-axis states, recorded on the M3 Max,
show a texture buffer's index past its end addressed as the first texel of a
row past its one row: the border texel where t's mode is a border mode, else
texel 0, whatever s and r are; a runtime sampler whose s mode is
clamp_to_edge clamps it first (s-border reads texel 0, st-border the border,
tr-border clamps). The read took s's mode, which read the border for s-border,
sr-border, s-zero and three mixed states. The border now follows t, and never
applies where the sampler clamps.

The retaken buffer recording; known-gaps rows for the argument-buffer
texture's swizzled transparent border (divergent) and its opaque-border and
runtime-sampler reads (refused), with the swizzle gap in FAST-PATHS.md's known
gaps; the module docs say both.

Verified: the replay on the M3 through MoltenVK (job m3-max-13263) named the
six buffer divergences this fixes; the fix's replay is next.

(cherry picked from commit 22c6817d4074c1b18bbc7c6d166370fe9990c1a5)
2026-11-10 01:30:11 -08:00
Anees Iqbal b8e865bf21 read_through: recordings, axis states for texture buffers, the golden printout
The thirteen read_through cases' Metal answers, recorded on the M3 Max
(macOS 27.0.1). The texture-buffer case gains fourteen runtime sampler
states that change one or two axes from clamp_to_edge, because the first
replay showed Metal reading texel 0, not the border, past a texture buffer's
end through s = clamp_to_border, t = repeat, r = clamp_to_edge: the index is
not addressed by s alone. Its recording is retaken next.

The plane cases declare set-past-layout-support: their argument-buffer reads
take the handle heap, which MoltenVK's layout query refuses though it runs it
(the replay on the M3 announced it in all four and nothing else).

kernel_read_through's golden printout, blessed on msi under LLVM 21. The
translator test accepts a profile without descriptor indexing refusing
rt_heap_zero with its feature needs.

Verified: record and MoltenVK replay on the M3 (job m3-max-13250); the golden
printout test passes on msi (job m3-max-13256).

(cherry picked from commit 6bfa6f481eb9253b197146524eed739aecd95f37)
2026-11-10 01:30:11 -08:00
Anees Iqbal c72724ea14 Conformance: read_through, reads through samplers of each address family
Thirteen cases over the owned fixture kernel_read_through: four plane formats
(R32Float, RGBA8Unorm plain and swizzled, A8Unorm) through every constexpr
kernel, eleven runtime sampler states at the slot and through an argument
buffer, and an argument buffer's texture; an array, a volume, a line, a
read-write texture, a texture buffer, an int and a half texture; and the two
argument-buffer-texture reads the translator refuses, as cases of their own.
Each case reads at positions inside, past each edge, at a lower level and at
levels past the texture's.

Verified: nothing yet; the recordings are taken on the M3 next.
(cherry picked from commit 2dc084d1bfd12736c7e38b73cacb43b147423351)
2026-11-10 01:30:11 -08:00
Anees Iqbal ea89941dda BorderTexels in the mechanism test's tables and the interpreter's neutral defaults
The mechanism test enumerates every RuntimeFact without a wildcard, so the new
BorderTexels fact needs its variant index (93), its sample and its expected
mechanism (Specialization). The interpreter's push defaults give BorderTexels
the module's own neutral bits rather than 0.

Verified: the lib-test build on gem10 failed on exactly these two matches.
(cherry picked from commit 2f7fce9e6a19bc4ee197ff565fbd879dcce4c53c)
2026-11-10 01:30:11 -08:00
Anees Iqbal 5b24698068 SEMANTICS 2012, ARTIFACT_FORMAT 499, REFUSALS.md and the API signatures for reads through a sampler
What: SEMANTICS_VERSION 2011 -> 2012: reads through a sampler other than constexpr
clamp_to_edge now translate (they were refused), a clamp-to-edge read past its level or layer
reads zero in every lane, and a texture buffer's index outside a constexpr clamp_to_edge reads
its first texel. ARTIFACT_FORMAT_VERSION 498 -> 499: SpecKey::BorderTexels and
RuntimeFact::BorderTexels are encoded variants. docs/REFUSALS.md regenerated
(refusal_surface.py): select_through's two sites. api_signatures.tsv blessed:
SpecKey::BorderTexels, RuntimeFact::BorderTexels and SamplerWord::READ_STATE are added; nothing
is removed or changed.

Why: the translation's output changed under unchanged keys, and the encoding gained two variants.

Verified: refusal_surface.py wrote the doc with 0 unmarked variants; signatures.py --bless
reported only those three additions; METAL-COVERAGE.md --check is current.

(cherry picked from commit 26c37d74d6d2a4bb395ff64a539eb7fc617619bd)
2026-11-10 01:30:11 -08:00
Anees Iqbal ecda2f87a5 Reads through a sampler: interpreter tests per state family, and the measured edge rows
What: engine_texture_oob/through.rs runs the fixture kernel_read_through's reads on every
profile class, with a four-channel and a one-channel format's border texels: constexpr samplers
of each address mode, border color and mip filter (per axis and mixed), 2D, 2D array, 3D, 1D,
read_write, texture buffer, int and half texels and an alpha read; a runtime [[sampler(0)]] at
six words (2D), four (texture buffer) and one (3D); every entry links and passes spirv-val, and
an argument buffer's texture through an opaque white border or a runtime sampler is refused
typed. The clamp-to-edge rows of EDGE_READS move there with the measured answers: a level or
layer outside reads zero in every lane, and edge_buffer's index outside its first texel. The
refusal test keeps the cube read and the 16-bit coordinates; the runtime, repeating and filtered
reads now translate. border_texels is checked against the M3's per-format answers.

Why: the reads of the previous commit, against the M3's measurements.

Verified: not yet run (the next build runs them).
(cherry picked from commit 35b48c92a5af15851bd73603c195a8a2d5ce0aaa)
2026-11-10 01:30:11 -08:00
Anees Iqbal a7c663dbc0 Fixture kernel_read_through: its companions, compiled with -std=metal4.1
What: scripts/regen-air-fixtures/regen-air-fixtures.sh kernel_read_through on the M3 (Apple
metal 32023.922, macOS SDK 27.2, LLVM 21 tools): kernel_read_through.ll and .air.ll, and its
TOOLCHAIN line.

Why: the owned MSL of reads through each sampler state family, which the translator's tests read.

Verified: the script's own check, that metal-as of the typed text reassembles the module.
(cherry picked from commit 9c18d497e92ae44fb98f49c29383b65dd77c67cb)
2026-11-10 01:30:11 -08:00
Anees Iqbal 5a43682074 Reads through a sampler: every constexpr, runtime and argument-buffer sampler state
What: Metal 4.1's read(sampler s, coord[, offset][, lod]) was built only for a constexpr
clamp_to_edge sampler of default state; every other constexpr state and every runtime or
argument-buffer sampler was refused. The read is now addressed by the sampler's state, decided
from its fields (a constexpr sampler's) or its word (a [[sampler(n)]]'s SamplerState
specialization with SamplerWord::READ_STATE, an argument buffer's sampler table entry):
- the level is the read's under a mip filter, else the base level; a level or array layer
  outside the texture reads zero in every lane;
- per plane axis, an index outside the level reads the border texel under clamp_to_zero and
  clamp_to_border, and clamps under every other mode;
- a texture buffer's index outside reads its first texel, but under a runtime sampler's
  clamp_to_edge, which clamps it;
- the border texel is the sampler's color in the bound format's channels through its swizzle,
  the new BorderTexels specialization (metal::sampler::border_texels, RuntimeFact::BorderTexels).
A heap texture takes only the transparent black border (its handle's alpha flag); another border
color there, a ulong texel's border, and a read_write texture's read at a computed level are
refused, as cubes and sparse reads stay.

Why: the M3 Max measures these reads (three probes, macOS 27.0.1, -std=metal4.1; the module docs
list the formats, kinds and states). The fixture kernel_read_through's MSL is added here; its
compiled companions and the tests follow.

Verified: not yet built; this commit carries the lowering for the first build.
(cherry picked from commit 4c40ba03e693441d0618a8f41f68bebb47a1e1cd)
2026-11-10 01:30:10 -08:00
Anees Iqbal fb1644378e Runtime-sources: list lower/users.rs, the used-parameter walk lower/dispatch.rs reads
What: crates/metal2vulkan-validation/build.rs lists metal2vulkan/src/lower/users.rs as a
runtime input, and the runtime-sources pin follows. c009a039fb's lower/dispatch.rs (a
listed input) calls lower::users::params_used, so the runtime's inputs reached an
unlisted file.

Why: the validation suite's guard failed at 51f0139737 (msi job m3-max-13324):
candidate::engine::artifact::tests::the_runtime_sources_are_the_committed_ones,
'the runtime inputs reach files that are neither inputs nor listed: [(lower/users.rs,
{lower/dispatch.rs})]'. No behaviour changes: no RUNTIME_VERSION bump.

Verified: the guard test at this commit (a scoped potluck job, next).
2026-11-10 01:19:43 -08:00
Anees Iqbal 51f0139737 Re-bless the authored compile census at c009a039fb
SEMANTICS 2012 (c009a039fb): the new owned fixture engine/dfk_dead_rog and the regenerated fragment_rog (209 new golden cells, 4 inventory rows, air_input printouts); the census follows the new product fingerprint.

Its product fingerprint follows development's versions at c009a039fb. Blessed on the
M3 (s37-pl.sh censusbless --bless).

(cherry picked from commit a775d9e5d3ad655c0b0e350f1099640d05224bd7)
2026-11-10 01:03:35 -08:00
Anees Iqbal b48c2b906b Re-bless the engine inventory and golden tables at c009a039fb
SEMANTICS 2012 (c009a039fb): the new owned fixture engine/dfk_dead_rog and the regenerated fragment_rog (209 new golden cells, 4 inventory rows, air_input printouts); the census follows the new product fingerprint.

Blessed on the M3 (s37-pl.sh bless: bless_engine_inventory, the air_input printouts,
bless_golden_hashes, then the check step).

(cherry picked from commit 0d3d442c75252a00777d476b6003c76890dc5240)
2026-11-10 01:03:35 -08:00
Anees Iqbal c009a039fb The runtime-sources pin for deadrog's shared params_used in lower/dispatch.rs
What: the twelve commits before this one (deadfetch, steelbrain/deadrog 93aaa9c668):
a raster order group or an interlock is decided from the parameters the specialized
body uses (rog::declared, color_group::entry), and a declared [[color(n)]] input
with no attachment is refused InvalidDescriptor(ColorAttachment) as Metal refuses it
(pipeline::compile::color_inputs_attached, in stage_inputs and plan_one; the dead
fetch fix of 4d187515d7 had let it through). SEMANTICS_VERSION 2012. The pin moves
because lower/dispatch.rs, a listed file, now calls the shared
lower::users::params_used instead of its own copy of the same walk: no behaviour
changes there, so no RUNTIME_VERSION bump (the new refusal is the translator's,
covered by SEMANTICS).

Verified (deadfetch): Metal on the M3 (probe dead_ordered_and_unattached_reads.m,
job 13241, macOS 27.0.1, with and without the debug layer) makes and draws the three
raster-order shapes dead and live, 64/64 texels, and refuses an unattached color
input dead and live. Negative controls at base (13247): 12 split refusals, 6
interlocks, 4 RasterOrderGroups refusals, 2+4 unattached pipelines made. At the
fix (13276): 123/123 touched tests; lavapipe color_groups/framebuffer_fetch/
raster_orders 64/64 at both widths (profiles layer carried from msi); M3 MoltenVK
63/63 (13277). Rebased tip (13286): core 3414 + the 4 bless rows (209 new golden
cells, no existing row moved). Generators and api-signatures --check unchanged.
2026-11-10 00:56:45 -08:00
Anees Iqbal ac0ffe1c25 Probe measurements and the API guide for reads dead after specialization
dead_ordered_and_unattached_reads.m records what it measured on the M3
Max under macOS 27.0.1 (potluck job m3-max-13241): dfr_color,
dfr_buffer and dfr_output are made and drawn, dead and live, every texel
the closed form's, with the debug layer silent; dfr_lacks has no state,
dead and live ('Shaders reads from a color attachment whose pixel format
is MTLPixelFormatInvalid'). Its header names the tests and the lane that
read it.

docs/API.md's color-group refusal list now names a raster order group on
a color output or on a parameter the function uses; one on a parameter
it never uses orders nothing and is not refused.

(cherry picked from commit 93aaa9c6685770db04032b710ec7b36950b56f89)
2026-11-10 00:55:27 -08:00
Anees Iqbal 4bae61044e Check a fragment's color inputs for attachments on the keyed path too
color_inputs_attached ran in grouped_entry, which a stage's keys
(stage_inputs) reach only for a color group's variant, and the runtime's
creation compiles each stage from those keys under given inputs, where
no check ran. It now runs on the specialized entry, before any group
renumbers it, in stage_inputs and in plan_one, for a render pipeline's
fragment stage (InputsFrom::Fragment).

(cherry picked from commit 277cf7472f972d4812f870cfeec9fb4f7715fba5)
2026-11-10 00:55:26 -08:00