Commit Graph
1873 Commits
Author SHA1 Message Date
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 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 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 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 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 3cdca62567 identity domains: a loaded or converted pointer is the device address it holds, no root table
rt answers MTLArgumentBuffersTier2 and refused the tier's basic buffer member: a kernel reading
two buffers through an argument buffer's pointer members, and one reading a buffer through a
gpuAddress the CPU wrote into a constant buffer, were both "Unsupported{IdentityDomains} (an
encoder value the function reads as RootTableAddress)". A pointer loaded from memory or made
from an integer is a wide pointer, which the resident-table domain resolves by searching the
root table's resident set; the identity domains push no root table, so the gate refused it.

Under the identity domains a pointer is the device address of the byte it names, so a wide
pointer there is (0, a, 0, 0) for address a, the form of a miss of an empty table: a loaded word
or an inttoptr operand is the pointer itself, with no search, a wide buffer parameter is its
slot's address (SlotGuestBase with the bias added back), its Metal address is `at`, and its
accesses are at host + at = a, unchecked and uncounted (a stored address is used as it is; there
is no resident set to miss). Nothing pushes RootTableAddress or ExecutionStatusAddress for it.
An escaping slot root stays static there, as on Profile F, which has no root entries either: a
slot pointer converted to an integer or stored through a static destination is SlotGuestBase
plus its displacement, and the slot's run-time accesses keep their SlotBounds check.

The same gate lifts the texture behind an argument buffer's pointer member (ab_tier2's
ab_indexed) and a kernel that converts a slot pointer to an integer. A slot pointer stored
through a loaded pointer or into an open pointer cell stays refused, as on Profile F
(Unsupported{Lowering(Access)}). Every branch is under the identity domains: the default
domains' modules are unchanged. SEMANTICS_VERSION 2202: these refusals become modules.

Tests: engine_identity_pointers (ab_sum, ab_address, ab_slot_address and ab_indexed on every
committed profile Device::from_queries derives under the identity domains: no RootTableAddress,
no ExecutionStatusAddress and no descriptor, L3, and on the CPU interpreter with buffers above
4 GiB and offset addresses, the words the addresses name, the slot's Metal address and the
increment, and the slot checked against its bounds); rt's argument_tier device tests sum through
two pointer members, read through a CPU-written gpuAddress, answer a converted slot pointer as
its gpuAddress plus its offsets, and read the textures behind a pointer member, each exactly. The
two translator tests and the device test that asserted these refusals go. Run by the lane's
compile gate (fmt, clippy plain, m2v_gpu and m2v_cpu_icd, workspace Rustdoc, the translator's
and rt's suites on lavapipe); job ids in the landing note.

Docs: rt's README says the condition in one sentence (the stored word must be a buffer's
gpu_address plus an offset inside it, and a buffer not placed at the address its guest asked
for has another gpu_address) and drops the three refusal bullets; docs/API.md sections 1 and 5
and PointerDomain::Identity say what the identity domains lower now. docs/REFUSALS.md
regenerates unchanged.
2026-11-20 08:35:00 -08:00
Anees Iqbal 1b6a802908 Conformance: the rt ledger's bicubic rows on LLVM 23.1.4 lavapipe, the coverage document regenerated
The lane's compile job m3-max-59010 ran on um870, whose lavapipe is llvmpipe (LLVM 23.1.4,
256 bits). Its conformance replay --cpu failed on six unlisted bicubic-texel-classes sites:
mixed, r8unorm, rgba16float, rgba16unorm, rgba8snorm and rgba8unorm, each /sampled. The ledger
held those sites only for LLVM 23.1.1, the venue of msi's lavapipe. The 115 other rows for the
23.1.4 venue were all held.

On 23.1.4 five of the sites give the RTX 3090's answer and rgba8unorm gives 23.1.1's. Each goes
in as a "llvmpipe (LLVM 23.1.4, 256 bits)" row after its twin, with the twin's note, which names
no device.

docs/CONFORMANCE-COVERAGE.md counts and lists the ledger's rows. It is regenerated
(scripts/conformance-coverage/coverage.py) for this commit's rows and the 164 rows of the three
before it, 7457 rows to 7627. The same job's conformance suite failed
the_conformance_coverage_document_is_what_the_sources_derive on those three commits.

Verified: m3-max-59010 listed these six gaps and no row as no longer held. Each gap's answer
equals its twin's.
2026-11-20 08:12:19 -08:00
Anees Iqbal 53f3e522e9 API.md: section 9 is the catalogue of the precision notes rt carries
Section 9 was the deleted runtime's notice catalogue: its message sink, announce_each,
lowering_refuses, DegradeNotice, exactness(), degraded_objects and the METAL2VULKAN_LOG_*, DUMP,
QUEUE_TIMES, PENDING_AUDIT and ENCODER_* diagnostics, none of which rt has.

- The intro now states rt's model as its code has it. Each note is fixed per operation (module,
  pixel format, descriptor or state) and given through six accessors: ComputePipelineState and
  RenderPipelineState::precision_notes, Texture, SamplerState, DepthStencilState and
  RenderPassDescriptor::precision_note. Two constants carry notes too:
  BlitCommandEncoder::GENERATE_MIPMAPS_NOTE and RenderCommandEncoder::DEPTH_BIAS_NOTE. A note
  is never fatal, and rt prints and sends none (its non-test sources hold no eprintln, log or
  sink); the consumer reads them.
- The 87 entries whose code a PrecisionNote variant backs stay. Their text no longer names the
  deleted runtime (compressed-texel-decode, bicubic-filter-arithmetic,
  swizzled-opaque-black-border). Their trigger is rt's where the deleted runtime's stood beside
  it (device-filtered-mipmaps, shared-exponent-kept, compressed-texel-decode). They no longer
  say when a deleted runtime announced the note, and they drop the blit, fill and clear parts
  that only that runtime noted (shared-exponent-kept, device-nan-encoding,
  device-color-conversion, device-pack-conversion). Their driver-fact text is left for the
  translator-switch commit.
- The 165 entries no note backs go: 59 performance, 104 precision and 2 validity kinds of the
  deleted runtime.
- Section 8's last paragraph names metal2vulkan_rt::Error, REFUSALS.md and rt's README. The
  guide's opening line and README's row say precision notes.

tests::fast_paths reads the catalogue only for the codes of its ledger notes, all PrecisionNote
codes, which stay. Section 10 still names some deleted codes; that is a follow-up.
2026-11-20 08:01:21 -08:00
Anees Iqbal 6dda5a4617 Conformance coverage: regenerated for the ledger's reasons and the folded justifications
docs/CONFORMANCE-COVERAGE.md quotes known-gaps-rt.tsv's reasons and names each family's
justification kinds. 8fd1a5f35f changed the reasons and 57af29bde9 folded NewRuntimeNotice and
NewRuntimeAccepted into Degradation and AcceptedDifference, so the document is regenerated
(python3 -I scripts/conformance-coverage/coverage.py). Job m3-max-58840 found it stale
(conformance_coverage and the coverage check); every other step of that job was green.
2026-11-20 07:59:12 -08:00
Anees Iqbal 430fd25c60 Conformance: carried origins, probes, slugs and the rt ledger name no deleted crate
The old runtime is deleted, so the suite's text stops pointing at it:

- The carried cases' origins (compute_threadgroups, sample_fills, sample_positions,
  texture_buffer_fills, texture_fills, two_plane_copies, handler_waits) state the measurement
  itself, and the 81 recordings that store an origin carry the new strings.
- docs/API.md section 10's four entries that said "the new runtime" say "the runtime"; their
  slugs follow in the cases that name them (buffer_target_clears, pass_sequence_actions,
  event_orders, texture_query) and in the quotes of the lead-ins.
- The probes drop their runtime_lane and metal2vulkan-runtime citations; a probe whose results
  lived only in a deleted lane module names that module and the last commit that held it.
