Commit Graph
172 Commits
Author SHA1 Message Date
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 ad35582f61 matrix: the RX 550's constant_managed row takes constant_private's 1.20 ceiling
The planner ruled that the RX 550's (1002:699f) constant_managed row shares constant_private's
ceiling of 1.20: the two rows run the same constant-table kernel, the table Managed in one and
Private in the other, and the cost is the same GPU cause, tiles over a grid one high and one deep
and the RX 550's 64-bit address per read. Matrix cbd4644463 timed constant_managed at 1.180 (the
median of three re-timed pairs) next to constant_private at 1.193. The rt README's known gap now
names both storage modes.

Verified: scripts/matrix/test_results.py, 29 tests OK; HARNESS_CEILINGS reads both rows for
1002:699f.
2026-11-18 02:04:02 -08:00
Anees Iqbal b6b303f8a0 matrix: the RX 550's constant_private ceiling, 1.20; the rt README gap names what was measured
The planner set the RX 550's (1002:699f) constant_private row a ceiling of 1.20 in
HARNESS_CEILINGS, based on the row's measured median. The matrix's limit is that ceiling times
HARNESS_BUDGET (1.236). The pushed-flag branch for 256x1x1 tiles was tried and dropped under the
planner's time box.
- v1 (probe a29d4d4fde): 0.884 of tiles on the RX 550, but the untaken branch cost 6.7% on the
  UHD 630's grid3l (m3-max-45077) and 1.6% on the RX 550's (m3-max-45076).
- v2 (probe 559c61a305), where the branch covers the extent test too: 0.954 of tiles on the RX
  550's constant_private (m3-max-45131), under the 5% bar.

The README bullet now says what was measured, not the earlier attribution:
- On the RX 550 the row runs at 0.90 of tiles in 256x1 workgroups, 0.89 through storage-buffer
  descriptors, and 0.89 with both (probe 4f8a9df6b5 on 80bd8ca764, m3-max-45027).
- The decode's instruction count does not explain it: the decode's masks as constants gave 1.000
  of tiles (m3-max-45076).
- The 64-bit address per read is from the ISA (m3-max-44342).
- The Iris clause is corrected. In an exclusive 7-round run (m3-max-45057) the Iris Xe took
  1.027 of the old runtime's GPU time, with 0.999 in 256x1 workgroups and 1.002 through
  descriptors. It pays neither cause, and it has no gap (under 1.03).

Verified: scripts/matrix/test_results.py, 29 tests OK, including
test_every_ceiling_is_over_the_budget. README lines are 100 columns or fewer.
2026-11-18 01:29:02 -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 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 a1a5ada454 matrix: the harness budget lists no ceiling: a ceiling is ruled after the work on its row, never taken from a measured ratio
The 2080's frame_5cb ceiling of 1.166 was its measured commit-to-complete ratio at 594b86d1f2,
which turned a red into a budget without a ruling. The GPU-time ceilings dropped earlier on this
branch were ratios of another measure. With none listed, every row over HARNESS_BUDGET fails its
leg until a ruling, made after the work on that row, gives it a ceiling.

Verified: python3 scripts/matrix/test_results.py, 28 tests OK.
2026-11-17 20:55:18 -08:00
Anees Iqbal b74e1a50b9 harness, matrix: a row is judged by host time: commit-to-complete where the row times it, else the wall time a run adds; the GPU time is a diagnostic
The matrix judged every plan row by its GPU time (first command buffer's GPUStartTime to the
last's GPUEndTime), which is not what a program waits on, and whose placement changed between
builds. The harness's matrix time is now run::matrix_time: the steady time of each run's mean
commit-to-complete time where the plan times its command buffers' (frame, frame_5cb, long_4cb;
frame now times it too), else the steady time of the host wall time each run adds
(Report::wall_us, the timed loop's period with two runs in flight). The GPU time stays in the
table as a diagnostic; a new line per row prints the matrix time, what it is, and the wall p50.

results.py's ceilings were GPU-time ratios. They are now host-time ratios: frame_5cb on the 2080
keeps a ceiling of 1.166, its commit-to-complete ratio at 594b86d1f2; the others are dropped, and
the first matrix on host time sets the ceilings of the rows still over the budget.

Re-judged from the 594b86d1f2 matrix's harness output (c2c p50 of every command buffer, new over
old; the records hold no host wall time, so the burst rows and frame cannot be re-judged):
- frame_5cb: 780M Phoenix 0.671, 780M HawkPoint 0.693, RX 550 0.820, XTX 1.003 (pass, as on GPU
  time); 2080 1.166 (GPU 0.928: now over the budget, its ceiling 1.166); 3090 0.760 (its GPU
  ceiling 1.137 leaves the list); UHD 3.535 (GPU 2.395; fails either way).
- long_4cb, both runtimes at one size: 780M Phoenix 1.273, 780M HawkPoint 1.309, XTX 1.291,
  2080 1.345, 3090 1.266, UHD 1.154: pass on GPU time (0.99-1.01), fail on host time: a group's
  first command buffers are seen complete with its last. RX 550: the runtimes ran different sizes
  (1024 and 2048), so its ratio (1.014) is not comparable until both run the same work.

Test: tests::a_row_is_judged_by_host_time_never_its_gpu_time (wall time without commit-to-complete,
the mean of a run's places with it, the steady time of those means, none without host times).
scripts/matrix/test_results.py passes (28 tests).
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 445b720f78 identity: texture slots sampled through runtime sampler slots from set 1's sampler arrays
Under the identity domains a kernel samples a texture slot through a runtime sampler slot. The
texture is its class's set-1 element at the index of its pushed gpuResourceID, as a read's is.
The sampler is the element of a set-1 sampler array at the index of the sampler slot's pushed
gpuResourceID (SlotGuestBase of the sampler slot), joined to the texture by OpSampledImage. The
array is picked by the use: binding 2 for a plain sample, 3 for a depth comparison, 4 for a
texture of an integer format; 4,000 SAMPLER descriptors each, PARTIALLY_BOUND |
UPDATE_AFTER_BIND | UPDATE_UNUSED_WHILE_PENDING, every stage, the same set 1 for every pipeline.
The sampler's word (pixel coordinates, a nearest pixel sampler) is read from the ID's high word,
so no specialization constant and no SamplerReduction, SamplerCoordinates, CubicSampler or
ConstantLanes fact remains; every precision note is static. An integer write to a storage slot
without a format saturates to the channel widths the consumer pushes
(PushField::TextureIntegerChannels, a u32), with no fact.

Still refused as Unsupported{IdentityDomains}: constexpr samplers (next change: a pushed index),
an argument buffer's sampler, arrays of samplers, bicubic and anisotropy emulation, a slot's
minimum level.

Translation output changes only under the identity domains (Device::from_queries). Device::new
output is unchanged: golden_hashes_match_the_table passes at this tip (job m3-max-42189), with no
"changed under an unchanged key" and no "profile changed:" line.

For the runtime's side (the planner's three facts):
a. The runtime must dedupe device samplers by create info across the three arrays' uses.
   Exhausting maxSamplerAllocationCount (4,000 on the 2080, 3090 and UHD 630; 32,768 on
   lavapipe; 65,536 on the others) must be a typed refusal, with a fill-past-capacity test.
