Commit Graph
61 Commits
Author SHA1 Message Date
Anees Iqbal eb16d34f15 matrix: the instructions gate judges the new runtime's own threads, a driver's left beside
The burst rows' whole-process count swung by up to 25 million instructions per run between
processes on NVIDIA, all of it in the driver's own "[vkrt] Analysis" thread, while rt's own
threads held steady (48-50k instructions per command buffer on the 2080, 23k on the XTX). A gate
on the whole count judged the driver.

rt now registers the OS id of every thread it starts in Gauges::threads, at one place: the
spawn helper device::start, which the reaper, block-maker, submit and completion threads and the
cache store's removal thread all start through. A thread holds its slot until it ends. The list
is bounded by construction (5 slots), nothing on a commit or submit path reads it, and
Device::new's paths are untouched. devtools gains ThreadInstructions (per-thread user-space
counters by OS id, a thread that already ended skipped) and this_thread. The harness reads the
runtime's thread ids through Device::threads before a row's timed runs, counts them with its own
thread, and records own_per_run and others_per_run beside per_run. Every counter read now sits
outside the timed wall span.

results.py, per the planner's ruling: EXACT, the new runtime's own count at most 1.03 times its
stored count (instructions.tsv now holds own counts), ratcheting down; LENIENT, named on every
row, the own count at most the old runtime's whole count, old's driver share not separable since
the old runtime names no threads. A whole count with no own count fails the row. The base
comparison skips the harness's counts: the gate judges them.

Verified: scripts/matrix/test_results.py, 42 tests OK locally. Builds and the other suites run
on the check job.
2026-11-18 05:04:14 -08:00
Anees Iqbal 8b428fe5ed matrix: a compute creation row's call alone is shown beside its first use, never judged
The cold-creation split (probe a3318b088f, m3-max-45806/45807/45809/45810) found the old
runtime returning from new_compute_pipeline_state before it makes its VkPipeline: no
vkCreateComputePipelines runs inside the call, and the driver's compile comes before the first
dispatch completes. rt compiles inside the call, as Metal does at newComputePipelineState. A
compute creation row's `/first` sample already spans the creation, one dispatch and the wait
for it (CreateReport::first_us), so that row compares like with like. The call alone was only
in the table's text.

The harness now also records it as `harness-<runtime>/<row>/first_call` for a compute state row.
The creation processes keep it like the other first samples (FIRST_KEEP matches it as is).
results.harness_budget shows it with the median of each runtime's five processes and their
ratio, as "shown, not judged: the creation call alone, which old returns from before it makes
its pipeline", and never judges it. One process's sample alone is not shown. `/first` and its
floors are unchanged. The planner approved this form.

Test: test_a_creation_call_alone_is_shown_beside_its_first_use_and_never_judged. Docs:
VALIDATION.md's creation and harness budget paragraphs.

Verified: nothing yet; the Python suite and the harness build are reported with this sha.
2026-11-18 04:26:08 -08:00
Anees Iqbal d2e5edbd60 harness and matrix: record the whole process's instructions per run and gate the frame and burst rows on them
The harness now counts each timed run's user-space instructions across the whole process. The
counts repeat run to run where the times do not: rt's p50 spread across processes was 0.16 to
0.27%. The matrix gates the frame and burst rows (WALL_ROWS) on those counts, beside the host-time
judgement and floors they keep under the GPU-p50 rule.

devtools: ProcessInstructions opens one user-space instructions counter per core type with
inherit set, so every thread started after it opens counts: the runtimes' and the drivers'
threads too. The harness opens it first thing in main, before any device starts a thread, and
each timed run records the counted delta. A node that refuses perf_event_open, and every
non-Linux host, records none.

harness: each row whose runs were not sized prints
`M2V-MATRIX instructions harness-<runtime>/<row>/per_run <p50>`.

matrix: a frame or burst row with a count on both runtimes passes the instructions gate as well as
its time's limit:
- it fails when rt's count is over old's;
- it fails when rt's count is past 1.03 times the stored count in scripts/matrix/instructions.tsv
  (one column per driver family, `all` where the legs agree within 3%);
- it is named when its count is more than 1% under the stored count, which then ratchets down;
- it is named when no count is stored, and is then gated against old alone.
The single-kernel rows stay judged on their GPU p50 as before, and every row's count is shown
beside its times. The old runtime's harness counts are parked from the per-record
instructions-versus-base check, like its times. instructions.tsv starts empty: a matrix run's
counts seed it. VALIDATION.md describes the time rules and the gate in one paragraph.

Verified: scripts/matrix tests (python3 -m unittest discover, 45 OK) on this Mac, over this rule
and the GPU-p50 rule together. Before the rebase, check m3-max-45591 on msi (at c597bb3603) passed
clippy x4, nextest for devtools, harness and rt (118 passed, with the process counter's test), and
the release harness build. Count job m3-max-45641 on the 2080's node recorded the per_run count of
every row on both runtimes except long_4cb, which is sized.
2026-11-18 03:31:27 -08:00
Anees Iqbal b2e33dba6d matrix: a harness row with a GPU time is judged on it against the old runtime's GPU-time floor
The planner's ruling on the old-against-old GPU-p50 floors. On the XTX, whose host-time floors
reach 1.2-1.3 on the shader rows (8 runs, m3-max-45546), the same runs' GPU p50 spreads 1.004 on
simd_reduce (36.96-37.12 us, host time 44.9-55.8 us), 1.008 on narrow_ints, 1.012 on image_filter
and 1.024 on constexpr_sampling: the host time's spread is the host's, not the card's. So:

- A row with a GPU time on both runtimes is judged on its GPU p50, new over old, against the old
  runtime's GPU-time floor on that leg (the new scripts/matrix/gpu-floors.tsv), with its host
  times shown beside it. A ceiling applies to the time its row is judged on.
- The frame and burst rows (WALL_ROWS) stay on their host time and its floor, with the
  instructions gate: their GPU time spans the gaps between their command buffers and spreads as
  widely on several GPUs (1.68 on the Iris Xe's frame_5cb, 1.43 on the UHD 630's
  burst_160_shared). gpu-floors.tsv lists no such row.
- CARD_VARIANCE names rows whose GPU time varies on the card itself: the XTX's sampling (GPU p50
  16.3-20.3 us over the 8 runs; 1.264 in the earlier 4-run set, m3-max-45424) and
  constant_managed (66.8-69.2 or 74.4 us). They are judged like any other row, never fail a leg,
  and are named on its line as the card's variance.
- A re-timed run keeps the row's GPU time too (RETIME_KEEP, harness-retime-gpu/), and the re-time
  selection chooses by the same measure (RETIME_SELECT with GPULIMITS and WALLRE), so a row judged
  on its GPU time is re-timed and judged on its re-timed GPU pairs.

gpu-floors.tsv comes from the runs behind floors.tsv, no new job: the harness of 4cc7963005, 4
runs of `harness --runtime old` per leg (8 on the XTX), jobs m3-max-45422 (1002:15bf), 45430
(1002:1900), 45423 (1002:699f), 45546 (1002:744c), 45425 (10de:1e87), 45426 (10de:2204), 45437
(8086:3e9b) and 45427 (8086:a7a0). Its header notes that the UHD 630's texture_read (1.075) and
the Iris Xe's wide_bindings (1.097) are those GPUs' floors, not reds.

Verified: the matrix's Python tests (42, 4 new: a row with a GPU time judged on it and a frame or
burst row on its time, the GPU floor and the re-timed GPU pairs, a card's variance named and
failing nothing, the re-time keeping both times), run locally; the harness runs' shell renders
and passes `bash -n` for a leg with limits.
2026-11-18 03:24:47 -08:00
Anees Iqbal 813dd5cfd7 matrix: jobs sized from whole builds' peaks, and a job short of RAM runs again with twice its room up to the default
The UHD leg of matrix e060958855 lost its Windows build twice to memory:
45442 at 3 GiB (137), then the retry 45471 at 6 GiB (rustc-LLVM out of
memory, 137), and the leg failed with no tests run. The sizing took the
last three runs' peaks, incremental builds in a kept workspace that peak
far below a build of most of the tree, and a job short of RAM ran once more
only, at twice its room.

Now a job's RAM is 1.3x the largest peak of the last three runs that
started in a fresh workspace (each run records whether it did), else the
kind's default; minutes still follow the last three runs of either form.
A job short of RAM runs again with twice its room until it reaches the
kind's default (16 GiB for winbuild).