- known-gaps-rt.tsv's reasons drop the comparisons with the old runtime (226 rows) and say
  "a known gap of the runtime". The stage-in rows are as they were.

Prose that describes the suite's own run-kind branch (Unjustified::OldRuntime, the recording's
new_runtime flag) is left with that code.
2026-11-20 07:58:57 -08:00
Anees Iqbal b50bf56b3e rt and the translator's prose name no deleted crate; REFUSALS regenerated
- rt's error.rs: three Basis citations named the deleted runtime's view plan, mipmap plan and
  RenderPassProblem; each keeps its Metal evidence without them. docs/REFUSALS.md regenerated.
- rt's submit.rs: the group bounds' docs drop "the old runtime's bound".
- rt's alpha-test module doc cites its 413 probed rows without the deleted lane's test name.
- rt's Cargo.toml comment and README line 3: unpublished until it takes the name
  metal2vulkan-runtime.
- The translator: repro.rs and the cli test say a runtime writes repro bundles through
  `metal2vulkan::repro`; build.rs names a runtime's shader cache; api_surface.rs says
  `api_signatures` pins metal2vulkan-air and metal2vulkan-rt (its table is unchanged: no public
  item moved).

Verified: the compile job is named in the hand-off.
2026-11-20 07:58:57 -08:00
Anees Iqbal 4d3daeace8 Docs: the runtime is metal2vulkan-rt; HOWTO's sections on the deleted runtime give way to rt's README
metal2vulkan-runtime is deleted, so the user-facing docs name metal2vulkan-rt as the runtime:
- README.md: the crate table's runtime row is metal2vulkan-rt (not published yet); two published
  crates; the git dependency and both README links name it; the runtime needs a Vulkan 1.3 device
  with its README's floor; the sentence on the deleted runtime's repro bundles goes.
- CONTRIBUTING.md: the layout lists metal2vulkan-rt and metal2vulkan-conformance; the gate drops
  `-p metal2vulkan-runtime` and gains the conformance suite's line, as AGENTS.md's gate has it;
  two published crates for the signatures and the license copies; the refusal check reads the
  runtime's refusal enums (the deleted runtime's `Problem` is gone).
- docs/VALIDATION.md: the gate as CONTRIBUTING's; "the new runtime" is the runtime in the matrix
  rules and the command replay (the record keys and `harness --runtime new` keep their names).
- docs/HOWTO.md: the sections on the deleted runtime's shader cache, host memory (no-copy
  buffers, unmapping, copied host buffers, guest RAM) and exported memory described its API
  alone; each is now a pointer to rt's README (The cache directory, Imported blocks, Exported
  blocks and Exported surfaces), stating only what that README states. Section 4 loses the
  deleted runtime's repro bundles; section 8 loses its pipeline names, its start-up checks, its
  suspend-time measurements of its own calls and its exit-handler probe, keeping the driver facts.
- docs/ARCHITECTURE.md and the CI workflow's comment name the runtime as metal2vulkan-rt.

Left for the translator's commit (part 2): FAST-PATHS.md and the DevicePolicy text in README,
CONTRIBUTING and VALIDATION's golden-table paragraph ("The old runtime's translations do not
move"), which follows the matrix's old-path rule.

Verified: the compile job is named in the hand-off.
2026-11-20 07:58:56 -08:00
Anees Iqbal ca5aa90e09 env_vars: the ten variables only the deleted runtime read go
With metal2vulkan-runtime deleted, ten accessors in crates/metal2vulkan/src/env_vars.rs have no
reader: lane_validation, log_pipelines, log_memory, log_shadows, dump_pipelines, log_passes,
pending_audit, queue_times, encoder_trail and encoder_times. A grep of the tree finds no call of
any of them and no other read of their METAL2VULKAN_* names, in metal2vulkan-rt or anywhere else.
They go with their registry rows, so `metal2vulkan --help` lists only the variables something
reads: METAL2VULKAN_REPRO_DIR and the METAL2VULKAN_<TOOL> family.

METAL2VULKAN_REPRO_DIR's row and accessor doc lose the deleted runtime's half (its bundles of
refused creations, and "unset is off (the runtime's)"); the binary's bundles are unchanged, and the
binary is the variable's one reader.

docs/API.md's paragraph describing the ten variables (section 9, under "How a notice reaches you")
goes; the heap-texture refusal line after it no longer begins "Whatever the variables". The rest of
section 9 still describes the deleted runtime and is the docs step's.

The env_vars module is hidden (not in tests/api_surface.rs or api_signatures.tsv);
scripts/api-signatures/signatures.py --check is 0 on this tree.