b. The update-after-bind limits for 65,536 sampled images, 4,096 storage images and 12,000
   samplers hold on all nine profiles (the smallest is lavapipe's 1,015,808); the floor must
   check them by query.
c. The count of cubic sampler descriptors is asked of the replay lane; if any exist it goes back
   to the planner before step 5 closes.

SEMANTICS_VERSION 2161: identity-domain modules of sampling kernels and integer writes change.

Verified:
- m3-max-42094 (msi), this change on cd5a76a757: clippy -p metal2vulkan --all-targets
  --all-features and rustdoc -D warnings green; nextest all() of metal2vulkan and metal2vulkan-rt,
  3,719 of 3,723 passed. The four failures were development's own (the new pad_simd_shape and
  vector_word_phases fixtures had no table rows), re-blessed at 74669c0552.
- m3-max-42096 (msi): clippy --cfg m2v_gpu and --cfg m2v_cpu_icd green.
- m3-max-42189 (msi), this tip on 58891b9ce5: golden_hashes_match_the_table,
  public_fixtures_engine inventory and llvm_as part 8, and air_input's engine golden printouts
  pass.
- engine_identity: sample_down links and passes L3 on every profile and on moltenvk-m3 without
  robustImageAccess2, with set 1 bindings 0, 1 and 2 used, no spec constant but LocalSize, and no
  sampler fact; an integer write of (300, 70000, 5, 2^31) stores (255, 255, 5, 255) under the
  RGBA8Uint word and the raw lanes under word 0, on the CPU interpreter.
2026-11-17 12:46:10 -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 d5a475f1a0 old-runtime regression fix: the stage bounds return to Device::new's ANV rows; the bound on every device is a fact of from_queries' profile
576a7348bc put one stage bound on every device on the shared translator
path, so the old runtime (Device::new) newly refused what it compiled
before: on the UHD 630 and on every committed profile without maximal
reconvergence, 6 corpus modules (12 rows) went from compiled (emulated
simdgroups, entry weights 104,424 to 188,554) to Needs::StageBound.
Measured on gem10 through Device::new at 9cb90de8cc (job m3-max-41747).

Restored for Device::new, as before 576a7348bc:
DriverWorkaround::SerializedStageWrapsLargeModules and
CompilerMemoryGrowsWithStageSize on ANV's identity row, their bounds
(786,432 and 99,109), the re-plan keeping the widest pin, and the
refusal as Needs::DriverDefect naming the defect; no bound elsewhere.
The old runtime's heap-trim test, warm-refusal kinds and their tests go
back to their text before 576a7348bc.

rt keeps what landed, carried with no switch. The bound is a fact of
the profile (device::profile::StageBound): Device::new builds
StageBound::Defects (the bounds of its rows), Device::from_queries
builds StageBound::Every (99,109 on every device, refused as
Needs::StageBound). stage_bound::emit reads that one field. The
fingerprint renders the fact only when it is Every, so every
Device::new fingerprint is byte-identical to before 576a7348bc. Every
from_queries fingerprint moves, so an rt profile is never one of the
old path's.

Tests:
- The pre-576a7348bc ANV tests are back (both defects' bounds, and the
  same profile without them emitting under every bound).
- New every_stage_from_queries_keeps_the_widest_pin_or_is_refused:
  re-planned, then StageBound; the serialized bound is none there; RADV
  through Device::new is unbounded.