Verified: scripts/matrix tests, 39 OK, run locally. The new test_matrix.py
fails on the old code (it sized from incremental peaks and retried once:
dispatches 4 and 8 GiB, not 4, 8 and 16).
2026-11-18 02:57:17 -08:00
Anees Iqbal 56efbd0e13 matrix: the floors measured with the mean statistic on seven legs; the seeded-floor stopgap deleted
scripts/matrix/floors.tsv held floors seeded from old-runtime runs under the nearest-rank
statistic, some of them the old runtime's paired completions read as a fast run (alu 22.066 on
the 780M leg, 19.640 on the Iris). Measured again with the harness of 4cc7963005 (a row's time the
lowest mean of its windows of 10 timed runs, an untimed run after each gauge read): 4 runs of
`harness --runtime old` per leg, A B B A, each its own process on a fresh driver shader cache and
store, a sized row at the first run's size; a row's floor is the largest of its 4 times over the
smallest. Legs: 1002:15bf (gem10's 780M, m3-max-45422), 1002:699f (m3-max-45423), 1002:744c
(m3-max-45424), 10de:1e87 (m3-max-45425), 10de:2204 (um870's 3090, m3-max-45426), 8086:3e9b
(m3-max-45437) and 8086:a7a0 (m3-max-45427). 1002:1900 (um870's 780M) is not measured yet; a leg
the file does not list keeps a floor of 1. The seed's 1002:15bf column came from runs on
1002:1900.

With the table measured, the seeded-floor naming goes: SEEDED_FLOOR_OPEN, seeded_floor() and their
uses in harness_budget, its test, and VALIDATION.md's sentence on the seed.

Verified: the matrix's Python tests in the check job named in the report.
2026-11-18 02:41:31 -08:00
Anees Iqbal 5abbd52c0e matrix: the memory pool's blocks gauge fails only on a rise between iterations 100 and 200
The matrix at cbd4644463 failed long_4cb's blocks gauge on the XTX, 2080
and 3090 (9 at iteration 100, 8 at 200). The cause, from the quiet probe
(each idle free logs the time since the last commit): the pool frees an
allocation an earlier workload left idle once the most bytes in use over
its window falls and the device has been quiet for 20 ms, and long_4cb is
the first row after the earlier rows' peak whose runs leave 20 ms gaps
between submissions. On the RTX 5080 (b5080 entry quiet5080, q10
0c0e50688a / q3 6b8cd2b793, 2 runs each) the 10 s window freed a 16 and
two 64 MiB allocations 6.5 and 7.5 s into long_4cb (11 -> 8), the 3 s
window the two 64 MiB ones 0.53 s in (8 -> 8); every free in every run on
the 5080, XTX (m3-max-45392) and 2080 (m3-max-45391) began 20.0 to 52 ms
after the last commit, so the quiet clock saw every commit.

Per the planner's ruling, the pool's gauges (blocks) now fail only if
they rise between @100 and @200; @drop still has to be 0, and every other
gauge stays flat. Verified: scripts/matrix tests, 37 OK, run locally; the
new test fails without the change (a fall of blocks is a problem there).

The commit before this one (1f41099948) shows each row's GPU p50
(store2's harness-gpu-<runtime>/<row> records, parked) beside its time
in the budget's lines and in a list of every row that run and show print
under each leg, and names a row that passes only on a seeded floor over
1.10. Its tests (36 OK at that commit) pin the line formats.
2026-11-18 02:32:53 -08:00
Anees Iqbal 5422cf1825 matrix: every row's GPU p50 beside its time; rows passing only on a seeded floor over 1.10 named 2026-11-18 02:32:53 -08:00
Anees Iqbal de2ce035e9 matrix: creation rows timed alone in five processes, per-row floors, an A B B A re-time
The planner's timing rule for the matrix's harness legs:

- The harness takes `--skip NAME,...`, and a name ending in `*` in `--only` or `--skip` names
  every workload it starts. A name that names no workload is an error.
- Each runtime's harness run skips the creation rows (`--skip 'create_*'`); they then run alone
  (`--only 'create_*'`) in five processes per runtime, each with a fresh driver cache and store,
  so no row before them moves their times. The first process's records are kept whole, its
  device's gauges at drop renamed to harness-<runtime>/creates/device/... so every key is
  recorded once; the later processes keep only the creation rows' first samples, as
  harness-first/<row>/<n>/<runtime> (parked records).
- A creation row's first sample (/first, /first_take, /next_take, /first_allocation_total) is
  judged by the ratio of the medians of its five processes; a single first sample is never red.
- A row's limit is 1.03 times the greater of its ceiling and its floor: the widest ratio between
  two of the old runtime's own runs of the row on that GPU (scripts/matrix/floors.tsv, seeded
  from store2's noise table's "widest" column; 1002:1900 has no column there, so its floors are
  1). Ceilings are unchanged.
- A row past its limit is re-timed once, A B B A (two pairs), and fails only if the median of
  the pairs' ratios is past the limit too.

Deterministic counts are untouched. docs/VALIDATION.md describes the new runs and rule.

Verified: scripts/matrix/test_results.py, 33 tests OK locally (new: a row within its floor
passes, past it but back within on its re-time passes, past both fails; first samples by the
median of five, never one alone; the creation processes' sed programs record each key once; the
floors table reads). The generated harness_runs shell passes bash -n for a Linux and the Windows
leg. The harness's selection tests and lint run in the check job.
2026-11-18 02:17:14 -08:00
Anees Iqbal 8fa569e62d harness, matrix: each runtime keeps its pipelines in a store of its own, fresh for the matrix's main run and warm for its warm run, so create_state and the first uses compare like for like
The old runtime's shader cache defaulted to the per-user ~/.cache/metal2vulkan, which every earlier
run on the node had filled, while the new runtime's harness device kept no store: create_state's
first state and the first-use rows timed old warm against rt cold (jobs 44170, 44171: old's first
on the 2080 2.9-3.2 ms on its warm cache, 8.9-9.7 ms on a fresh one).

- old::system_default and rt::system_default take the store (None: the runtime's default, for the
  tests).
- The command takes --store DIRECTORY: each session keeps its pipelines in
  <DIRECTORY>/<place>-<runtime>; without it, a directory made for the run under the OS temp
  directory and removed when it ends. Each runtime's line and each create_state row say
  "store fresh" or "store warm, N files".
- The matrix gives each runtime's main run a fresh empty store beside its fresh driver cache, and
  its warm run the same store; a re-timed row's runs take the harness's own fresh store.
- VALIDATION.md and the harness docs say so.

Verified: the matrix's harness script, rendered and run against a stand-in harness, passes a fresh
--store to each runtime's main run (cygpath'd on Windows); the build, clippy and the authored tests
in the check job.
2026-11-17 21:56:01 -08:00
Anees Iqbal e0f76d7836 harness: a multi-command-buffer row is judged by its last command buffer's commit-to-complete time, and each command buffer's lateness is a column
The planner's ruling on long_4cb's red: rt reports the command buffers committed while an earlier
one runs complete together, at the group's last end, which the owner accepted. The mean over a
run's places counted that lateness: on the 2080, long_4cb's #2-#4 came at 96.2-97.3 ms where the
old runtime's came at 71.7, 83.7 and 95.6 ms, while the last's own (96.6-97.2 against 95.6-95.8
ms) is not late (jobs 44196, 44197). The rule holds for every row of several command buffers, so
frame_5cb's too.

- run::matrix_time is the steady time of each run's last command buffer's commit-to-complete
  time.
- The harness's completed handler is given its lateness, from the command buffer's GPUEndTime to
  the handler's start on the runtime's host clock (rt::host_time, the old runtime's host_time);
  Report::late_us holds it by place, and the table prints late_us_p50 and late_us_p99 beside the
  c2c columns, with a line by place. It is no record: no ceiling until the first host-time matrix
  shows it on every GPU.
- The rt README's queue known gaps carry the measured lateness; VALIDATION.md and the harness
  docs say the last command buffer's time.

Verified: the matrix_time unit test asserts the last place's time where the mean differs; the
check job builds and runs it.
2026-11-17 21:55:45 -08:00
Anees Iqbal 32d511d17d harness, matrix: long_4cb runs one size on both runtimes: --size gives a sized row its size, the matrix passes the first runtime's to the later runs, and a row run at two sizes fails uncompared
A workload whose size follows the device (long_4cb) was sized by whichever runtime ran it first in
its process. The matrix times each runtime in its own process, so each sized it from its own base
time, and they could run different work: the RX 550's long_4cb ran at different sizes on the two
runtimes at 594b86d1f2, and its ratio compared unlike runs.

- run_each takes the size where the caller gives one (ScaledTo::base_us is then None) and times no
  base; a size for a workload of one size is an error.
- The command takes --size NAME=N (repeatable; a name it does not know is an error) and prints each
  sized row's size as an `M2V-MATRIX size harness-<runtime>/<row> <size>` record.
- The matrix reads the first runtime's "sized to" lines and passes them as --size to every later
  run: the main run, the warm run and the re-timed pairs.
- results.harness_budget fails a row whose two runtimes' size records differ (or only one has
  one), uncompared; `size` is a record kind.

Verified: python3 scripts/matrix/test_results.py, 29 OK; with the size check removed, the new test
fails (negative control). The matrix's harness script, rendered and run against a stand-in harness,
passes `--size long_4cb=4096` from the first runtime's line to the second's run. Harness unit test
a_scaled_workload_given_its_size_runs_at_it_and_times_no_base: build and run in the check job.
2026-11-17 20:57:07 -08:00
Anees Iqbal b96e61afa3 docs: VALIDATION.md's matrix says a harness time is host time and a ceiling is only ruled
The `time` record kind is what a program waits on, timed on the host (commit-to-complete where the
workload times it, else the wall time a run adds), since the harness's matrix_time change on this
branch; the harness budget lists no ceiling now, and one is given only by a ruling after the work
on its row. The doc said GPU time and measured-ratio ceilings.

Verified: the text only; python3 scripts/matrix/test_results.py, 28 OK on this branch.
2026-11-17 20:55:18 -08:00
Anees Iqbal 76ddb7ed45 matrix: a harness row over its budget is re-timed in its leg, three alternating pairs, judged by the median
The matrix at 4e02a34a38 failed vote_loop on the HawkPoint 780M at 1.123, new over old, from one
timed window each. Five alternating rounds on that GPU read a median of 0.992, one new window
held a slow state throughout (662.8 us against 415.5 to 415.9), and the Phoenix 780M read 0.999:
one window caught in a clock episode decided the row.

- harness_runs keeps each runtime's output (tee) and, after the last runtime's run, before its
  suite's line, chooses the rows over their limit (results.RETIME_SELECT, awk over both outputs:
  each listed row's ceiling times HARNESS_BUDGET, else HARNESS_BUDGET, the same comparison of the
  same decimals as harness_budget), at most RETIME_ROWS (8), the furthest over first. Each is
  re-timed alone in RETIME_PAIRS (3) pairs, old then new, the second pair new then old, and only
  its time records are kept, as harness-retime/<row>/<pair>/<runtime>.
- harness_budget judges a row past its limit by the median of its pairs' ratios where all three
  pairs are there: a problem past the limit, else named with its pairs; a row the leg did not
  re-time is judged by its one time as before. The pairs are parked records for the time rule.
- docs/VALIDATION.md states the rule beside the budget.

Verified (job 43277, msi, GNU awk 5.4.1): the matrix's rule tests, 28 of 28, among them an
episode in one pair that does not decide a row, a regression in every pair that fails it, a row
with a pair missing judged by its one time, a listed row judged against its ceiling's limit, and
the leg's awk choosing exactly the rows harness_budget fails on their one time, at the 2.06 edge
of a 2.0 ceiling; then the rendered harness_runs run under bash with a fake harness for an unlisted
and a listed leg: it re-timed burst_160 (2.0 in every pair) and frame (1.0, 1.5, 1.0), and
harness_budget failed burst_160 on its median and named frame within, judged by the median.
2026-11-17 16:59:41 -08:00
Anees Iqbal eea1ef870e matrix: harness first uses compile cold on a fresh driver cache, and warm on a second run
The matrix at 691b0e43d1 failed four legs on harness-new/authored/first_use_wait_total against
9c61460b3d: on AMD it went from 0.3-0.5 ms to 7.9-33 ms. The driver's shader cache explains it. The
matrix gave the harness the node's own cache (~/.cache/mesa_shader_cache held 260 entries on the
XTX's node), so a commit whose modules the node had compiled before read hits, and one that changed
them read misses. Run with a fresh empty cache directory, then again on it (jobs 42912 and 42913),
authored first_use_wait_total in us:

  XTX   base 9c61460b3d cold 5,833 warm 411; tip 691b0e43d1 cold 5,551 warm 390; the base on the
        tip's warm directory 7,198 (its modules differ, so they miss); the node's own cache 446
  2080  base cold 34,062 warm 4,178; tip cold 75,715 (one slow cold run) warm 4,479;
        the node's own cache 32,555 (~/.cache/nvidia/GLCache held 2 entries, so NVIDIA read cold
        at both commits)

and base and tip alternating cold on the 2080 (job 42933): 36.7, 34.3, 36.7, 33.0 ms; the 75.7 did
not recur when 42913's runs were repeated (job 42945: tip cold 34.9).

The Intel driver on the Windows host keeps one too: three runs in a row on the UHD 630 read 54.9,
1.9 and 2.0 ms (job 42935), and with LOCALAPPDATA and USERPROFILE pointed at a fresh directory,
58.8 then 1.3 ms, its entry written there, then 1.4 ms on its own cache (job 42950).

So each runtime's harness run now has a fresh empty cache directory, MESA_SHADER_CACHE_DIR for
Mesa, __GL_SHADER_DISK_CACHE_PATH for NVIDIA, and on the Windows host LOCALAPPDATA and USERPROFILE
pointed into it, and its first uses compile cold whatever ran on the node before: those records
stay as they are and are judged. For the new runtime (HARNESS_WARM; the old runtime counts no
first uses), a short second run on the same directory (--runs 5
--warmup 1 --no-settle) follows before the suite's line, and its first-use records are kept as
harness-new-warm/<set>/first_use_*, the same first uses with the cache warm. PARKED_RECORDS parks
them: the cold ones gate.

docs/VALIDATION.md says so.

Verified: the matrix's rule tests, among them a warm first-use outlier parked beside a cold one
that fails; and the rendered harness_runs against a fake harness that reports how many files its
cache directory held when it started: the old and new runs each started on an empty
directory (cold 0), the new runtime's warm run on the one its cold run wrote (warm 1), the warm
records in the harness-new suite and none for the old runtime, every directory removed; in the
Windows form (cygpath faked) both variables in the run's directory; and the rendered GPU and
Windows scripts parse (bash -n).
2026-11-17 16:03:43 -08:00
Anees Iqbal fe9dd3d6da matrix: a listed row's ceiling has parity's 3% allowance; a row the old runtime failed is named and not compared
Two follow-ups to the harness budget.

The allowance. A ceiling is the row's ratio when it was listed, so run-to-run spread put rows just
past it: over the runs one commit before the seeds (08ff6ed59c), five rows came 0.1 to 3% past
their ceilings. A listed row now fails its leg only past its ceiling times HARNESS_BUDGET, the same
3% allowance parity gets. The ceilings stay the measured ratios and only go down.

Old-runtime failures. The old runtime is frozen and its regressions are parked, but a workload it
failed (on the UHD 630 at 8b15f6574b, one burst_2000x5 run ended in a GPU recovery,
GpuRecoveryVictim, in job 42642) failed the leg through the harness suite's exit code. PARKED_RECORDS
covered the old runtime's gauges and time outliers, not its failures. Now:
- the harness names the runtime of a failure: run_each wraps a session's error other than a
  refusal in Failed { runtime, why }, as is the creation workloads' error, and beside the FAILED
  line the command prints `M2V-FAILED harness-<runtime>/<workload>` (for each runtime of the
  command where the failure names none: a plan that could not be made, outputs that differ);
- the matrix runs each runtime's harness as a suite of its own, harness-old and harness-new, so a
  suite's exit belongs to one runtime, and a leg whose job reported either suite missing fails;
- results.py reads M2V-FAILED lines as a suite's failed tests; one under PARKED_RECORDS
  (harness-old/) is parked, so a harness-old suite that failed only by them has not failed, and
  harness_budget names the row "old failed, not compared". A harness-new failure still fails its
  suite, and a crash of either runtime's run, with no M2V-FAILED line, still fails its suite.

docs/VALIDATION.md says both.

Verified: the matrix's rule tests (24) pass, among them the allowance at its boundary (a ceiling
of 2.0: 206 over 100 passes, 206.1 fails) and an old-runtime failure parked beside a new-runtime
failure that fails its suite; the harness's unit test checks that a session's failure names its
runtime and that outputs that differ name none; and the rendered GPU and Windows scripts parse
(bash -n).
2026-11-17 15:10:34 -08:00
Anees Iqbal bbf8fbb29a matrix: the harness budget, new over old per row on each GPU at most 1.03, with the rows over it held to ceilings
results.harness_budget compares the two runtimes within one leg. For every harness row timed on
both runtimes in the leg (harness-new/<row> and harness-old/<row>), the new runtime's time over the
old's is at most HARNESS_BUDGET, 1.03. HARNESS_CEILINGS lists the rows over it, per GPU, each
with its ratio as its ceiling. A listed row past its ceiling fails its leg, and a listed row within
it is named on the leg's line (with the parked items), so an open row can neither hide nor grow. A
fix lowers its row's ceiling, and a row within 1.03 is named as leaving the list.

This rule is separate from TIME_OUTLIER and PARKED_RECORDS, which judge a time against its base
commit's across GPUs and park the old runtime's outliers. The budget reads the old runtime's times
as its reference. It ends with the cutover, with the old runtime.