Verified: the gate of this commit (fmt, clippy x3, workspace doc, the metal2vulkan crate's tests).
2026-11-20 07:24:20 -08:00
Anees Iqbal 5d725aeec7 Delete metal2vulkan-runtime, with every test and script that read it
The cutover deletes the old runtime: crates/metal2vulkan-runtime and its workspace member go.
Nothing in the workspace depends on it any more: the harness and conformance lost their old arms,
and validation dropped its dependency in its own commit.

Adapted in this commit, so no gate reads the deleted tree:
- CI and scripts/linux-gate-ci: the crate's per-feature clippy group, its `-p` in the Windows
  clippy and the test step, and its private-doc-links row go. Packaging needs no edit: the
  workspace's published crates are now metal2vulkan and metal2vulkan-air.
- The published-crates test lists those two; devtools' carried trees and the five nextest groups
  of the old crate's tests go.
- scripts/api-signatures: the crate leaves CRATES, FLOORS and the header, its self-test trees name
  rt (read by the same rules), and the table is re-blessed (the old crate's 4555 rows go);
  api_signatures.rs pins the three crates left.
- scripts/refusal-surface: the old crate's tree and its sections go (RuntimeGap, AppleOnly,
  Problem and the problem enums it forwards to), with their 87 reach rows, the `--delegations`
  verb and the test that counted the old Problem's delegations; docs/REFUSALS.md is regenerated.
  The basis check now holds rt's refusal enums alone, which it already required.
- scripts/api-cost-coverage goes: it measured only the old crate's surface.
- feature_vocabulary.rs: the old crate's two enable tables go; the Khronos and validation tables
  stay held to the vocabulary.
- The conformance coverage generator's by-hand roots read rt instead of the old crate, and
  docs/CONFORMANCE-COVERAGE.md is regenerated (MTLResourceOptions' row, which only the old crate
  modelled, gives way to rt's MTLCommandBufferError).
- scripts/matrix: the harness times the new runtime alone (`--runtime new`), so the rules that
  judged it against the old one go: the new-over-old budget with its floors (floors.tsv,
  gpu-floors.tsv), ceilings, card variance and status table (status.tsv), the frozen arm, the
  base spread and the timing once more it set off, the re-timed pairs, the five creation rounds
  and the old runtime's parked tests and records. A harness row's time is judged as a cross-GPU
  outlier, with its alone runs as before, and the frame and burst rows by their stored
  instruction counts; the creation rows run once, in their own process. docs/VALIDATION.md's
  matrix section says these rules.

Checked locally (python, no build): signatures.py --check and --selftest, refusal_surface.py
--check, --selftest and --missing-basis, coverage.py --check and --selftest, and scripts/matrix's
49 tests pass. The compile gate (fmt, clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, Windows
clippy for gnullvm and msvc, workspace Rustdoc, packaging, the touched crates' suites on the host
and on lavapipe) runs on this sha as potluck jobs that the landing note names.
2026-11-20 07:01:01 -08:00
Anees Iqbal 779eb522b4 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 06:59:54 -08:00
Anees Iqbal ac90becd94 Conformance: the old runtime's side goes; rt's side is the only one, held to one ledger
The cutover deletes metal2vulkan-runtime, so the conformance suite stops depending on it.

What goes: the old runtime's side (runtime_side.rs, runtime_work.rs, states.rs) and its runs in
run.rs, report.rs and the command; the cost verb, the timing-coverage verb, `times`' leg of ours,
the `--rt`, `--default-policy`, `--leg`, `--call` and `--cold-shaders` flags; the four split
binaries that drove the old runtime directly; coverage.rs; and the old side's ledger,
known-gaps.tsv. The harness half of the cutover landed separately.

What stays: rt_side is the only runtime side, and `conformance replay` runs it (CI's
`replay --cpu` now replays rt on lavapipe). Its ledger, known-gaps-rt.tsv, is the one ledger, with
the rows it held; a call rt_side does not answer yet stays Failure::unavailable on it, as before.
The cases keep every allowance: the old runtime's Degradation kinds become the suite's own codes
(degradation.rs, the same `metal2vulkan-degrade-<kind>` codes), and the old runtime's Metal value
enums the cases state become the suite's own (values.rs). The old side's descriptor helpers that
rt_side and its tests used move to rt_side/fields.rs. Recordings keep their `costs` and our times
as data; `deny_unknown_fields` still reads them.

The coverage generator reads rt_side alone, and docs/CONFORMANCE-COVERAGE.md is regenerated.
The README describes the suite as it now is.

Checked: coverage.py --check and --selftest locally. The compile gate (fmt, clippy plain,
--cfg m2v_gpu, --cfg m2v_cpu_icd and for aarch64-apple-darwin, workspace Rustdoc, the suite on the
host and on lavapipe, and the lavapipe replay) runs on this sha as potluck jobs that the landing
note names.
2026-11-20 06:19:03 -08:00
Anees Iqbal a9acc24aa0 Coverage map: rows rt and the translator answer through their own calls, per-row sizes, refusals by rt's names
The fast switch to metal2vulkan-rt marked missing every runtime row whose old counterpart rt
does not hold under the same name. rt's and the translator's Rustdoc answer more of them:
- 28 runtime rows are implemented: the 9-argument texture and buffer-to-texture copies and the
  options form with no option, `enqueue`, `commandBufferWithUnretainedReferences` (the same call
  as `commandBuffer`), every `withRange:` setter of both encoders (a loop of the single setter),
  `useResources:count:usage:` and `useHeaps:count:`, both encoders' memory barriers,
  `newBufferWithBytesNoCopy` (Device::import_host_memory and a buffer in its block),
  `MTLCreateSystemDefaultDevice` (Device::new), `MTLCopyAllDevices`
  (Instance::physical_devices), a texture's `storageMode` through its descriptor, and
  `renderPassDescriptor` (RenderPassDescriptor's Default);
- 23 translator rows are implemented: MTLLibrary and MTLFunction by the translator's Library
  and Function (from_metallib, function, functions, library_type, install_name, properties,
  function_constants_dictionary, reflection), and MTLFunctionDescriptor by FunctionDescriptor;
- maxBufferLength and a texture descriptor's resourceOptions are the consumer's;
- 53 missing rows take their own size and note: encoder calls (S for loops of existing calls and
  store action options, M for stride binds and indirect draws, L for vertex amplification),
  render pass fields, a texture buffer's descriptor and alignment, function options;
- refusals are named by rt's types: Gap::IndirectCommandBuffers, Gap::KernelInput and
  Gap::DrawInput for function tables, RenderPipelineKind::VertexAmplification and Tessellation,
  RenderPassKind::TextureType and NoAttachment, Gap::TextureBuffer;
- 629 notes no longer name the old runtime's items (RuntimeGap's variants, FeatureRow's rows,
  its compiled_reflection, function_handle, allocated_size, new_library_with_source and
  BlitOption).
coverage.py's group names follow (buffers, encoder calls, command buffer options, function
options). docs/METAL-COVERAGE.md and docs/CONFORMANCE-COVERAGE.md regenerated: implemented
593, missing 1118, out of scope 424.

Verified: every implemented row resolves by the test's own rules in its crate's sources (a
script run of them: runtime 237, translator 356, none missing); every `Type::name` a note names
is held by rt or the translator (14 checked; the same check over the table before this commit
finds 26 it does not hold). The compile job is named in the hand-off.
2026-11-20 06:02:37 -08:00
Anees Iqbal 8871d40bdf Validation: delete the old runtime's lane, parity harness, player backend and old-only tools
The old runtime goes at the cutover, and validation's old-runtime-only parts go with it:

- runtime_lane/ (the old runtime's device tests) and the Metal predication probe that pinned
  its streams. Its one rt-based module, the replay player's rt device tests, moves to
  replay/rt_replay.rs with its three old-runtime comparisons cut (the census test on both
  runtimes goes; its rt half is its own test) and a pipeline cache directory of its own in the
  scratch root.
- parity/ (Metal programs compared with the old runtime alone) and its Metal records under
  corpus/observations/parity.
- The player's old backend (replay/old_runtime): command-replay always plays on the new runtime,
  and `--runtime` is gone.
- corpus-draw-ab and format-scout (old-runtime-only tools), scripts/making-bench (corpus-draw-ab's
  bench), and the eleven public fixtures only the deleted sources used.
- The nextest overrides of runtime_lane tests, the queue-plan test group and the few-channels
  profile; the matrix's device-test filter now names replay::rt_replay.
- VALIDATION.md, REPLAY-STREAM.md and validation's README lose the lines of what went.

The candidate executor's runtime path, and validation's dependency on metal2vulkan-runtime, go in
the next commit.
2026-11-20 05:42:33 -08:00
Anees Iqbal 220473aafd Coverage map: the runtime's counterparts are metal2vulkan-rt's, and the test reads rt's sources
The old runtime is being deleted, and the coverage map's 649 runtime rows named its items. Every
runtime row now names metal2vulkan-rt's counterpart or none:
- 180 rows whose counterpart rt holds under the same name keep it;
- 29 take rt's name for it: DeviceProperties fields that are Device methods, the heap placements
  that are Device::new_heap_buffer and Device::new_heap_texture, the lod-clamp and stencil
  setters, the dispatch type taken by CommandBuffer::compute_command_encoder, and a texture's
  getters through Texture::descriptor;
- 73 are out of scope as rt's README gives them to its consumer: labels, MTLHeap and its
  descriptor, MTLBinaryArchive and every descriptor's binaryArchives, a resource's options, a
  texture's parent and shareable getters, a library's and a function's device;
- 367 are missing, each with a group, a size and a note: indirect command buffers (71), function
  tables, handles and dynamic libraries (38), mesh (33) and tile (26) pipelines and their calls,
  encoder calls (59), argument encoders (24), libraries and functions as runtime objects (25),
  and smaller groups. Their sizes are the group's, to be refined.

coverage.py names metal2vulkan-rt as the runtime and gains the new groups;
metal_coverage.rs reads crates/metal2vulkan-rt/src. docs/METAL-COVERAGE.md and
docs/CONFORMANCE-COVERAGE.md regenerated from the table (implemented 542, missing 1171, out of
scope 422).

Verified: every implemented runtime row resolves in rt's sources by the test's own rules (a
script run of them over the tree: 209 of 209); the compile job is named in the hand-off.
2026-11-20 05:28:07 -08:00
Anees Iqbal e639f89d25 rt README, API.md: the known gaps a user reads before the old runtime goes
What each line states, in the section that owns it:
- Known gaps of pipeline states: on RADV a stage's pushed values that the driver reads from its
  own upload can be read past that upload's end (a 12-word load widened to 16), which faults
  where the upload ends the driver's upload buffer and loses a Radeon 780M or RX 7900 XTX.
  Recorded as open: rt places pushed values with no regard to that widening.
- Known gaps of pipeline states: the pipeline cache's cold price per card (RTX 3090 5.8% and
  6.8% slower, Iris Xe 9.8% faster, Radeon 780M level) and its warm effect.
- Known gaps of pipeline states, the identity domains' list: in plain words, a buffer reached
  through a pointer member of an argument buffer or a stored gpuAddress, and a kernel that turns
  a buffer argument's pointer into an integer, each named; the texture behind a pointer member
  named as such.
- Known gaps of render pipeline states: each render content is one whole VkPipeline with no
  shared parts; the heaviest recorded content's cold driver time on two RTX 3090s (1,408 and
  1,335 ms), the dynamic states' share (under 1%), the warm figure, and the render records'
  warm saving on lavapipe.
