Commit Graph
8201 Commits
Author SHA1 Message Date
Anees Iqbal 2caf214316 Conformance tests: stand-in kinds that are not native notes
Degradation::ALL now starts with DeviceRoundedResolve, a native note the suite declares for
every case, so a_notice_we_announce_and_metal_does_not_is_divergent_until_it_is_named read
announced where it expects divergent (job m3-max-59204), and DeviceFilteredMipmaps, ALL[2], is
native too. The tests that took ALL[0], ALL[1] and ALL[2] as stand-ins now name GradFromBias,
PixelSamplerScaling and BicubicFilterArithmetic, none of them native.

Verified: cargo fmt --all; the conformance suite runs in the next check.
2026-11-20 09:14:21 -08:00
Anees Iqbal 4d5a25ac4f compressed_blits: the module doc names kept_encoding_notice without a link
The module is public and kept_encoding_notice is pub(crate), so the intra-doc link the first
commit of this range wrote failed workspace Rustdoc -D warnings (job m3-max-59204, step doc,
private_intra_doc_links). A code span names it instead.

Verified: cargo fmt --all; Rustdoc runs in the range's next gate.
2026-11-20 09:14:21 -08:00
Anees Iqbal 00b6fbe6a2 Conformance: two comment separators left behind by the shared-memory paragraphs
buffer-target-clears' and extended-range-blends' allowances each ended their comment on an empty
separator line where the removed paragraph had been.

