Commit Graph
6423 Commits
Author SHA1 Message Date
Anees Iqbal 737ccbf81a metal: the resource ID word, its spec and test vectors
Under the identity binding domains a guest computes a texture's or sampler's gpuResourceID itself,
with no round trip: the index the consumer grants in the low 32 bits and a word in the high 32 bits
that is a pure function of the Metal descriptor. The guest's port needs the word specified and a
file of vectors both sides check.

- metal::resource_word::TextureWord::of(pixel_format, swizzle): bits 0-11 Metal's border texels
  after the swizzle (the existing border_texels rule), bit 12 the out-of-bounds alpha of a format
  without alpha, bits 16-31 the MTLPixelFormat raw value, so a texture's word is never 0. None for
  the placeholders and the formats the translator holds no texture of or only copies.
- The sampler word is the existing SamplerWord, unchanged.
- docs/RESOURCE-ID.md: the ID's layout, the index classes (0 nil; storage-capable textures 1 to
  4,095, valid in both arrays; other textures 4,096 to 65,535; samplers 1 to 3,999), both words'
  bits and the level rule, and the vectors file. README's documentation table lists it.
- crates/metal2vulkan/tests/resource_words.tsv: 392 vectors (every pixel format with a word under
  the default swizzle, each channel of seven formats from each other source, every sampler field
  through its values, the level clamps around the points the nearest level turns at, and one
  descriptor with every field changed). tests/resource_words.rs recomputes every line through the
  public API and holds the file equal to what the generator writes; an ignored test blesses it.
- api_surface lists the new module; api_signatures regenerated.

Verified:
- msi job 40810 at the same tree: clippy -p metal2vulkan --all-targets --all-features -D warnings,
  rustdoc -D warnings, nextest 18 of 18 (resource_words, the TextureWord unit test, api_surface,
  api_signatures).
- msi job 40811 at the same tree: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
- msi job 40809: the bless test wrote the vectors; the combined sampler line (0x58f6ab53) and the
  A8Unorm and R8Unorm texture lines checked by hand against the bit tables.
2026-11-17 07:01:32 -08:00
Anees Iqbal c944d63548 matrix: a leg whose suite never reported fails
A job that printed a leg's device lines and was then killed before the leg's M2V-SUITE line ran
nothing of that leg, yet the leg was judged on its other suites: on 248d41074f the 3090 and the
UHD 630 read PASS on their harness suites alone while their rt jobs (m3-max-40768, 40800) had
been killed for RAM. Such a leg now fails with the job and its exit.

Verified: the script parses; the next matrix run on development's tip exercises it.
2026-11-17 06:45:22 -08:00
Anees Iqbal e1648adeb4 metal2vulkan-rt: the memory tests' leak records are read at the device's drop
The matrix judges a gauge only at a point (@100, @200, @drop) and failed every GPU leg and
lavapipe on 248d41074f for the memory tests' pointless keys: blocks_live, pool_full and
pool_settled are mid-test counts the tests already assert exactly, and blocks_teardown is the
leak check. The mid-test lines are gone; the teardown line reads blocks_teardown/{buffers,blocks}@drop.

Verified: cargo fmt; the matrix rerun on the tip reads these keys (next run).
2026-11-17 06:45:22 -08:00
Anees Iqbal 248cee5cbf matrix: a job killed over its RAM runs once more, sized from that kill
Jobs are sized from their last measured runs: 1.3x the peak, at least 2 GiB. On 248d41074f
the held workspaces sat at a commit the tip does not descend from, so the GPU legs got fresh
ones, and the rt jobs on ms01 (m3-max-40768) and the Windows host (m3-max-40800) went over
their 2 GiB in their first two seconds (potluck why: over memory, 2 GiB and 2.1 GiB of 2) and
lost their legs. Such a job now runs once more with the room its kill gives it (1.5x), and the
leg is judged on that run.