- Known gaps of render pipeline states: mesh render pipelines have no call in rt and no mesh
  draw; a mesh or object function in a render descriptor's vertex place is the translator's
  refusal.
- Known gaps of queues: a texture or block not shared outside rt, released while an unsent
  upload holds it, keeps its memory until that upload is submitted, and with no later call until
  the device drops.
- Floor: Mesa's driver for Apple GPUs (KosmicKrisp, Mesa 26.3.1) meets the floor on macOS;
  MoltenVK is below it (no nullDescriptor, set 1 refused by its set-layout support query).
- docs/API.md section 5, at PushField::SlotBounds: the bounds check's measured cost (harness GPU
  rows on a 780M, an RTX 3090 and an Iris Xe; replay streams' GPU time a frame; cold pipeline
  makes on two RTX 3090s), and the rt README's check entry points to it.

Why: the old runtime is being deleted; these are the gaps of rt a user meets that the README did
not state, stated as what is true now with the jobs that measured each.

Verified: docs only; the numbers are read from the jobs each line names (the bounds check rows
recomputed from m3-max-56485, -56486, -56546 and -56641). Compile job named in the hand-off.
2026-11-20 05:20:15 -08:00
Anees Iqbal 0cd2ad765d Push placement: on the floor each stage's push ends with its tail, 24 bytes above its other fields
A driver that uploads a stage's push bytes up to the highest one the stage reads, and widens a
push load past its last byte by up to 28 bytes, read past the upload where a stage's last field
ended its push (RADV: 49 compute stages at tip). A read pinned past the fields (R7) cost the
stages a driver holds whole in registers those registers: the pin raised the used-word count past
the driver's limit (RADV keeps all 16 words of the harness's lcg_step in user SGPRs at tip, none
under R7). The tail adds no read where the stage has a field of a tail kind, and moves one.

- lower/push.rs: on PushWindow::Floor, place() lays the longest prefix of the kind order that
  fits with its tail: the highest field of a tail kind (SlotBounds or ZeroAddress, the two kinds
  whose value the consumer never pushes with every bit set) moves HOLE_BYTES (24) above the other
  pushed fields' end; where the pushed fields hold no tail kind, the zero tail word
  (PushField::TailWord at PushPlacement::tail_word) takes that place, with which push_range ends.
  One pushed field of one or two words has no tail. The guaranteed window is packed as before.
- tail(), check_floor(): the structural tail and the floor's bound, which select checks on every
  placement as an invariant error.
- emit: the stage reads its tail in its first block and returns where it holds the value the
  consumer never pushes there (emit_tail_guard): the word non-zero, bounds with both words all
  ones, the zero range's address all ones.
- PushPlacement::tail_word (public, serde default, codec), PushField::TailWord (codec, API
  table); SEMANTICS_VERSION 2201, ARTIFACT_FORMAT_VERSION 556; the old render descriptor key
  re-pinned at 2201.
- Tests: push.rs's floor placements at their tails, the bound's refusals; engine_identity's
  31-slot kernel spills 4 addresses to its block; engine_identity_render's vertex range ends at
  64. Docs: API.md section 5 (the tail and what the consumer pushes), rt README (24 addresses
  below the tail), the profile's window doc.

Verified at 855d973a38 (this change before development's c39f6e8350 and 1de18aa609, which
touch no translator file), m3-max-58299 on msi: the metal2vulkan and metal2vulkan-rt suites
3911 of 3911 passed; the old-path pins (golden hashes over Device::new and the old render key)
pass. Clippy failed there on four indexing lints in push.rs, fixed here with get().
RADV dump (m3-max-58310, Radeon 780M, Mesa 26.2.6): lcg_step keeps the same 16 push words in
user SGPRs with no push pointer, plus a 3-instruction scalar guard; the 18-word kernel keeps its
two loads (+0x20, 32 bytes; the second now at +0x58).
2026-11-20 05:17:29 -08:00
Anees Iqbal 1de18aa609 Tests: the stream device tests of the old runtime's queue plan run at most four at a time
What: .config/nextest.toml's default profile puts the validation crate's
runtime_lane::replay_streams tests, and the three runtime_lane::rt_replay tests that play
on the old runtime too (a_private_shown_texture_is_checked_through_a_copy,
a_tiled_texture_takes_its_buffer_s_bytes_and_levels_at_first_use,
the_address_census_is_the_same_on_both_runtimes), in a test group, queue-plan, of
max-threads 4. These are the tests of the GPU legs' filter (DEVICE_TEST_FILTER in
scripts/matrix/matrix) that open a lane device of the old runtime's queue plan (at_plan).
docs/VALIDATION.md's paragraph on a GPU of few channels says so. The few-channels profile
stays: the lane's other at_plan tests lie outside the group, so a whole lane run on such a
GPU still takes it.

Why: the RTX 2080's GPU leg (NVIDIA 620.70.06) failed 3 runs of 3 at b4058db961
(m3-max-58129, m3-max-58168, m3-max-58241), each at the same test:
tests::translate::on_device::every_device_removes_a_blob_it_cannot_take, "NVIDIA GeForce
RTX 2080: vkCreateDevice failed: Initialization of an object has failed". In the seconds of
the failure the kernel logged NVRM "kchannelAllocMem_GM107: Could not create Channel" (31
times in 58241), "kchannelAllocMem_GM107: Instance block allocation ... failed" and
"heapAlloc_IMPL: no free blocks" (39). 58241 sampled the card and the test processes every
0.3 s: at the first error 17 test processes were alive, 15 of them replay_streams tests,
whose devices take the queue plan's 18 VkQueues, each a channel on NVIDIA's driver (the 2080
holds 10 such devices). The card had 242 to 257 MiB of its 8,192 in use then, 1,458 MiB at
most over the leg, 393 MiB reserved: not its memory. The test alone passed (m3-max-58193,
0 NVRM lines), and so did it 18 runs of 18 beside the host-import timing test alone
(m3-max-58237). The lane's devices wait for room (runtime_lane/device_room.rs); the new
runtime's device tests take the driver's refusal as it is. Four devices of the plan are 72
VkQueues, which leaves room for six more: the leg's other 12 processes, whose new runtime
devices take at most 2 VkQueues each, and other programs' devices on the GPU.