Verified: cargo fmt --all. Comments only.
2026-11-20 09:14:20 -08:00
Anees Iqbal bd98c71f97 Conformance: prose no longer names notices the runtime never announces
Eleven passages still said the runtime announces a notice that is not a precision note's:
device-boolean-visibility (README.md and Loosening::Nonzero's doc), drawn-depth-copy,
emulated-simdgroups, render-pass-split, extended-range-blends-stored-codes,
restricted-depth-upload, optimized-depth-stencil-texture (texture-descriptor-pairs and
texture_query) and unmeasured-resolve, and rate-map-degenerate-forms and sampler-crossings still
described the shared-memory declaration. Each loses the clause; the facts about Metal and the
notes the runtime does carry stay.

Verified: cargo fmt --all. Documentation only.
2026-11-20 09:14:20 -08:00
Anees Iqbal 28b20187d4 CONFORMANCE-COVERAGE.md: regenerated over the declarations left
Regenerated with scripts/conformance-coverage/coverage.py after the shared-in-system-memory
declarations went: 43 modules declare a notice where 142 did.

Verified: the script wrote the file; its --check runs in the range's gate.
2026-11-20 09:14:20 -08:00
Anees Iqbal ba00965274 Conformance: the ledger's name, and mentions of the deleted runtime's policy
The known-gaps ledger is known-gaps-rt.tsv; 32 mentions in the conformance crate, its error
messages among them, still named known-gaps.tsv. compressed-blits and extended-range-targets
said the runtime rewrites no texel "under the suite's exact policy", a policy of the deleted
runtime; they now say what the runtime announces. The rotated-tiles probe no longer names the
deleted RotatedLoadTiles notice, and the engine fixtures' table no longer cites
runtime_lane::queue_storms for the spin kernel.

a_declared_notice_does_not_excuse_an_undeclared_one lists its two undeclared stand-ins in code
order, the order the divergence rows come in (job m3-max-59190 failed on the other order).

Verified: cargo fmt --all; job m3-max-59190 (clippy of metal2vulkan-conformance, all targets,
-D warnings) exit 0 on the range before this commit.
2026-11-20 09:14:20 -08:00
Anees Iqbal 23b8d08409 Conformance: no case declares shared-in-system-memory
The runtime's side announces only the codes of the precision notes its states, textures and
sampler states carry. shared-in-system-memory is not one: it was the deleted runtime's notice
for a Shared buffer on a device without unified memory. Every case that read an answer back
through a Shared buffer declared it, so the declaration held on no run.

What goes:
- the declaration in every case, and the prose and measurements that justified it;
- the allowances methods left returning nothing (the trait's default stands), and the helpers
  that only carried the declaration: replay::shared_memory_notice, fresh-contents' copy of it,
  mesh_draws::mesh_notice_allowances, buffer-tails' and buffer-textures' allowances,
  render-depth-stencil-state's pass_notices, blit-encoder-commands' NOTICES and its notices
  field, sparse-mappings' reaches_a_shared_buffer, format-footprints' shared_texture_buffers,
  and the entries of sample-positions' and visibility's notice lists;
- the SharedInSystemMemory kind, its ALL entry and its code;
- compressed-moves' prose about notices of the deleted runtime (staged-texture-copy,
  shadowed-texture);
- imports that only the removed code used;
- docs/FAST-PATHS.md's sentence on the declaration, and coverage.py's count of the helper.

The prose a removed paragraph shared with other notices is kept for those notices. Tests that
counted a case's declarations count what is left; that includes depth-resolve-pairs,
stencil-resolve-pairs and pass-attachment-pairs, whose counts the previous commit left at the
deleted kinds'. A new test, every_kind_is_a_catalogued_precision_note, holds every kind to an
entry of docs/API.md section 9; it fails on any kind no precision note announces.

Verified: cargo fmt --all. The gate runs once over this range.
2026-11-20 09:14:19 -08:00
Anees Iqbal a7320ad3f9 Conformance: no case declares a notice the runtime never announces
The runtime's side announces only the codes of the precision notes its states, textures and
sampler states carry (Degradation::from_precision_note). 66 Degradation kinds had no precision
note behind them: they were the deleted runtime's notices. A case that named one declared a
notice nothing can announce, and a value it loosened by one stayed loosened on no run.

What goes:
- every declaration of those 66 kinds, in 70 case files and the native-note set (six of its
  members were among them: float-tininess-after-rounding, unorm-depth-rounding,
  signed-depth-test, ycbcr-filter-not-exact, device-line-ties, device-subpixel-snap);
- the value tolerances justified by one: astc's and etc's compact-twin bounds
  (decoded-texel-precision), visibility's Boolean words (device-boolean-visibility),
  rotated-planes' unreached rotation-4 bands (rotated-load-tiles), sample-fills' wide depth
  digest (drawn-depth-copy), texture-fills' 32-bit float depth digests and fresh-contents'
  Depth32Float fresh site (restricted-depth-upload, fresh-pattern-zeroed);
- the replay helpers staged_records_notice, interlocked_split_notice and
  set_past_layout_notice, and every call of them;
- the 66 variants, their ALL entries and their codes;
- what only they used: the mesh pass notice list, the sparse notice lists, the GPU-time list,
  the buffer-blits and sparse-mappings rows' notices fields, buffer-target-clears' kept_image,
  buffer-texture-blits' copies_shared_bytes and its two tests, render-draw-forms'
  bounds-pass helpers, rotated-planes' band_is_reached and surface::stored_at,
  rotated-targets' reads_destination_alpha_in_color, visibility's boolean_words, and the
  module prose that described those notices.

The one backed kind whose name was not its note's, ImplementationDefinedReconvergence, is now
DeviceReconvergence with the code metal2vulkan-degrade-device-reconvergence, the note's kebab
name, and docs/API.md section 9 gains its entry. shared-in-system-memory stays for the next
commit. The tests that used a deleted kind as a stand-in use a backed one. Every case keeps
its shared-in-system-memory declaration; tests that count a case's declarations count what is
left. pass_start_reads no longer cites the deleted cost::the_creation_prediction.
docs/CONFORMANCE-COVERAGE.md is regenerated.

A case whose values the deleted tolerances held is now compared exactly; whether the runtime
differs there shows on the venues' replays.

Verified: cargo fmt --all. The gate runs once over this and the following commits.
2026-11-20 09:13:39 -08:00
Anees Iqbal a4540b3913 Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 09:10:37 -08:00
Anees Iqbal 9a1c8fe6dc metal2vulkan-rt takes the runtime's name: metal2vulkan-runtime, published
The cutover's last mechanical step. The old runtime is deleted, so its name is free: the crate
moves to crates/metal2vulkan-runtime, its package is metal2vulkan-runtime and its library
metal2vulkan_runtime, and every reference in the tree follows (sources, tests, scripts, CI,
generated tables and docs).

It is now a published crate, as AGENTS.md said it would be once it took the name: version 0.2.0
with the other two, the translator pinned exactly (=0.2.0, as the translator pins the AIR front
end), documentation, keywords and categories, and copies of the repository's four license files,
which the published-crates test now holds equal to the root's for three crates. CI packages it
with the others. Prose that said it was unpublished, or counted two published crates, says three.

AGENTS.md: facts only. The crate table row, the published-crates and version sentences, and the
paragraph on the old runtime, whose name the runtime now carries (listed for the owner).

Made by one script run on this tip. Verified by the job
named in the landing note.
2026-11-20 09:10:02 -08:00
Anees Iqbal 16c831165d Translator cutover: the old render key re-pinned at 2203; two tests take from_queries' answers (ninth part)
From job m3-max-59194 (5aeee89a90, the rebased tree; clippy, the
suites' test step and clippy --cfg m2v_gpu ran, then it was cancelled):
- pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value:
  the old runtime's key at SEMANTICS_VERSION 2203 is 459a25436a3c9b02,
  as that job reported (it was 8953dc9fc0ccf3b0 at the branch's 2202,
  325562c0e5657846 on development's 2202).
- engine_render_target_slice: amp_fragment's keyed inputs carry the
  push base the keys give a fragment function, the vertex function's
  push end (36 there); the expected inputs take it.
- engine_simd_emulated: the test keeps its name and claim. The flattened
  plan refuses a grid of [1, 1, 100] in threadgroups of [1, 1, 96] up
  front (LocalSize z, 96 past 64) and asks for the variant at
  [1, 1, 64], whose plan runs both regions. It no longer asks the
  variant's plan about [1, 1, 96]: on from_queries' profile that plan
  runs it in 2 regions (job m3-max-59194), which the up-front check
  refuses; that disagreement is reported for its owner.
2026-11-20 09:08:23 -08:00
Anees Iqbal 083c191f75 Translator: what the entry hooks remember past the floor's tail guard holds for the whole body
tests::engine_pointer_memory::accesses_through_a_loaded_pointer_read_no_root_entry_in_a_loop
failed on from_queries' profile (job m3-max-59099, all six arms: moltenvk-m3, lavapipe and
amd-rdna2-apu-radv, robust and not): the kernel's loop read one u64 through the root table on
every iteration. Under Device::new it read none.

The cause is the floor's push window, not a switch, a hoist or a forwarding pass. Device::new's
profile placed its push fields in the guaranteed 128-byte window, which has no tail;
from_queries' places them on the floor, whose tail guard (push::emit_tail_guard) reads the
tail in the first block and returns from an arm. The hooks after it run in the guard's merge,
access::dynamic::emit_entry among them, which reads the sink's address there and remembers it
(Invariant::SinkHost). The walk's first block then forgot every memo entry outside the
function's entry block (EmitCx::unwind), so each contained access in the loop read the sink's
host from the root table again. A driver cannot hoist that read: the loop stores to device
memory.

Now EmitCx keeps the block the hooks end in (hooks_block), which dominates every block of the
body, as it keeps the entry block. A memo entry made there is recalled in the body and outlives
the walk's blocks. That is right on every device: the root table is read-only to the dispatch,
the binder writes it before submission and no lowering stores to it. So it is the one form,
with the test unchanged.

Expected: the test passes; it waits for the next job.
2026-11-20 09:08:23 -08:00
Anees Iqbal 322b5de3cc The runtime sources re-pinned on the rebased tree
runtime_pin.py (the validation build script's fingerprint, replicated;
it reproduces development's 3fd40802ce at c0403a1c98's successor
7c43b97cda) gives eaf5a47505 over the 141 inputs at the rebased tip,
RUNTIME_VERSION 2541.
2026-11-20 09:08:23 -08:00
Anees Iqbal d58835f5da SEMANTICS_VERSION 2203: the cutover's translations over development's 2202
Development took 2202 for the identity-domain change (3cdca62567) while
this branch's cutover had taken 2202 too; rebased onto c0403a1c98, the
cutover's modules, refusals and notes differ from both, so the version
moves past both. The old render descriptor key hashes the version; its
pin follows from the next job's output.
2026-11-20 09:08:23 -08:00
Anees Iqbal 05fcefc24d Translator cutover: tests take Device::from_queries' answers (eighth part)
Job m3-max-59099 (dab3c5fe42) left six of these red besides the tables:
- engine_fragment_imageblock: at four samples the plan of the variant
  that tests depth in the shader is refused (FramebufferFetch,
  NotImplemented, at the depth attachment), as no profile states which
  depth a sample-rate FragCoord holds; it was the variant's compile.
- engine_native_half: on RADV the controlled half sum records no note
  (half held at 16 bits under the controls); the narrowing alone, a
  conversion pair, records NativeHalfConversion.
- engine_render_target_slice: amp_vertex_layer's slice differs among a
  primitive's vertices, so on RADV the synthesized geometry stage
  stores it: the vertex function declares no Layer in either variant,
  and the pipeline declares Layer only where the variant keeps it.
- engine_sampler: each stage's unconditional notes are now the device's
  own sampling, texel conversion, denormals and NaN bits beside its own.
- engine_simd_emulated: a deep threadgroup runs on both pipelines on
  from_queries' profile, so a grid of [1, 1, 100] in threadgroups of
  [1, 1, 96] asks for the variant as one of [1, 1, 64] does (renamed
  a_mixed_dispatch_runs_on_the_variant).
- engine_viewport_compensation: the bounds become 130, 250, 280 and
  380 words (at most 129, 247, 276 and 375 measured in that job).

Verified: only as far as m3-max-59099's output for the old forms; this
commit's expectations wait for the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal e19e49c782 RUNTIME_VERSION 2541; the runtime sources re-pinned
The cutover changes what a run of an unchanged artifact does: the profile
is derived from Vulkan queries alone, the policy switches and driver
facts are gone, and the binder's check modules (bind::view_check,
bind::check_draw) are deleted. So RUNTIME_VERSION moves from 2540 to
2541, and validation's runtime guard pins the inputs' new digest,
533daddb0abdb3a34d2eadec92724e5bee8fe5039736db727f775ee1c20963ab (141
inputs, from 145: device/driver_facts.rs, device/gpus.rs and the two check
modules went), computed by a replica of build.rs's hash at this tree.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal 3025e35627 Validation: devices come from Device::from_queries; engine_roll's chain test takes MoltenVK's profile
Device::new went with the cutover: validation's acceptance, engine,
coverage, worker and test sites derive their devices through
Device::from_queries. The roll test's chain case takes moltenvk-m3's
profile where it read the deleted moltenvk_floor helper.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal 30e6818799 Translator cutover: tests take Device::from_queries' answers (seventh part)
No profile takes Apple's premultiplied blend, so the accumulated straight
pair takes the general second-output form. A multisampled in-shader depth
variant is refused as not implemented: no profile states which depth a
sample-rate FragCoord holds. The argument-table spill test of a 128-byte
push window, below the floor, goes with its kernel. The heap storage
encode's note follows the heap's sRGB alias conversion. RADV's controlled
half pair notes NativeHalfConversion. The precision contract loses its
Metal-functions arm. The mixed-dispatch test keeps development's
expectations. The mesh region check reads the push and the argument
tables, and the pointer loop test reports every profile.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal 3cb16deb67 Validation: the sink withholds no driver diagnostic; the unadvertised-vertex pass goes
The driver facts went with the cutover, and with them the two MoltenVK
warnings validation's message sink withheld (a dynamic primitive restart,
a blend-enabled attachment of a format it cannot blend) and
DriverDeviation::MetalVertexSimdgroups, which no profile takes now. The
sink's per-call expectation (expecting_diagnostics, withholds), its
per-device making list, VulkanContext::executing_driver_facts, the
graphics pipeline builder's facts argument and candidate::unadvertised_stage
go; the sink still passes the loader's ignored-driver reports and
MoltenVK's set-layout report. On MoltenVK, below rt's floor, the two
warnings now fail the rows that draw them. The translator tests' and the
profiles README's prose stop naming exact_answers and driver_facts.rs.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal cd94fb81f0 Validation: devices take the default policy; the runtime inputs drop the deleted device files
DevicePolicy::exact_answers went with the policy switches it set, so
candidate::requested_policy goes and its three callers (the corpus
pipeline's leg device, the native-refusal device and the opened
context's device) take DevicePolicy::default(). build.rs's runtime
inputs no longer list device/driver_facts.rs and device/gpus.rs, which
the cutover deleted.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal b0dc5be83c Translator cutover: tests take Device::from_queries' answers (sixth part)
Every device samples through its own sampler and reads a two-plane
YCbCr texture in place: the sampler, sRGB, swizzled-storage, YCbCr and
specialization tests lose their Metal-sampler arms; the runtime-sampler
filter-note test of MoltenVK goes with its arm; a half texel takes the
device's NaN, noted, with no measured half conversion, texel write or NaN
move; a normalized vertex format notes the device's conversion on every
device. Every tessellator orders its own triangles; every kernel declares
DeepThreadgroup; no product merges opposite zeros; the threadgroup tests
lose their contained Device::new arms; MoltenVK refuses a per-vertex
layer without geometryShader and has no vertex subgroups or quad control;
the roll, render-target-slice, stage-I/O tail and SIMD tests take one
profile's answer. Two tests that baked in the base-0 fragment inputs take
the keys' push base (the compiled-stage round trip, the dense-by-link
test, which now asserts the keys' pipeline key is the compile's). The old
render descriptor key's pin moves with the profile:
7db91256cad4f906a76cb491703c77a1a5d26767149739c836ff0d626da9715e ->
8953dc9fc0ccf3b0170cbcea480b9655fea79417273334e042cbf25d63c3b799.
The viewport-compensation and cubic-sampler tests collect every
deviation before asserting.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal f48d8ff28a Translator cutover: tests take Device::from_queries' answers (fifth part)
Every device reads an interpolation offset from the pixel's center and
takes no driver workaround but the clipped-coverage and tessellator ones:
the pull-model test drops RADV's extrapolation note, its whole-quad and
lavapipe's split-triangle refusals and MoltenVK's 7/16 origin; the
multisample tests read every center varying through a centered
InterpolateAtOffset. The maths functions are the device's on every
profile, MoltenVK's float dot and mix noted too. A controlled half pair is
noted on every device and NVIDIA's profiles take the controlled form: the
two controlled-pair tests become one, and the NVIDIA test drops its device
ID variants; MoltenVK's half conversion and widening are lavapipe's, with
no measured fact. Function storage is the 16 KiB floor: the private-memory
and recursion tests take its sizes and the tile test the RDNA 3 profile as
it is. The narrow-wrap tests keep from_queries' one profile, the
render-state tests lose their Device::new arms, and the Metal-sampler
anisotropy test goes with the arm it tested. The pointer loop test prints
the loads it finds.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal 20292c789e Translator: a render pipeline's keys start the fragment's push fields at the vertex function's end
On the floor a render pipeline pushes one range: the vertex function's
fields from 0, then the fragment function's from the vertex function's
push end (LoweringInputs::push_base, CompiledFunction::fragment_push_base).
compile_render_variant lowers the fragment from that end, but
render_variant_key and render_pipeline_key handed out the fragment's inputs
at push_base 0. So wherever the vertex function pushes fields, the keys'
pipeline and fragment keys were not the compile's, and keys.fragment named
the lowering at base 0 for a pipeline that lowers it at another base.