A time recorded more than once has no single value to judge: twice in one suite, where parse_suite
keeps the first and now lists the key in `duplicated`, or once each by two suites, where
leg_records keeps the later. Such a row is a problem of the budget's own, named and not compared,
beside the record problem the leg already has.

The matrix's harness suite now runs one job per GPU. Each job holds its node alone (--exclusive)
and times that one GPU. Before, one exclusive job per node timed the node's GPUs in turn.
docs/VALIDATION.md says both.

Ceilings: one run per GPU of the harness's full set, both runtimes, as the matrix runs it, two
passes, each run an exclusive job timing one GPU, at development 8b15f6574b. Each ceiling is the
worse of the two passes' ratios, rounded up to three places. The latest matrix run, 100b92d608,
predates the barrier commits 7edbf84c8f and 8d160c12ac, which moved rows a long way (the 2080's
dispatch_chain from 1.816 to 0.34, the 3090's frame from 1.156 to 0.38), and its 2080 leg ended
with the GPU gone. The Iris Xe has no run (its node is down), so its rows over 1.03 fail its first
matrix run and are listed from it.

The seed runs, by leg (job): RX 550 1002:699f (42513), RX 7900 XTX 1002:744c (42512), RTX 2080
10de:1e87 (42523), RTX 3090 10de:2204 (42518), UHD 630 8086:3e9b (42642, the harness cross-built
on the Linux builder for x86_64-pc-windows-gnullvm and run there), the 780M 1002:15bf (42515) and
the 780M 1002:1900 (42517), whose rows are all within 1.03. On the UHD 630 the old runtime's
burst_2000x5 ended in the second pass with GpuRecoveryVictim, so that row's ceiling is the first
pass's.

Verified: the rule tests, 22 of them, pass (python3 -m unittest discover -s scripts/matrix).
Replaying harness_budget over each seed run's two passes gives no problem on any GPU. The same
ceilings over the runs one commit earlier (08ff6ed59c, before the SIMD-group commits) put five
rows 0.1 to 3% past their ceilings: run-to-run spread that a ceiling at the current ratio does not
absorb.
2026-11-17 14:55:21 -08:00
Anees Iqbal b206c48b2a matrix: only a subject that opens with the phrase lets the old path move
a17eb26a6b's matrix run did not report OLD PATH MOVED although its golden test counted 7260
cells under a changed profile fingerprint (the stage-bound change): the check commit's own
message quotes "old-runtime regression fix", and the rule looked for the phrase anywhere in a
message since the last bless. It now takes only a subject that starts with it, as each fix's
does.

Tests: scripts/matrix/test_results.py, 17 pass; the old-path test now also feeds a message that
quotes the phrase in its body and expects the problem to stand.
2026-11-17 11:24:09 -08:00
Anees Iqbal 37cc7ac829 matrix: harness counts compare under one harness; six old-runtime lavapipe flakes parked
The 7fa6662170 run failed every GPU leg on harness-old/authored/pipelines_created 8 -> 10. That
was the harness itself gaining two workloads (eddc9b80bf), not the runtime. The harness's counts
sum over its workloads, so like its times they now compare only with a base whose harness tree is
the same; the other records still compare.

Its lavapipe leg failed on one old-runtime test that passed in the runs around it, as a different
one did in most runs today (cfa389aa9b, c944d63548, bfe63b5097, 73e0af4b66), the old runtime's
code unchanged between them. The old runtime is frozen and its regressions parked, so the six met
so far join PARKED_TESTS with the run each failed at; they stay named on the leg's line.

Tests: scripts/matrix/test_results.py, 17 pass (the new one: a harness count compares under the
same harness and not under a changed one, while a runtime count compares in both).
2026-11-17 10:45:01 -08:00
Anees Iqbal a17eb26a6b matrix: the old path moving fails a leg unless its fix says so
The old runtime is frozen until the cutover: the translator's output through Device::new must not
move. Today it moved three times through the shared path (half outputs widened, the half pair
workarounds dropped, the stage-size rows dropped) and nothing caught it, because the golden table's
failure read as "needs a bless" whatever moved.

The golden table compiles through Device::new. Its test's stale message now counts each kind
(new, gone, under a changed fixture source, under a changed profile fingerprint), from one tested
function. The matrix reads the counts: a cell changed under an unchanged key, or one under a
changed profile fingerprint, fails the leg with OLD PATH MOVED, unless a commit since the table's
last bless says "old-runtime regression fix" (the fix of such a move, or a fix the old-runtime
lane lands). New, gone and re-keyed fixture rows still only need a bless.

Tests: scripts/matrix/test_results.py (16 pass; the new one feeds both panics as nextest prints
them, a new-rows-only failure and a passing run, with and without the phrase);
golden_hashes::only_a_cell_changed_under_its_key_needs_a_bump checks the counts' text.
2026-11-17 10:37:10 -08:00
Anees Iqbal 35fbfb4f2e matrix: the old runtime's time outliers are parked like its gauges
The UHD 630's harness-old/frame time swung to 1.58x its base at a68d520bee and 1.47x at
9af29fbb20, with no change to the old runtime between them; the owner parked the old runtime's
regressions until the cutover deletes it. PARKED_GAUGES becomes PARKED_RECORDS: a key under
one of its prefixes has its gauge flatness and its cross-GPU time outlier named on the leg's
line as parked, failing no leg. A gauge's @drop still fails, and every rt time still fails as
an outlier.

Verified: scripts/matrix/test_results.py, 15 tests pass, one new (a parked time outlier is
named and fails no leg).
2026-11-17 09:44:26 -08:00
Anees Iqbal 001cc5ae8a matrix: a lint leg runs the gate's fmt check, clippy in three configurations and Rustdoc
The matrix ran the suites but none of the gate's lints, so a public doc linking private items
(eaac55bd36) left the workspace Rustdoc failing on development with every leg green. The lint
leg runs cargo fmt --all --check, clippy -D warnings plain, under --cfg m2v_gpu and under
--cfg m2v_cpu_icd, and Rustdoc -D warnings, each reported as its own suite, in a workspace of
its own on the builder beside its other jobs, so it adds no wall time to the run.

Verified: the script parses; the first run is the matrix on this commit.
2026-11-17 09:18:51 -08:00
Anees Iqbal a68d520bee matrix: times compare under one harness; the old runtime's met failures are parked
At 8a07d62b97 six GPU legs failed on time and one on a gauge, none of them
the new runtime's (rt 38/38 on every leg):

- The harness landed its settled warm-up and steadiest-window time between
  the base (b216007f0a) and this run, so most GPUs' times fell to about 0.69x
  and the ones that fell less read as outliers. Times now compare only when
  the base's crates/metal2vulkan-harness tree is the commit's; a harness
  change sets the base for the next run.
- harness-old's memory_blocks gauge went 3 -> 2 between iterations 100 and
  200 on the Iris and the UHD 630: the old runtime frees idle blocks when it
  will. lavapipe failed two old-runtime tests: cross_queue_shadows' GPU
  hazard (its spin ended before the host's write on a loaded host, twice
  now) and compute_inherited_buffers' barrier count (2 against 3, which
  moves with the old runtime's background pipeline builds).

The old runtime takes no fixes until the cutover, so these are parked:
PARKED_TESTS and PARKED_GAUGES in results.py, each with its reason. A parked
failure is named on the leg's line and in the note's `parked` field and
fails no leg; a parked gauge's @drop still fails. docs/VALIDATION.md says
both rules.

Verified: the rule tests (14, two new: a suite whose failures are all
parked passes and names them, an unparked one beside it still fails; a
parked gauge may move between iterations but must reach zero at drop);
the harness trees differ between b216007f0a and 8a07d62b97 (038009feec
against d25ef7d25d) and match between 8a07d62b97 and the tip.
2026-11-17 08:33:59 -08:00
Anees Iqbal 4406486e8c docs: the matrix's harness suite and time records 2026-11-17 06:19:58 -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 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 017ff31e2f wip harness crate 2026-11-17 05:22:15 -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 af372e849c Lane busy work: one GPU job stays under the kernel's timeout; host copies past the window ask again
What: the runs behind running work (behind_running_work, behind_another_queue_s_handler,
behind_a_kept_signal) calibrate A's fills by the GPU's time of the calibration command buffer
(first_use::gpu_took) instead of its commit-to-completion wall time, and cap every stretched A
(and behind_a_kept_signal's long B) at A_MOST, 1 s of GPU time at the measured rate. A stretch
past the cap repeats at the cap. Each run writes a GROUPED-A line with A's fills, the time they
take at the calibration's rate and A's GPU time.

Why: round e8d0bfc33c's PHOENIX lane leg 2/4 (gem10, m3-max-34259) failed
a_held_group_goes_before_another_queue_s_submission_handler_runs with "buffer 0: bytes off its
fill: left 4096": all four command buffers completed with no error, yet B's whole fill was never
run. A ended before Y's handler in runs 1 to 3, so the loop doubled A to 8 times its calibrated
fills, one kernel job. At 17:18:48 the node's kernel logged "ring gfx_0.0.0 timeout ... Ring
gfx_0.0.0 reset succeeded", naming a metal2vulkan_validation process. amdgpu's default job
timeout on that kernel is 2 s (Linux 7.3.3-cachyos, modinfo: "lockup_timeout ... default:
2000"; no override on the command line). The reset ended A and dropped B, which A's context had
emitted behind it; RADV 26.2.6 reported neither (radv_device_check_status checks only
OpAbortKHR, and the kernel did not refuse the context's later submissions: X and Y ran).
Measured on a Radeon 780M (um790, same kernel, m3-max-34394): one 128 MiB fill takes 2.09 ms of
GPU time; A of 192 fills took 0.39 to 0.45 s, of 384 fills 0.80 s, so 8 x 192 fills is about
3.2 s, past the timeout. The wall-time calibration also stopped at 4 fills (12 or 24 returned,
28 to 50 ms of GPU work) in 3 of 10 quiet runs, where the others took 192: the first
calibration command buffer carries first-use costs, so a short A ends early and the loop doubles.
Windows' default TDR is 2 s too, so the cap is half of it.

Not a regression of c218071502..e8d0bfc33c: both shas passed every run of m3-max-34394 (3 quiet,
1 at stretch 2 and 3 beside 8 busy CPU threads and lane partition 2/4, each), with no stretch
past 2 and no ring timeout.

Test: a_stretched_command_buffer_stays_within_its_job_bound (no GPU) asserts that every stretch
the loops reach keeps one command buffer within A_MOST at the leg's measured rate (192 fills at
2.09 ms), where 8 x 192 fills would take about 3.2 s, and that a calibration already past the
bound is cut to it. It fails without the cap.

first_use: a host copy whose busy window the host outlasted is asked again

What: shared_textures_copy_on_the_host_while_the_gpu_is_busy runs each storage mode's calls
through busy_premise's until_premise_held, as device_copies' did_modify_range steps do. Each try
makes a new texture and new busy work, checks its bytes and the copies' counts on every try, and
where the busy work's end mark turned before the calls (or, for copies on the host or the staging
queue, before they returned) writes a LANE-BUSY-MISS line with the time to the busy work's
scheduling, each call's time and the busy work's GPU times, and tries again, at most 3 times. A
copy that waits for the busy work misses every try and fails with each try's times, as before.

Why: round e8d0bfc33c's PHOENIX lane leg 2/4 (gem10, m3-max-34259) failed it with "Ok(Shared) on
AMD Radeon 780M: a host copy waited for the busy work (get_bytes 139.749us, replace_region
666.597us)": the end mark read 0 right before the calls and ENDED after a get_bytes of 140 us.
The calls did not wait for about 2 s of busy work; the test's thread was held past the busy
window between the check and the call, in a leg at its 3 GiB memory limit (peak 3.0 of 3 GiB)
while a virtual machine booted on the node. The test passed at both e8d0bfc33c and c218071502 in
every run of m3-max-34394 (Radeon 780M on um790: 3 quiet runs, 1 more and 3 beside 8 busy CPU
threads and lane partition 2/4, each), its calls taking 20 to 222 us; the miss did not recur.

docs/VALIDATION.md and busy_premise.rs name the test beside device_copies.

Verified in the lane: lavapipe 10/10 (m3-max-34415, GROUPED-A stretch 1: 48 fills, 447 ms of GPU, cap 1 s) and
clippy under m2v_cpu_icd 0; the m2v_gpu archive built (34416). Not a regression of c218071502..e8d0bfc33c:
both shas pass quiet and loaded on PHOENIX (m3-max-34394), and the red leg's ring timeout followed the
stretch to 8x (~3.2 s in one job, past amdgpu's 2000 ms lockup_timeout). PHOENIX run follows.
2026-11-15 18:03:50 -08:00
Anees Iqbal 48c7296fcb device_copies: a did_modify_range step whose calls outlasted its busy work is asked again
runtime_lane::device_copies::exact_answers_take_a_did_modify_range_at_the_commit failed once on the
RX 7900 XTX (round c218071502, m3-max-33927): "the runtime's, step 4: the busy work ended first".
Each oracle step commits about 2 s of busy work (8 links of 250 ms at the kernel's measured rate)
and then makes its calls; the end mark reading 0 as they return is the step's premise, that the GPU
has not run its command buffer yet.

The cause is the host, not the runtime. Host times around each act (probe jobs) show no act waits
on the GPU at ef313200e2 or at c218071502: from the busy work's first commit to the mark check a
step took 13-47 ms alone on the XTX and 5-36 ms in its lane leg 2/2 (m3-max-34065), against links
that spun 240-268 ms each (their GPU times, about 30 samples). On the RX 550 (m3-max-34044, 3 runs
of each sha) per-act times swung with the node's load, the busy work's commit from 3 to 280 ms,
equally at both shas. c218071502 passes alone and in the lane; the failure was one step in one of
8 XTX rounds, in a leg whose node's 16 CPUs also ran the RTX 2080 runtime suite, the PHOENIX
replay and lavapipe 2/4. round.py now runs one round job per node, so rounds no longer pack suites
so; this guards the nodes we don't control.

The window cannot be stretched to fit a host: its length rests on a rate measured once, and Vulkan
does not promise that a running shader sees the host's release (on the XTX alone the first link
never saw it and spun its whole cap). So a step now asserts its premise and asks again, as
device_room's with_room does for a device: runtime_lane/busy_premise.rs's until_premise_held runs
a try, and where the busy work ended before the calls returned the try still checks the bytes it
read (one of the answers allowed whatever the timing), writes a LANE-BUSY-MISS line with each
act's host time, the calls' total and each busy command buffer's GPU time
(BusyWork::gpu_span), and runs the step again with fresh busy work, at most 3 tries. A step that
misses every try fails with each try's times, so a call that waits for the GPU's earlier work
still fails as before, and the next real miss shows which side moved.

Tests: busy_premise's a_held_premise_is_tried_once, a_missed_premise_is_tried_again and
a_premise_missed_on_every_try_fails (no GPU). docs/VALIDATION.md names the rule.

Verified: m3-max-34107 (msi) clippy -p metal2vulkan-validation --all-targets --all-features -D warnings under --cfg m2v_gpu, and on lavapipe 5/5 (busy_premise unit tests x3, device_copies exact_answers_take_a_did_modify_range_at_the_commit and a_did_modify_range_reaches_the_bytes_the_next_commit_finds). Running at landing: the XTX run (m3-max-34117).
2026-11-15 16:39:22 -08:00
Anees Iqbal b6081e2c7e Runtime tests: a device of the queue plan is made again while the driver lacks room for it
On the RTX 2080 (job m3-max-33317, 31 queue tests at 16 threads) the
driver refused 10 of the 12 queue_share_device tests' devices their
queue plan, and the runtime made them with its least plan's 3
VkQueues; the tests passed on one shared VkQueue, so what they claim
about the plan's queues went untested. The runtime's own device tests
had no wait like the lane's (ef66c46a5f): on NVIDIA each VkQueue is a
channel, the 2080 holds about 210 across processes (11 devices of the
plan's 18, job m3-max-19615), and the suite's 16 processes ask more.

src/tests/plan_room.rs's device_with_room makes such a device again,
the one made dropped first, while the driver refuses it for want of
resources (Error::DeviceRefused) or it took its least plan
(DeviceShared::least_plan), with pauses doubling from 0.25 s to 2 s up
to 120 s in all, each a PLAN-DEVICE-ROOM line naming the answer and the
wait. Any other error returns at once; past the bound a refusal is
returned and a device still of its least plan fails its test, so a test
of the plan's queues runs on them or not at all. No lock and no
cross-process coordination.

Every plan-device maker in the runtime's tests goes through it:
blit_holds, caller_queue_writes, commit_and_submit, completion,
completion_wakes, draw_again, hand_out_waits, queue_limits_device,
queue_share_device (5), reserved_queues, scheduler_held_wakes,
scheduler_wakes, store_out_device and video_interop. Left as they are:
the least plan's own tests (least_queue_plan, reserved_queues'
a_device_made_with_its_least_plan_reserves_what_its_plan_spares), which
stand the driver's refusal in with refuse_next_devices; many_devices, a
GPU hazard that fills the GPU on purpose; host_ram_first_fill_bench's
ignored release benchmarks.

Test: plan_room::a_plan_device_refused_once_is_made_again_of_the_plan_s_queues
refuses the first making with the stand-in and asserts the device
helped back is of the plan's round robin and presenting queues (from
queue_plan over its families), not its least plan; a plain making
answers the least plan (NVIDIA) or a refusal (lavapipe, RADV) there.
docs/VALIDATION.md says the runtime's tests wait too.

Verified: cargo fmt; build, clippy and the tests in the lane's jobs.
2026-11-15 12:22:02 -08:00
Anees Iqbal 760f8d045b Runtime lane: a device the driver refused for want of room is made again once other processes may have let it go
The 2080 legs of round 9ce951f521 failed 33 of 2,054 lane tests at device
creation: 27 devices of the queue plan that the driver refused (the
runtime then took its least plan and announced least-queue-plan, which
the lane's creation check rejects) and 6 lane devices of 3 VkQueues it
refused outright (Error::DeviceRefused, ERROR_INITIALIZATION_FAILED or
ERROR_OUT_OF_HOST_MEMORY).

Cause, measured: NVIDIA's driver gives each VkQueue a channel with an
instance block of its own, and refuses a device where it cannot allocate
one (the kernel logs "Could not create Channel"). A device of the plan
takes 18 VkQueues on the RTX 2080 (14 round robin, 2 presenting, the
staging and fill queues; its copy family's 2 queues put the copy queue on
the fill queue's), a lane device 3. With nothing else running the 2080
(NVIDIA 620.70.06) holds about 210 channels across processes: 11 runtime
devices of the plan and 3 of the least plan, the 15th refused (job
m3-max-19615), and 66 bare devices of 3 with room for 18 (19562). The
legs run 16 test processes, 188 of the lane's 408 modules make devices of
the plan, and nextest runs a module's cases side by side: 16 x 18 = 288
VkQueues. Lane 2/2's indirect_executions shards, 64 tests at the plan in
a row, took 22 least plans. Nothing leaks: each lane test is its own
process, every helper drops its device in a scope, and a runtime device
makes one vkCreateDevice whose queues its threads never add to.

Neither answer is the test's: its device is the one it asked for, and
the GPU lacked room only while the lane's other processes held theirs
(the runtime's DeviceRefused docs: a device asked for again once fewer
are live may be made). So validated_device_with makes such a device
again, the one made dropped first, after a pause doubling from 0.25 s to
2 s, for at most 120 s in all (runtime_lane/device_room.rs), and
made_lane_device does the same for a refusal. Only Error::DeviceRefused
and a least-queue-plan announced as the device was made are asked
again; any other answer returns at once, and past the bound the last
answer is handed back, failing the test as before. Each pause writes a
LANE-DEVICE-ROOM line naming the answer, the pause and the time waited.
No lock and no cross-process coordination: the driver's answer is the
only signal. The runtime's least plan and refusal stay its own tests'
(tests::least_queue_plan, the driver's refusal stood in for).

Tests: runtime_lane::device_room's unit tests (no device): a short
answer is asked again with doubling pauses until one has room; an answer
with room returns with no pause; one that never has room stops at the
bound. docs/VALIDATION.md's few-channels paragraph says what the lane
does now; degrade_notices' LEAST_PLANS says why no lane test keeps it.

Verified: cargo fmt; build, clippy and the tests in the lane's jobs.
2026-11-15 12:06:06 -08:00
Anees Iqbal 5efe2f1d73 Test queue limits count the program's live command queue handles
The runtime tests' default queue limits count the queues the program holds, not live ones

The check that fails a test needing the queue plan counted live queues
(QueueShared). A command buffer holds its queue's QueueShared, and the
runtime's threads let a completed one go a moment after its wait
returns. So a test that let a queue go and then made two more could
fail or pass by timing.

The check now counts the command queues the program holds a handle of:
- each QueueLine counts, under cfg(test), the command buffers alive
  whose `commandQueue` it is;
- a queue the program made is held where its strong references
  outnumber those command buffers plus the caller's upgrade
  (QueueLine::held_by_the_program, Line::program_queues_held);
- a command buffer takes its count before its handle of the queue and
  drops it after, so a count in passing reads one fewer, never one
  more.

The product's count of live queues (WorkCounts::command_queues_live_most)
is unchanged.

The device test a_default_test_device_fails_where_its_work_needs_the_plan
now keeps a command buffer of a queue it let go before making the
third. The live-queue count panicked there; the held count does not.
The message reads "while the program holds 2 of its command queues".
docs/VALIDATION.md and TEST_QUEUE_LIMITS' doc say the same.

The command buffer's count among its queue's is a guard held for its drop: _counted

Clippy (-D warnings) refused 3d6e4e5957's field `counted`, never read:
the field exists for its Drop, which takes the command buffer's count
off its queue's. Named _counted, as a guard held for its drop.

The test limits' check runs where the program makes a queue, not where a recovery places one again

With the held count, a recovery's queue that took its place on the new
generation counted itself and the program's other queues. So
device_recovery's a_loss_holds_the_hang_s_queue_until_the_recovery and
work_held_unsubmitted_at_a_loss_fails_as_its_victims_in_queue_order (two
queues each) failed on lavapipe at 577d649100. The rest of the suite
passed: 2741 of 2743.

The check now runs in Device::command_queue, for a new round-robin or
unshared queue of the program's, before its place. A queue placed again
after a recovery was counted where it was made.

Verified: job 31249 at 1f69cb2e0c: clippy plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd; queue_limits, queue_limits_device and device_recovery on
lavapipe three times (22/22 each); the runtime suite on lavapipe 2743/2743;
a negative control (the old live count) fails at the third queue. Test-only
(cfg(test)).
2026-11-14 21:02:38 -08:00
Anees Iqbal 58de9ba9a1 The runtime's own device tests take four VkQueues by default, not the plan's 18
What: in the runtime crate's test build, DeviceOptions::default() carries queue limits of a round
robin of two VkQueues and none for presenting (TEST_QUEUE_LIMITS), beside the staging and fill
queues: four on NVIDIA's families, where the queue plan takes 18. Outside the crate's own tests the
default is unchanged (None, the plan), and on RADV's and lavapipe's one graphics queue the limits
leave the plan as it is. DeviceOptions' Default is now written out (every field named) so that its
queue_limits can be the test default there; the API signature table is re-blessed for the derive
moving to an impl, which changes nothing for a consumer.

A test whose work needs more than the default gives on a device with queues to spare (the
program's third command queue, unshared or not; a presenting queue; reserved or extra queues; a
read of the queue sharing) panics where it asks for it, on every device, and makes its device with
`queue_limits: None`: the runtime lane's LANE_QUEUE_LIMITS rule, whose failure is the device's
metal2vulkan-queue-limits-reached and so is said only on a device with queues to spare. Here the
check reads no plan, so a lavapipe run finds every such test. least_queue_plan and many_devices
measure the plan and take it.

Why: NVIDIA's driver makes and destroys one device at a time across processes, and each VkQueue
adds to both. Measured on the RTX 3090 (620.70.06, a probe build that timed each phase of a
device's opening and teardown, m3-max-30672): alone, vkCreateDevice took 540-575 ms and
vkDestroyDevice 163 ms of a device test's 1.17 s (priming 129-142 ms, loader and instance 93 ms,
the runtime's own phases under 25 ms); at 12 threads 55 device tests took 66.9 s, 1.2 s each, no
less than one at a time, their vkCreateDevice a median of 8.1 s and vkDestroyDevice 2.8 s. On the
RTX 5080 Laptop GPU a device of 2 queues took 145 ms against 445 ms with 17
(DeviceOptions::queue_limits' measurement).

Verified: tests::queue_limits::the_tests_default_devices_take_four_of_nvidia_s_eighteen_queues
(no device: NVIDIA's families give 4 VkQueues under the default, 18 at the plan; fails without the
change, whose default is the plan) and
tests::queue_limits_device::a_default_test_device_fails_where_its_work_needs_the_plan (on the
device the cfg selects: the third command queue, an unshared one past it, a presenting queue, a
read of the queue sharing and a reserved queue each panic under the default, and a plan device
makes each).

Also in this landing (the lane's later commits):
- 1edf6b494a The runtime tests' default queue limits fail a test by its live command queues, not its made ones
- 9a2bfa7bc5 Tests that ask for reserved or extra queues take the queue plan
- b9e7cd775b Tests that keep more than two command queues live take the queue plan

Proof (m3-max-30836 at b9e7cd775b): clippy plain and cpuicd 0; the no-device tests 33/33
(the_tests_default_devices_take_four_of_nvidia_s_eighteen_queues: 4 of 18 placed); lavapipe runtime
suite 2732/2732. Negative control m3-max-30752 (default_queue_limits returns None): fails at the 4-of-18
assert. No RUNTIME bump: the product default is unchanged.
2026-11-14 18:24:24 -08:00
Anees Iqbal b3d844f9fb RUNTIME 2261: a commit returns while its batch waits for a held VkQueue; kept draws carry only into passes of the same sample positions and layer count; the lavapipe and AMD lane failures
Runtime fixes, each with a test that fails before:
- A command buffer's queue slot lives apart from its state lock (d159e7a2f1, 78d5a44df2).
  commit() handed its slot over under the command buffer's state lock, which the scheduler
  thread held across vkQueueSubmit; that submit waited for a VkQueue someone else held (a
  compositor sharing the queue), so the program's commit waited as long as the queue was held
  (gdb, m3-max-28123: the lane's checked-commit tests ended in SendError after 60 s). Test:
  tests::scheduler_wakes::a_commit_returns_while_the_thread_submits_its_batch_to_a_held_vk_queue
  (lavapipe, fails before in 20 s: m3-max-28149).
- A render encoder at custom sample positions carries no kept draw (1da568fc43): a kept draw's
  VkPipeline has the positions baked in, and carry_ends never compared the ending pass's, so a draw
  kept from a pass at custom positions was carried into a later pass of the same shape at the
  default ones (runtime_lane::sample_positions on the XTX and the 780M, draw_again.rs:1320).
- A kept draw carries only into a pass of the same renderTargetArrayLength (430fad72b8): the
  layered passes' kept draws were carried across layer counts (runtime_lane::layered_passes, both
  tests, on lavapipe and AMD). The debug check that caught both now names the parts that differ
  and whether the draw was rebound or carried (8bfeebe929, 3973769b86, 9da59ae9e3).

Test fixes (the expectation follows the runtime's documented behaviour):
- runtime_lane::degrade_notices::dispatches_degrade_once_per_kind expects a split where the device
  splits the ragged grid (1b58b69953's partial-threadgroups variant runs it whole elsewhere).
- handed_objects x2 and host_memory: a held import's deallocator runs once its command buffer
  completed, posted to the free thread (41b5430f6a) or not, as Metal's may run after the waiters.
- queue_order's host-step order test commits B once A's gate was taken (b46459080d: a batch whose
  host step has not taken its gate gives way, the order the x86 Macs keep).
- The two dispatches past 2^32 threads compile only under m2v_gpu: a CPU device runs each past the
  watchdog's 20.2 s (docs/VALIDATION.md).
- The held-wakes tests begin once the device's own checks answered.

Verified: lavapipe suite at 430fad72b8 6019/6020 (m3-max-28179; the one failure the runtime-sources
pin this landing re-pins). The XTX and 780M legs (m3-max-28177, 28178) run after the landing.
2026-11-13 21:59:11 -08:00
Anees Iqbal a96e93f4da runtime_lane under sync validation: the layer's false positives become narrow claims, and the tests' own races are taken out
Under METAL2VULKAN_LANE_VALIDATION=sync on lavapipe the runtime lane failed 31 tests on
the layer's hazard reports. At def64b1999 it failed 34: these 31, plus write_routes and two
frame_costs tests, all since fixed in the runtime (write_routes in 14c0b28928 and 952755253f).
None of the 31 is a missing barrier. Each is one of:
- the layer taking a shader's storage buffer as written over its descriptor's whole range;
- the layer reading no indirect draw's counts;
- a difference the runtime already announces;
- a test program's own race, which Metal leaves unordered too.

Claims (runtime_lane::apart_writes, runtime_lane::stage_races; docs/VALIDATION.md's table):
- NotedWrites notes every write a test places in a buffer: a dispatch's, a draw's, a fill's, a
  bounded draw's or a patch draw's, by command buffer. The layer's hazard reports are held
  apart, each distinct one once with its count, so a claim reads every report.
- LAYER-APART-WRITES, widened from dispatches to draws and fills: a write after write between
  noted writes, each one Vulkan command's, no two of which share a byte.
- LAYER-IDLE-DRAW: the index bounds pass's two vkCmdDrawIndexedIndirect of one bounded draw,
  reported as recorded, one such draw noted per command buffer, on a device that announced
  indirect-index-bounds-pass. At most one of the two draws.
- LAYER-IDLE-CHUNK: an emulated patch draw's vkCmdDrawIndirect chunk draws, reported as
  recorded, the patch draws of each command buffer noted apart, on a device that announced
  emulated-tessellation-draws. The tests keep each patch draw below 2^30 triangles and the scan
  writes vertexCount 0 past them, so at most one chunk of a draw draws.
- LAYER-STAGE-RACE: a later draw's vertex stage against an earlier draw's fragment stage of one
  pass, on a buffer the test names, reported as recorded, of the kind whose notice the device
  announced (in-place-vertex-reads, fragments-before-geometry).
- Each form has unit tests of the shapes that pass and of those that must fail.

Tests:
- draw_bases, index_fetches, index_pools: bounded draws noted (idle draw).
- int_attributes, normalized_vertex_fetch, memoryless_uses, render_executions,
  render_gpu_executions, predication: their writes noted apart.
- argument_buffers moves to NotedWrites.
- patches, patch_indices, render_executions' indexed patch commands: patch draws noted (idle
  chunk on the emulation, apart draws on a device with tessellationShader).
  answer_as_plain_metal gives each draw that runs a marks buffer of its own: Metal orders no
  draw's vertex writes after another's in a pass.
- pass_start_reads: the stage-race claim.
- helper_select: a texture memory barrier between its draws, whose storage image the layer
  takes whole.

Verified on lavapipe (CPU ICD), the same sync command at base and tip (whole runtime lane,
--success-output immediate, claim lines printed):
- base 13e0a9b60b, m3-max-21616: 2019 run, 32 failed. That is the 31 above, plus depth_executions,
  a regression from RV 2124 fixed on its own branch.
- tip, m3-max-21631: 2032 run, 1 failed (depth_executions). 31 tests passed with claim lines.
- clippy (every feature, --cfg m2v_gpu, --cfg m2v_cpu_icd) and rustdoc clean, m3-max-21617.
2026-11-12 09:20:56 -08:00
Anees Iqbal 9dc4b0c953 Runtime lane: argument_buffers lets the layer's writes after writes between its dispatches' apart words pass
Under METAL2VULKAN_LANE_VALIDATION=sync on lavapipe, two argument_buffers tests failed with
SYNC-HAZARD-WRITE-AFTER-WRITE between dispatches of the word copier on set 0 binding 1
(resource_ids_a_kernel_writes_name_resources_as_the_cpus_do,
addresses_a_kernel_writes_reach_buffers_as_the_cpus_do; privmem's m3-max-21017 and 21016).
These hazards are not races. Each copy writes 4 bytes, at owner offsets 4 bytes apart. The
runtime's tracker orders a serial encoder's dispatches by the plan's proven window (here 4 bytes
each, disjoint), so it records no barrier between them. The layer takes the descriptor's whole
range as written, and bind::descriptor_range binds that range from the offset alignment down, in
16-byte granules and 16 bytes at least, so to the layer the two ranges meet. Vulkan's memory
model has a data race only between operations on overlapping memory locations ("A memory
operation must not affect memory at a memory location not within its set of memory locations").
The lane's sync_coverage::disjoint_words_of_one_block_are_a_hazard_to_the_layer_alone already
shows this false positive word by word and names these reports. The runtime is unchanged:
adding barriers would only silence what the layer reports.

runtime_lane::apart_writes is a fourth claim form,
layer_reported_nothing_but_apart_writes(messages, claim, &writes). The test notes each
dispatch write as it places it (DispatchWrites: buffer, bytes). A message passes, with a
LAYER-APART-WRITES line, only when all of these hold:
- it is a SYNC-HAZARD-WRITE-AFTER-WRITE (not the racing form);
- both commands are dispatches (hazards::DISPATCHES, now shared with the sequences lane);
- it is on a VkBuffer the test noted two writes or more of;
- no two of those writes share a byte. The writes are read in VkBuffer space through
  Buffer::vk_buffer, asked only once the work ran.
Everything else fails as layer_reported_nothing does. So does a message list the sink filled
(Messages::MAX, now crate-visible), since what it dropped is unread. The hazard text is read by
the sequences lane's parser (parity::sequences::hazards::parse, now crate-visible), not a second
one. Both tests now state that claim after each iteration's run. VALIDATION.md's claim-form table
gets the row. The table's last row and the paragraph after it had run together on one line; they
are split again.

Unit tests (no device) show these fail: a read after a write, a write after a read, the racing
form, a draw or a copy at either end, an image, a buffer not noted or noted once, and two noted
writes at one word or overlapping ones.
2026-11-12 06:52:42 -08:00
Anees Iqbal a094c7f72a Tests: a nextest profile that runs a GPU of few channels three device tests at a time
On NVIDIA's driver each VkQueue is a channel and a runtime device of
the queue plan takes 18. An RTX 2080 held 10 such devices at once
(job m3-max-18774), so a 16-thread host's default 16 test processes
ask it for 288 VkQueues and the driver refuses the rest; the 3090 and
the 5080 Laptop GPU held 61 (jobs m3-max-18776, m3-max-18775).
--profile few-channels runs three at a time, as the consumer's own
profile does. docs/VALIDATION.md says when to pass it.
2026-11-11 21:51:22 -08:00
Anees Iqbal 7d7085f9d0 Remove the host GPU locks: the validation batch's run lock and device-lane's --wrap
GPU work now runs under the cluster scheduler's exclusive GPU hold, which already gives a job
the GPU to itself, so the repo's own cross-process GPU locks only duplicated it.

- vulkan_batch: delete run_lock.rs, the ~/.cache/m2v-gpu/run.lock + run.turn flock that made
  GPU batches on one host take turns run by run, and its two tests. A GPU batch already runs
  one executor at a time (it refuses jobs != 1), and it still reads the hang tripwire before
  every run and writes it on a hang; the tripwire is a stop, not a lock, and stays.
- scripts/device-lane: drop --wrap, which existed to put each shard under a host GPU lock and a
  memory cap; the report's "wrapped" column and totals become the run's.
- docs/VALIDATION.md: the device-lane section says to run it under the host's exclusive GPU
  hold instead of a --wrap lock.
- Comments that told the reader to run probes under `maclock` or spoke of "the Mac's GPU lock"
  now say the run has the GPU to itself (Metal probes, recording.rs, stage-input-split, two
  runtime test modules, which are outside the runtime-sources pin).

Checked on a Linux node before landing: cargo clippy -p metal2vulkan-validation --all-targets
--all-features (plain and --cfg m2v_gpu) -D warnings, the vulkan_batch tests, and the
runtime-sources guard (the pin is unchanged).
2026-11-10 23:19:57 -08:00
Anees Iqbal cc4c44bd7e Make the GPU hazard tests opt-in under --cfg m2v_gpu_hazards
Owner's rule (11-05): tests that fault a real GPU, hold one for long, or
allocate toward its limits never run in sweeps, lanes, stress loops or
gates; they run only when that feature is tested, on request. On the M3
Max a GPU fault's recovery fails other processes' command buffers in
flight (.config/nextest.toml has the measurement). #[ignore] is not
enough, since lanes run --run-ignored all, so the gate is a cfg: on a
real GPU a hazard compiles only under --cfg m2v_gpu --cfg
m2v_gpu_hazards. Under --cfg m2v_cpu_icd it compiles and runs as
before, so lavapipe CI keeps them.

Gated (each doc comment now says which hazard it is):
- runtime_lane::host_memory::a_gpu_fault_fails_its_command_buffer_and_the_queue_runs_on
  and ::a_lost_device_s_command_buffers_let_go_of_their_pools_after_the_driver_s_completion:
  GPU writes into read-only host pages, real page faults (2 and 3).
- host_memory::a_no_copy_buffer_s_pages_are_imported_when_it_is_made:
  no-copy buffers of 1 to 16 GiB.
- vertex_strides::vertex_fetches_past_4_gib_of_a_buffer_are_refused and
  stage_in_strides::stage_in_fetches_past_4_gib_of_a_buffer_are_refused
  (and their `Large` helper): 4 GiB + 4 KiB buffers.
- heaps::the_largest_heap_lies_in_one_allocation: a heap of the device's
  largest allocation, up to 4 GiB.
- cross_queue_shadows: the three tests whose spin holds one command
  buffer for 1.5 s.
- framebuffer_fetch::storage_forms::a_steady_stream_takes_the_storage_form_at_its_first_lone_commit:
  a single-dispatch spin of up to 1 s that only its cap ends on Apple GPUs.
- detach::table_3_a_detach_waits_for_running_work_then_refuses: single
  dispatches calibrated to 500 ms (up to 2 s loaded), the cap alone ending
  them on the M3 Max, where Metal ended some 0.5 s dispatches as hung.
- runtime tests::detach_lost: one dispatch of 2^25 loads (about 4.5 s on
  the M3 Max) whose word the GPU does not see raised.

Made safe instead of gated:
- mesh_draws::object_grids_run_as_metal_runs_them: on a GPU without the
  hazards cfg, grids past 2^20 object threadgroups are skipped (printed),
  as a CPU ICD already skips them; the 70k to 262k grids and the
  past-the-watchdog discards still run. The 4.6M grid took 12 s in one
  command buffer on the RTX 5080 Laptop GPU.
- detach::a_resident_buffer_no_command_reaches_fails_its_submission_once_detached
  takes the spin kernel without calibrating a cap (`spin_kernel`): its
  word is raised, so the cap never mattered, and the calibration's
  unraised runs are bounded only at 16 x 50 ms.
- cross_queue_shadows::an_encoder_after_a_signal_reads_what_another_queue_wrote_after_it
  no longer calibrates a spin it never ran.

The cfg is declared for unexpected_cfgs in the runtime, validation and
conformance manifests. docs/VALIDATION.md says what a hazard is and how
to run one; CONTRIBUTING.md and .config/nextest.toml mention the cfg.
The device lane is unaffected: its builds set RUSTFLAGS to --cfg
m2v_gpu alone. No product code changed (no RUNTIME_VERSION bump; the
runtime-sources pin skips test modules).

Verified on this Mac (no test run on any GPU): cargo fmt --all; cargo
clippy --workspace --all-targets --all-features -D warnings clean plain,
under --cfg m2v_gpu, --cfg m2v_gpu --cfg m2v_gpu_hazards and --cfg
m2v_cpu_icd. cargo nextest list -p metal2vulkan-runtime -p
metal2vulkan-validation --all-features --run-ignored all: under --cfg
m2v_gpu 5022 tests, under --cfg m2v_gpu --cfg m2v_gpu_hazards 5034, and
the difference is exactly the 12 gated tests; all 12 are listed under
--cfg m2v_cpu_icd (5000 tests).

(cherry picked from commit 7b57d9a87a3dd8275a2ece547fc0bd9b9cb6808c)
2026-11-05 00:43:51 -08:00
Anees Iqbal 7cce610704 Delete the shader-side dropped-store mask
One work packet, landed as 5 commits (a31d02e99a..46c3156d42 on archive/development-linear-2026-10-28), in order:

* Delete the shader-side dropped-store mask

What. The per-stage mask of buffer slots whose stores the shader drops
goes, with everything that existed only for it:

- translator: the store-dropping lowering (lower/access/sink.rs; the
  guarded stores in emit, psb, pulled, dynamic, atomic and blob; the
  write-only store-sink binding and the OpSelect of two storage-buffer
  pointers that chose it, with its VariablePointers requirement), the
  specialization key, the stage-table field and their codec tags;
- runtime: argument_table's dropped_store_buffers and its refresh,
  Buffer::drops_writes (now unused), the two variable-pointer enables,
  and SetZeroChoice.store_sinks (now the layout's set-0 bindings);
- tests: engine_dropped_stores, engine_dropped_store_sink, the sink
  cases of neutral_zeros_shared, and dynamic_multi_variable's two
  encoders_plain tests, whose only binding of several variables was the
  sink. The narrow-unit kernel now runs at its buffers' starts and at
  moving offsets: the moved run checks that a dynamic offset reaches
  every variable of its three-variable binding, and no dispatch at a
  moved offset reuses its predecessor's set in either form, since a slot
  read to its buffer's end has a range that moves with its offset;
- the Apple M3 Max known-gaps row for
  host-page-writes-kernel-store-read-only at
  case/bytes-in-the-same-command-buffer-bytes, which this fixes.

Removed public items:
- metal2vulkan::bind::StageTable::dropped_store_buffers (field)
- metal2vulkan::bind::StageShape::dropped_store_buffers (field)
- metal2vulkan::pipeline::SpecKey::DroppedStoreSlots(Stage)
- metal2vulkan::pipeline::SyntheticBinding::StoreSink
- metal2vulkan::device::VkFeature::VariablePointers
- metal2vulkan::device::VkFeature::VariablePointersStorageBuffer
(the two features were asked for only by the sink's pointer select)

Why. The mask was set only from Buffer::drops_writes, which is true only
for host pages imported through a read-only view, and only macOS makes
one (VIEWS_DROP_WRITES; ReadOnlyView::of is None elsewhere, and
no_copy_options keeps the private bit off it). No other path set it:
Linux writable imports, dma-buf imports (excluded where writes drop),
heaps (the same import) and argument buffers (which name no slot). On
that memory the view already takes the GPU's writes nowhere, so the
shader-side drop was redundant there. It was also wrong: a later
command of the same command buffer reads the stored words back from
the GPU's caches on Metal (8 runs of 8 on the M3 Max), and the
shader-side drop made it read the pages' own bytes.

Versions, placeholders for the landing to renumber: SEMANTICS_VERSION
2000, ARTIFACT_FORMAT_VERSION 500 (the codec loses four tags),
RUNTIME_VERSION 1840. api_signatures.tsv re-blessed, docs/REFUSALS.md
and docs/CONFORMANCE-COVERAGE.md regenerated, the runtime sources
re-pinned. FAST-PATHS: the read-only-memory known gap now says what is
true (writes reach the pages off macOS), and the dynamic multi-variable
row is scoped to bindings whose range stays as their offset moves.

Verified:
- metal2vulkan suite: 3329 of 3330 pass. golden_hashes moves 3391
  cells (every module with a device store loses its guard); the table
  is re-blessed on development.
- clippy -D warnings clean, plain and with --cfg m2v_gpu; rustdoc
  -D warnings clean for the four touched crates.
- MoltenVK 1.4.2 on the M3 Max: conformance replay of the four
  host-page-writes cases exits 0, both kernel-store cases exact (the
  visibility pair "announced", the fast-math notice, as before). The
  host-page, read-only and private-bit lanes and argument_table,
  neutral_zeros_shared and dynamic_multi_variable pass.
- lavapipe (arm64, linux-gate): full conformance replay exits 0, its
  891 gap rows exactly the ones the ledger expects on the venue (none
  unlisted, none stale); the same lanes pass.

* Lane: a kernel's stores into private-bit memory reach only its own command buffer

What. runtime_lane::degrade_notices gains
a_kernel_s_stores_into_private_bit_memory_reach_only_its_own_command_buffer.
It dispatches a4_index_word into no-copy memory of an anonymous
mapping, filled with 0xab and made with Metal's private option bit 24,
bound 512 bytes in, then copies the first 1024 bytes in the same
command buffer and in a later one, and reads them from the CPU.

Why. It holds Metal's measured answer where the runtime gives it: the
same command buffer's copy reads the stored words, everywhere; on
macOS, where the pages come through a read-only view, the later command
buffer and the CPU read the pages' own bytes and nothing is announced;
elsewhere they read the stores, announced once as the private-option
notice. Every byte the stores do not name keeps 0xab at every site.

Verified: MoltenVK 1.4.2 on the M3 Max prints "drops writes true; same
command buffer stored true, later command buffer stored false, CPU
stored false" and passes; lavapipe (arm64) prints "drops writes false;
... true, true, true" and passes.

* Number SEMANTICS_VERSION 1907, ARTIFACT_FORMAT_VERSION 475 and RUNTIME_VERSION 1681, past development's

The dropped-store mask's deletion took the placeholders 2000, 500 and
1840; development is at 1906, 474 and 1680.

* Re-bless the golden tables after the dropped-store mask's deletion

Every module with a device store loses its read-only guard (a31d02e99a),
so bless_golden_hashes moves 1330 rows of golden_hashes.tsv;
bless_engine_inventory, bless_engine_goldens and tests::air_input wrote
nothing new.

Verified: the three bless runs and air_input exit 0 at 623f8d2170.

* Re-bless the authored compile census after the dropped-store mask's deletion

corpus-triage --audit authored-compile --bless over 2253 cases and 21
profiles: 0 differences, 0 regressions, 0 failed, 20159 artifacts moved
by hash alone (the store guard's words). Slowest compile 586 ms,
slowest case across all profiles 18.5 s, peak worker RSS 231 MB.

Verified: the census run above at 623f8d2170.
2026-10-28 17:24:23 +02:00
Anees Iqbal bd1861cf3d Keep the samples a resolve after the pass reads on a framebuffer-fetch-by-input device
One work packet, landed as 5 commits (8ec20af606..60fe70fb12 on archive/development-linear-2026-10-28), in order:

* Keep the samples a resolve after the pass reads on a framebuffer-fetch-by-input device

A multisampled color attachment resolved by the crate-owned resolve after the pass
(the sRGB twin, an extended-range format) under `MultisampleResolve` is meant to
render through an image its texture keeps, so the texture keeps the samples it held
before the pass, as Metal's does (`resolve::keep_samples`). The pass asked it whether
a draw took a view of the attachment with the linear rule's `taken`, which on a device
whose framebuffer fetch reads input attachments (`PassLayout::fetch_inputs`:
rasterizationOrderColorAttachmentAccess, lavapipe's) counts every color of every pass.
So on such a device no pass ever kept its samples: the attachment held the resolving
pass's clear and draw (lavapipe: `80808080` where Metal keeps `bf4080ff`; BGRA10_XR
`c09f...` where Metal keeps its earlier clear).

keep_samples now takes `viewed`, the colors a draw actually read (input attachment,
pixel interlock, sample planes, another format's view, the extended-range shadow), as
`kept_bytes::settle` asks it of the attachment it renders apart. The subpass's input
references name the framebuffer's attachments, which take the kept image's view, and a
stand-in takes input attachment usage on such a device (`attachment_stand_in.rs`), so
nothing a draw recorded refers to the attachment's own image. The linear rule keeps
`taken`.

RUNTIME_VERSION 1700 (to be renumbered at landing).

Verified: runtime_lane::resolves::samples_a_twin_resolve_reads_are_kept_as_metal_keeps_them
and ::samples_an_extended_range_resolve_reads_are_kept_as_metal_keeps_them failed on
arm64 lavapipe at 742b94ac06 (diagnostic print: every pass's color counted taken,
`fetch_inputs` true, including a pass with no draw) and pass with this change; both pass
on MoltenVK (M3 Max), where `fetch_inputs` is false and nothing changes.

* Wait on the GPU for the signal a checked head's shared-event wait is held for

Since 0f374bc9ec a shared event's wait is held on the host until its value is reached
and never handed to a VkQueue: `EventTimeline::wait` answers `None` for a settable
event's unreached value even where a submitted GPU signal reaches it. The scheduler
found the indices it may wait for on the GPU through that same answer (`check_heads`'s
`event_waits`, `gpu_waits`'s `WaitFor::Index`), so a checked head waiting for a shared
event recorded nothing to wait for, and the scheduler's thread slept on its condition
variable for the completion turns on every driver but MoltenVK's alike, where its
contract (scheduler/mod.rs, "Waits for a signal to land itself") is to wait in one
vkWaitSemaphores for the signal itself.

`EventTimeline::landing` answers how the host waits for a value: reached, or the index
of the submitted signal that reaches it, whether or not the host may set it; `wait` is
`landing` less a settable event's index. The scheduler's head checks
(`landing_waits`) and its GPU wait take `landing`, so the thread waits on the GPU for a
held wait's signal as for a plain event's; a host set still wakes it through the nudge.
No batch is handed a held index: submissions still go by `wait`.

The runtime behaviour change rides RUNTIME_VERSION 1700 with the resolve change before it.

Verified: runtime_lane::event_round_trips::a_checked_head_waits_for_another_queue_s_signal_on_the_gpu
and ::a_host_signal_wakes_the_scheduler_from_its_wait_on_the_gpu failed on arm64
lavapipe at 742b94ac06 (diagnostic print: the checked head's event wait `None` after the
signalling batch was submitted, then reached; no GPU wait; the second test timed out at
60 s) and pass with this change (WorkCounts::scheduler_gpu_waits above zero, the host
signal waking it; the second in 5 s); both pass on MoltenVK, which keeps its condition
variable (`WaitForAnyObjectLosesASignal`). New device-free test
host_settable_event_waits::a_held_wait_lands_where_a_plain_event_s_wait_chains.

* Ask the layer whether it sees a kernel's write before a sync lane needs one

Four runtime_lane::sync_coverage controls and parity::sequences::lane's hazard control
expected the validation layer's synchronization checks to report a hazard whose earlier
access is a kernel's write of a bound buffer. Since ca74ea24d4 every store through a
descriptor view on a device with variable pointers is an `OpSelect` of the slot's place
and the stage's store sink (`lower::access::sink`), and the layer does not trace a store
through a selected pointer to its descriptor: it takes the kernel's every bound buffer as
read alone. Measured with a dispatch of hand-assembled modules on the runtime's device,
then a copy with no barrier: the store through an access chain is reported
(SYNC-HAZARD-READ-AFTER-WRITE), the same store through the select is not, with Ubuntu
26.04's layer 1.4.341 on arm64 lavapipe and with Homebrew's 1.4.363 on MoltenVK (M3 Max)
alike. So the layer's version is not the cause, and the runtime's recording is not
either: it orders nothing between the two accesses, as Metal leaves them to the program.

As the owner decided for a layer blind to kernel writes: the lanes ask the layer first,
by capability, never by its version. The positive control is
`a_shader_write_then_a_copy_of_one_untracked_buffer`'s run (one dispatch writing an
untracked buffer through the runtime's recording, then a copy, nothing else), done once a
process (`layer_sees_kernel_writes`). Where it finds the layer blind, each test whose
hazard needs a kernel's write prints one `LAYER-BLIND-KERNEL-WRITES <test>: ...` line
naming what it did not check, and requires the layer to have reported nothing of the rest
of its run (`blind_to_kernel_writes`; disjoint_words still checks its bytes). Where the
layer sees the write, every assertion stands as before. docs/VALIDATION.md and the lane's
LaneChecks docs say so.

Verified: the five failed on arm64 lavapipe at 742b94ac06 and pass with this change, each
printing its marker; on MoltenVK (layer 1.4.363) they pass and print the marker as well,
the control there reporting no hazard either.

* Number RUNTIME_VERSION 1670, after development's 1669

The branch's placeholder 1700 left a gap; the resolve and shared-event GPU-wait fixes
take the next number after development's.

* 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-10-28 17:24:21 +02:00
Anees Iqbal adef203530 Describe each driver deviation's route as the code takes it now
One work packet, landed as 10 commits (262093ec48..8e4bfa28b4 on archive/development-linear-2026-10-28), in order:

* Describe each driver deviation's route as the code takes it now

The DriverDeviation, VkProperty and driver-table docs still named the
exact emulations the native-arithmetic change sets deleted (Metal's
libm, division, denormal flushing, NaN selection, min/max picks, the
emulated sampler, the color, storage and Depth16 write roundings, the
depth stand-in). Each variant's doc now says what a profile that takes
it gets and what one without it gets: the device's own answer with the
precision note recorded, or, where a capability hangs on the answer, its
emulation or refusal.

- error/mod.rs: DriverDeviation's header and the float-function, NaN,
  sampler, color-write, FMA, denormal, quantize, min/max, half
  arithmetic, storage-write, texel-write and Depth16 variants.
- device/requirements.rs: the matching VkProperty docs; MetalColorWrites
  says no module requires it (compile.rs never adds it), and
  MetalHalfQuantize drops the clamp claim the code does not make.
- device/driver_facts.rs: the table preambles and measurement paragraphs
  (docs and citations only, no row or variant changed); the deleted
  resolve_rounding::color_resolves_against_metals_rules citation now
  names the_device_resolve_rounds_as_announced, which holds the row.
- runtime_lane/heap_textures.rs: heap_depth_textures_keep_their_bytes,
  renamed from ..._with_their_twins (no twin exists), with the two
  driver_facts.rs citations updated.
- lower/texture/mod.rs and pipeline/compile.rs: the storage_properties
  doc and comment list the four properties select_write relies on,
  dropping the 0x7fc00000 store.

Verified by reading each route in lower/ (narrow, fma, denormal, nan,
arith, sampler, stage_io/color_write, texture) and pipeline/compile.rs,
and by git grep for every cited test and item.

* Describe the pixel samplers, routines and color-write inputs as they run now

Translator docs that still described the deleted emulated sampler, the
cube face fold routine, the compiler-word-bound fit and the shader's own
color-write rounding:

- pipeline/artifact.rs: PixelSamplerScaling no longer names a linear
  sample's emulation or a MetalSampler condition; a runtime word's linear
  pixel sample snaps onto its footprint cell on every device
  (position::plan plans SnapKind::WordCell with no device test), a word of
  mixed filters is the device's. ArgumentPixelSamplerScaling says it is
  recorded on every device for any access but a 2D gather and a sample
  without a comparison, as select.rs pixel_note does.
- lower/sampler/select.rs (pixel_note) and lower/sampler/mod.rs
  (RuntimeSlot::cells, ::texels): the cell snap holds on every device; the
  slot's word filter fields are read for a half texel's conversion alone,
  on a MetalSampler device (half_converts requires !device_texels).
- device/profile.rs: FunctionsInlinedAtEveryCall lists the routines that
  exist (wide-integer divisions, precise fmod, texel conversions, filter
  sums, sampling routines; no face fold); takes_driver_deviation names the
  route a deviation's docs give for a driver without it.
- error/mod.rs: RuntimeInput::ColorWrites says what the color-write map
  decides (the conversion that records a note, and NearestEven's half
  rounding), not a rounding of every output.
- bind/color_resolve.rs and its tests: drop the citation of
  resolve_rounding's cost test, which is deleted.
- device/mechanism.rs: drop the trailing comment on the deleted
  ExactFormsOverCompilerLimit fact.

Verified by reading position::plan, select.rs pixel_note and the
half_converts branch, spirv/builder/module.rs's routine kinds and every
mb.routine site, pipeline/color_writes.rs, and git grep for each cited
item.

* Describe texel conversion, YCbCr filtering and depth comparison as the device's

Translator docs still named the deleted linear-filter emulation, the
shader's own depth comparison and the depth twin:

- lower/texture/half.rs: off MetalSampler devices the device's sampler
  filters and the half is its float texel rounded to nearest even
  (device_texels), not this routine's; the only fetch-computed filter that
  skips the routine is the in-place YCbCr one.
- lower/texture/mod.rs (half_texels): drop the example of a runtime
  sampler's sRGB raw-code emulation for the `arm` clauses.
- metal/format/mod.rs: a two-plane YCbCr texture's linear sample is the
  device's filter, noted, but where its planes are read in place.
- pipeline/artifact.rs (RestrictedDepthRange) and lower/texture/slot.rs
  (depth_comparison): every comparison is the device's; no shader-made
  comparison is left to exclude.
- lower/sampler/select.rs: a depth comparison reads the texture's own
  depth image (no twin).
- lower/sampler/mod.rs (Sampling::words): list the terms plain_words
  sums; no linear emulation, level grid or shader comparison term exists.

Verified by reading device_texels, half_texels and both its callers,
linear.rs filter_note and metal_filtered_ycbcr, depth_comparison's one
caller, in_place.rs, and plain_words.

* Describe the runtime's YCbCr filter notice and variant kinds as they fire now

- degradation.rs: YCbCrFilterNotExact fires on a device that samples
  through Metal's own sampler alone (linear.rs metal_filtered_ycbcr is
  None elsewhere), where the stage records HalfSampleFilter or
  FloatSampleFilter for any two-plane YCbCr format bound; a native sampler
  announces device-sampling. The module doc drops the exact forms dropped
  to fit a compiler word bound, whose kind and fit are deleted.
- ycbcr.rs: linear filtering of the converted texels is the device
  sampler's (Metal's own on MoltenVK, announced ycbcr-filter-not-exact);
  only planes read in place are Metal's filter exactly.

Verified by reading lower/sampler/linear.rs, in_place.rs and the runtime's
Kinds::of and degrade_bound_formats.

* Describe the lanes' and cases' native forms where they named deleted emulations

Docs and comments only; no expectation changed.

- validation runtime_lane/driver_deviations.rs: the half quantize,
  min/max, half arithmetic and half widening bullets say what the module
  does off the deviation (the device's own conversion or quantize, the
  same NMin/NMax/NClamp noted native-min-max, narrow::from_bits' decode),
  not the deleted integer rounding, operand picks and exact_answers
  decode.
- validation observation_contract/comparison.rs: HalfSampleFilter and
  FloatSampleFilter are a YCbCr texture through Metal's own sampler.
- validation runtime_lane/pixel_samplers.rs, conformance
  cases/pixel_samplers.rs: the pixel coordinates reach Metal's texels
  through the translator's snaps, filtered by the device's sampler.
- conformance cases/snorm_tile_store.rs: no exact tile store and no
  FAST-PATHS row; only extended-range, padded and bfloat attachments take
  a load pass.

Verified by reading the lanes' assertions, select.rs pixel_note,
position::plan and narrow.rs.

* State the native forms in the doc pages where they promised exact switches

- README.md: the promise that every speed-for-accuracy choice has an
  opt-in exact switch was false for the device's maths, rounding,
  conversions and sampler, which have none; it now says those are the
  device's, recorded, and the runtime's choices keep their switches.
- docs/API.md: exact_answers selects the runtime's five switches (as
  policy.rs's exact_answers sets them), not exact forms of the native
  arithmetic; an unmeasured driver takes each deviation's documented
  route, not a conservative one; half widening's NaN and denormal are the
  device's under its own conversion or the float controls; Depth32Float
  texels are the depth image's, announced where it clamps or flushes; the
  catalogue intro names the native forms.
- docs/ARCHITECTURE.md: the native forms are the device's on every device
  with no policy choice; the policy's accuracy switches are the runtime's.
- docs/FAST-PATHS.md (after the opening section): a YCbCr texture's image
  form holds Metal's texels exactly and its linear sample is the device's
  filter; only the in-place form is Metal's filter.

Verified against device/policy.rs, lower/arith/narrow.rs, the depth twin's
deletion (c11e653acd) and lower/sampler/linear.rs.

* Drop the exact golden table from VALIDATION.md's emitter-stability contract

4bf2c22aad deleted golden_hashes_exact.tsv and its table in
golden_hashes.rs; VALIDATION.md still described a second table of every
sampling fixture under exact_answers. The contract now names the one table.

Verified: crates/metal2vulkan/tests/ holds golden_hashes.tsv alone, and
golden_hashes.rs names no exact table.

* Re-pin the runtime sources after the doc audit

The audit's commits edit doc comments and comments only in files the
runtime guard hashes (degradation.rs, ycbcr.rs, and translator files the
build lists); no run's behaviour changes, so RUNTIME_VERSION stays.

Verified: the_runtime_sources_are_the_committed_ones failed with 81ebd500
committed against 8bc0e06b computed, and passes after this pin.

* Drop the 0x7fc00000 hand-off from half_write_nans_converted's doc

a6e97e7f93 deleted the NaN canonicalization before storage writes
(StorageImageClass::SmallFloatQuietNan among it): a half write to a
packed small float hands the device the half widened, as to a 16-bit
float channel. The doc still said such a write hands it 0x7fc00000, and
tied MetalHalfTexelWrites to both kinds, where it states the 16-bit
float store alone (lower/texture/mod.rs half_write_nans).

Verified by reading half_write_nans and the write emission
(lower/texture/emit.rs), which canonicalizes no small-float NaN.

* Re-pin the runtime sources after the half-write NaN doc fix

metal/format/mod.rs is a runtime guard input; the preceding commit edits a
doc comment there alone, so no run's behaviour changes and RUNTIME_VERSION
stays.

Verified: the_runtime_sources_are_the_committed_ones failed with 8bc0e06b
committed against 279b25d4 computed, and passes after this pin.
2026-10-28 17:24:21 +02:00
Anees Iqbal 78ed264c90 Drop the normalized vertex attribute's exact division (vertex_normalized)
One work packet, landed as 9 commits (9c0bdbe0d2..41066d87d0 on archive/development-linear-2026-10-28), in order:

* Drop the normalized vertex attribute's exact division (vertex_normalized)

The owner's ruling of 2026-10-27: the GPU's native arithmetic is the contract, no exact
emulation. A normalized vertex attribute is now always the device's fixed-function UNORM or
SNORM conversion; the policy-forced pull that divided its codes in the shader goes with
DevicePolicy::vertex_normalized, VertexNormalizedPolicy, its profile field, its ledger row and
its tests. A format pulled for any other reason (a format the device cannot fetch, alignment,
limits, containment, the capture form) still decodes in the shader as before.

Verified: cargo clippy --workspace --all-targets --all-features -D warnings clean; nextest of
engine_vertex_variants, device::tests::profile, fast_paths, catalogue, degradation and
api_surface: 71 passed. api_signatures is re-blessed at the end of the lane.

* Keep the compact decoded twin only (decoded_texels)

The owner's ruling of 2026-10-27: no exact emulation. A carried ASTC LDR texture's decoded
twin now always holds 8-bit codes, and an EAC 11-bit texture's 16-bit normalized codes (its
values in floats only where the device does not take those codes' format, a capability
fallback). DevicePolicy::decoded_texels and DecodedTexelsPolicy go, with their ledger row,
their mentions in the degrade catalogue and the runtime's docs, the policy-keyed fingerprint
test, and the validation lanes' exact twins. decoded-texel-precision is announced as before.
bind::AstcTexels::Float stays: the conformance suite's cross-check decodes Metal's values with
it. RUNTIME_VERSION 1654.

Verified: clippy --workspace --all-targets --all-features -D warnings clean, plain and with
--cfg m2v_gpu; nextest of fast_paths, device profile, degradation and catalogue, image_plan's
decode bands, the conformance ASTC and ETC cases, api_surface: 112 passed.

* Take the device's texel conversion only (texel_conversion)

The owner's ruling of 2026-10-27: no exact emulation. A read, sample or gather with a float
or half result off Apple's GPUs is now always the device's conversion of the texel's codes,
recorded as DeviceTexelConversion or HalfTexelConversion. DevicePolicy::texel_conversion and
TexelConversionPolicy go, with Metal's conversion by the bound format's class:
lower::texture::float_texel (its routine, census entry and tests), the float_texel plan flags of
reads and samples, the slots' float_format and the heap's float class, and the field of
RuntimeFact::ExactFormsOverCompilerLimit that named it (encoded, so ARTIFACT_FORMAT_VERSION
456; SEMANTICS_VERSION 1873). The ledger row goes; DeviceTexelConversion is now documented in
docs/API.md section 9 alone (fast_paths classes it Elsewhere), and the conformance cases cite
the note's bound in place of the row. The half routine on Apple's GPUs is untouched.

Verified: clippy --workspace --all-targets --all-features -D warnings clean, plain and with
--cfg m2v_gpu; nextest of fast_paths, device profile, catalogue, degradation, the fit, mechanism,
codec, the snapshot variant, engine_handles, the extended-range heap tests, the texel-conversion
test (rewritten for the device's form alone), the conformance ETC, BC and border cases and the
runtime's fitted-variant notice: passed (one exact-conversion test deleted).

* Take the device's filter of a two-plane YCbCr texture only (ycbcr_filter)

The owner's ruling: promise the GPU's native arithmetic, no exact emulation.
YCbCrFilterPolicy and its Exact form go: no slot takes a YCbCr variant
(RuntimeFact::YCbCrTexture, VariantKey and LoweringInputs::ycbcr_textures,
ProfileFields::ycbcr_variant, Linear::exact_only and the binder's
ycbcr_variant are gone). A natively sampling device filters such a texture's
texels (device-sampling); on MoltenVK Metal's own sampler filters them,
noted where the bound format is two-plane YCbCr (ycbcr-filter-not-exact).
The planes read in place on a device whose memory is the host's are kept:
that is a capability path, Metal's filter exactly.

The FAST-PATHS row goes; HalfTexelConversion, which only that row named, is
classed Elsewhere (API.md's catalogue states it). The YCbCr tests keep the
default's selection and drop the variant's; the uniform-branch test runs at
the default policy; the validation lane's Exact draw test goes.

Verified: cargo clippy --workspace --all-targets --all-features -D warnings,
plain and with --cfg m2v_gpu, clean. nextest over fast_paths, device::tests,
bind::plan, compile::fit, compile::tests, engine_linear_half, catalogue,
degradation, api_surface, codec, cache: 372 passed, 5 failed. The five are
engine_linear_half tests of the emulated sampler on lavapipe and MoltenVK
under EXACT_SAMPLING (the_emulation_reaches_what_metal_measured,
the_linear_sums_run_one_by_a_branch_and_stay_calls,
swizzled_packed_texels_are_the_unswizzled_swizzled,
a_pipelines_texture_notes_follow_its_bound_format_and_sampler,
a_depth_comparison_through_a_filter_is_a_filtered_float_sample); they go with
the emulated sampler in the next step. api_signatures is re-blessed at the
end of the lane.

* Take the device's sampler only (sampling, unorm8_linear_filter)

The owner's ruling of 2026-10-27: promise the GPU's native arithmetic, no
exact emulation. Metal's sampler emulated by fetches (SamplingPolicy::Exact,
a pipeline per bound sampler state) and the device's 8-bit unorm filter at
Metal's footprint step (Unorm8LinearFilterPolicy) are gone with their
switches: every sample, gather and comparison goes to the device's sampler,
Metal's own on MoltenVK (VkProperty::MetalSampler) and the device's
elsewhere (VkProperty::DeviceSampling, PrecisionNote::DeviceSampling).

Deleted: lower/sampler/compared.rs, native.rs, linear/compare.rs,
linear/cube.rs, the nearest and level snaps, the cube face position and
fold (face::snapped, FaceWrap), the span and cube bicubic routines, the heap
depth class (FLAG_DEPTH_*, HANDLE_DEPTH_*, Lookup::Flagged's depth), the
normalized gather snap and the runtime sampler's anisotropic bias route.
Notes nothing records any more are deleted with their catalogue and codec
entries and the runtime's Degradation kinds: DeviceGatherFootprint,
CubeFaceReciprocal, DeviceDepthComparison, DeviceTexelDenormals,
DeviceUnorm8LinearFilter. The fit drops the sampling field of
ExactFormsOverCompilerLimit and makes every module-growing form native in
one reduction.

Kept as capability: bicubic, extended range, heap raw reads, YCbCr planes
read in place (its tests move to engine_ycbcr_in_place), constexpr pixel
samplers' snaps and fetches, the runtime pixel word's gather and footprint
cell, Metal's cube face at a tie, the anisotropic emulation without
samplerAnisotropy and for an unmeasured cube-gradient route, the
VkSampler level clamp on Metal's grid.

Validation and conformance follow: the lanes judge the device's filter
within two codes where it samples natively, the anisotropic lane runs with
samplerAnisotropy withheld, and the conformance cases drop their
device-texel-denormals declarations. docs/API.md, FAST-PATHS.md,
ARCHITECTURE.md, CONTRIBUTING.md and VALIDATION.md updated.

Verified so far: cargo check of the workspace, all targets and features,
plain and --cfg m2v_gpu; 1000 of 3664 translator lib tests passed before
the run was stopped for the rebase.

* Join the device-sampler deletions with development's half and write removals

The rebase onto development left two joins only a build shows:

- `packed_scales` and `PackedField::small` lost their last readers (the
  float texel conversion this branch deleted and the normalized write
  development deleted): both go.
- `engine_srgb_raw` takes `DevicePolicy::default()` where development's
  side named `EXACT_SAMPLING`, so it imports `DevicePolicy` again.

Also formats the conflict resolutions (`cargo fmt --all`).

Verified: `cargo check --workspace --all-targets --all-features` passes.

* Drop the sampler word's snap and level-rule fields with their last readers

With every sample the device's own, no function reads a runtime sampler's
nearest snap (`SamplerWord::NEAREST_BASE`, `NEAREST_SNAP`, `NEAREST_LEVEL`,
`LEVELED_SNAP`) or its level rule (`LEVEL_RULE`); only tests named them.
The constants go, with the word test of the base-level mask; the
`VkSampler` clamp on Metal's level grid (`clamps_on_grid`) stays, and its
docs no longer say the shader reads the rule.

The runtime-sampler tests of `engine_sampler` asked, off MoltenVK, for the
emulation's linear state, leveled snap and level rule: they now state the
device's sample on every committed profile (the pixel fields alone, gated;
`MetalSampler` on MoltenVK, `DeviceSampling` elsewhere; no level field).

Also matches `SnapKind::WordGather` as the unit variant it is (clippy).

Verified: clippy (all targets, all features, -D warnings) passes.

* Test the anisotropic, bias and position paths as the device's sampler runs them

The tests of these paths compiled under the exact sampling policy, which
is gone; under the default each now states what the translation does:

- Metal's anisotropic filter is emulated only without `samplerAnisotropy`
  (and on MoltenVK's unmeasured cube-gradient route), so the emulation's
  shape tests compile on committed profiles with the feature withheld,
  and their MoltenVK arms on the profile as described. An isotropic cube
  keeps the device's gradient sample except on the unmeasured route.
- A bias through a sampler without its own is the `Bias` operand on every
  profile (one test over MoltenVK, RADV, lavapipe and the floor); the
  compile-time and anisotropic axis-gradient tests take a constexpr
  sampler with its own bias, the only one that reaches them. The runtime
  slot's word-chosen axis gradients have no reader left: its test goes,
  with the helpers only it used.
- The position kernel writes three words a lane: its record stride is 12
  bytes, not 16, and the by-word gather test's lane floor matches its
  single pass.

Verified: `cargo check -p metal2vulkan --tests --all-features` clean; the
tests run after the rebase onto development.

* Rewrite the sampling tests and notes for the device's sampler

The sampling, texel-conversion and YCbCr-filter emulations are gone, so
the tests that pinned them now pin the device's answer, and the note
docs that described them describe what the module records today.

Tests: the sampler-unk, anisotropic cube, depth-range, bicubic,
dynamic-offset, heap half-texel, shared-switch, sRGB raw view,
swizzled packed and texture-interpreter families. Deleted the tests of
the emulated linear filter over raw sRGB codes (constexpr and runtime),
the runtime sampler's one-texel raw sample and its switch, the shader's
linear depth comparison, the bicubic small-level comparison against the
linear emulation and the depth read's class conversion; the shared
switch keeps the bicubic emulation alone. A NaN texel's half read only
needs to read a NaN under the default policy.

Docs: HalfSampleFilter, FloatSampleFilter, SrgbTexelDecode,
AnisotropicFilter, DeviceAnisotropicFilter, ViewBaseTexelOffset and
HalfTexelConversion in artifact.rs, RuntimeFact::TexelFormat, the heap
class flag, texel_format_spec and a few comments that still named the
emulated linear filter, snapped gathers or the shader's comparisons.

Verified: plain clippy over the workspace with all targets and
features; the touched families under nextest (see the next commits for
the full runs).
2026-10-28 17:24:20 +02:00
Anees Iqbal a14ea5dba8 Make the --cfg m2v_gpu device lane one repeatable command
The steps this packet landed as, in order:
- Name a device-lane shard by the whole area it starts in
- Read a nextest listing by what its filterset takes, not by what it holds
- Say in --help what a slice marks in the report
- Keep the lane runner's lines and its verdict readable
- Say what the device lane's ignored tests actually are
- Align the shard table's header with its rows
- Hold each shard to the tests it had to run, not to nextest's skipped figure
- Say why no shard run builds under the wrap
- Compile each device-lane shard before it takes the GPU lock
- Say why both halves of a shard keep the workspace scope
- Say what a shard's wrapped seconds are, and what they are not

Content: the tree of `development` at 48daef6735, unchanged.
2026-10-26 13:19:20 +02:00
Anees Iqbal 14fb1be63e State what every lane claim of the layer's silence holds, at all 355 of them
Content: the tree of `development` at cdc23c17c1, unchanged.
2026-10-26 13:19:16 +02:00
Anees Iqbal cb38695646 Decide the release's wait from the parking's count, not a command buffer's status
The steps this packet landed as, in order:
- Commit the command buffer behind the refused one while the lowering is held
- Say plainly which answer the freed-memory test reads
- Record what the compute creation prediction cannot know
- State what a lane's layer-dependent claims hold, from what the instance enabled

Content: the tree of `development` at 84b37f339b, unchanged.
2026-10-26 13:19:15 +02:00
Anees Iqbal 646ce435f9 Record what a refused attempt cost, as a run's row records it
The steps this packet landed as, in order:
- Name run_on_device in words where a doc link would reach a private item

Content: the tree of `development` at b23991eba0, unchanged.
2026-10-26 13:19:11 +02:00
Anees Iqbal 5f5db7c870 Record what every validation case cost on Metal and on Vulkan
The steps this packet landed as, in order:
- Guard the recorded timings against reaching a verdict or a digest

Content: the tree of `development` at f800b768e9, unchanged.
2026-10-26 13:19:10 +02:00
Anees Iqbal 0175289314 Batch the development-fast round: tessellation without tessellationShader, primitive ids, mesh tooling, color groups, the vk12 floor, runtime timing and teardown fixes
One commit of the 247 on development-fast (720ef1ce9a..9f46fdf80d), squashed at the user's request.

Translator:
- Tessellation on a device without tessellationShader: Metal's tessellator emitted as SPIR-V, a
  one-workgroup scan placing each patch's triangles in Metal's order, and the post-tessellation
  function as a plain vertex stage (EmulatedTessellationDraws; SEMANTICS 1739, ARTIFACT_FORMAT 419).
- [[primitive_id]] on a device without geometry or tessellation shaders, as a flat varying the
  vertex function writes; indexed lists, lines and points drawn de-indexed (RuntimeGap::PrimitiveIdIndices).
- Fragment functions of more colors than the device draws at once, compiled in color groups
  (PrecisionNote::ColorAttachmentGroups).
- Object functions' threadgroup memory from the render encoder; a kernel's mesh draws from an
  indirect command buffer; mesh payload sizing.
- The Vulkan 1.2 floor profile (vk12-floor) and the gates it needs; Metal 27.0.1 answers as the M3 Max.
- Overflow tests in the runtime-built modules by the product's high word (NVIDIA's compiler fails
  the division form), guarded crate-wide by tests::owned_divisions.

Runtime:
- Color-group passes replayed per group over twin depth/stencil; snapshot and copy-back cost cuts.
- Command buffers finish on the queue waiter that saw them; the waiter holds no device handle, so
  a program's drop after its wait is the device's last.
- Every object an encoder was handed held until its command buffer completes; deallocator order
  and announcements.
- Driver defects recorded and announced: ANV counts a visibility sample once per color output
  (visibility-count-per-color); MoltenVK fails pending work when memory that held a device-address
  buffer is freed, so freed memory waits for the work in flight (host-deallocator-delayed).
- RenderCommandEncoder::set_object_threadgroup_memory_length; Visibility::counting().

Validation: mesh tooling (object, mesh and ICB-mesh cases on both executors), the authoring
census closed, the queue storm judged in Metal's unit, load-robust exits and indirect-census
bounds, and the golden hashes, printouts, fixture inventory and authored compile census blessed.

Docs: FAST-PATHS.md trimmed to a ledger of what is true now; API.md's catalogue and accepted
differences, REFUSALS.md and METAL-COVERAGE.md current.

Verified on development-fast before the squash: the full suites on the RTX 5080, RTX 3090,
RX 7900 XTX, Radeon 780M, Iris Xe, lavapipe and the M3 (MoltenVK and the Metal oracle), lint in
every configuration, rustdoc, doc tests, packaging and public case qualification; the timing and
teardown lanes x5 on every venue; the authoring-capability census 16656/16656 with 0 unresolved,
the vk12-floor translation census at 6139 translated with the slowest row 794 ms and peak 126 MiB.
The tree is development-fast's at 9f46fdf80d.
2026-10-16 11:12:03 +03:00