Verified (archive m3-max-58111 at b4058db961; the nextest config of a commit whose tree is
this commit's, read from the workspace):
- m3-max-58271, exclusive on homelab-um790-xtx-1: the 2080's leg 506 of 506 passed, exit 0,
  0 NVRM lines, 0 refused channels, at most 4 of the group's tests alive at once; the replay
  tests' wall time 33.4 s; the leg 167.4 s (175.1 to 185.4 s in the three failed runs).
- The same job, the RX 7900 XTX's leg in turn before, after, after, before: 21.62 and
  21.44 s before, 21.57 and 22.09 s after (1.4% longer on the means); the replay tests' wall
  time 3.1 and 2.9 s before, 2.9 and 3.7 s after; at most 8 and 11 of the group's tests alive
  at once before, 4 after; every run 506 of 506, exit 0.
- m3-max-58260: the 2080's leg under --profile few-channels (3 test threads), 506 of 506,
  exit 0, 0 NVRM lines, 166.4 s, the replay tests' 22 runs 54.9 s in all (434.2 s in 58129).
2026-11-20 04:49:59 -08:00
Anees Iqbal f7a833a939 conformance coverage: the ledger rows of bicubic-texel-classes; its sRGB rows name both notes
docs/CONFORMANCE-COVERAGE.md lists the ledger rows, so it is regenerated with the case's
35 old-runtime rows. The old runtime's sRGB rows say "the static notes ... and
srgb-texel-decode".

Verified: scripts/conformance-coverage/coverage.py --check reports the document as derived;
m3-max-57864 at 23dcb71cd6 failed only the coverage test this fixes, and its lavapipe
replays of both runtimes read the ledger rows clean (exit 0).
2026-11-20 02:55:02 -08:00
Anees Iqbal bafdd29f9c conformance: bicubic-texel-classes's rows on an RTX 3090; the note's figures with it
The 3090 answers as lavapipe does (its half results unnarrowed, RGBA16Unorm's largest
difference 2.16e-4), and the old runtime's sRGB row reaches 1.58e-3 there, so the
note's per-format figures in docs/API.md take it.

Verified: the rows are the replay's own ready-to-paste rows at 40bc6a759e on the 3090
(m3-max-57815).
2026-11-20 02:55:02 -08:00
Anees Iqbal a1c3a472bb conformance: bicubic-texel-classes's known-gap rows; the bicubic note states what Metal measured
The case's samples differ from Metal's on every venue by the precision note
BicubicFilterArithmetic: Metal's bicubic results lie on the format's grid (a sixteenth
of a code for the 8-bit classes, a whole code for RGBA16Unorm, an exact half for
RGBA16Float), and at the six RGBA16Float samples whose sum lies exactly halfway between
two halves Metal rounds away from zero; ours is the unrounded f32 sum. Under rule 1 a
filtering answer within Metal's precision is the device's, under its static note, so no
form rounds the sum onto Metal's grid.

docs/API.md's catalogue entry for the note and the note's own definition state those
measurements and the largest difference per format over the venues run. Both ledgers
carry the case's divergent rows per venue (lavapipe, the M3 on KosmicKrisp for the new
runtime and on MoltenVK for the old, a Radeon 780M, an Iris Xe), and the new runtime's
ledger the sRGB texture's refusal (Gap::BicubicTexels) at every venue.

Verified: the rows are the replays' own ready-to-paste rows at 40bc6a759e (lavapipe on
msi, m3-max-57732, m3-max-57813 on a 780M, m3-max-57816 on an Iris Xe); the tie scan
compared rt's lavapipe samples with the recording in exact arithmetic.
2026-11-20 02:55:02 -08:00
Anees Iqbal a816607226 conformance: Metal's recording of bicubic-texel-classes (the M3, macOS 27.0.1), its arms held by three tests; CONFORMANCE-COVERAGE.md regenerated 2026-11-20 02:55:02 -08:00
Anees Iqbal 6833eba8e2 identity domains: a 2D bicubic sample reads its slot's format treatment from a pushed word
Under the identity domains (Device::from_queries, the new runtime's translator device) every
kernel that sampled a texture through a bicubic constexpr sampler was refused as
Unsupported{IdentityDomains} ("a bicubic filter"), because the filter's treatment of the bound
format (its inner taps, its clamp and its border texels) was a SpecKey::BicubicTexels
specialization the old binder sets from the bound texture. One compute pipeline of every macOS
guest boot met that refusal; the old runtime builds it.

The treatment is now one u32 field per bicubic slot, PushField::BicubicTexels(SlotRef), placed
and filled as TextureIntegerChannels is. The 2D routine already took the bits as a run-time value
(Bits::Value), so a sample reads the field instead of the constant; no per-format pipeline, no
new descriptor. metal::format::bicubic_texels_word(pf, swizzle) gives the word the binder
specializes the constant to (BICUBIC_TEXELS_UNBOUND for a slot bound to nothing), and None for a
format of no measured family or of 8-bit sRGB codes. rt fills the field from the bound texture
when the slot's texture changes, and refuses a dispatch whose bicubic slot holds a texture with no
word as Gap::BicubicTexels, naming the slot and the pixel format. The static precision note
BicubicFilterArithmetic stays.

Still refused under the identity domains, each the refusal it was: a bicubic sample of a 1D
texture or at pixel coordinates (and the in-place two-plane routine), an argument buffer's
texture, an array of samplers. The default domains (Device::new, the frozen old runtime's path)
are unchanged: they still specialize SpecKey::BicubicTexels and state RuntimeFact::BicubicTexels,
and the binders refuse the new field.

SEMANTICS_VERSION 2199 -> 2200, ARTIFACT_FORMAT_VERSION 554 -> 555 (a new push field tag).
docs/REFUSALS.md regenerated; api_signatures table blessed; docs/API.md and the rt README's known
gaps say what is lowered and what is refused.

Tests:
- engine_identity::a_bicubic_kernel_reads_each_slots_format_treatment_from_its_pushed_field
  (replaces the refusal test; fails without the change): bcu_formats on lavapipe and moltenvk-m3
  profiles under the default domains keeps its 10 facts and 10 spec keys and no push field; under
  the identity domains it compiles, passes L3, pushes the 10 slots' fields, declares no spec key
  and no fact, and keeps the precision note; bcu_forms (1D) and bcu_address (pixel) still compile
  on the default domains and are refused under the identity domains.
- rt tests::bicubic (device cfg): each format bound at every slot of bcu_formats pushes its word,
  its arm asserted per format (R32Float linear; RGBA8Unorm, RGBA16Unorm, R8Unorm the [0, 1] clamp;
  RGBA8Snorm the [-1, 1] clamp; RGBA16Float no clamp), an unbound slot the unbound word, and an
  RGBA8Unorm_sRGB texture at slot 3 is Gap::BicubicTexels naming slot 3 and the format.
2026-11-20 02:55:02 -08:00
Anees Iqbal b506518794 rt: prepare_dispatch's tests, README and surface; the player's read-ahead encoder a struct
Tests: the pre-pass grid against each call's own (a saturated dispatchThreadgroups axis, a
dispatchThreads grid of u32::MAX on a size that does not divide it, indirect), GPU-free; on a
device, prepare-then-dispatch of an observing kernel for each kind, each call making exactly one
pipeline (and the ragged grid its one lowering) and the dispatch then waiting for nothing; a
second call making nothing; what the dispatch records nothing for or refuses making nothing; the
emulated-SIMD-group variant prepared; a square-form grid eight deep prepared; and the same
counts recorded and submitted with the calls and without, on two devices.

README: the hook in the compute pipeline states section, and the translation bound the caller's
width multiplies. api_signatures blessed; REFUSALS.md regenerated (the refusal sites moved into
the shared helpers, no new refusal).

Verified: the check job that follows this commit.
2026-11-20 02:44:56 -08:00
Anees Iqbal e4de7cc44e rt: undo the per-slot refill and the changed-words push; a draw and a dispatch refill every slot again
What. Reverts the refill series (68740984ba, 5b164777bd, 71ef1ba14b and its tests b97d37c104,
c076e8d17b, cd134b0995) on development, keeping everything landed since. A render or compute bind
marks the encoder changed again, and the next draw or dispatch finds and fills every slot's facts
and fields and writes every spilled block into the ring, as at f44fb795ae. A draw or a dispatch
whose push bytes the command buffer already holds pushes nothing; any other pushes the whole
window. Rebound, the per-slot facts, Pushed's span and mark, Metrics::push_bytes and
tests/refill.rs go; the push and push-window tests of f44fb795ae come back. rtover's over check
stays as it landed: the texture setters keep their over count (Tables::set_texture, the compute
encoder's `copied`), and the draw keeps Overs' reached form. docs/REFUSALS.md re-derived: the
refusal sites move back from `refilled` and `find` to `dispatch`.

Why. The planner's bar for the series, as amended: instructions a draw and a bind at or below
f44fb795ae's for the refill's own share. If the bar fails, the bookkeeping is undone, and the
push of changed words stays only if it alone meets the bar. Neither does. Harness, own user
instructions, 780M (um870, one round, m3-max-57484; the exclusive rounds m3-max-57397 on gem10
and m3-max-57398 on the 3090 read the same):

  arm                                      a draw   a bind
  f44fb795ae (the bar)                        842      739
  92b9cbb232 (the series alone on it)         963      874
  7096fa7de3 (development)                    958      887
  3cc134e439 (the series' fix)                943      835
  24dd31af87 (this undo, on 3cc134e439)       836      751
  05cca3d165 (the undo + changed words)       887      770

The series alone adds 14.3% a draw and 18.3% a bind. Its fix still left 11.9% and 13.0%. The
push of changed words on its own adds 5.3% a draw: comparing the window word by word costs more
than the whole-window compare it replaces. The undo is 0.7% under the bar a draw and 1.6% over it
a bind; the commits besides the series account for the +12 a bind (rtover's over count in
set_texture; bind_2000 sets a fragment texture before every draw). At the fix, bind_2000 was
18.7% slower on the 780M and 15.6% slower on the 3090. The gain the form was ordered for did not
come: on the video stream (vaapi-780m, lavapipe, m3-max-57454 and m3-max-57460), fields filled a
bind fell from 1.42 to 1.22, but the bind redo (fill_push, Facts::find and the held block) rose
from 901 to 1,079 instructions a draw.

Verified: the table above (m3-max-57484: each arm one harness process on a fresh cache, release).
24dd31af87 is this commit's rt, translator and validation tree but for dfb00c74c6's import test.
cargo fmt; the refusal surface regenerated with scripts/refusal-surface/refusal_surface.py.
2026-11-20 01:13:26 -08:00
Anees Iqbal a48d634517 conformance: two ushort3 function constants read as half3, on Metal and on both runtimes
A case of our own MSL that reads its constants the way the consumer's two refused records do:
engine/fc_ushort3_half3 (our MSL, compiled by scripts/regen-air-fixtures on the M3) declares two
ushort3 function constants and reads each through as_type<half3>, which the compiler folds into
a <3 x half> load of the constant's <3 x i16> global (the regenerated .ll holds exactly that
load), so the translator holds both in the constant blob. Thread t stores, as floats, lane t % 3
of each, their half sum and t; the values (1.0, 2.5, -0.75 and 0.5, 4.0, 1.25) have exact sums.

The suite gains the call that makes such a pipeline: Side::compute_pipeline_with_constants
(newFunctionWithName:constantValues:error:, then newComputePipelineStateWithFunction:error:), on
the Metal side, the new runtime's side (FunctionDescriptor.constants), the old runtime's side and
the watching wrapper. The Metal side's constant setter pads each value's packed bytes with zeros,
so a setter that reads a vector type's aligned size reads zeros past the packed lanes.

Metal's recording (the M3, macOS 27.0.1 26A434, `conformance record` with three runs and the
validated leg, then `times --runs 8 --write`) stores the program's floats for every thread,
which metal_stores_the_programs_floats holds. The engine fixture inventory gains the fixture's two
rows, ok on every profile (blessed on the M3).

The case is named among those authored after the last whole-set cost --write, whose next
run pays its cost record, and docs/CONFORMANCE-COVERAGE.md is regenerated for it. The golden
table gains the fixture's cells on development, where the tables are blessed.

Verified: see the check job named in the landing.
2026-11-20 00:28:33 -08:00
Anees Iqbal a89e4c0838 identity domains: the constant blob is the module's own words; rt's two constant-data gates go
Under the identity domains a function binds no descriptor, so a function reading the constant
blob was refused ("a resource bound through a descriptor"): the 16-byte blob of two ushort3
function constants read as half3 (as_type, folded by LLVM into a <3 x half> load of the
<3 x i16> constant, which fails the typed-access test) refused a consumer's kernel on both
records.

There the blob is now a Private u32 array whose initializer is the blob's little-endian words,
zero-padded to 16 bytes as a bound blob's range is (memory::blob, BlobHome::Module). The blob's
existing word-composed leaf loads read it, every load checked against the array's length (no
robustness covers Private memory); use_blob counts no descriptor and the artifact carries no
blob, so no stage has a constant_blob. Off the identity domains nothing changes (BlobHome::Bound).
The module's blob counts in the plan's private bytes where an access reaches it at an offset only
the run knows, as a run-time-indexed Private constant does, and its declaration's words count in
the size estimate.