render_variant_key now takes the vertex stage's push end from its plan: a
Function vertex stage is decoded and specialized (the entry the creation's
StageEntries holds, so a creation specializes it once), analyzed and
selected, and the end of the push range its plan places is read; nothing
is emitted (pipeline::compile::vertex_push_end). A vertex stage is selected
once in a compile (the stage bound's second selection is a kernel's
alone), so the plan is the compile's. A Compiled vertex stage states its
end (fragment_push_base). The fragment's FragmentPass carries it, so its
inputs, its key and the pipeline key are the compile's.

metal2vulkan-rt took its own form of this: lower_stages set the fragment
inputs' push_base from the vertex lowering. That goes; rt lowers each stage
under the keys' inputs as given. On rt's cold make (no record of the
content) the added work is one selection of the vertex function inside
render_variant_key: it reads the plan and lowers nothing; the vertex and
fragment functions are each lowered once, as before. The lowerings are the
same as before: the base rt set is the one the keys now carry, so each
fragment lowering's key is unchanged. The record cache key is the
descriptor's queried key (Device::queried_render_descriptor_key), which
this does not read, so it is unchanged for every vertex function, pushing
fields or not, and the record's version stays.

Tests: the viewport-index test and the unbindable-vertex-buffer variant
test take the keys' fragment inputs as given and keep their asserts that
the keys' pipeline and fragment keys are the compile's (the latter also
asserts the inputs' push_base is the lowered vertex function's end); rt's
record test asserts its record names the lowerings of the translator's
keys.