- the_stage_bound_fixture_keeps_the_pin_or_is_refused covers both
  paths. Iris pinned through both. Without maximal reconvergence:
  StageBound through from_queries, DriverDefect on ANV through
  Device::new, and emitted emulated through Device::new under Intel's
  Windows driver (the UHD 630's case).
- New the_stage_bound_is_a_fact_of_the_profile checks every committed
  profile.

Docs:
- FAST-PATHS' known gap is ANV's again.
- The rt README's known gaps gain the every-device bound.
- API.md and the Needs::StageBound and Feature::StageSize docs name
  both paths.
- REFUSALS.md regenerated; the API table regains the two variants.

SEMANTICS_VERSION 2153.
2026-11-17 10:57:34 -08:00
Anees Iqbal 75b422338a identity: argument-buffer textures are the set-1 elements their resource IDs name
Under the identity domains an argument buffer's texture handle is the gpuResourceID its member
holds: the handle is the ID's index, the element of the class's set-1 array (0 is nil, the null
descriptor), with no handle table, no search and no descriptor. Where the shader checks a read
itself (no robustImageAccess2) the handle carries the word's missing-alpha bit (word bit 12) at
HANDLE_ALPHA_ONE, so the handle form is Lookup::Element or Lookup::Flagged{alpha} only.

The handle tables' variant forms are off under these domains (`texture::tabled`): reads of a
member of another numeric class, raw-texel decodes, storage conversions (red-blue, sRGB alias),
A8 alpha-in-red, unreadable-storage nulls, YCbCr write marks, and the HeapCrossClassNeutral,
HeapStorageReads and HeapResidency facts. A slot and a member of one class index one array, so
the class's volatility now merges the slots' uses with the groups'. The admission takes heap
groups whose declaration is their identity class with no plain, raw or cross classes; anything
else stays Unsupported{IdentityDomains}.

Translation output changes only under the identity domains: the default domains plan and emit
as before (no golden re-bless needed). SEMANTICS_VERSION 2153.

The test kernel `tex` gains an argument-buffer form (`texture_kernel(true)`), checked on
lavapipe, moltenvk-m3 and moltenvk-m3 without robustImageAccess2: same answers at the same
elements, set 0 empty, and the handle form Element or Flagged{alpha} as the profile checks reads.

Verified (this commit's tree, as 657e2245c2 on 2872c419e0):
- msi 41756: clippy -p metal2vulkan --all-targets --all-features -D warnings, rustdoc
  -D warnings, nextest -p metal2vulkan -p metal2vulkan-rt in full: 3,701 of 3,702 pass; the one
  failure is golden_hashes_match_the_table, stale under development's own profile change.
- msi 41800: that golden test with every difference listed: 7,260 cells under a changed profile
  fingerprint (development's at 2872c419e0; this commit changes no profile field), no cell whose
  value moved, no cell changed under an unchanged key. Fixtures that need metal-as (macOS) are
  not compared there.
- msi 41757: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
- msi 41712, 41713 and 41752: the same at 160a3c5bae on 9cb90de8cc (SEMANTICS 2152 there), the
  golden test matching 1,815 rows x 19 profiles.
2026-11-17 10:56:25 -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 576a7348bc translator: one stage bound on every device; the two stage-size workarounds go
A module whose entry weighs more than COMPILED_STAGE_WEIGHT (99,109, the
heaviest stage measured to compile within host-sized memory, on ANV) is
now handed to no driver, whatever its identity. A kernel that emulated
its simdgroups only in place of the widest mode's pin (the subgroup size
range decides it) is planned again keeping the pin, as before; every
other module past the bound is refused with Feature::StageSize and a new
Needs::StageBound, its symbol naming the weight and the bound. The
refusal is permanent for the input on the device (its plan decides the
weight), so it is not NotImplemented; validation reads it as the
translator's own gap.

DriverWorkaround::SerializedStageWrapsLargeModules and
CompilerMemoryGrowsWithStageSize go, with ANV's identity entries for
them and the serialized bound (786,432), which the single bound sits
far below. Why: the workaround ladder takes one form for every device,
the slowest compiler's; a device whose compiler would take a heavier
stage is refused it, recorded in FAST-PATHS' known gaps.

Measured before this change, with a scratch build that applied the
bounds and the re-plan to every profile: the corpus on the Iris Xe's
description without its identity refused nothing (largest planned
module 91,399, job m3-max-41496), and RADV and NVIDIA nothing either;
without maximal reconvergence 12 rows were refused, 6 distinct
simdgroup-matrix modules of 198 to 285 products whose lockstep pairs
force emulated simdgroups (jobs m3-max-41474, m3-max-41523).

The owned fixture stage_bound/stage_bound_matrix (512 simdgroup matrix
products beside a lockstep pair in divergent flow, our own MSL) has
their structure: on the Iris Xe its emulated module weighs 123,307 and
its pinned one 37,646; without maximal reconvergence it is refused at
123,308 (scratch weighing, job m3-max-41602). The new test
the_stage_bound_fixture_keeps_the_pin_or_is_refused asserts both paths
and that the re-planned kernel is under the bound.

The old runtime's heap-trim test loses its long chain, now refused on
every device; it asks for a trim where the making left more than the
floor free (NVIDIA's compile never does under the bound, 189 MB at
most measured). SEMANTICS_VERSION 2150; REFUSALS.md regenerated; the
API table loses the two variants and gains Needs::StageBound.
2026-11-17 10:24:59 -08:00
Anees Iqbal d9b03bf1f4 harness: the new runtime runs every workload; typed refusals by name; counts of a lone run
The new runtime now implements the harness's compute traits (rt.rs): the
translator's library and function descriptor, its pipeline states, a queue of
newCommandQueue's 64 command buffers, serial compute encoders, and GPU times from
its host clock in nanoseconds. `--runtime new` runs the authored, described and
creation workloads; run::Buffers, the creation-only session, is gone, and the
matrix runs the harness on both runtimes (HARNESS_RUNTIMES).

A workload a runtime answers with a typed refusal (the new runtime's
Error::Unsupported known gaps, such as Gap::KernelInput, and its device limits)
prints REFUSED with the refusal on that runtime's row; the other runtimes'
outputs are compared among themselves, and the command does not fail for it.
Each set prints `refused <n>` as a matrix metric, so a refusal that appears is a
matrix failure.

Per workload, the runtime's own counts of its work (the new runtime's
submissions, passes, barriers and bytes copied; the old runtime's
vkQueueSubmit calls) are read over one run after the timed ones, committed alone
and waited for, so nothing else in flight blurs them: `<count>_per_run` metrics,
for `frame` its counts per frame. Per set, where the runtime counts them, the
first-use waits (count, total and longest) print as a metric and two times.
This replaces the per-timed-run barrier average, which a run still in flight at
either read could shift by one run.

Function constants convert in plan.rs, which both runtimes use. The device
tests run every authored workload on both runtimes (the new one's gauges read
zero after its device drops, and it waited for at least one pipeline), and the
described test compares the old runtime with the new. Unit tests: the new
runtime's refusal mapping and 32-bit sizes, and run_each with a refusing and a
failing session.
2026-11-17 10:08:52 -08:00
Anees Iqbal fa52012831 identity: texture slots are the set-1 elements their pushed resource IDs name
Under the identity domains a kernel's texture slots now lower. A slot's
gpuResourceID is pushed as its PushField::SlotGuestBase (the index in the
low word, the word in the high one). Its texture is the element at that
index of one of set 1's two fixed arrays: binding 0, SAMPLED_IMAGE x
65,536, and binding 1, STORAGE_IMAGE x 4,096. Each is partially bound,
updated after binding and while unused elements are pending, and seen by
every stage, with the same layout for every pipeline
(BindingSource::IdentityArray). Each image class the kernel declares
(shape, numeric type and depth comparison, sampled, or storage without a
format) is a variable of its descriptor type's binding. The slot binds no
descriptor and declares no specialization constant:
- is_null_texture answers whether the index is 0. Nil needs nothing
  else in the shader, since element 0 of each array is a null descriptor
  (the device test of ba4454b05b).
- A read the shader checks itself takes Metal's out-of-bounds alpha of 1
  from bit 12 of the word (TextureWord::OUT_OF_BOUNDS_ALPHA_ONE).
- The ResourcePresence and OutOfBoundsAlpha facts are not stated there.

No binder chooses a variant under identity, so a slot reads whatever
texture its ID names through the plain form:
- the variant facts (cross-class reads, planes read in place, texel rows,
  texture-buffer parts) are not stated;
- a float or half read takes the device's sRGB decode with
  PrecisionNote::SrgbTexelDecode (VkProperty::MetalSampler on MoltenVK),
  as a heap element's does, with no SrgbTexture twin;
- no texture is sparse (the consumer refuses one): no write-dropping
  SparseTexture constant and no ConstantLanes;
- a storage slot is formatless with no StorageTextureFormat fact. Where
  the device cannot access it without a format, the slot is refused as
  Unsupported{IdentityDomains} instead of asking for an input no consumer
  gives there.

Admission stays typed. Under identity, a function is refused as
Unsupported{IdentityDomains}, not implemented, if it:
- samples (any sampler plan; Metal's own sampler as a requirement is
  allowed);
- reaches textures through argument buffers (any heap group);
- declares a slot with no identity class: texture buffers, level views,
  cube-as-array, planes, extended range, RGBX, ulong, or a storage
  image with a format;
- uses a slot whose state comes from anything but its ID: border texels,
  sparse residency arms, a half conversion by the bound format, swizzles,
  offset bases;
- carries a fact naming such state (identity_unsourced).
That keeps the arm64-only forms (two-plane, extended range, sRGB twins)
out of the identity domains, as the x86 scope wants. The old binder
refuses an identity array as an internal error, since the consumer
writes those arrays.

SEMANTICS_VERSION 2150 (identity output changes), ARTIFACT_FORMAT_VERSION
529 (BindingSource gains IdentityArray). docs/RESOURCE-ID.md says what the
arrays are and what the shader reads of an ID. docs/API.md says what the
identity domains lower. The refusal surface and the API signatures are
regenerated. The blessed table also gains
metal2vulkan-rt::PrecisionNote::CappedLodBias, a variant development's
table lacked.

Verified, on development cfa389aa9b (check commit 564d131163, same tree):
- msi, job m3-max-41519: clippy -p metal2vulkan --all-targets
  --all-features -D warnings, rustdoc -D warnings, and nextest of
  metal2vulkan's whole suite: 3672 tests run, 3672 passed, 20 skipped.
- msi, job m3-max-41520: clippy of metal2vulkan under --cfg m2v_gpu and
  --cfg m2v_cpu_icd, both clean.
- The new test, texture_slots_are_the_set_1_elements_their_pushed_resource_ids_name,
  runs on lavapipe, moltenvk-m3, and moltenvk-m3 without
  robustImageAccess2. Its words come from tests/resource_words.tsv rows
  70 and 10, checked against TextureWord::of. It checks the fixed set-1
  layout and that the pushed fields are exactly the buffer, the three
  texture IDs and the region. On the interpreter, with the source at
  sampled element 3 and the destination at storage element 2, it checks
  the reads, the writes, the width and is_null_texture both ways (index
  0 and index 1). On moltenvk-m3 without robustImageAccess2, where the
  shader checks the read, the source image traps any access outside it
  and the out-of-bounds alpha comes from bit 12 of the word: 1.0 for
  R8Unorm, 0.0 for RGBA8Unorm. On the other two profiles the device's
  robust texel answers.
- The same change on the earlier base 9a3b6587b2 (jobs m3-max-41478 and
  41479): 3670 of 3670, clippy clean in all three configurations.
2026-11-17 09:51:53 -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 46e3215e55 identity: kernels over buffers lower under the identity domains
Under PointerDomain::Identity with HandleDomain::Identity every buffer slot of a kernel is its
device address used directly. Each slot is the Psb form, its address read from its own push
field, PushField::SlotGuestBase(slot): gpuAddress plus the bind offset, which under the identity
domains is the Vulkan device address. No root table is read, and no access is contained, as Metal
contains no device-address access (psb::prepare_at). Selection admits, under the identity domains,
only the plans lowered so far (select::identity_admits): a kernel whose push fields are its slot
addresses and its dispatch region, all in the push window, with no descriptor and every slot
addressed. Anything else is still Unsupported{IdentityDomains}, not implemented, now refused there
rather than for every function at analysis. SEMANTICS_VERSION 2146: a refusal under the identity
domains became a module.

The new tests (src/tests/engine_identity.rs):
- a1_bool_from_float under the identity domains on lavapipe and moltenvk-m3 has no descriptor,
  no root table and three SlotGuestBase fields. It passes L3, and it computes the program's
  answer on the CPU interpreter, with its buffers above 4 GiB at bind offsets 32, 16 and 4. It
  writes nothing past its output, with its region pushed.
- a2_dynamic_texel_offset, which samples a texture, compiles under the default domains and is
  refused under the identity ones.

Verified:
- m3-max-41149 (msi, check commit eeecc4492b, the same tree but for the test's region bytes):
  clippy -p metal2vulkan --all-targets --all-features, rustdoc -D warnings, and nextest -p
  metal2vulkan --all-features, 3664 of 3665. The one failure was this test, which met the kernel's
  DispatchRegion field and did not fill it.
- m3-max-41195 (msi, a5dbfd408f, this tree): clippy and rustdoc; tests::engine_identity and the
  domain pair test, 3 of 3.
- m3-max-41150 (msi, eeecc4492b): clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
2026-11-17 08:13:46 -08:00
Anees Iqbal 8a07d62b97 matrix: a run that wanted RAM sizes the next at twice its reservation
At b216007f0a the rt suite on ms01 was killed at 3 GiB and then at 5 GiB, and
on the UHD 630 at 4 GiB and then 6 GiB: each rt test device makes a 256 MiB
Private and a 256 MiB Shared block, at nextest's default parallelism (20 on
ms01, 12 on the mini), all in system memory on an integrated GPU. 1.5x per
step takes two lost legs to get there; 2x takes one, and the next measured run
brings the size back to 1.3x its peak.

Verified: the script parses; arithmetic read against jobs m3-max-41113,
41148 (ms01) and 41115, 41116 (UHD 630).
2026-11-17 08:02:10 -08:00
Anees Iqbal d33138f23c matrix: a job that failed an allocation at its RAM ceiling runs once more with room
The 2080's rt suite ended 1, not 137, at b216007f0a: it peaked at its 2 GiB
reservation, and NVIDIA's driver, pinning host memory for the 256 MiB Shared
blocks, answered the limit with VK_ERROR_OUT_OF_DEVICE_MEMORY rather than the
kill. The matrix counted it as a plain failure, kept the 2 GiB for the next
run (a run at its reservation kept it), and failed the leg on four tests.

Wanting RAM is now a peak at the reservation plus either the kill or a failed
allocation in the output (OUT_OF_DEVICE_MEMORY, OUT_OF_HOST_MEMORY, or Rust's
"memory allocation of N bytes failed"); such a run gets its one rerun and
sizes the next at 1.5x. A failure at the ceiling with no failed allocation
stays a failure: lavapipe's suites peak at their reservation as a rule.

Verified: the script parses; the rule is read against job m3-max-41114
(peak 2.0 of 2 GiB, exit 1, four ERROR_OUT_OF_DEVICE_MEMORY panics).
2026-11-17 07:59:21 -08:00
Anees Iqbal 94071f82a2 device: the identity pointer and handle domains, taken as a pair
The new runtime's form: pointers are device addresses used directly and a texture's or sampler's
handle is its gpuResourceID (docs/RESOURCE-ID.md). The variants come beside the old domains,
which stay until the cutover; nothing lowers under them yet.

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

Verified (this commit's tree, rebased with the ledger commit before it onto b216007f0a):
- msi 41071: clippy -p metal2vulkan --all-targets --all-features -D warnings, rustdoc -D warnings,
  nextest -p metal2vulkan in full, 3,663 of 3,663 (the golden table included: no cell moved; the
  new test the_identity_domains_come_as_a_pair_on_a_device_with_addresses among them).
- msi 41072: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
- msi 41073: the conformance crate's ledger tests, 7 of 7.
2026-11-17 07:46:08 -08:00
Anees Iqbal 4e8784ad14 refusal surface: the new runtime's own refusal enums, one section each
What: refusal_surface.py reads the new runtime's Error and makes a section of
docs/REFUSALS.md for each variant whose payload is one enum the runtime
declares: today Refused(Refusal) and Limit(Limit), and any family added later
(a Gap included) without a list of names to keep. Each of their variants
declares its basis, as Problem's do, and --check fails on one that does not.
The translator's Limit section no longer counts rt's Limit sites. A rustdoc
link [text](path) in a summary reads as its text; three existing rows lose a
link the file could not follow.

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

How verified: the script regenerates, --check and --selftest pass locally;
the refusal_surface test runs in the compile job.
2026-11-17 07:25:30 -08:00
Anees Iqbal c944d63548 matrix: a leg whose suite never reported fails
A job that printed a leg's device lines and was then killed before the leg's M2V-SUITE line ran
nothing of that leg, yet the leg was judged on its other suites: on 248d41074f the 3090 and the
UHD 630 read PASS on their harness suites alone while their rt jobs (m3-max-40768, 40800) had
been killed for RAM. Such a leg now fails with the job and its exit.

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

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

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

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

Verified: the script parses; unittest of scripts/matrix passes. The sizing itself runs on the
next matrix run.
2026-11-17 06:19:58 -08:00
Anees Iqbal 6a5e230514 matrix: the harness's timed workloads per GPU in an exclusive job; time records in microseconds 2026-11-17 06:19:58 -08:00
Anees Iqbal bb30a0b040 matrix: a GPU job prunes carry mirrors left by jobs that never ran 2026-11-17 06:19:58 -08:00
Anees Iqbal 391cc679e7 matrix: a chain's own failure fails its legs; no stats for a job that never started 2026-11-17 06:19:57 -08:00
Anees Iqbal aaa6350ee6 matrix: record the driver version; read dispatch errors from the reply 2026-11-17 06:19:57 -08:00
Anees Iqbal b4b22c7b2c matrix: the per-commit matrix runner and the user-space instruction counter (WIP) 2026-11-17 06:19:57 -08:00
Anees Iqbal 374e29a988 metal2vulkan-rt: the floor's shader features, queue family, timestamps and memory types
The floor now also requires what the translator's shaders and the runtime's
core need of every device:

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

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

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

Verified: see the lane report (compile job, device legs on every lab GPU,
lavapipe and the Windows UHD 630).
2026-11-17 05:33:25 -08:00
Anees Iqbal bcd50aba9f C3 venues: the Iris venue allows the RPL-P alone, which its translation key names
Iris venue: allow the RPL-P alone; the RPL-S derives another translation key

Since SEMANTICS 2128 DriverWorkaround::PushReadsLengthenThreadPayload is keyed on the Iris Xe of
RPL-P (8086:a7a0) alone, where it was measured. The UHD Graphics 770 of RPL-S, which the
intel-irisxe-rplp-anv venue also allowed, has a capture that differs from the RPL-P's only in
maxMemoryAllocationSize, but its derived profile does not take the workaround, so its translation
key differs. Venues::check_profiles refuses that, and every test that loads the committed venue
list failed, among them candidate::engine::guards::tests::no_venue_runs_a_guarded_target_under_
robustness_1_alone, the c3 venue tests and the two-device profile test.

The RPL-S leaves the venue: translation tells the two apart, and no cluster host has an RPL-S to
record a venue of its own. Its capture stays committed (other tests read it as a device profile).

- c3-venues.json: the Iris venue's devices are the RPL-P alone.
- c3::tests: the venue allows the RPL-P alone; pushing the RPL-S with its own capture is refused
  as a device that derives another key and needs a venue of its own; the RPL-P's capture under
  the RPL-S's identity is refused as another device's.
- candidate::platform::profiles::tests::the_intel_venue_allows_the_rplp_alone_and_stops_the_rpls
  (was one_intel_venue_allows_both_devices_and_stops_any_other): the captures still differ only
  in maxMemoryAllocationSize, the workaround is the RPL-P's and not the RPL-S's, the keys differ,
  and the venue runs the RPL-P and stops the RPL-S on its name, device ID and driver build.
- c3/venues.rs docs and the regen script's comment say so.

Verified: cargo fmt; built and tested in the next potluck job.

Iris venue tests: the RPL-S also stops on its key and allocation size; six venue devices

The venue no longer allows the RPL-S (51c031e187), so its check against the
RPL-P's venue reports, past its four identity differences, its own
translation key and its host's maxMemoryAllocationSize; and the venues allow
six devices, not seven. Both tests now say so.

Verified: cargo fmt; clippy and the c3/candidate tests run as a potluck job.

Iris venue tests: the venues that present the requirements documents no longer list the RPL-S

The RPL-S is no venue device since 51c031e187, so the presented-on lists of
lunarg-desktop-baseline-2023 and roadmap-2022 drop it.

Verified: cargo fmt; clippy and the c3/candidate tests run as a potluck job.

Fix for development's red since SEMANTICS 2128 (d3b1dbdbe0): DriverWorkaround::PushReadsLengthenThreadPayload is keyed on the RPL-P (8086:a7a0) alone, so the RPL-S capture's derived profile takes another translation key, and every test that loads the committed venues failed (c3::tests x6, guards::no_venue_runs_a_guarded_target_under_robustness_1_alone, profiles::tests x2, integration authored_compile_census and private_corpus_root). Verified (m3-max-34762, msi, at b5d745e599): validation clippy --all-targets --all-features 0; c3:: + candidate:: tests 270/270.
2026-11-15 19:37:36 -08:00
Anees Iqbal aa5511f61e SEMANTICS 2130 / RUNTIME 2406: 16x16x16 simdgroup matrix products: refused as their own feature, Metal's rule below Apple10
What: `air.simdgroup_matrix_16x16x16_[widening_]multiply_accumulate` is now refused in every stage
as `Unsupported{SimdgroupMatrix16x16x16, NotImplemented}` (a new `Feature`), ahead of the 8x8
lowering's kernel-only check. The runtime's `compile_error` answers it as Metal does:
`Needs::MetalGpuFamily(1010)` on a device that does not claim Apple10, `NotImplemented` on one
that does (as `IndirectRenderState`). The owned fixture engine/simd_matrix16 shrinks to one form
per class (float, half, widening signed int8), each with the four transpose-flag pairs, 12
kernels; the probe carries the M3's answer in its header.

Why: Metal itself refuses these products below Apple10. The M3 Max (macOS 27.0.1) refused every
pipeline of the fixture at creation, AGXMetalG15X_M1 code 3, "simdgroup_matrix<T,16,16x16>
operations are supported by GPUFamily10 and later" (job m3-max-34410). No device the runtime
presents claims Apple10: the family lists the "SIMD-scoped matrix multiply operations" row (from
Apple7), refused NotImplemented(SimdgroupMatrix) on every device, and the lod-bias row, a gap. So
the refusal is Metal's own answer, not a device gap: no FAST-PATHS known gap.

Tests: engine_simd_matrix::products_of_16x16x16_are_refused_as_their_own_feature (every
committed profile, the fixture's 12 kernels); runtime_lane::simd_matrix16 (the device's compute
pipeline creation answers MetalGpuFamily of Apple10). REFUSALS.md regenerated, api_signatures
blessed, reach mark added. The engine fixture expectation table and golden hashes take the
fixture's rows on development.

Also: f639b74288 adds the owned fixture (MSL we wrote, compiled by scripts/regen-air-fixtures) and
its Metal probe; 5dbfa3d3d5 imports AirLibrary in the runtime-lane test.

Verified in the lane: m3-max-34499 (msi, at 38d4694b12) clippy -D warnings for metal2vulkan, runtime
and validation (all targets and features) and 45/45 tests, incl. the new engine_simd_matrix test (12
kernels on every committed profile), the error tests, refusal_surface, api_signatures, api_surface;
m3-max-34514 (gem10, at 5dbfa3d3d5) clippy m2v_cpu_icd and runtime_lane::simd_matrix16 on lavapipe
(Needs::MetalGpuFamily(1010) for all 12). Clippy m2v_gpu (34516) still running when landed.

API: adds Feature::SimdgroupMatrix16x16x16 (additive; api_signatures blessed in the lane).
2026-11-15 18:32:00 -08:00
Anees Iqbal ab139e4b6e RUNTIME 2366: Runtime FALLBACK repro bundle at a creation refusal (default-off diagnostic)
What: metal2vulkan-runtime writes the FALLBACK repro bundle the command line
writes for its own failures when it refuses a library or pipeline creation,
where METAL2VULKAN_REPRO_DIR names a directory (unset, nothing is written).

- The CLI's bundle writer moves into the library as the hidden crate-root
  module metal2vulkan::repro (feature serde), shared by the binary and the
  runtime. A bundle's directory is named by its content
  (metal2vulkan-repro-<16 hex>), written under a temporary name and renamed,
  so an identical failure is written once, across threads, processes and
  runs. The CLI's own bundles keep their files (input, profile.json, the
  descriptor files, repro.sh, repro-command.txt, failure.txt); only the
  directory's name changed, so a bundle written before still replays.
- The CLI takes --device FILE in place of --profile: the JSON of a
  DeviceDescription and DevicePolicy (ReproDevice), which builds the
  runtime's own compile device.
- The runtime hooks each creation where its refusal returns: a library of a
  metallib, a function's lookup, every compute and tile state
  (ComputePipelineState/TileState::create_adding: creations, added binary
  functions, archive adds) and every render state
  (GraphicsState::create_reflecting). It bundles Unsupported, NotImplemented
  and Compile refusals but a cancelled compile and a name the library lacks
  (Metal's own nil); never Invalid/Nil/MetalError. The bundle holds the
  library's bytes, device.json, the request as the CLI's options and
  descriptor files, and failure.txt with the call, the refusal and what the
  command does not replay. That list comes from a full destructuring of the
  compute, tile and render descriptors (and the stage functions): a new
  descriptor field fails to compile in repro.rs until it is replayed or
  listed.
- Bounded: at most 32 bundles and 256 MiB per process; past either nothing
  more is written and one line says so. Written on the refusing thread; the
  call returns the same refusal; a write failure is said once. Each bundle
  is named in one line through the device's message sink (id name
  metal2vulkan-repro). The runtime's metal2vulkan dependency gains serde.
- Not bundled: mesh states (no CLI mesh path), a dispatch's or draw's later
  variant, driver VkPipeline makings, Metal-source libraries.

Docs: env_vars registry, README CLI, docs/HOWTO.md section 4, the runtime
README's Errors section, the CLI help.

Tests: runtime CPU tests of the bounds (a tally with the seam's limits);
a lavapipe/GPU device test (ob3_stage_input with no stage-input descriptor:
one bundle with the expected parts and command, device.json rebuilding the
runtime's compile device by profile fingerprint and answering the same
refusal, none for a second identical refusal or a missing name, none
without a directory); CLI tests replaying library-written runtime bundles
(compute, and render with a vertex descriptor) through repro.sh to the same
FALLBACK, and --device compiling what --profile does.

Verified at ae56b195e9 (msi, m3-max-32986): metal2vulkan cli,
api_surface and api_signatures 25 passed; runtime repro tests 9 passed;
clippy -p metal2vulkan -p metal2vulkan-runtime all targets, all features
0. Lavapipe (m3-max-32978): repro_device writes one bundle that the
CLI replays to the same refusal; a second identical refusal writes
nothing.
2026-11-15 10:14:52 -08:00
Anees Iqbal f851c07e52 SEMANTICS 2123 / RUNTIME 2349: Texture buffers past maxTexelBufferElements bound through views of their parts
Metal makes texture buffers of up to 2^28 texels on every Mac; one texel
buffer view holds at most the device's maxTexelBufferElements (2^27 on ANV
and lavapipe, 2^26 on MoltenVK), and the binding of a wider one was refused
(BindError::TexelBufferTooLarge).

The consumer now states with a texture buffer's binding the views its texels
take (BoundTexture::Buffer::parts, bind::texel_buffer_parts: 1 within the
limit), which its shape carries. A slot whose function only reads, writes,
updates by an atomic or asks the width of the texture buffer, on a device that
indexes texel buffer arrays NonUniform, states RuntimeFact::TexelBufferParts;
where the shape binds more than one part there, the plan asks for the parts
variant (VariantKey::texel_buffer_parts). Under it the slot is an array of
the parts' texel buffers: texel i is texel i - k*P of part
k = min(i / P, parts - 1), P the device's limit rounded down to its texel
buffer offset alignment (bind::part_texels), and the width (parts - 1) * P
plus the last part's. texel_ranges writes one range per part at its array
element (DescriptorRange::element), and the runtime views each.

Each part is the device's own view in the format one view takes, so a read
converts its texel as the one view does: no precision note. A texture buffer
one view holds keeps one view, no variant and its key. The families row
TextureBufferWidth is exact where the parts reach 2^28.

Still refused (TexelBufferTooLarge): a slot read through a sampler or used beyond read/write/atomic/width; a device
without NonUniform indexing of that kind of texel buffer array; formats with several texels a block. Argument-buffer
texture buffers past the limit stay the heap neutral (unnamed-texture-unviewable). New: WorkCounts::texel_buffer_parts_bound,
RuntimeFact::TexelBufferParts (appended), bind::part_texels / texel_buffer_parts, BoundTexture::Buffer.parts,
TextureShape::Buffer.parts (serde default 1), VariantKey/LoweringInputs.texel_buffer_parts (hashed only when non-empty),
DescriptorRange.element. SEMANTICS_VERSION bumped: input once refused now translates.

Evidence (lane jobs, msi): m3-max-32343 at 628264de17: clippy --workspace --all-features --all-targets -D warnings 0;
41 metal2vulkan tests incl. golden_hashes_match_the_table (every fixture's SPIR-V unchanged on every profile: one part is
byte-identical), the binder test (an under-limit slot: no parts entry, empty variant, layout counts 1), the interpreter
parts test (robust and unrobust), api_surface / api_signatures / refusal_surface; families::states_follow_their_sources;
lavapipe texture_buffer_width_device (R32Uint limit+64 texels: both sides of the limit and the last texel read and written,
past the end reads 0 and writes dropped, texel_buffer_parts_bound +3) and buffer_tail_device. Without the fix the device
test fails at bind: TexelBufferTooLarge{elements 134217792, limit 134217728} (m3-max-32140). ANV (2^27) is down; the XTX
(2^29) never parts.

Lane commits: 9fbf7d3c14, 7f7f3ad95e, 9a745ffb3c, 740e9e43dd, 628264de17.
2026-11-15 07:10:59 -08:00
Anees Iqbal 2bd067d6c7 RUNTIME 2254: a command buffer's completion exports as a SYNC_FD sync file
A consumer that composites one GPU's frames on another vendor's GPU has to order the second
device's work after a runtime command buffer. The only semaphore export was
SharedEvent::export_semaphore_fd: a timeline semaphore as OPAQUE_FD, which Vulkan imports only on a
device with the same deviceUUID and driverUUID, so it cannot cross from NVIDIA to RADV. The consumer
waited on the CPU instead, about 3.5 ms a present on its window thread. A cross-driver handle needs
SYNC_FD, which only binary semaphores export.

New (unix only, no Metal counterpart):
- CommandBuffer::add_completion_sync_file(), before the commit: the command buffer's last batch
  also signals a binary semaphore exportable as SYNC_FD, after its to-host barrier. That batch never
  joins a submission group. A command buffer with no GPU work submits the signal alone, after its
  queue's earlier work.
- CommandBuffer::export_completion_sync_file() -> Result<Option<OwnedFd>, Error>, after the
  commit. It blocks only until the signalling batch's vkQueueSubmit has returned, never on the GPU.
  None means the work already ended, or the driver answered -1; the importer imports -1 or skips
  the wait.
- Spec: the export follows the signal's submission (VUID-03254), with copy transference. One export
  per command buffer. Event::reserve_vk_signal's doc carries the contract for a reserved signal
  that the batch waits on.
- The semaphore goes back to an idle pool of up to 8 per device once the command buffer completes
  with its fd exported, and is released otherwise.

Where the host writes the caller's pages after the GPU work (a copied host buffer's merge back, or a
managed two-copy buffer's copy-out), no GPU signal can come after those writes. There the export
waits for completion and answers None, announced by a NEW Degradation: SyncFileAfterHostCopies
(sync-file-after-host-copies, performance). Also new: WorkCounts::sync_files_exported and
sync_files_after_host_copies; RuntimeGap::SyncFileExport, for a device without
VK_KHR_external_semaphore_fd or without binary SYNC_FD export (MoltenVK, an adopted device without
the extension); Problem::SyncFile(SyncFileProblem { Committed, NotCommitted, Exported }).
docs/API.md (catalogue entry), the runtime README, REFUSALS.md (regenerated), the reach table and
api_signatures are updated.

Verified (syncfile, 8f9caba0ae on d72dc03519, msi):
- Runtime suite: 1538 passed, 6 skipped (27758).
- tests::sync_file on lavapipe (27733). llvmpipe exports and imports SYNC_FD. The no-copy buffer
  was imported by pointer. A second VkDevice imported the fd and read every byte filled. The export
  came while the status was Scheduled.
- The lane test a_sync_file_after_host_copies_waits_for_them_announced (27759): the export over a
  copied buffer's merge back waited, the pages held the fill, and the kind was announced once and
  counted.
- clippy plain, m2v_cpu_icd and m2v_gpu 0 (27709, 27737, 27760); rustdoc 0 (27730).
- Owed: the cross-vendor run on um790, the 2080 writing and an XTX VkDevice importing (27739,
  queued).

RUNTIME_VERSION 2253 -> 2254.
2026-11-13 19:06:19 -08:00
Anees Iqbal 977c9da12f RUNTIME 2246: setTriangleFillMode: 2 (MTLTriangleFillModePoints, Apple-private) draws a triangle's vertices as points
Apple's GL renderer sends setTriangleFillMode:2 for glPolygonMode(GL_POINT) under its Intel and
Apple-silicon caps tables. The value is not in the public headers. Our TriangleFillMode had only
Fill and Lines, so the consumer's raw-value conversion failed and its host died. Measured on
Metal: an M3 Max and an Intel UHD 630 draw only a triangle's 3 vertex pixels (a Radeon Pro 5300M
fills it); our own probe on the M3 (m3-max-26811) draws 1-px points whether point_size is 4, 1 or
unwritten, culls them with CullMode Front, and draws them with Back.