Verified: the script parses; exercised by the next matrix --legs rerun on 248d41074f.
2026-11-17 06:35:58 -08:00
Anees Iqbal 248d41074f matrix: a run of some legs is timed against the note's other GPUs; untested suites show their exit
The cross-GPU time rule took its median from the run's own GPU legs, so `run --legs` of one GPU
had fewer than three and never judged time. The median now takes every GPU leg of the sha's
note, with each leg's base, and only the legs of this run are judged.

The harness suite counts no tests, so its verdict read "harness 0/0"; a suite that ran no test
now shows its exit code.

Verified: unittest of scripts/matrix passes; `show 73e0af4b66` prints the new form.
2026-11-17 06:19:58 -08:00
Anees Iqbal c8321149f7 matrix: a job kind's default minutes stay its timeout floor
The timeout was 1.5x the longest of the kind's last three runs, at least 5 minutes. A held
workspace makes most builds incremental (the msi build of 793a1f7980 took 1.8 minutes), so the
next build was given 5 minutes, which a full rebuild after a translator change would overrun and
waste the run. The kind's default (build 30, Windows build 60, lavapipe 60, GPU 15, timing 20
minutes) is now the floor; measured runs only raise it.

Verified: the script parses; unittest of scripts/matrix passes. The sizing itself runs on the
next matrix run.
2026-11-17 06:19:58 -08:00
Anees Iqbal 4406486e8c docs: the matrix's harness suite and time records 2026-11-17 06:19:58 -08:00
Anees Iqbal 56b979574e metal2vulkan-rt: the teardown gauges name their point, @drop, as the matrix reads them 2026-11-17 06:19:58 -08:00
Anees Iqbal 6a5e230514 matrix: the harness's timed workloads per GPU in an exclusive job; time records in microseconds 2026-11-17 06:19:58 -08:00
Anees Iqbal bb30a0b040 matrix: a GPU job prunes carry mirrors left by jobs that never ran 2026-11-17 06:19:58 -08:00
Anees Iqbal 391cc679e7 matrix: a chain's own failure fails its legs; no stats for a job that never started 2026-11-17 06:19:57 -08:00
Anees Iqbal aaa6350ee6 matrix: record the driver version; read dispatch errors from the reply 2026-11-17 06:19:57 -08:00
Anees Iqbal b4b22c7b2c matrix: the per-commit matrix runner and the user-space instruction counter (WIP) 2026-11-17 06:19:57 -08:00
Anees Iqbal 4dcd5a74b9 AGENTS.md: docs/REPLAY-STREAM.md in the doc table
The replay stream format and its player landed in 84fc9a95fc; the doc table names every doc an
agent reads. Doc-only change.
2026-11-17 06:15:44 -08:00
Anees Iqbal 84fc9a95fc validation: replay streams name the guest RAM copies; a present reads nothing
The recorder writes the host's copies between the guest's RAM and a buffer as blit-encoder
records: m2v.copyFromGuestRam ([runs, buffer, offset, data]), m2v.copyFromGuestRamAt ([placed runs,
buffer, data]) and m2v.copyToGuestRam ([buffer, placed runs]), a run being [start, end] host
addresses of which only the length counts. docs/REPLAY-STREAM.md names them, with the data the
next recording carries. The player relocates the data of every upload (these two and
m2v.copyBytes:toBuffer:offset:) by one rule, where its buffer answered a gpuAddress, and counts its
bytes as written; the old runtime's backend copies them through a staging buffer, piece by piece,
and copies m2v.copyToGuestRam into host memory nothing reads.

m2v.present is now recorded wherever the device's display shows a guest present, a nil texture
where the stream never made it, so frames are counted once: the player closes the frame and
reads nothing (a readback per frame would add a copy Metal does not make).