Unverified: compiled by the next job.
2026-11-20 09:08:22 -08:00
Anees Iqbal e7a2f24a9a Translator cutover: tests take Device::from_queries' answers (fourth part)
No profile takes a driver deviation: the half-storage notes hold on every
profile, the heap alias and chosen-sample tests take the device's own
answers, the heap YCbCr filter note and the SPIRV-Cross helper picks go
with their arms, and the helper-thread tests run on Intel's ANV, which has
demote and shaderQuadControl, beside a copy of it without demote. Every
device reads a center varying through a centered InterpolateAtOffset: the
multisample tests drop MoltenVK's own read and its driver-keyed bias, and
the portability member's test runs on moltenvk-m3 alone. Device::new's arms
go from the identity tests, with the window-past and pushed-region tests;
a kernel declares its dispatch keys (local size, multi-region, deep
threadgroup). The push window is the floor's: the link tests compile their
fragments from the color-writes map, the variant-key test from the vertex
function's push end, a mesh pipeline may push nothing, and a mesh dispatch
region may sit in the argument table. The metered walks take a profile at
the floor's push bytes and one holding 192 KiB of Function storage.

Unverified: compiled by the next job.
2026-11-20 09:08:21 -08:00
Anees Iqbal a73b54a0f8 Translator cutover: tests take Device::from_queries' answers (third part)
An absent read takes zero and marks nothing on every profile, so the
absent-handle, absent-threadgroup, gated-slot and function-constant tests
assert no fact, no status and no binding; the storage-limit test of the
status binding goes. No profile takes a driver deviation or the
coverage-loop, whole-quad, push-payload or early-tests workarounds, so the
tests drop those arms: alpha coverage, heap and half-storage NaNs, the
per-sample coverage loop and its natural functions, the storage view's
bind-offset read, the imageblock's early tests and MoltenVK's fast-math
float functions. MoltenVK has 32-lane, maximally reconverging subgroups
without vertex subgroups: the tangle barrier test takes it beside the
RTX 5080, the lockstep conflict tests run on lavapipe and roadmap-2022, and
the tier table's MoltenVK vertex row is -,xO,xO,xO,xO,xO,xM. Function storage
is the 16 KiB floor: the frame tests take it and the interpreter's deep
stacks use a test profile holding 192 KiB. A half fast chain on a device
without shaderFloat16 rounds at its exits. The variant-key test lowers its
stages as the runtime does, the fragment's push fields from the vertex
function's end.

