Commit Graph
6448 Commits
Author SHA1 Message Date
Anees Iqbal 94071f82a2 device: the identity pointer and handle domains, taken as a pair
The new runtime's form: pointers are device addresses used directly and a texture's or sampler's
handle is its gpuResourceID (docs/RESOURCE-ID.md). The variants come beside the old domains,
which stay until the cutover; nothing lowers under them yet.

- PointerDomain::Identity and HandleDomain::Identity.
- Device::new refuses one identity domain without the other (InvalidDescriptor) and the identity
  domains on a device without bufferDeviceAddress and shaderInt64 (Unsupported{IdentityDomains},
  naming both features as one alternative).
- A compile under the identity domains is Unsupported{IdentityDomains}, not implemented, at the
  start of analysis, so no old form is ever emitted under them. Later steps lift it as the
  lowering lands.
- The profile fingerprint covers the domains (tested).
- docs/API.md's policy section names the domains; docs/REFUSALS.md and the reach table carry the
  new refusal; api_signatures regenerated.

Verified (this commit's tree, rebased with the ledger commit before it onto b216007f0a):
- msi 41071: clippy -p metal2vulkan --all-targets --all-features -D warnings, rustdoc -D warnings,
  nextest -p metal2vulkan in full, 3,663 of 3,663 (the golden table included: no cell moved; the
  new test the_identity_domains_come_as_a_pair_on_a_device_with_addresses among them).
- msi 41072: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
- msi 41073: the conformance crate's ledger tests, 7 of 7.
2026-11-17 07:46:08 -08:00
Anees Iqbal 32b1c1578c conformance: the MoltenVK half-output rows say they are the test venue's
The 52 known-gaps.tsv rows for MoltenVK on the Apple M3 Max (half-output-blends-r16f, -rg16f,
-rgba16f) now open with "TEST VENUE, NOT A PRODUCT GAP": MoltenVK is a test venue, so the rows
record the venue's answer and no precision note or README entry carries them.

The blend-colour rows also say what their large differences are: cancellation near zero in the
device's `float` blend, not overflow or NaN and not our conversion. At RGBA16Float's alpha, source
-1.0625 over destination 0.869140625 with blend colour 0.45 sums to -9.8e-5 exactly; the device's
`float` blend stores -9.763e-5 (0x8666) and Metal, rounding the blend colour to `half`, -3.34e-6
(0x8038): 1,582 codes apart near zero, 9.4e-5 in value, under one `half` unit in the last place at
the operands' magnitude. A `float` model of the blend over the case's own inputs reproduces the
1,582 against Metal's recorded codes. The one-zero site, the output through the attachment's own
conversion with no blend, holds no row on MoltenVK, so the output reaches the attachment exactly.

Verified:
- msi 41073 at the next commit's tree (this ledger plus the identity domains, on b216007f0a): the
  conformance crate's ledger tests, 7 of 7 (the ledger parses and every row names a real case and
  its gap); 40976 the same at the ledger change alone on 0524d5a1c2.
2026-11-17 07:46:08 -08:00
Anees Iqbal b6077a933a docs: REPLAY-STREAM.md says how much the old runtime's executed counts move
A play of one recorded stream on a 780M with an empty translation cache and an empty Mesa
cache (m3-max-41100, at a8ad095897) recorded 2523 dispatches, 71967 draws, 28321 render passes
and 8503 submissions; the two warm plays after it recorded 2079, 71742, 27871 and 7036. The
stream's counts were equal in all three, every group and frame line (0 of 7932 differ); the
executed counts differ in 285 lines cold against warm and in 11 between the two warm plays.
So cold caches change the totals, not only where a few draws land, and the spec now says so.
2026-11-17 07:45:21 -08:00
Anees Iqbal 83134a6555 validation: the event-order replay test reads its submissions from the executed counts
The test that checks which command buffers complete together indexed a group's counts as one
map; since the report split them, the runtime's submissions are in `executed`. Found by the
tests' build on every node (m3-max-41083, 41084, 41085: E0608 in replay/tests.rs).