Tests: a unit test plays the three copy-ins into a block and an addressless buffer (relocated,
counted apart 4 past 8, untouched) and refuses data of another length than its runs; a device
test lays a buffer out with a fill, both guest RAM copies, a fill copy and a copy back, and reads
it back as expected.
2026-11-17 06:14:55 -08:00
Anees Iqbal a934dea858 validation: replay device tests take the queue plan
A play's readbacks take a command queue beside the stream's, which the lane's queue limits put on
the one shared VkQueue on NVIDIA (metal2vulkan-queue-limits-reached on the RTX 3090 and RTX 2080,
jobs m3-max-40608 and m3-max-40607); the tests make their devices at the plan (at_plan).
2026-11-17 06:14:55 -08:00
Anees Iqbal 1de964bbff validation: command-replay picks its subcommand with a plain match (clippy type_complexity, job m3-max-40574) 2026-11-17 06:14:54 -08:00
Anees Iqbal 9f6e6a8b37 validation: replay clippy (a boxed blit encoder, pairs as chunks, slices from refs) and the relocation test's offsets
Clippy -D warnings in job m3-max-40563; the address map test put its aligned and its 4-past-8 address
the other way round from its assertions (the counts held).
2026-11-17 06:14:54 -08:00
Anees Iqbal 27ba730d44 validation: the replay reader asks whether a segment is the last before borrowing it
The segment count was read while the segment was borrowed mutably (E0502, job m3-max-40546).
2026-11-17 06:14:54 -08:00
Anees Iqbal 964ae2c241 validation: replay streams v2, their player and the old runtime's backend
What: docs/REPLAY-STREAM.md specifies the binary replay stream (version 2): segments of records
(names, blobs by SHA-256 of the exact bytes, calls), tagged values, the address and resource-ID
model, CPU writes, surfaces before the platform cutover, commits, events and frames. The new
`replay` module of the validation crate holds its reader and writer, the address map, the player
(relocation of 8-byte-aligned address words in live recorded ranges, counting rewritten words and
the 4-mod-8 values it leaves; exact resource IDs; waits only for command buffers that can
complete, so one held on an event never stops another queue; counters per waited group, per frame
and in total, readbacks excluded; SHA-256 checks), and a backend over the old runtime's public API
(compute and blit encoders, blocks as placement heaps, textures at recorded IDs, events). A
selector it does not play is a typed refusal naming it.

`command-replay` now plays and dumps v2 streams; the v1 JSON manifest runner is deleted (nothing
in the tree or the lanes used it).

Tests: unit tests write their own streams (round trip, segments and a cut tail, refused kinds and
versions, the blob directory and its hash check, nested ranges, relocation counts, event-held
command buffers, frames, releases and host splits). Device tests (`runtime_lane::replay_streams`,
under m2v_gpu or m2v_cpu_icd) play written streams on the old runtime: a device pointer written
at a recorded block address is relocated and the kernel's output is the case's Metal output, on
two devices alike; a command buffer held on a CPU-set shared event does not stop another queue's;
textures are made at recorded resource IDs 77 and 5 and read back as written.
2026-11-17 06:14:54 -08:00
Anees Iqbal ec40b7de6d Interface: what a function reads and writes beyond its bound slots
Each stage interface, and a pipeline's together, states whether its
function may read or write a resource through anything but its bound
slots: a pointer or texture it loads from memory or makes from an
integer (an argument buffer's resources, an address stored in a buffer,
a resource ID), an indirect command buffer, ray tracing, or a call it
cannot see into. Decided from the specialized entry's memory plan: an
access whose pointer or texture handle may have a dynamic or call root.
With each slot's access, these are the two static facts the new
runtime's compute encoder needs to place a barrier only on a hazard.

SEMANTICS_VERSION 2144 (interface facts), ARTIFACT_FORMAT_VERSION 526
(two fields in StageInterface and PipelineInterface).
2026-11-17 06:14:08 -08:00
Anees Iqbal a933b864a4 harness: a described buffer filled zero is left as made
Metal makes a new buffer zero, so a zero fill needs no copy in the harness
and no upload: a described workload's buffers reach hundreds of MiB, and
holding their zeros doubled its memory and added a copy before its first run.

Verified: the description unit test asserts the zero buffer has no contents
(compile job after this commit).
2026-11-17 06:10:21 -08:00
Anees Iqbal 71eb64cd42 harness: a workload with no dispatch is refused as such, bindings or not
The per-dispatch reading refused a workload of bindings and no dispatch as
setting a binding after its last dispatch; it has no dispatch, which the
refusal says again.