Unverified: compiled by the next job.
2026-11-20 09:08:21 -08:00
Anees Iqbal f5ae95b44e Translator cutover: tests take Device::from_queries' answers (second part)
The amplification and cache tests that drew on MoltenVK's views move to
nvidia-rtx50-linux (32 views, geometry shader); MoltenVK refuses a vertex
function that writes its layer (LayeredRendering needs the geometry
shader). Arithmetic tests read one float-environment column for every
profile, and a half FMA follows half_controls. The fragment tests lose the
MoltenVK workaround arms and the split-quads note; a four-sample depth or
stencil test in the shader is refused at the depth attachment on every
device, as no profile states where FragCoord.z is evaluated. The rotated
blend's straight-alpha case takes copies of the source alpha in every
lane; the colour-write sweep loses the 16-bit unorm arm no profile takes.

Unverified: compiled by the next job.
2026-11-20 09:08:21 -08:00
Anees Iqbal f7e47b7df4 Translator cutover: tests take Device::from_queries' answers (first part)
The tests that checked an arm Device::new's profile took (a driver
deviation, a driver workaround, a measured fact) go with that arm; the
tests whose subject survives take the one profile from_queries derives.

- Threadgroup memory starts at zero, so a profile without
  shaderZeroInitializeWorkgroupMemory (vk12-floor,
  lunarg-desktop-baseline-2023) refuses every function that uses it.
  Tests of threadgroup, tile, imageblock, mesh-emulation and emulated
  simdgroup kernels move to roadmap-2022 (16 KiB, emulated simdgroups)
  and swiftshader, or iterate spirv::testing::threadgroup_profiles, or
  skip the refusal (spirv::testing::refuses_threadgroup_memory). The
  coherent-access and device-replay tests add lavapipe without the
  Vulkan memory model, and without device addresses, so the second form
  of each still runs.
- Threadgroup accesses are not contained (one past the memory is
  undefined, as in Metal): the containment tests of the arena and typed
  threadgroup objects go, the census names lose .checked and .clamped.
- No profile takes the MoltenVK deviations or workarounds: the
  serializer's MoltenVK materialization tests (array_copies,
  localized_loads, loop_reads), the vertex-simdgroup, min/max,
  measured half arithmetic, early-tests and split-pixel tests go; the
  device's lockstep (SimdgroupLockstep) is never taken, so moltenvk-m3
  takes emulated simdgroups where no subgroup barrier orders a pair.
- A deep threadgroup runs as one row: max_threads_per_threadgroup is the
  capped invocations on every axis.
- The floor's one render push range: a fragment function's fields start
  at its vertex function's push end, so a render pipeline's keys are
  the compiled pipeline's only through fragment_push_base.

So far, deleted / updated by module:
  device::tests::profile 0/1, device::tests::subgroup 1/2,
  lower::arith::tests 1/0, lower::arith::tests::narrow 0/1,
  lower::fragment::fetch::tests 0/1,
  lower::sampler::face::tests::routines 0/1,
  pipeline::compile::tests 0/2, pipeline::link::tests 0/1,
  pipeline::link::tests::render 1/2, pipeline::rotated_blend::tests 0/1,
  spirv::serialize::tests 7/0, tests::engine_absent_threadgroup 0/1,
  tests::engine_agx 0/1, tests::engine_arena 2/9,
  tests::engine_atomics 1/7, tests::engine_binder 0/1,
  tests::engine_chosen_pointers 0/1, tests::engine_copy 0/1,
  tests::engine_device_replay 0/2, tests::engine_divergent_barriers 0/4,
  tests::engine_handles 0/1, tests::engine_imageblock 0/12,
  tests::engine_mesh 0/6, tests::engine_mesh_barriers 0/2,
  tests::engine_places 0/1, tests::engine_pointer_cells 0/1,
  tests::engine_refused_families 0/1, tests::engine_simd_emulated 0/7,
  tests::engine_simd_lockstep 0/9, tests::engine_texture_levels 0/1,
  tests::engine_tile 0/9, tests::engine_typed_clamp 0/3,
  tests::engine_typed_threadgroup 0/4, tests::engine_volatile 0/2,
  tests::engine_zeroed_threadgroup 0/2.

Verified: not yet; the next job runs clippy and the suite.
2026-11-20 09:08:21 -08:00
Anees Iqbal dbad964165 Translator cutover: docs that named the removed profile facts say the one form; two broken private doc links fixed 2026-11-20 09:08:21 -08:00
Anees Iqbal 51be813915 Translator cutover: the device checks' modules go (bind::view_check, bind::check_draw)
Only the old runtime's device checks ran them: its view check, which measured the two view cost
facts into the description's measured set, and its check of render targets in place over host
pages. The signature table and api_surface drop them; API.md drops the measured set.
2026-11-20 09:08:21 -08:00
Anees Iqbal 97b5c1b65b Translator cutover: SEMANTICS_VERSION 2202; the API signature table and REFUSALS.md regenerated
The profile and the lowering of every device made through the removed constructor change, and
the removed switches' outputs go: the version bump misses every cached artifact. The signature
table drops the removed public items (blessed by scripts/api-signatures/signatures.py, source
only); REFUSALS.md loses the stage bound's defect site and the absent read's device refusal.
2026-11-20 09:08:21 -08:00
Anees Iqbal 77a66a19bf Translator cutover: API.md and the workaround docs name the one profile; unused test items go 2026-11-20 09:08:20 -08:00
Anees Iqbal 21487adb21 Translator cutover: second trial-compile fixes (unused items of the removed facts) 2026-11-20 09:08:20 -08:00
Anees Iqbal aaa3213887 Translator cutover: first trial-compile fixes (imports, the half pair, push tests, removed routes) 2026-11-20 09:08:20 -08:00
Anees Iqbal 0b94d919d9 Translator: the DevicePolicy switches, the driver-fact tables and Device::new go; Device::from_queries is the one constructor
Work in progress of the cutover's translator lane: the policy keeps the pointer and handle
domains, containment and isolation; the profile is derived from Vulkan queries alone; the
measured description set, the per-identity function storage table and the fact pairs of the
profile go with docs/FAST-PATHS.md and tests::fast_paths. Not yet compiled.
2026-11-20 09:08:20 -08:00
Anees Iqbal b100185a2d Re-derive the generated documents at the landing tip
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.

Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
2026-11-20 09:07:17 -08:00
Anees Iqbal 9b1da87a62 rt test: a signal from a queue three submissions deep goes at once to a held waiter on another
What: every_device_sends_a_signal_from_a_queue_three_deep_to_a_held_waiter_on_another_queue, for
a plain event and for a shared event. Queue A has three busy submissions in flight, so its next
fill is held in a group. A waiter on queue B is host-held for a value nothing has promised. A
command buffer on A that signals that value then sends A's group at once, the held fill with it,
and the waiter on B goes after it: two submissions, both made before the busy work ends. The
waiter is counted once in Metrics::event_holds.