Now TriangleFillMode::Points (2) exists. The generator (scripts/regen-metal-enums) takes a
PRIVATE line for it, with its evidence, and a PRIVATE_DOCS doc comment (metal_enum! accepts
variant attributes); generated.rs stays generated and `--check` passes. The runtime draws it as
VK_POLYGON_MODE_POINT. It needs fillModeNonSolid (refused otherwise:
Feature::TriangleFillPoints) and, on a portability-subset device, pointPolygons
(VkFeature::PointPolygons; MoltenVK withholds it, so it refuses Points). New degradation
TrianglePointSize ("triangle-point-size"): Vulkan sizes the points by the PointSize the vertex
function writes, where Metal draws 1 px. An ICB command still refuses set_triangle_fill_mode, as
before. New lane module runtime_lane::triangle_points.

Verified (fillpoints, 6b9927c402 on 25be73dddf):
- lavapipe lane 30/30: points light {(3,3),(3,12),(12,3)} (Metal's 3 vertex pixels); culled
  front none, back the same 3; fill 45 px (the M3 lit 45); lines 27; fill/lines unchanged.
- msi: clippy plain, m2v_gpu and m2v_cpu_icd 0; rustdoc 0; touched tests 102/102.
- Owed: the XTX leg (m3-max-26943).

ARTIFACT_FORMAT_VERSION 519 -> 520 (VkFeature appended to the codec), RUNTIME_VERSION 2245 -> 2246.
2026-11-13 15:26:44 -08:00
Anees Iqbal 4383b55aed SEMANTICS 2096: ANV: a stage heavier than the largest measured to compile in host-sized memory is refused, or keeps the widest pin
ANV's compiler takes memory that grows faster than the stage it compiles, inside the process that
creates the pipeline, well below the 2^20-object bound the serialized stage already keeps under.
Measured on the Iris Xe of RPL-P (Mesa 26.2.6), compute modules created cold through
vkCreateComputePipelines, the resident set sampled every second (job m3-max-26147): entry weights
73,814, 75,886 and 99,109 were created in 45 s, 47 s and 132 s at peaks of 1.76, 2.24 and
3.65 GiB; a module of entry weight 532,213 passed 16 GiB at 358 s without finishing. Job
m3-max-26086: a module of entry weight 796,525, its heap raw-texture arms dead, passed 20 GiB in
under two minutes. Both under the old bound (786,432) would have been handed to the driver: one
pipeline creation that can take a host's memory.

- DriverWorkaround::CompilerMemoryGrowsWithStageSize, keyed on ANV whatever its GPU and release
  (device::derive), documented with those points.
- stage_bound: StageBounds holds both bounds (SERIALIZED_STAGE_WEIGHT 786,432;
  COMPILED_STAGE_WEIGHT 99,109, the largest measured to compile, no margin below it as nothing
  above it is measured to compile). emit keeps a module under every bound its profile's defects
  set, with the same widest-pin retry; a refusal (StageSize, DriverDefect) names the serialized
  stage's defect past 786,432 and the compiler's memory below it. The bound rises when a larger
  compile is measured within host-sized memory.
- The test hooks (compile_bitcode_bounded, compile_stage_bounded) take StageBounds.

Docs: stage_bound's module docs and FAST-PATHS' known-gaps entry state both bounds with the
measured points only (weights, never names), and restate the serialized bound's figures in
entry_weight's units: the faulting stage 1,603,989 (0.683 objects per unit, was 1,565,083 and
0.70 by a count 2.4% lower), the other 21 stages' ratios as counted by that count, which ran 1.9
to 2.7% below entry_weight on the five modules both counted; the shader-object figure likewise
1,603,989. Feature::StageSize's docs and its reach line cover the memory bound; REFUSALS.md
regenerated. api_signatures.tsv blessed with the new variant (the bless also moves
scheduler_slice_rescues to the script's own order).

For a consumer on ANV: a module of entry weight past 99,109 and up to 786,432 that was handed to
the driver is now refused (Unsupported, Feature::StageSize,
Needs::DriverDefect(CompilerMemoryGrowsWithStageSize)) unless its pinned plan fits. Other drivers
are unchanged.

Tests:
- engine_simd_lockstep::a_kernel_past_the_stage_bound_keeps_the_widest_pin_or_is_refused covers
  both defects: for each, under a bound the emulated module passes the kernel is planned again
  pinned (exact at 32 lanes), under one its pinned module passes too it is refused naming that
  defect, and past both the serialized stage's defect is named; RADV emits under every bound.
- engine_simd_lockstep::a_kernel_past_the_stage_bound_gets_one_answer_through_either_path on the
  serialized bound through StageBounds.
- device::tests::profile::large_module_defects_are_keyed_on_anv includes the new workaround.

Verified, on msi, read from inside each job:
- m3-max-26184 (this change on 86d362e2aa): cargo fmt --check 0; clippy --workspace
  --all-targets --all-features -D warnings 0; clippy -p metal2vulkan --no-default-features 0;
  clippy with --cfg m2v_gpu (all features) 0; nextest over device::tests, engine_simd_lockstep,
  fast_paths and the refusal_surface, api_signatures, api_surface and feature_vocabulary
  binaries: 189 run, 189 passed.
- m3-max-26212: the stage-bound test with its output shown passed with no SKIPPED line; the
  negative control, the compiled bound's cap set past every module, fails it ("left: Emulated,
  right: Direct" for CompilerMemoryGrowsWithStageSize).

SEMANTICS_VERSION 2095 -> 2096: on ANV a module of entry weight above 99,109 (and up to 786,432) is now
refused or re-planned with the widest pin kept, where it was handed to the driver.
2026-11-13 11:45:50 -08:00
Anees Iqbal c53ea4164e SEMANTICS 2091: on ANV, a stage past the serialized-object bound keeps the widest pin or is refused
Mesa's common pipeline runtime (vk_pipeline.c) serializes every compute stage into a precompiled
shader and reads it back before compiling it. nir_serialize names each object by a 20-bit index
(MAX_OBJECT_IDS 1<<20) checked only by an assert, so a release build wraps past 2^20 objects and
the driver faults inside vkCreateComputePipelines. On Intel Iris this took a consumer's host
process down on a large compute kernel (its translated stage: idx_table_len 1,096,128).

DriverWorkaround::SerializedStageWrapsLargeModules (keyed on ANV) bounds the stage's weight at
SERIALIZED_STAGE_WEIGHT = 786,432 instructions, every call counted as its callee's body. A module
over the bound is never handed to the driver: a kernel that emulated its simdgroups only in place
of the widest mode's pin compiles pinned to 32 lanes again (lower::simd::WidestPin::Kept), and any
other is refused as Unsupported::driver_defect(Feature::StageSize, ..), where Metal compiles it.
The gap is recorded in docs/FAST-PATHS.md's known gaps; REFUSALS regenerated, reach.tsv marks
StageSize rare, api_signatures carries the two new variants.

The bound's basis: 22 stages measured at 0.14-0.99 serialized objects per weight unit; 786,432 is
3/4 of 2^20 at the worst measured ratio of about 1.

Verified: the crash reproduced live on ms01's Iris (job 25723) with both the consumer kernel and a
synthetic 360k-FMA chain; test
a_kernel_past_the_stage_bound_keeps_the_widest_pin_or_is_refused; checks job 25736 (msi): clippy
on the workspace, rustdoc, the full metal2vulkan suite, green. Not yet verified: the consumer's
Iris run at the next pin.

SEMANTICS_VERSION 2090 -> 2091: translator output and refusals change on ANV.
2026-11-13 09:05:44 -08:00
Anees Iqbal 10f2539a71 8-bit floats widen through the device's own type where it has one
Owner rule 1: where a device has a native 8-bit float type, its conversion is the only form.
VK_EXT_shader_float8's shaderFloat8 (the SPIR-V capability Float8EXT, SPV_EXT_float8) is now a
VkFeature the device enables and the profile reads (leaf.float8); the SPIR-V IR has
Type::Float8 { encoding } (OpTypeFloat 8 with its FPEncoding, from the regenerated grammar items),
and the interpreter reads OCP's E4M3 and E5M2.

The shared decode, narrow::fp8_to_f32, widens through the device's type where the layout names
one (Fp8Layout::on): each u32 lane bitcast to four 8-bit floats, the low byte's widened by
OpFConvert, so no 8-bit integer type is needed. f8e4m3fn and a tensor's e4m3 take Float8E4M3EXT,
f8e5m2 and a tensor's e5m2 Float8E5M2EXT; the IEEE-like f8e4m3 has no device encoding and keeps
the integer decode. Every site takes it: air.convert's 8-bit float sources, simdgroup-matrix fp8
cells, and matmul2d, whose expansion now widens each element by an air.convert of the tensor's
format (Fp8::TensorE4M3, Fp8::TensorE5M2: Metal's reading, qualified on the M3 Max, e4m3 with no
specials, e5m2's NaNs 0x7FC00000; never parsed from a name, built by Out::air_call). A device
without shaderFloat8 decodes with integers, as before.

Where a tensor's element widens natively the stage records PrecisionNote::NativeFloat8
(native-float8): the device's e4m3 reads 0x7F and 0xFF as NaN where Metal reads 480 and -480,
and an e5m2 NaN's bits are the device's. Validation classes it Unbounded; the conformance suite
lists it among the native notes; FAST-PATHS.md has its device-gap row and API.md its catalogue
entry. The other formats record none: Metal on Apple M3 does not compile them.

The refusal of a matmul2d of 8-bit floats on such a device (Entry::float8_products, the select
check) goes. REFUSALS.md and api_signatures.tsv regenerated.

Tests: matmul2d's fp8 fused sums on the RTX 50 profile (Float8EXT declared, the note recorded,
e4m3 NaN sums) beside MoltenVK, RADV and lavapipe (neither); air.convert widenings on the RTX 50
profile and lavapipe; simdgroup-matrix fp8 cells on the RTX 50 profile too. Not yet built here:
the build and these tests run next on the cluster.
2026-11-13 01:11:22 -08:00