The bound is memory::blob::MODULE_BYTES = alloca::MAX_UNSHARED (64 KiB), the most the typed
objects of one function may declare: a typed constant up to that size is already a Private
variable with its initializer, so the module's blob gives the make no larger initializer than
one of those. Past it the identity refusal names the kind, "constant data of N bytes read through
memory", in place of the descriptor catch-all.

rt: nothing reaches its two gates on constant_blob now (rt always compiles under the identity
domains, and the linked stages' constant_blob is None), so interface()'s Gap::KernelInput for
it and RenderPipelineKind::ConstantData are deleted, with the README's two mentions and the
variant's row of the API signature table. docs/REFUSALS.md regenerates unchanged (the variant was
in no section); no crate-root item changed. SEMANTICS_VERSION 2199: identity modules and refusals
change; the encoding does not. The old runtime's render descriptor key, which hashes the version,
is pinned at its 2199 value.

Tests: engine_identity's blob_words kernel reads the records' half3-of-ushort3 load and 2-byte
units at run-time offsets, one past the words: under the identity domains no descriptor, no
artifact blob, private bytes +32, L3, and the CPU interpreter's answers (zero past the words);
the default domains bind the same 24-byte blob. blob_past (a 65,600-byte blob) is refused naming
its size where the default domains bind it.

Verified: see the check job named in the landing.
2026-11-20 00:28:33 -08:00
Anees Iqbal f631d9081d 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 00:05:53 -08:00
Anees Iqbal f1c3a2557e translator: spilled fields read 16 bytes at a time, through a NonWritable block
Under the identity domains a function's fields past its push window live
in a parameter block at the pushed ArgumentTableAddress, and each was read
by a load of its own size (a slot's bounds: 8 bytes, aligned 8) through a
writable device place. The block is now read in 16-byte lines: each line a
spilled field touches is one uvec4 load, aligned 16, made once where it
dominates (EmitCx::block_line, so load_push_fields' reads at entry share
them), and each field is taken from its line (a word, a two-word shuffle,
a bitcast for an address, whole lines for a region). The place's member is
NonWritable: nothing writes the block while a command reads it, so a device
may read it as read-only memory; device_place_read_only notes that RADV
reads a uniform address of such memory with a scalar load.

The block's address is a multiple of 16 (rt's ring aligns every write to
16) and its size is (argument_table_size), so every line lies in it.
docs/API.md states that contract for a consumer.

Why: wide_bindings spills 23 of its 24 slots' bounds; it read them as 23
loads of 8 bytes, now 12 of 16. In one stream's kept lowerings
(gb-3090-r2) 2 of 424 modules spill: 14 spilled bounds become 7 lines,
2 become 1. SEMANTICS_VERSION 2197 -> 2198: module words change.

Test: engine_identity_spill's vertex function loads each 16-byte line of
its spilled fields once, in its first block, as a uvec4 aligned 16 through
a NonWritable block; its interpreter tests read the spilled bounds as
before.
2026-11-19 23:35:15 -08:00
Anees Iqbal bda9935e09 rt: VK_NV_linear_color_attachment where listed; a plane renders through its bit only as a LINEAR image, marked, in a pass of such planes alone
The RTX 3090 and the RTX 5080 Laptop GPU (NVIDIA 620.70.06) give every plane format's linear
tiling, and its DRM_FORMAT_MOD_LINEAR modifier where listed,
VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV in place of the colour attachment feature.
Query::plane asked the image format query alone, which offers the colour attachment usage there,
so rt rendered NVIDIA's in-place planes through that bit with the extension off.

- Floor: VK_NV_linear_color_attachment joins OPTIONAL_EXTENSIONS (enabled where listed), and its
  linearColorAttachment feature (LINEAR_ATTACHMENTS) is enabled where the device lists the
  extension and reports it, which Vulkan requires of a device that lists it. Vulkan 1.3 needs no
  other extension for it (its dependency is VK_KHR_get_physical_device_properties2 or 1.1). The
  translator is told of neither. Core::linear_attachments carries the enabled feature.