Why: it pins the rule that a held group never keeps back an event's signal (submit.rs, step: a
staged segment with a signal returns Goes whatever the queue's depth in flight), so no link of
an event chain waits on rt's grouping for its signal.

How verified: the lane's small gate on lavapipe. It runs clippy of the runtime in all three cfgs
and the full rt suite once, then this test with the signal term removed from the last segment's
send condition (FAIL) and as committed (PASS).
2026-11-20 09:06:49 -08:00
Anees Iqbal 7049c249de rt test: the upload grouping test sends the group only once both command buffers are staged
What: every_device_orders_a_copy_after_a_copy_in_two_uploads_of_one_submission waits for both
command buffers to leave Committed before it calls send_now. That means both are staged into the
group the queue holds behind the busy work. The trace gains that step.

Why: the trace of the split (job m3-max-59017, run 2 of 2, full rt suite on lavapipe) read "4
sent, 1 seen, busy false" at every step up to the send, then 6 sent. Nothing went early on its
own; the two submissions came from the send. send_now(next) sets the queue's send_through to
next's place. When the submit thread, woken late on a loaded host, then stages the first command
buffer into a group of its own, `send_through >= group.first` sends that group at once, before
next joins it. So the uploads went in submissions 5 and 6.

The early send is valid: a host wait for a command buffer sends what is ahead of it, and Metal
promises nothing about how many submissions carry it. The test, though, is about the barrier
between two uploads in one submission. So it now makes that precondition its own: the group goes
only once both are in it. The other tests that send a held group already wait for each held
command buffer to leave Committed first. The remaining candidates were ruled out by the test's
sizes and calls: the half-region flush (1 KiB uploads), a room-full wait, a shared Held release,
and ready_value.

How verified: the full rt suite on lavapipe under the lane's gate, with this commit on the
branch tip.
2026-11-20 09:06:49 -08:00
Anees Iqbal 152672c212 rt test: the upload grouping test traces each step's counts
58870 split the two uploads again at 76812775f1, under the full suite on a loaded node, with the
queue's expected run set and the completion thread idle. When the uploads go in two submissions,
the assertion now names, at each step of the body, the submissions counted, the progress the
completion thread has seen and whether it is in a round.
2026-11-20 09:06:49 -08:00
Anees Iqbal 5d5827b16a rt tests: the busy work's grouping takes its expected run as the test's own input
every_device_orders_a_copy_after_a_copy_in_two_uploads_of_one_submission once put its two
uploads in submissions 5 and 6 inside the full suite on a loaded node (job m3-max-58795, at
d68b3067cc, before the completion-thread form). It passed 15 of 15 runs alone (m3-max-58847).
Its grouping turned on a measured GPU run. behind_busy's empty command buffer set the queue's
expected run, and a held group joins only while the members' expected runs, summed, stay within
GROUP_RUN (16 ms). The group goes member by member (apart) where they pass it at the send. A
group sent only once the busy work opened went at whatever run the busy command buffers'
retirements then left. On lavapipe under load either timestamp pair can measure milliseconds.

Now behind_busy sets the queue's expected run to BODY_RUN (1 ms) through a cfg(test) setter,
QueueInner::set_run_for_test. It does so after its first command buffer retires and once the
completion thread waits on the GPU again (Done::busy), so a commit in the body is held, not sent
as that round ends. The bodies that count a group's submissions now send it before the busy
work opens:
- the upload test sends with send_now and waits for the submission;
- every_device_joins_a_held_group_only_within_its_expected_run does the same;
- every_device_retires_a_group_in_commit_order_each_with_its_own_times waits for the send that
  its ended command buffer's commit starts.
The tests that seed a run with QueueInner::ran now start it from 1 ms, not from a measurement.
When the upload test's grouping differs, its message names both submission numbers and the
queue's expected run as the group went. No product path changes.

Read for the same dependence: the other behind_busy bodies in tests/command.rs, fence.rs and
upload.rs count submissions only before the busy work opens, or for a single held command buffer,
or send at an event signal or wait as the group is staged.
2026-11-20 09:06:48 -08:00
Anees Iqbal 4730af16e7 rt: a command buffer waiting for a shared event's value is Scheduled as it is submitted
What: the status hold for shared-event waits is deleted:
- hold(), Pending::held and QueueInner::held;
- the completion thread's held list and due();
- EventState::holds and its host-set wake, EventInner::shared;
- the hold_completions test seam, which only the deleted test used.
A command buffer whose wait's signal is submitted is now scheduled as its last segment joins a
submission, its scheduled handlers run then, as for a plain event's wait. A presenting one is
scheduled after vkQueueSubmit2, as for any other. Its queue's later command buffers are no
longer held behind it. Waits on a value that neither the host has set nor a submitted signal
promises stay host-held by the submit thread, as before: every queue submits to one VkQueue,
and a wait submitted ahead of its signal would hold the signal too (vkspec 8432; 6.6, 8985).
Metrics::event_holds counts those.

Why: the hold rested on an M3 recording (event-wait-behind-a-running-signal), not on documented
Metal. MTLCommandBuffer.h:47-48 describes Scheduled as "All dependencies have been resolved and
the command buffer has been scheduled for execution", and :405-406 describes
encodeWaitForEvent:value: as a command that "pauses execution of this command buffer until the
specified event reaches a given value". So execution pauses after scheduling. On the RTX 2080
walk, after the walk's clock correction, the hold lasted p50 5 ms and p90 9 ms per interval, in
command-buffer counts; the 33.6 ms read earlier as the hold was the submit stage, before that
correction.