Verified: the description refusal unit test in the compile job after this
commit.
2026-11-17 06:10:21 -08:00
Anees Iqbal 463599f647 harness: each dispatch's bindings a fresh local, moved once its dispatch is read
Draining the pending bindings trips clippy's drain_collect, which asks for
mem::take, a placeholder move this tree does not use. Each dispatch now reads
its lines into a Vec of its own, moved into the dispatch once the dispatch
line is read; at the end of the lines, bindings left over are the refusal
they were.

Verified: clippy and the description unit tests in the compile job after this
commit.
2026-11-17 06:10:21 -08:00
Anees Iqbal 5e94f0d887 harness: buffer creation workloads, old runtime against new
Shared buffers of 4 KiB, 1 MiB and 64 MiB made and released in turn, so each
takes the range the last one left: Session::create times each
newBufferWithLength:options: call by wall clock, checks the new buffer starts
zero (every word the first time, one word a 4 KiB page after), writes it all
over and releases it. The first creation of the length writes and releases a
buffer before the loop, so even the checked one reuses a dirtied range. The
command runs them after the authored workloads and prints their p10, p50 and
p90 and the gauges at the 100th and 200th, with
M2V-MATRIX time harness-<runtime>/create_<size> lines; --only selects them.

Verified: unit test of the zero check over a host buffer; the device test
creates each size once on the old runtime (compile job after this commit).
2026-11-17 06:10:21 -08:00
Anees Iqbal c546c13905 harness: a dispatch drains the pending bindings (clippy new_instead_of_clear)
Moving the pending bindings into the dispatch and assigning a new Vec trips
clippy's new_instead_of_clear on the dated nightly; draining them leaves the
Vec empty for the next dispatch without a reassignment.

Verified: clippy in the compile job after this commit.
2026-11-17 06:10:21 -08:00
Anees Iqbal a20f8503f8 harness: described workloads over metallibs, and outputs compared between runtimes
What: a description file names workloads over metallibs in a directory (description.rs): per
workload its metallib, buffers (length, storage mode, fill: zero, seeded words, seeded floats
in [0, 1), or hex), the setBuffer/setBytes calls before each dispatch, dispatchThreadgroups or
dispatchThreads with an optional repeat, and the buffers runtimes compare (exactly, or as
floats within a tolerance, NaN matching NaN). Both are the command's arguments
(--workloads DIRECTORY --description FILE); nothing in the tree names such a workload. Each
workload's plan, which holds its buffers' starting contents, is made once at parse to check it
and again when it runs.

The harness owns its device, the authored library and the metallibs plans named (run.rs), behind
an object-safe Session, so the command runs each workload on every runtime it names in turn
(--runtime old[,RUNTIME...]) and prints its rows only once each runtime's outputs after the first
run matched the first runtime's (compare_outputs). Plans carry their library (Source) and their
outputs.

Why: the benchmark's harvested kernels have no CPU reference; the old and the new runtime check
each other on the same inputs instead.

Verified: see the lane report (compile job and GPU legs).
2026-11-17 06:10:21 -08:00
Anees Iqbal c43fccb7c2 metal2vulkan-rt: the consumer's instance and device extensions, enabled where offered
What: Instance::new takes any instance extension, not only the window system's: it
enables the floor's and each one the consumer names that the loader offers, once,
and Instance::extensions lists those enabled. DeviceOptions::extensions names
device extensions beyond the floor's. A DeviceExtension is a name and, through
DeviceExtension::with_features, its feature structure: the members the consumer
needs set, and a test of the device's answer. Device::new enables each where the
device lists it and, for one with features, where vkGetPhysicalDeviceFeatures2's
answer passes the test, chaining the consumer's structure in front of the floor's;
it passes over the rest. Device::extensions lists those enabled, the floor's first.

Why: reims's review (F12): present fences need VK_EXT_swapchain_maintenance1 with
its swapchainMaintenance1 feature, and the instance's surface_maintenance1 and
get_surface_capabilities2. Without them, retiring a swapchain waits for the
presenting queue to go idle, which on a shared queue covers every guest's GPU
work. The consumer names an extension's dependencies too.