A correction to the previous commit's message: over the seven plays at one tip, the barrier
totals differ by a few too (69804 to 69810); the other totals were equal.
2026-11-17 07:45:21 -08:00
Anees Iqbal c97dbd66ea validation: the replay report keeps what the stream fixes apart from what the runtime executed
Each report line (completed group, frame, total) now holds two sets of counts. `stream`: the
calls played, the command buffers committed, the encoders made, the draws and dispatches their
calls issued, and the player's own relocated, misaligned and written counts, all fixed by the
stream, so equal on every play on any runtime. `executed`: the runtime's counters (for the old
runtime, the Vulkan commands it recorded and the pipelines it made). The separate `calls N` line
goes: the total's stream calls are the calls played.

Why: the old runtime's executed counts are not repeatable at one tip. Seven plays of one
recorded stream on a 780M at one tip gave equal totals, but in some plays a few draws (with
their barriers) moved from one group to a group 15 later, and once from one frame to the next.
The moving groups are the ones that make a pipeline, and they differ in `draws_unkept_making`
(2 against 1): draws recorded through a pipeline's general form while its own was still being
made on the runtime's pool, which keep nothing to draw again
(metal2vulkan-runtime's pipeline/render/residual.rs). Where a background making lands is
timing. The commits, submissions per group and the player's waits did not differ. The matrix
compares the stream's counts only.
2026-11-17 07:45:21 -08:00
Anees Iqbal b216007f0a metal2vulkan-rt: quiesce's doc states the exit contract
The consumer quiesces before exit(); an atexit handler holds only where registered after the
driver loaded (after Device::new), as the README now says.

Verified: cargo fmt; the lint job follows.
2026-11-17 07:25:31 -08:00
Anees Iqbal de9b63d93a metal2vulkan-rt: the README's exit contract, from the exit probe
The consumer quiesces before exit(); a quiesce in an atexit handler is a fallback that holds
only where it was registered after the driver loaded. Measured with the exit test's child process
(M2V_EXIT_RUNS=50, both registration points) on NVIDIA's driver: after Device::new, 50 of 50
clean on the RTX 2080 (m3-max-40942) and the RTX 3090 (m3-max-40944); before Instance::new, 0 of
50 on both, each a SIGSEGV before the handler printed.

Verified: the two probe jobs named.
2026-11-17 07:25:31 -08:00
Anees Iqbal d41378b547 metal2vulkan-rt: every gauge reads zero only once the VkDevice is destroyed
The teardown test from a completed handler passed on every Linux leg and then aborted at process
exit (Iris Xe: double free; RX 550: SIGSEGV; legs m3-max-40938, 40941): the completion thread,
which finishes a teardown that starts in a handler, was still in vkDestroyDevice when the zero
source's gauge fell and the test process exited, so the driver's exit teardown ran beside it.
Windows passed (40946): ExitProcess stops the other threads first.

The zero source's gauge now falls after vkDestroyDevice, so every gauge at zero means the
teardown made its last Vulkan call; the docs tell a consumer whose last handle drops in a
handler to wait for that before it drops its instance or exits.

Verified: cargo fmt; the legs follow.
2026-11-17 07:25:30 -08:00
Anees Iqbal 60c59c6b9d metal2vulkan-rt: the completion thread takes its lists whole
clippy's drain_collect: the scheduled, ended and fire lists and the watch list at the thread's end
are taken with mem::take rather than drained into new vectors.

Verified: cargo fmt; lint job m3-max-40916 named these five sites and nothing else.
2026-11-17 07:25:30 -08:00
Anees Iqbal 077c9722e3 metal2vulkan-rt: command queues, command buffers and events on the submit and completion threads
Step (c) of the new runtime's compute core.

What:
- CommandQueue (newCommandQueueWithMaxCommandBufferCount:, its bound on uncompleted command
  buffers), CommandBuffer (enqueue, commit, handlers, waits, status, error), Event and
  SharedEvent (signaled_value, set_signaled_value, wait_until_signaled_value,
  notify_listener).
- A command buffer records at once into segments split at event waits and signals. The submit
  thread holds a segment whose waits are not met, and its queue behind it, while the segments
  before it run (reims F1). A wait the host's value meets submits no semaphore wait; a GPU
  signal not above the highest value submitted or set is left out, so the semaphore only rises.
- The completion thread retires by a progress semaphore, follows submitted event signals (a
  listener runs at a mid-buffer signal, reims F2), runs handlers with no lock held, and is
  woken through a host-signalled timeline semaphore only when a wait needs it.
- A command buffer keeps each block it uses until it retires. A zeroed Private buffer's fill is
  an upload submitted ahead of every later commit, whose segments start with a barrier; each
  segment ends with a barrier to the host.
- Device::quiesce(timeout) (F9), with every wait bounded, no join of a thread still running, no
  thread-local that exit() tears down, idempotent, freeing nothing; unmap runs on the caller for
  every block handed out, once (a handed set replaces the per-idle flag).
- The last handle dropped in a handler: the completion thread finishes the teardown itself (F8).
- CommandQueue::abandon (F14); a loss ends held work, in-flight work once the device is idle,
  host waits on pending signals, and later commits, with DeviceLost { in_flight } (F13).
- Refusals Committed, OtherDevice, NoCommandBuffers with their basis; Error::Quiesced;
  docs/REFUSALS.md and the API signature table regenerated; the README's contract.

Verified: cargo fmt; refusal_surface --check. The compile and device jobs follow.
2026-11-17 07:25:30 -08:00
Anees Iqbal 4e8784ad14 refusal surface: the new runtime's own refusal enums, one section each
What: refusal_surface.py reads the new runtime's Error and makes a section of
docs/REFUSALS.md for each variant whose payload is one enum the runtime
declares: today Refused(Refusal) and Limit(Limit), and any family added later
(a Gap included) without a list of names to keep. Each of their variants
declares its basis, as Problem's do, and --check fails on one that does not.
The translator's Limit section no longer counts rt's Limit sites. A rustdoc
link [text](path) in a summary reads as its text; three existing rows lose a
link the file could not follow.

Why: AGENTS.md wants every new refusal in REFUSALS.md, and the scan of rt read
the floor's Missing only, so EmptyBuffer, BufferPastBlock, BlockLen and
BlockIds were missing. Their basis lines cite the M3 Max measurements the old
runtime records for the same answers (newBufferWithLength:0 and a placement
past the heap's end answer nil), the device's limits, and our 32-bit numbers.

How verified: the script regenerates, --check and --selftest pass locally;
the refusal_surface test runs in the compile job.
2026-11-17 07:25:30 -08:00
Anees Iqbal d3b0f2f580 validation: a played no-copy buffer drops the read-only option
A no-copy buffer plays as a buffer of its length (its host memory is not in the stream), and the
runtime refuses option bit 24 on such a buffer, as Metal ends the process there; b2 stopped at
its 354th call on one. The bit is dropped for a no-copy buffer alone, so the replay keeps the GPU
writes Metal drops from that memory; the spec says so. A heap keeps the bit, which the runtime
takes.

Found by the b2 play on gem10's 780M (job m3-max-40908).
2026-11-17 07:18:19 -08:00
Anees Iqbal 2dda92f5e0 validation: a buffer in a block is the block's call, as the recorder writes it
The recorder renames a placement on a block (newBufferWithLength:options:offset:) and keeps its
receiver, the block; the backend took it on the device, and b2 stopped at its 88th call. A no-copy
buffer, [nil, length, options, nil], plays as a buffer of that length.

Found by the b2 play on gem10's 780M (job m3-max-40905).
2026-11-17 07:18:19 -08:00
Anees Iqbal a28aca8889 validation: the replay report counts the calls played, so a stop names its call
The stopping call is the one after the count: on a long stream the selector alone does not say
where the play stopped.

Verified by the unit test of a refused selector (the count stops before it).
2026-11-17 07:18:19 -08:00
Anees Iqbal e99ec291b5 validation: the replay player plays the recorder's format, renders included
The spec and the player follow what the recorder writes (reims-vgpu bec103226; b2 was recorded
at 50fc14009, the same format but for refused guest-RAM copies): structs and descriptors are maps
keyed by the recorder's camelCase field names, nil for an unset optional field; f32 values are
f64; descriptors Metal makes as objects (texture and render pass descriptors) are platform
records changed by setter records; a drawable never seen made is a texture of its descriptor;
the host's plumbing (padded, exportable and dma-buf buffers, an unshared queue) plays as the plain
Metal call it stands for; the host's scheduling records play as nothing; no call answers a
resource ID, and a descriptor's resource index places its object.

The guest-RAM copies are [buffer, [[byte, data], ...]] in and [buffer, [[byte, [start, end]],
...]] out. m2v.copyBytes:toBuffer:offset: and m2v.copyToHost: are gone: the host has no such
methods. The gpuResourceID answer check and PlayError::ResourceId are gone with the answers.

The old runtime's backend becomes a module: argument and map readers (args), descriptors
(texture, render pass setters, render and compute pipelines, depth-stencil, sampler, buffer and
heap descriptors, function constants and descriptors, surface planes), and the command buffer,
compute, blit and render encoders' calls. Each mapping follows how the host's platform applies the
recorded value to the runtime.
2026-11-17 07:18:19 -08:00
Anees Iqbal 79e87462e6 validation: command-replay shapes, a stream's calls by the shape of their values
For each selector, how many calls had each shape of arguments and answers: kinds, list structure
and map keys, none of the data. It says what a stream asks of a player without showing what a
guest's stream holds, so the description can leave the host that keeps the stream.
2026-11-17 07:18:18 -08:00
Anees Iqbal 7a3e31ff2e validation: resource_word.rs is a file the old runtime reaches but never runs
737ccbf81a (the resource ID word) added metal/resource_word.rs under metal/mod.rs, which the
runtime-sources inputs reach, without listing it, so
candidate::engine::artifact::tests::the_runtime_sources_are_the_committed_ones failed on
development (found by the replay lane's whole-suite run, m3-max-40953). Nothing in the old
runtime calls it (only the new ID spec's tests and docs do), so it joins the not-runtime list
with that reason; the runtime-sources pin does not move.

Verified: cargo fmt; the test reruns in the next suite run on development.
2026-11-17 07:18:12 -08:00
Anees Iqbal bfe63b5097 Re-bless the golden tables at 0524d5a1c2
The stage-output change (one 32-bit form, a6277b1a10..c6e86ab3a8) removed a profile field, which
moves every profile's key in golden_hashes.tsv; CONTRIBUTING.md re-blesses on development after
merges. The engine inventory and the air_input printouts did not move.

Verified: potluck job m3-max-40932 on m3-max at 0524d5a1c2 (inventory=0 golden=0 printouts=0).
2026-11-17 07:07:49 -08:00
Anees Iqbal 0524d5a1c2 harness: the described test names a definition with a nested fn
A closure returning a borrow of its argument does not elide the lifetime,
which the device cfgs' build of the test refused.

Verified: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd in the job after
this commit.
2026-11-17 07:04:53 -08:00
Anees Iqbal 1399ab016c harness: the described test's metallib holds one module per kernel
The described test wrapped the whole authored fixture, seven kernels, as
each metallib function's bitcode. The translator checks that a metallib
function's module declares one entry point (AirAbi::check_container) and
refuses it (Abi(ContainerMismatch)) otherwise. The test passed only while the
old runtime's disk shader cache held these kernels' translations, which the
authored test makes from the same AIR without a container; development's
SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION bumps emptied that cache, and
the matrix's lavapipe leg ran the described test first.

Each function's bitcode is now the fixture's text with that kernel alone:
the other kernels' definitions, their !air.kernel nodes and their
threadgroup globals left out, assembled by llvm-as.

Verified: under --cfg m2v_cpu_icd on lavapipe with an empty shader cache, the
old test fails with ContainerMismatch and this one passes, then the harness's
tests with LP_NUM_THREADS=1 (job after this commit).
2026-11-17 07:04:53 -08:00
Anees Iqbal 531e41ee93 validation: the replay's waits for command buffers go through the bounded wait module
The old runtime's backend for the replay player waited for each committed command buffer with
its own 60-second bound, outside gpu/wait.rs, and the player, its unit tests and its device
tests spelled the stream's wait records whole, which the check that every device wait is
bounded (gpu::tests::device_waits_exist_only_in_the_bounded_wait_module) reads as waits.

The backend now takes the device's type and waits through gpu::wait::runtime under the hang
protocol, for the stream's commits and the player's readbacks alike; command-replay passes its
--device-type, the device tests the cfg's TEST_DEVICE. The stream's wait records are named by
WAIT_COMPLETED and WAIT_SCHEDULED, spelled in pieces: they are record names, and the player's
own waits are its backend's.
2026-11-17 07:03:37 -08:00
Anees Iqbal 066122aad6 AGENTS.md: docs/RESOURCE-ID.md in the doc table
The resource ID's spec landed with a6277b1a10. Doc-only change.
2026-11-17 07:03:30 -08:00
Anees Iqbal 77e3a23e5b 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 07:02:45 -08:00
Anees Iqbal 21082c0094 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-17 07:02:13 -08:00
Anees Iqbal 6f5bd20321 stage io: one 32-bit form for every stage output
The translator declared a `half` color output with 16-bit float lanes where the device enabled
storageInputOutput16 and shaderFloat16: a second form chosen by a query that is not one of the four
the owner's rule 2 allows (the 3090, 2080, RX 550 and lavapipe lack it; MoltenVK, RADV and ANV
have it). Every interface variable is now 32-bit on every device: a `half` output is widened to
`float`, which holds every `half` exactly, and no module needs StorageInputOutput16.

- lower::stage_io: plan::half_variable, IoObject::User::half and the 16-bit store are gone, and
  io_elem takes no width. StageIo::half_outputs and the profile's input_output_16bit are gone;
  the link contract checks 32-bit float lanes only.
- SEMANTICS_VERSION 2145 and ARTIFACT_FORMAT_VERSION 527 (the artifact codec lost a field). The
  golden table needs its re-bless on development: every profile's key moved with the profile's
  lost field.
- The HalfOutputPrecision and HalfOutputFastMathBlend notes, docs/API.md's degrade catalogue,
  docs/FAST-PATHS.md and the half-output-blends conformance case say what the device receives
  now; their statements about the 16-bit form are gone.
- known-gaps.tsv: 52 rows for MoltenVK on the Apple M3 Max. With the 16-bit output MoltenVK stored
  Metal's codes at every word of half-output-blends-*; with the `float` output its blend is the
  device's own (half-output-fast-math-blend) at 17, 17 and 18 sites of the R16Float, RG16Float and
  RGBA16Float cases, largest differences 1 to 1,582 codes at the stored value (the blend-colour
  sites the largest). Its 32-bit float cases still store Metal's codes.

Verified (code at c55bc28e43, ledger rows added at 2754676210, this commit's tree):
- msi 40877: clippy -p metal2vulkan --all-targets --all-features -D warnings, rustdoc
  -D warnings, nextest -p metal2vulkan in full: 3,661 of 3,662 pass; the one failure is
  golden_hashes_match_the_table (every profile's key moved), for the re-bless on development.
- msi 40827: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
- XTX (RADV NAVI31) 40843: runtime_lane color_writes (every `half`, NaN and infinity included),
  half_output_blends and extended_range_blends, 16 of 16 pass; the conformance replay of the six
  half-output-blends cases exits 0 against the RADV rows, so every row's count and largest
  difference held.
- RTX 3090 (ms01) 40844: the same 16 lanes pass; the replay's 59 divergent sites are exactly the
  RTX 5080's 59 rows (the ledger holds no 3090 rows; NVIDIA never had the 16-bit form).
- M3 Max on MoltenVK: 40833 before the rows (52 new gaps, all in the 16-bit float cases), 40862
  with them (exit 0, every count held on the second run).
- msi 40875: the conformance crate's ledger tests, 7 of 7.
2026-11-17 07:01:32 -08:00
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