What the deletion removes, in the walk's terms: a command buffer's kernel start is its commit,
raised to its queue's previous command buffer's scheduling where that is later, and its kernel
end is its scheduling. So a held command buffer's late scheduling also delayed the scheduling
of every later one on its queue. The deletion removes the held command buffers, and that chain
behind each one, from the span before staging. What is left there is the submit thread's own
pace: its passes over other groups, their calls and queue locks.

Scope of the claim:
- It changes nothing about GPU order or when a waiter completes: the wait still goes to the
  driver with its submission, as before.
- It changes when the guest's threads and handlers see Scheduled: a frame loop waiting on
  Scheduled no longer makes one GPU-to-host round trip per link.
- Its effect on presents per second is not known until the walk at the pin.

Docs: CommandBufferStatus::Scheduled, add_scheduled_handler, Device::new_shared_event, the
runtime README's submission and handler paragraphs (quoting both header lines so the hold is not
brought back from a recording), and docs/API.md's accepted differences. The conformance case
event-wait-behind-a-running-signal declares the shared-event row's status and handlers loosened
on the runtime by that entry, and its test checks that a status other than Committed or
Scheduled is still a row.

How verified: the lane's lavapipe gate on this series' tip tree, and the negative job for the
two tests of the commit before (FAIL there, PASS at the tip).
2026-11-20 09:06:48 -08:00
Anees Iqbal 7f2ba521b1 rt tests: a waiter is Scheduled as it is submitted, and a shared-event chain goes ahead of its first link
What: two lavapipe tests replace every_device_schedules_a_wait_for_a_shared_event_once_its_value_is_reached.
- every_device_schedules_a_wait_for_an_event_s_value_as_it_is_submitted: a command buffer whose
  wait is met only by a submitted signal not yet run reads Scheduled as it is submitted, with
  its scheduled handler run, and so does its queue's next command buffer. This holds for a plain
  event's value and a shared event's alike.
- every_device_submits_a_shared_event_chain_across_two_queues_before_its_first_link_runs: five
  links on two queues, each waiting for the shared event's value the link before signals, the
  first behind a value the test gives last.
  - Every link reads Scheduled, its handler run, while the first has not run, and
    Metrics::event_holds counts none of them.
  - Once the first is let go they complete in order.
  - A link waiting for a value nothing promises stays Committed until the host sets it, and is
    the one hold counted.

Why: the shape of the RTX 2080 walk's present path, about five held links a frame on two
queues. This commit adds the tests alone. They fail here, where rt holds a shared event's waiter
at Committed until the value lands. The next commit removes that hold.

How verified: the lane's negative job runs both tests at this commit (expected FAIL) and at the
form's commit (expected PASS).
2026-11-20 09:06:48 -08:00
Anees Iqbal fb4b77048c rt counters: the segments the submit thread holds for an event's value, by length
What: Metrics::event_holds, a histogram in the stage histograms' 23 log2 buckets. It counts the
segments the submit thread held for an event's value that neither the host had set nor a
submitted signal promised. A hold starts when the thread, with nothing left to stage, finds a
queue's head segment waiting (WorkState::mark_holds). It ends at the segment's staging, once the
host set the value or the signal was submitted. A wait whose signal is submitted is never held:
it goes to the driver with its submission. Relaxed, always on.

Why: an RTX 2080 walk put the present path's largest stage in rt's handling of event waits. A
walk needs to be able to tell from counts how many waits the host held, and for how long.

How verified: compiled and tested by the lane's lavapipe gate on the branch tip; the chain test
in the commits after it reads the counter.
2026-11-20 09:06:48 -08:00
Anees Iqbal 33a45215ea rt counters: what pipelines_created and translations count, as they count it
What: two doc comments, with no counter changed.
- Metrics::pipelines_created now says that a VkPipeline is counted as its vkCreate*Pipelines call
  returns it, made at a state's creation for a content the device does not hold or at a first
  use. A state of a held content makes none, a call still inside the driver is not counted yet,
  and a failed one is never counted.
- Metrics::translations said it counted the kernels of compute contents only. Render lowerings
  count there too: render.rs lower_stages calls pipeline::lower, which counts. It now says so.

Why: a walk on the RTX 2080 counted 110 pipeline events inside an 8.4 s gap while
pipelines_created stayed flat. The docs gave no way to tell whether the two disagreed. They do
not: state creations of held contents make no VkPipeline.

How verified: Rustdoc -D warnings in the lane's gate on this tip.
2026-11-20 09:06:48 -08:00
Anees Iqbal 4c808ffa6d rt: every free of device memory on a normal path is the block-maker thread's
What: three frees move from the reaper to the block-maker thread's queue:
- a texture's or a shadow's allocation of its own (Backing::Own);
- a surface plane's import (Backing::Import);
- a copy's staging buffer of its own.
The reaper gives the first two up, and a staging buffer's drop gives itself up (Pool::give_back_loose,
memory::Loose). The block-maker thread frees each one, after the imported and exported blocks
given back, through its form of every free (SubmitCalls::free): it first waits out the submit
calls its previous memory call met, and the submissions made during the free are counted.
Metrics::submissions_during_frees and submit_call_nanos_during_frees now cover these frees. The
teardown frees what is still queued after the reaper's drain. Free::Staging is deleted. What
still frees on its own thread is a call's undo of what it made and did not use, and the
teardown's frees.

Why: these frees ran on the reaper beside the submits, in plain vkFreeMemory calls back to back,
uncounted. A copy's staging buffer is Shared memory, larger than the 16 MiB region. On the RTX
2080 a 16 MiB Shared free takes 17.1 ms and holds every submit of the process for its length.
With one rule, a submit waits out at most one free, and every such free is counted, so a walk can
say by count whether frees hold its submits. Nothing is kept: the memory goes back as promptly as
before, one hop later.