How verified: the device test enables, on every device of the cfg's kind, a
missing name, a floor name again, and swapchain_maintenance1 with its feature
where the instance has its dependency, and expects exactly the floor's plus what
the device offers; the instance likewise with the two surface extensions. The API
signature table is blessed for the new items and Instance::new's renamed
parameter.
2026-11-17 06:01:27 -08:00
Anees Iqbal 650c070dcb metal2vulkan-rt: the runtime-queue test helper only under the device cfgs; a struct literal for test options
clippy -D warnings (job m3-max-40633): the helper was unused in plain test
builds, and the memory tests reassigned a field of a default DeviceOptions.
2026-11-17 05:58:26 -08:00
Anees Iqbal c052143c75 metal2vulkan-rt: memory blocks, the pool that makes them ahead, and buffers as views
What: Device::take_block and release_block hand out memory blocks of two classes,
Private (the floor's device-local type, never mapped) and Shared (the host-visible,
coherent, cached type, mapped for the block's life), each one VkBuffer with every
buffer usage and a device address over an allocation of its own. Up to BLOCK_LEN
(256 MiB) a block is pooled: the block-maker thread ("m2v-blocks") keeps one ready
per class, off every caller's path, so a take waits only when none is ready. Past
it a block is dedicated: the length rounded up to 64 KiB, made in the call, up to
maxMemoryAllocationSize and maxBufferSize (Limit::BlockLen). Device::new_buffer
makes a Buffer, a (block, offset, length) view with no Vulkan object: gpu_address
is the block's address plus the offset, contents its mapping plus the offset, or
None in Private.

Every block reads zero when handed out, new or taken again, as Metal's new buffers
do: Shared zeroed through its mapping (which also makes every page resident before
anyone holds it), Private by a GPU fill submitted on the runtime's queue and waited
for. new_buffer(.., zeroed: true) zeroes exactly the buffer's range before it
returns: through the mapping in Shared; in Private a fill of the whole 4-byte words
inside the range and copies of the bytes beside them from a 16-byte zero source.
Heap placements pass false. A length of 0 and a range past the block are refused
(Refusal::EmptyBuffer, Refusal::BufferPastBlock), as Metal answers nil.

A released block takes effect once its last buffer is gone (buffers hold it).
The block-maker thread then zeroes a pooled block and keeps it, with its number,
address and mapping, while its class has fewer than two idle; the rest, and every
dedicated block, it frees after the consumer's BlockMappings::unmap, which
DeviceOptions carries. Block numbers are never reused (Limit::BlockIds). Teardown
stops and joins the block-maker thread, waits for the GPU, then frees every block
on the dropping thread, calling unmap for each the consumer was handed, and
destroys the device.

Counters: blocks and buffers gauges, blocks_made and submissions metrics are now
written.

Cleanup: floor::check already refuses a device with no graphics+compute family,
so Device::new takes capabilities.queue_family and keeps only the spare-queue
decision for presenting; queue_plan and Error::NoGraphicsComputeQueue are gone.
Device::new takes DeviceOptions.

Not here: the reuse of a released block waits only for its buffers; waiting also
for the last command buffer that used it arrives with command buffers.

The API signature table is blessed for the new items, the removed variant and
Device::new's new parameter; docs/REFUSALS.md regenerates unchanged (its rt scan
reads the floor's Missing only).
2026-11-17 05:55:07 -08:00
Anees Iqbal 08bde281aa metal2vulkan-rt: std430 uniform blocks, explicit threadgroup layout and the private memory type in the floor; Device keeps its memory types
Every lab capture (3090, 2080, XTX, RX 550, 780M twice, HawkPoint, Iris Xe,
UHD 630 under Windows, lavapipe) offers uniformBufferStandardLayout and
VK_KHR_workgroup_memory_explicit_layout with all four of its features, which
the translator emits for std430 uniform blocks and explicitly laid-out
threadgroup blocks. So the floor requires them: the extension joins
DEVICE_EXTENSIONS, and Features gains workgroup_layout, read only from a
device that lists the extension (a device-extension structure may be queried
only there). Each is named when missing, with a unit case.

MemoryTypes gains `private`: the first device-local type a BUFFER_USAGE
buffer can use, for the core lane's Private storage. Vulkan guarantees one, so
it is named (as a MemoryType) only on a device that breaks that rule.

Device::new chains vulkan11 and workgroup_layout into device creation, then
chooses the memory types on the device with floor::memory_types (destroying
the device if that refuses), and keeps them; Device::memory_types returns
them. The device test checks each type's flags and prints all three.

docs/REFUSALS.md and api_signatures.tsv are regenerated over development's
new rt types.
2026-11-17 05:38:05 -08:00
Anees Iqbal 374e29a988 metal2vulkan-rt: the floor's shader features, queue family, timestamps and memory types
The floor now also requires what the translator's shaders and the runtime's
core need of every device:

- shaderInt16, shaderInt8, storageBuffer16BitAccess (Vulkan 1.1 features,
  now read and enabled through Features::vulkan11), storageBuffer8BitAccess,
  scalarBlockLayout, vulkanMemoryModel and vulkanMemoryModelDeviceScope. The
  translator emits 8- and 16-bit access only in storage and physical storage
  buffers in practice (uniform views are u32 or uvec4, push fields are 32- or
  64-bit), so the uniform and push-constant 8/16-bit features stay out; it
  does use device scope.
- timestampComputeAndGraphics, and timestampValidBits of at least 36 on the
  first queue family with graphics and compute, which Capabilities names
  (queue_family). A device with no such family is Missing::QueueFamily.
- a host-visible, host-coherent, host-cached memory type (Shared storage)
  and a device-local, host-visible, host-coherent one (the parameter ring),
  each usable by a buffer of BUFFER_USAGE: every Vulkan 1.3 buffer usage plus
  device addresses. Vulkan answers buffer memory types only for a created
  device, so check() finds a type with each set of flags and carries the
  memory properties, and memory_types(device, &capabilities) chooses the
  first usable type of each with vkGetDeviceBufferMemoryRequirements.
  Missing::MemoryType names the flags.

Each shortfall is named in BelowFloor, with a unit case; the README's Floor
section states every item and tests::floor holds it to the code. The device
test now also creates each device with the floor's features and extensions
and chooses its memory types on it.

CI's lavapipe step (ci.yml and scripts/linux-gate-ci) runs the rt crate's
device tests too. refusal_surface.py reads metal2vulkan-rt and writes the
floor's Missing as section 10 of docs/REFUSALS.md; signatures.py pins
metal2vulkan-rt's public surface in api_signatures.tsv.

Verified: see the lane report (compile job, device legs on every lab GPU,
lavapipe and the Windows UHD 630).
2026-11-17 05:33:25 -08:00
Anees Iqbal 793a1f7980 metal2vulkan-rt: device tests format flags without Debug 2026-11-17 05:26:58 -08:00
Anees Iqbal 49a879bd0c metal2vulkan-rt: the instance, one device for everything, and its counters
Instance::new loads the loader and makes the instance at the floor's version with
the floor's and the consumer's surface extensions; physical_devices lists
PhysicalDevice handles that keep their instance alive. Device::new checks the
floor, makes one VkDevice with the floor's feature chain, and takes the first
graphics+compute family: one queue for the runtime and a second for presenting
where the family has one, else the same queue behind the same lock. raw() and
with_present_queue() give the consumer its handles; has_unified_memory() answers
from the device type. Teardown waits idle with every queue held, then destroys
the device. Counters (metrics and gauges, relaxed atomics) outlive the device.
2026-11-17 05:26:58 -08:00
Anees Iqbal eb7621de3b harness: the old runtime's gauges are its blocks with placements, not its kept empty ones 2026-11-17 05:22:15 -08:00
Anees Iqbal e1194be831 harness: doc links name Harness::run 2026-11-17 05:22:15 -08:00
Anees Iqbal ed7187a4e1 harness: authored workloads as named structs (clippy type_complexity) 2026-11-17 05:22:15 -08:00
Anees Iqbal 017ff31e2f wip harness crate 2026-11-17 05:22:15 -08:00
Anees Iqbal e21b8be64b harness fixture: companions and TOOLCHAIN from regen-air-fixtures --dir harness (job m3-max-40434) 2026-11-17 05:22:15 -08:00
Anees Iqbal ff0c532d71 harness fixture: the authored workloads' kernels (MSL, companions to come) 2026-11-17 05:22:15 -08:00
Anees Iqbal fe26a21c55 metal2vulkan-rt: tests::floor's device test checks the devices of its cfg's kind 2026-11-17 05:05:38 -08:00
Anees Iqbal d1b3d1ee31 metal2vulkan-rt: the floor, checked per device with a typed refusal below it 2026-11-17 05:03:48 -08:00
Anees Iqbal 65660ef735 AGENTS.md: the one exception to optimal images, and its fixed conditions
Rule 3 said "optimal images in real layouts" without the exception the owner
accepted for textures over Shared buffers, so the two contradicted each other.
The rule now names the exception and its conditions: a linear image on the
buffer's memory, in the device's own layout, created so its first use keeps the
bytes, with the alignment the guest reads from Metal's minimum linear texture
alignment; where a format query offers no linear image for a format and usage, a
counted copy at commit. The owner fixed these conditions and said they do not grow.

Doc-only change.
2026-11-17 03:57:01 -08:00
Anees Iqbal 5c121fec94 AGENTS.md: no calibration rung; second forms only for four query-decided features
The owner's decisions on the runtime rewrite's rules:

- The workaround ladder loses its calibration rung. Where no single form wins on
  every device, the form that is best on the slowest GPU is taken and the loss on
  the others is recorded as a known gap. The ladder is now four rungs; the
  thresholds' time box ends at rung 4.
- "One form" means one form per Vulkan capability. A second form chosen by a
  feature's query is allowed only for the four features the floor cannot
  require on every lab device: 16-bit floats, storage-image reads without a
  format, 64-bit atomics and 64-bit floats.
- Copies: nothing is copied that Metal would not copy; a copy is only the last
  form on a device with no other, reported as a known gap.

Doc-only change; nothing else refers to the removed rung.
2026-11-17 03:55:13 -08:00
Anees Iqbal 28b6b0b9df metal2vulkan-rt: the new runtime's crate, and AGENTS.md's rules for one path on every device
What: a new, unpublished workspace crate, crates/metal2vulkan-rt, that will replace
metal2vulkan-runtime and take its name at the cutover. It has no public API yet. Its first test,
tests::one_path, reads the crate's product sources (line comments removed) and fails on:
- a vendor, device or driver identity name (vendor_id, deviceID, DriverId, driver_name ...);
- a GPU vendor's ID as a hex literal (0x1002, 0x10de, 0x8086 ...);
- an environment read (env::var, option_env!);
- a struct or enum named as a policy.
Two more tests prove the scan finds each form and passes prose and unrelated numbers.

AGENTS.md takes the owner's new rules, in priority order:
1. correct for documented Metal, with the device's arithmetic and static notes per operation;
2. one path for every device;
3. native-like speed;
4. small.
It also takes:
- the workaround ladder, the never-list and the thresholds;
- the matrix rules: every check fans out one leg per GPU at once, and the replay matrix runs on
  development after each merge with deterministic metrics and leak gauges;
- the freeze: the old runtime, DevicePolicy switches, driver-fact tables, device checks and
  docs/FAST-PATHS.md get regression fixes only until the cutover deletes them, and nothing new
  of those kinds is added;
- the scope rule: below the floor is a typed refusal, and a Metal feature no replay stream uses is
  a typed refusal until a stream needs it.
The crate table, the doc table, CI's crate lists and the gate commands in AGENTS.md,
CONTRIBUTING.md and docs/VALIDATION.md name the new crate.

Why: the owner's plan replaces the runtime with one that has no per-device code paths. These are
the rules every lane of that work follows from its first commit.

Verified: cargo fmt. Build, clippy and the crate's tests run on development after this lands.
2026-11-17 03:09:06 -08:00
Anees Iqbal f84cc91cc8 view_check_device: the stream counts its pauses; strict where it saw none
What: Stream::next says whether the work had paused: none of the stream's
command buffers was left uncompleted as it committed the next. The
stand-by test counts the pauses over its window and prints them; where it
saw none it holds the check to every assertion as before (no answer, no
kernel begun, no dispatch submitted while the work went on, and the
stand-by length), and where it saw some, to its answer and its stand-bys.
Stream::new commits STREAM_DEPTH command buffers before it measures the
first, so the queue no longer drains as the stream is sized.

Why: the_check_stands_by_while_the_device_s_work_goes_on failed on
lavapipe in the lane (m3-max-40006): a kernel begun while the work went
on. The first command buffer measured about 3.6 times slower than the
later ones ran (67 fills, the longest commit to completion 496 ms where
8 x 225 ms was meant), so the queue held far less than it was sized for and
could drain while the test's thread was off its CPU; in a drain the check
rightly goes on. A failure with no pause seen still points at the product.

Verified: compiled and run in the job named when this tip is reported.
2026-11-17 02:29:16 -08:00
Anees Iqbal f31586247f joined_completions: the last part goes alone where the run bound ended a group
What: Moved also reads WorkCounts::group_ends_long. grouped_where_merging
asks that the last unmarked part close a group, or that a group went for
want of room before it (group_ends_long), the last then alone.

Why: marked_parts_go_in_fewer_kernel_submissions failed on lavapipe in the
lane (m3-max-40006, at 665949bf1a): Moved { grouped: 3, batches: 6,
submissions: 4, closed: 0 }. warm's fills ran 5.3, 13.7, 3.0, 9.9, 13.1 and
9.7 ms there, so the queue's expected run passed a quarter of the 16 ms
group bound (GROUP_RUN): the six marked parts grouped in pairs and the
unmarked last found no room in the third pair, which went first, the last
alone. That is the bound's behaviour; the test assumed runs of 4 ms or less.

Verified: compiled and run in the job named when this tip is reported.
2026-11-17 02:29:16 -08:00
Anees Iqbal 665949bf1a kept_textured: each device settles the view check before its frames
What: kept_textured's run_with calls Device::settle_view_check on each device
it makes, before the case's frames.

Why: the tests compare the resident uses frame 1 walked with frame 0's
(WorkCounts::resident_uses_noted). The view check runs from the device's
making (no record in the lane's scratch cache); its pointer import of host
pages, and that import's release, each change the device's host aliases
(HostAliases::version), and noted_apart.rs skips a draw's noting only while
that version stands, so a frame met by either walks its resident uses again.
On the RX 7900 XTX at development 01415e33d6 (m3-max-39932, lane 2/2) three
failed at kept_textured.rs:207 with frame 1 at 521 or 525 against 517, as at
the pin port 18b1c40ea4 (m3-max-39755).

Verified: compiled and run in the jobs named in the report.
2026-11-17 02:16:41 -08:00
Anees Iqbal e11a025d93 commit_work: the addressable-buffer count settles the view check first
What: runtime_lane::commit_work::buffers_made_take_their_addresses_from_their_blocks
calls Device::settle_view_check before its counted makings, as the lane's other
counting tests do.

Why: it counts the device-wide WorkCounts::addressable_buffers_made over 128
makings right after the device's making. The view check runs from the
device's making (no record in the lane's scratch cache), and its objects (two
scratch buffers and an import of host pages) take blocks of their own, each
with a buffer of addresses. On the RX 7900 XTX at development 01415e33d6
(m3-max-39932, lane 1/2) one landed in the count: 5 against at most 4.

Verified: compiled and run in the jobs named in the report.
2026-11-17 02:04:20 -08:00
Anees Iqbal 053e789a0e 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-17 02:01:49 -08:00