- The plane test (surface::held_usage): a usage is offered where the image format query offers it
  AND the plane's own tiling's format features (LINEAR's for an opaque handle, the
  DRM_FORMAT_MOD_LINEAR modifier's for a dma-buf, read through VkDrmFormatModifierPropertiesList2EXT)
  hold what the optimal image has for that usage (texture::kept_features, the test a texture over a
  buffer takes), and for rendering the colour attachment feature itself
  (VUID-VkImageViewCreateInfo-usage-08931). The NV bit stands for the colour attachment feature only
  where linearColorAttachment is enabled AND the image is VK_IMAGE_TILING_LINEAR: Vulkan sets it
  "for renderable color formats in the linearTilingFeatures" alone. So NVIDIA's opaque fd planes stay
  in place on the enabled path and its dma-buf planes take the copy form (SurfaceCopy::Tiling).
- The condition, held by rt: a plane accepted through the NV bit is marked at its make
  (surface::linear_alone, SurfaceImage and Image linear_attachment, Attachment::linear). A pass's
  begin (Pass::check, pass::linear_shape, one mark read an attachment) refuses with the new
  Gap::LinearPlanePass { kind: LinearPlanePassKind }: OtherColor, a colour attachment that is not a
  marked plane (the extension's rule: "as long as all the color attachments in the render pass
  instance have VK_IMAGE_TILING_LINEAR tiling"); DepthStencil, a depth or stencil attachment (not
  Vulkan's rule: an RTX 3090 lost the device on that shape, and rt recovers from no loss, so by the
  ladder's third rung it is not used; the words name the driver); Resolve, a multisample
  attachment resolving into a marked plane. Every colour attachment marked (both planes of a
  picture in one pass among them) with nothing else set renders.
- Unchanged: a texture over a Shared buffer keeps its plain-bit test and its counted copy; the old
  runtime is not touched.

The rt README: the surface test and the marking (Exported surfaces), NVIDIA's dma-buf planes as a
copy-form known gap, the refusal among the render encoders' known gaps, the extension row and a
Linear attachments feature table (Floor); the clear-reach slip "inside the Metal's render area"
fixed. docs/REFUSALS.md regenerated; api_signatures.tsv blessed: the new variant and enum,
floor::Features::linear_attachment, OPTIONAL_EXTENSIONS' value.

Tests: tests::floor (the extension and feature enabled where listed and reported, the README
table); tests::surface::verdicts (NVIDIA's linear word: held and marked only as LINEAR with the
feature, the copy form without it and under the modifier either way, the plain bit unmarked,
blend and filter held to the optimal image); tests::pass (linear_shape: one and two marked planes
render, the three shapes refused); tests::linear_planes on device (a draw into one plane and both
planes in one pass rendered and compared on every device; the three shapes refused where the
plane is marked and rendered, compared, where it is not).
2026-11-19 22:13:45 -08:00
Anees Iqbal 4c39fc5bcb docs: the compressed-texel-decode entry's ASTC bound follows the cost the old runtime announces
What: in docs/API.md's compressed-texel-decode catalogue entry, the sentence on the ASTC LDR bound
(up to 1/2048 off Metal's on ANV, Mesa 26.2.6, the Iris Xe of Raptor Lake-P, over the fourteen
footprints) moves from inside the Cost: words to its own sentence after them.

Why: c77d059c68 put it in the middle of the Cost: words. The old runtime announces
Degradation::CompressedTexelDecode with a fixed cost string, and its catalogue test
(tests::degradation_catalogue::a_runtime_kind_s_entry_states_the_cost_it_announces) holds that an
entry's Cost: text begins with those words. It failed at development b676eda182 (tip check
m3-max-56610, the product suite's one failure of 6200). The old runtime is frozen, so the doc
moves, not its string. The bound and the conformance constant that cites it are unchanged.

Verified: the doc diff alone; the test runs in the check job on development after landing.
2026-11-19 22:00:46 -08:00
Anees Iqbal b676eda182 rt: a colour render target takes an index, and a draw reads it as an attachment as it reads a shader-read one
Metal fetches any render target, and its header gives every texture a handle with no tie to
usage (MTLTexture.h: gpuResourceID, "Handle of the GPU resource suitable for storing in an
Argument Buffer"). rt took an index only for shader-read or shader-write usage, so a colour
target made for rendering alone had no second element and every fetch from it was
Gap::Draw(FetchedAttachment): guest 26's 4,792 refusals, all of that shape.

- The index rule: shaders reach a texture made for shader reads or writes, or a colour render
  target (render-target usage of a pixel format with no depth or stencil), which takes an index
  exactly where it does (Refusal::TextureIndex), at every maker: new_texture and the heap, buffer
  and Managed makers, views, drawables and surface planes. A depth or stencil target made for
  neither is unchanged.
- A colour render target not read takes what a shader-read one takes for attachment reads: the
  sampled usage, and the feedback usage where the image format query offers both beside its
  usage; the shadow on a device without the loop; neither where the query refuses them, and its
  draws that read it stay Gap::Draw. Its home stays the attachment layout, so a pass that does
  not read it records no move of it, and a fetching pass moves it home, feedback, home with the
  existing move code.
- Only its second element is written: its sampled-texture element stays the null one, so a slot
  that binds it reads nil as before. place_texture takes the view its second element names in
  place of a flag.
- A linear image in place over a buffer takes no sampled usage for a target shaders do not read.
- The in-tree consumers take the rule: the replay player's texture class, the harness's and the
  conformance suite's rt side. rt's own tests make their unindexed colour targets with
  new_texture_for_views, and give indices where a test needs new_texture's path.
- docs/RESOURCE-ID.md, the runtime README and Refusal::TextureIndex's doc say the rule; docs/REFUSALS.md is regenerated.

Also rides along, from the planner, in the README's known gaps of memory blocks: a block freed
before a submission used it waits on the block-maker thread for its bind, and a ring take that
needs a new ring block can wait behind it.

Verified: see the check job named in the landing.
2026-11-19 21:40:56 -08:00
Anees Iqbal 6e010b843f rt lock budget: a test that counts nothing says so, and the matrix shows its leg as not counted
A lock-budget test on a node that names no M2V_LOCK_EVENT returned early and passed, printing a
LOCKS-UNMEASURED line the matrix's filter dropped with the rest of a passing test's output. The
gem10 and um870 legs passed that way at 1ae9003019 while every leg that counted failed, and the
report could not tell them apart.

Each budget test now names its record (Locks::open takes its key) and prints, where it counts
nothing, 'LOCKS <test>: not counted, the node names no M2V_LOCK_EVENT' and
'M2V-MATRIX uncounted lock_budget/<key>'. The matrix keeps that line as it keeps a record
(KEEP matches 'M2V-MATRIX '), results.parse_suite collects it, leg_entry stores the leg's keys
(results.leg_uncounted), and the leg's verdict line ends in 'not counted: <keys>'. No node
setting changes.

Verified: scripts/matrix's unittest suite, 87 tests, OK locally, with the new
UncountedTests case (a passing test's line through matrix.KEEP, parse_job and verdict_line).
2026-11-19 21:12:49 -08:00
Anees Iqbal ff507ed9b5 rt: the border swizzle from the image where reported, and an opaque-black border's static note
Where a device lists VK_EXT_border_color_swizzle and reports borderColorSwizzleFromImage, device
creation enables the extension with both its features: borderColorSwizzle, which Vulkan requires
of every device that lists the extension, and borderColorSwizzleFromImage. Elsewhere neither is
enabled. Sampler creation is the same form on every device. No sampler chains
VkSamplerBorderColorComponentMappingCreateInfoEXT on any device: a sampler in the arrays meets
every view, and that structure names one mapping. So the struct is left off everywhere, and
VUID-VkSamplerBorderColorComponentMappingCreateInfoEXT-borderColorSwizzle-06437 cannot fire. With
the feature, an opaque-black border sampled through a view whose component mapping is not the
identity reads through that mapping, as Metal's border reads through the swizzle. Without it,
Vulkan leaves that texel undefined; the NVIDIA driver reads (0, 0, 0, 1).

A new static note, PrecisionNote::SwizzledOpaqueBlackBorder, records that difference, decided on
every device by the sampler alone:
- SamplerState::precision_note is Some for a descriptor whose address mode reads the border
  (ClampToZero or ClampToBorderColor) with an opaque-black colour (SamplerDescriptor::shape's
  opaque_black_border).
- A compute or render pipeline carries it among its precision_notes where a function samples
  through a constexpr sampler of such a border. That is decided by the constexpr sampler's own
  constants, through the device sampler the translator states for it
  (CombinedSampler::constexpr_sampler).
- The conformance rt side collects the sampler state's note with the others.

The rt README records the known gap and the feature table. docs/API.md has the catalogue entry.
The translator's cache appends the variant (ARTIFACT_FORMAT_VERSION 553 -> 554). Validation
derives no tolerance from the note (Allowance::Unbounded).

The old runtime's degradation.rs gains a notes entry, because Degradation::from_precision_note
matches every PrecisionNote. DeviceDepthBias did the same. The old runtime announces nothing new.

Census, GPU-free, over the 31 kept replay streams:
- 0 sampler states read an opaque-black border.
- 0 of 4609 constexpr samplers do, over the 12213 functions of their 322 distinct libraries.
  12 functions did not decode under the standard budget and are not counted.
2026-11-19 20:59:59 -08:00
Anees Iqbal 653014c278 conformance: the heap cases name their size allowance where the coverage document reads it
docs/CONFORMANCE-COVERAGE.md derives each case module's tolerances from the Allowance::new calls
in its own text, so the helper in texture_query.rs left the four heap modules reading 'every
field' while they loosen both numbers of every answer on the new runtime. Each module now names
the allowance itself (the same path, loosening and justification); texture_query keeps the entry's
slug, DEVICE_OWN_SIZES, with the rule in its doc. The document is regenerated: the four heap
modules, pass_sequence_actions and astc_textures each read one more tolerance, 26 in all.
2026-11-19 20:41:18 -08:00
Anees Iqbal 1f4cb5b986 conformance: the new runtime's heap texture sizes are held by their property, not by Metal's numbers
metal2vulkan-rt answers heapTextureSizeAndAlignWithDescriptor: with the device's own image
requirements, raised to bufferImageGranularity (its README's heaps), so on the Iris Xe 588 sites
of the heap families read divergent against Metal's numbers. They are not a bug and not ranked
against the old runtime: a consumer places by this device's answers.

So on the new runtime's run the cases stop comparing the two numbers with Metal's and the side
holds each answer to what a consumer places by, before answering it (rt_side/heap_sizes.rs):
1. the alignment is a power of two, for every query;
2. for a Private query, a heap of align + size bytes takes the texture at offset align;
3. there, level 0's first slice written from a buffer at Metal's layout of the level reads back
   unchanged.
A Shared, Managed or Memoryless query is held to step 1 alone: rt places heap textures in Private
blocks only, and placing the descriptor in a Private heap would answer another query. A
descriptor whose bytes rt does not move, which its copy answers Gap::TextureBytes (depth and
stencil both, multisample) or Gap::FloatDepthUpload (Depth32Float) for, is held to steps 1 and 2.
A failed step answers its failure, so the site still diverges (Err where Metal answered).

The cases (texture-pairs, heap-sizes, format-footprints, ycbcr-two-plane-format-descriptors)
name an rt-only allowance per query at case/<query>/size-and-align/Ok/*, Unchecked, justified by
a new docs/API.md section 10 entry, "The new runtime's heap texture size and alignment are the
device's own", worded as rt's README words it and naming the three steps. The old runtime's run
compares exactly, as before. A refusal still diverges: the allowance is under Ok.

Tests: every recorded heap answer (18 recordings, 2425 answers) has both numbers under that
allowance and its refusal site under none; every NewRuntimeAccepted slug a case names is a
section 10 entry (the existing check now covers rt-only slugs too).
2026-11-19 20:41:18 -08:00
Anees Iqbal c77d059c68 conformance: the ASTC cases hold the device's decode under compressed-texel-decode
On the new runtime a linear (_LDR) ASTC texture whose block the device holds is read through the
device's decode, the static note compressed-texel-decode (Texture::precision_note). The case
named only decoded-texel-precision for its linear forms' texels, the old runtime's emulated
decode, so on the Iris Xe its fourteen linear footprints' texels were unlisted rows, up to 0.00049
off Metal's value. The case now loosens each round's texels on the new runtime's run by the
catalogue's bound for that note, 1/2048 plus the float rounding of both values, justified by the
note alone (rt-only; the old runtime's run is unchanged). The catalogue entry states the ASTC
bound and where it was measured (ANV, Mesa 26.2.6, Iris Xe of Raptor Lake-P, fourteen
footprints): 0.00049 is under 1/2048 (0.000488...) only with the rounding allowance, so the
figure is stated with it. sRGB and HDR forms still compare exactly.
2026-11-19 20:41:18 -08:00
Anees Iqbal 0c451c569e conformance: the two new fetch-ordered cases take fetch-ordered-bgra8unorm's ledger rows
A fetch from a target made for shader writes and from one of unknown usage answers as the fetch
from a target made for shader reads, on both runtimes: the same three texel sites a code apart,
with the same counts on each card. Each ledger takes the read case's rows for its venues, reason
text unchanged (the device's conversion into an 8-bit unorm attachment it also fetches). The
coverage document counts the twelve rows the old runtime's ledger gains.

Verified: see the check job named in the landing.
2026-11-19 20:36:18 -08:00
Anees Iqbal 7839fa0876 conformance: the coverage document counts the two new fetch-ordered cases
Regenerated by the coverage tool at the cases' commit with their recordings: two more committed
recordings, fetch_ordered's six cases, and the case lists of the items they drive.

Verified: m3-max-56114 (msi) regenerated it, then conformance-host 1090 of 1090 passed, the
coverage document test among them; clippy of the conformance crate 0.
2026-11-19 20:36:18 -08:00
Anees Iqbal 5458ac7954 validation: a check or dump of a buffer with two copies names the copy it read
A two-copy stream's Managed buffer has a CPU copy, which Metal's contents answers, and a device
copy, which commands read. The player's check and dump read the CPU copy (Backend::read on the new
runtime), and nothing said so: on a discrete card, two plays' dumps of #106455 agreed as CPU copies
while the device copies the kernel read differed (count word 1848 against 12), and the verdict
'inputs equal' rested on them.

Now a check line of such a buffer ends '(CPU copy)' or '(device copy, read back)', a dump holds
cbC-objO.copy with those words, and compare-dumps compares only the same copy of both plays,
reporting 'copies differ' otherwise and counting the buffers compared as CPU copies and as device
copies in its summary. The new runtime's play reads the device copy with --read-device-copies yes:
through a blit into a Shared buffer of the play's own where the runtime keeps one, through the
buffer's mapping where the device's one copy is the GPU's and the player keeps the CPU's. On a
device that keeps a device copy, the report's 'managed digests' line after its device line says
which copy the play reads. Backend::read_copy names it; the old runtime's backend names none.

Tests: a_read_of_a_buffer_with_two_copies_says_which_copy_it_took (no device: both labels in the
check lines and dumps, the compare of like and unlike copies) and, on a device,
a_check_of_a_managed_buffer_names_the_copy_it_read (a blit's fill reaches the device copy: the CPU
copy reads zeros, the device copy read back reads 7s; the header line where the device keeps a
device copy). docs/REPLAY-STREAM.md section 10 says it.
2026-11-19 20:00:32 -08:00