How verified: the lane's lavapipe gate on this tip (fmt, clippy in every configuration, Windows
clippy, Rustdoc, signatures, the rt suite), and a negative job running
every_device_frees_a_copy_s_staging_buffer_on_the_block_maker_thread at the test-only commit
(FAIL) and here (PASS).
2026-11-20 09:06:48 -08:00
Anees Iqbal ab06175c7f rt test: a copy's staging buffer is freed on the block-maker thread
What: a lavapipe test makes a copy larger than the 16 MiB staging region. The copy goes through
a staging buffer of its own into a 2304-texel-square texture, with the block-maker thread's frees
held open (the hold_frees seam). Once the copy completed, the test asserts four things:
- the buffer's free is held open on that thread;
- a submission made then is counted in Metrics::submissions_during_frees, with its time in
  submit_call_nanos_during_frees;
- the buffer's memory is still a block;
- once the frees go on, the memory is freed.

Why: a copy's staging buffer of its own is Shared memory, the type a driver may hold submits
behind for the length of its free. Today the reaper frees it with a plain vkFreeMemory beside
the submits, uncounted. This commit adds the test alone, which fails here because the free never
reaches the block-maker thread. The next commit routes the free there.

How verified: the lane's negative job runs this test at this commit (expected FAIL, timed out
waiting for the held free) and at the form's commit (expected PASS).
2026-11-20 09:06:48 -08:00
Anees Iqbal 09735ad792 rt counters: each submit call that meets a free, its time, and the pool's allocations remade
What: Metrics::submissions_during_frees now counts the vkQueueSubmit2 calls that met one of the
block-maker thread's vkFreeMemory calls, not only those made while one was in progress. A call
made during a free is counted as it enters the driver, as before. A call that a free began beside
is counted as it returns: SubmitCalls counts the frees begun, and each call compares the count at
its entry with the count at its return. Metrics::submit_call_nanos_during_frees sums those calls'
time inside the driver, which is the time a driver may have held them behind the frees.
Metrics::shared_remade_after_frees and private_remade_after_frees count the pool's allocations
made within a second after the block-maker thread freed an idle allocation of their class: memory
given back and taken again, the pool looping.

Why: a walk on the RTX 2080 showed vkQueueSubmit2 at 16.7 ms p90, about one 16 MiB Shared free.
The count alone could not say how much submit time sat behind frees, or whether the pool gave
back memory that it took again a moment later. All four are relaxed atomics, always on.

How verified: compiled and tested by the lane's lavapipe gate on the branch tip; the test that
reads the new time is in the next commits.
2026-11-20 09:06:47 -08:00
Anees Iqbal 1c26e1dc54 rt tests: a refused kernel names its KernelInputKind, one test per kind lavapipe meets
A probe ran every engine fixture's kernel through new_compute_pipeline_state on lavapipe
(m3-max-59166, at the commit before this one). 38 states were refused as Gap::KernelInput:
- 34 of kind RuntimeFact, every one a kernel over an explicit imageblock;
- 4 of kind Slot, kernels that take a visible function table.
A [[stage_in]] kernel reaches rt only under a stage-input descriptor. Without one, the
translator refuses it first (needs StageInputDescriptor).

Three device tests assert the kind and that the refusal's text ends with it:
- stage_in_fetch under a descriptor of its four attributes: StageIn;
- a4_imageblock_extent: RuntimeFact;
- visible_table_dispatch: Slot.
No engine fixture's kernel meets the other kinds on lavapipe.

The README's known-gap lines that name Gap::KernelInput now name its kind:
- a [[stage_in]] argument is StageIn;
- an explicit imageblock is RuntimeFact;
- a function table is Slot.
The three list items they sit in are rewrapped, with their words otherwise unchanged.
2026-11-20 08:47:42 -08:00
Anees Iqbal 98895eb6d2 rt: Gap::KernelInput names what the kernel reads, a KernelInputKind
A guest boot (arm64 macOS 15) met one Gap::KernelInput refusal at
newComputePipelineStateWithDescriptor:options:reflection:error:. The refusal said no more than
"the kernel reads an input the compute encoder does not supply yet", so it could not be ranked
by its cause.

Gap::KernelInput is now KernelInput { kind: KernelInputKind }. Its text ends with the kind, and
the kind is decided at the site that finds it:
- interface()'s six checks of the translator's pipeline: PointerTranslation,
  HandleTranslation, CommandBuffers, StageIn, DescriptorSet (a set that is not the device's),
  StageFlags (flags other than full or varying subgroups);
- its later checks: RuntimeFact (a fact the encoder does not name), Slot, PushField,
  ConstexprSampler, ArgumentBlock, PushBytes, Specialization, Workgroup;
- Kernel::new's entry point with a NUL byte: EntryPoint.
A variant that samples a constexpr sampler its module does not, and a constexpr use whose
sampler the translator cannot state, are ConstexprSampler.

interface() returns the kind itself, and Kernel::new returns an Unmade (the kind, or
vkCreateShaderModule's result). So a variant's lowering keeps the kind in
Lowered::Unsupplied(kind), and nothing has to tell a module's failure from a refusal by a
wildcard. Each variant's doc comment names its Metal counterpart.

docs/REFUSALS.md is regenerated and api_signatures.tsv is blessed. Its one changed line is
Gap::KernelInput, now a struct variant: a breaking change to rt's public surface, which is
meant.
2026-11-20 08:47:42 -08:00
Anees Iqbal 7c43b97cda Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-20 08:35:29 -08:00
Anees Iqbal c0403a1c98 identity pointer tests: the texture kernel declares its set-1 arrays; the old render key follows SEMANTICS_VERSION
engine_identity_pointers asserted no descriptor for every kernel, and ab_indexed reads its texture
through set 1's arrays, so the assertion now holds for the three buffer kernels only. The pinned
old render descriptor key hashes SEMANTICS_VERSION, which the identity change bumped to 2202; the
pin takes the key the lane's gate (job m3-max-59004) reported.

Verified: the two tests failed in gate m3-max-59004 with exactly these values.
2026-11-20 08:35:01 -08:00