Commit Graph
1997 Commits
Author SHA1 Message Date
Anees Iqbal 68fd71dda2 Re-bless the authored compile census at 7470a49e6d
Its product fingerprint follows RUNTIME 1795 (the F2 landing). Blessed on
the M3 (s37-pl.sh censusbless --bless, dv-m3 at 7470a49e6d).

(cherry picked from commit 952421304691dd151fa059ce24a095a9a5132270)
2026-11-07 08:19:25 -08:00
Anees Iqbal c956a4236c Bump RUNTIME_VERSION to 1796: a committing thread's pass wakes the scheduler only for a batch that may group
The lvpfix landing (wake option b) narrows the wake at the end of
Scheduler::submit_at_commit to the arm where the committing thread
submitted alone a batch the old path would have left to the scheduler
thread (the buffer groups and goes alone at commit), so every driver keeps
the old path's wake cadence: RADV keeps its plain-commit figures, lavapipe
loses the extra wake. The runtime-sources pin is re-derived.
2026-11-07 08:18:06 -08:00
Anees Iqbal c36bf38d91 Scheduler: wake after a committing thread's pass only where it submitted alone a batch that may group
The wake that ends a committing thread's pass (ff870f6403) came after every such pass. Before the
alone path (4d4e103471), a commit_and_submit's batch of a VkQueue whose batches may wait in a group
was left to the scheduler's thread, which the commit woke; every other batch it submitted itself,
waking nothing. So on a driver whose check finds no merge (lavapipe) the base never woke the thread
for a commit_and_submit, and the unconditional wake added one there: on lavapipe the "seen handler
alone" shape's commit to watch went to p50 14.7-15.0 us, p90 21.9-22.6, against the base's
13.7-13.9 and 16.0-17.3, while the same binary with the wake switched off was at the base
(m3-max-3884, gem10 exclusive).

Now `submit_plain_ready` counts the batches it submitted whose `VkQueue`'s batches may wait in a
group (`Plain::alone`: for a committing thread, those `plain` lets go alone where the group would go
at once, `goes_alone_at_commit`), and a committing pass that left nothing wakes the thread
(`Woken::Commit`) only where that count is above zero: the wake the batch's hand-off to the thread
would have made. Every driver keeps the base's cadence by construction: RADV its wake per such
commit, lavapipe and any driver whose check finds no merge none. Docs: the scheduler module,
`submit_at_commit`, `Plain`, `Woken::Commit`, `CommandBuffer::commit_and_submit`,
`WorkCounts::scheduler_wakes_commit`, the runtime README's item, FAST-PATHS row 37's figures. The
scheduler_wakes test is now
`a_commit_and_submit_wakes_the_sleeping_thread_only_for_a_batch_that_may_group`: once the
submission checks answered, ten commit wakings of ten where the batches may group, none elsewhere.

Verified (m3-max-3922, gem10 exclusive, one job, this diff on 7e57099fa3; base = the three
scheduler files before 4d4e103471; two alternating rounds of both lanes on each driver):
- lavapipe (Mesa 26.2.6): the thread's counts over the lane as the base's, sleeps 4000 and
  commit wakings 4000 at both, 2000 submitted at commit; "seen handler alone" commit to watch
  p50 13.8-14.1 us, p90 16.9-17.5, against this run's base 12.9-13.2 and 15.9-16.9 (3884's base
  13.7-13.9 and 16.0-17.3), the unconditional wake's p90 21.9-22.6 gone; a checked fill's commit to
  submission handler p50 12.5-13.4 us against 12.4-13.4.
- RADV (RX 7900 XTX): sleeps 6000 at both, the commit_and_submit batches' wakes counted as a
  commit's (commit 6000, host 0) where the base counted them as a host signal's (4000 and 2000);
  the plain shapes' commit to watch p50 32.1-47.3 us against 38.9-46.7, the thread's wake p50
  4.0-4.5 against 4.1; commit_and_submit's gain kept: a checked fill's commit to submission
  handler p50 30.4-32.8 us, p99 48.8-57.8, against 36.2-55.7 and 112.1-198.5, 520 of 520
  submitted at commit; another queue's head waiting, p50 24.7-25.0 against 32.7-39.2; the shape in
  turn with the plain ones, commit to watch p50 31.9-36.1 against 39.2-50.1.
- Tests alone (commit_and_submit, deferred_calls, scheduler_wakes, each --exact on one thread):
  31 of 31 on RADV (the new test: batches grouping, 10 commit wakings of 10) and on lavapipe (not
  grouping, 0 of 10). Negative controls: on RADV with 3e9230adf2's scheduler (no wake) the new test
  fails with 0 of 10; on lavapipe with 7e57099fa3's (the wake after every pass) it fails with 10.
- Clippy (plain, m2v_gpu, m2v_cpu_icd) and rustdoc with -D warnings pass (m3-max-3923, ms01).

(cherry picked from commit 9184d15a5707ff4e89c00f32af225b66ec40875e)
2026-11-07 08:17:57 -08:00
Anees Iqbal 7089033bac Re-pin the runtime sources: the binary archive docs state Metal's measured answer
The replay landing (binary-archive-sources re-record) changes only doc
comments in the runtime (new_binary_archive, the binary archive module,
container::read): a metallib loaded as an archive holds no pipeline of its
functions, as the M3 Max measured (m3-max-3980). No behaviour changes, so
RUNTIME_VERSION stays; the pin follows the sources.
2026-11-07 08:17:28 -08:00
Anees Iqbal 8b4c83b3ee Re-record binary-archive-sources on the M3 Max: Metal's archive of a metallib misses
Taken on the oracle (Apple M3 Max, macOS 27.0.1, potluck job
m3-max-3980) at 77bd9d5a0a. Metal makes the archive from the
compute library's own metallib, and a compute pipeline of the
library's kernel listing it with MTLPipelineOptionFailOnBinaryArchiveMiss
is refused; without the bit it is created. So Metal's archive of a
metallib holds no pipeline of the functions in it, which is the
runtime's answer (it loads such a file as an archive holding nothing):
the replay on MoltenVK on the same Mac reads the case exact. Every
other site of the recording is unchanged; the input fingerprint moved
with the two new steps.

The runtime's docs (new_binary_archive, the module's Files bullet,
container::read) now state Metal's measured answer in place of "not
measured". CONFORMANCE-COVERAGE.md re-derives unchanged.

(cherry picked from commit 4d75f740e377f90f0ddc011c9e26efbf5b66a59c)
2026-11-07 08:17:10 -08:00
Anees Iqbal 396113b058 Conformance: binary-archive-sources asks what Metal's archive from a metallib holds
The case made an archive from a metallib of the compute library and
compared only whether Metal made it. The runtime now loads such a file
as an archive holding nothing (adadb73f7c), an answer no measurement
of Metal's backed. Two creations of the library's own kernel now list
that archive, with MTLPipelineOptionFailOnBinaryArchiveMiss set
(created only if the archive holds the pipeline) and without it.

The recording is re-taken on the M3 Max in the next commit.

(cherry picked from commit 77bd9d5a0a75588c1666d90b44c7ebd0444e65f5)
2026-11-07 08:17:10 -08:00
Anees Iqbal 7470a49e6d Bump RUNTIME_VERSION to 1795: the submission checks' work counts as none of the program's, and holds the loader word
The amdperf landing (the F2 regressions) changes runtime behaviour: the
submission checks' relay marks and command buffers count apart from the
program's (By::Checks, recorder::unrouted), a per-device DeviceWord lock
guards every loader-served call against MoltenVK's overwrite of the
device's loader word, the checks hold it across whole steps where the word
was found overwritten, the queue-switch and in-place checks' submissions
take it, and the in-place check runs no round on such a device. The
runtime-sources pin is re-derived.
2026-11-07 08:09:55 -08:00
Anees Iqbal 64439d4365 Lane: the beside-the-checks test commits the caller's own command buffers too, the form whose lock-off control faults
Each round now commits two command buffers on a new queue and waits for them
(a queue waiter then allocates the pool's secondary through the loader), then
makes 64 loads through Device::device_proc_addr, until every check answered.
Verified on the M3 Max at a6bf568281 with this same code as a job-local patch
(job 3969): no fault in ten runs of five devices; with DeviceWord::held taking
no lock, SIGSEGV at 0x1cdc0de in the queue waiter's vkAllocateCommandBuffers in
four runs of five. The loads-only form passed with the lock off too (job 3946).

(cherry picked from commit 2b9ea69531859cf5649ef5d7820f32b4e1668f3a)
2026-11-07 08:09:32 -08:00
Anees Iqbal ad9b404bb4 In-place check: no round where the device's loader word was found overwritten, its classes unchecked and recorded nowhere
On MoltenVK with each activity logged at once, a queue waiter's
vkAllocateCommandBuffers faulted on the magic beside the in-place check (M3 Max,
one run of three, job 3935), where the caller's same work with no check
running did not in 30 000 rounds (job 3946). The check's rounds make their
buffers and textures through the product's paths, which take locks that the
program's threads hold while they make calls the loader serves, so the word
cannot be held across a round as the submission and queue-switch checks hold
it across their steps. On such a device the check now runs no further round:
each class it has not answered is unchecked for the device's life, so its
textures over host pages take the shadow, and nothing is recorded, so a later
device of the driver without the logging checks again.

(cherry picked from commit a6bf568281f7151263b81625aace98070ee0454d)
2026-11-07 08:09:32 -08:00
Anees Iqbal f115861006 Lane: the caller's side of the beside-the-checks test loads commands only, so that the checks' work alone writes the device's word
The first form committed two command buffers a round on a new queue, and on the
M3 Max at cd1a42d6ee its device 2 of one run faulted in a queue waiter's
vkAllocateCommandBuffers (a pool given back as the caller's own command buffer
completed): a race of the caller's own work with MoltenVK's completion handler,
which the checks do not take part in. The caller's thread now makes only
vkGetDeviceProcAddr loads through Device::device_proc_addr, 64 between looks at
the checks, and no GPU work.

(cherry picked from commit 5001edb39e665dfaa8c35de3a9a10e9197c49e97)
2026-11-07 08:09:32 -08:00
Anees Iqbal 7bc1231fcd The queue-switch check and the in-place check's submissions hold the loader word as the submission checks do
The device's other checks that run beside the program on threads of their own
also make MoltenVK name the device, at their submissions and as their work
completes. The queue-switch check now takes the device's loader word inside
each batch's queue lock across the submission and the relay's mark, and, where
the word was found overwritten, across its objects' making and release, its
timestamp read, and from the gate's signal through the wait for the round (no
batch runs before the gate, so none completes while the word is let go between
the round's two submissions). The in-place check's rounds submit through
Device::submit_internal_naming: on the check's thread (in_place::checking) the
word is taken inside the queue lock across the submission and kept through the
wait for its fence where the word was found overwritten. Lock order stays
queue slot, then word.

A new lane test (device_commands) makes five devices with MoltenVK's
activities logged at once and the in-place policy, each over a cache of its own
so that every check runs, and makes the caller's loader-served calls (two
committed command buffers, a device_proc_addr) until all checks answered.

Verification pending on the M3: the test repeated, and a control with the
holds reverted.

(cherry picked from commit cd1a42d6eeb58fdc78e0d4ea50e4e685e52c9b32)
2026-11-07 08:09:32 -08:00
Anees Iqbal b8a57c5d91 Loader word: the held-step counter is the device tests' alone (cfg m2v_gpu or m2v_cpu_icd), as clippy without those found it unused
(cherry picked from commit 90324cbac27998771be3ca501de7ac78a4440004)
2026-11-07 08:09:32 -08:00
Anees Iqbal 93ec2cf7fe Submission checks: find the overwritten loader word as each step starts, count the steps held for the tests; in_place_textures' fresh class follows the device's verdict
The checks' step hold read only the flag a restore set, so a step that started
before any of the device's own loader-served calls found the word changed went
unheld. DeviceWord::overwritten now also compares the word as a step starts
(a fact of this device, never of its driver), and DeviceWord::step_hold counts
the steps it held under cfg(test). A new device test makes two devices that
each run the checks, one as ever and one with MoltenVK's activities logged at
once, and asserts the word is found overwritten, and steps held, only on the
second on MoltenVK.

in_place_textures' fresh class read fresh_page_buffers_made, which a long
buffer taken from the parked ones does not raise: the device's in-place check
makes and drops a 40 MiB Shared buffer in fresh pages, the class's own length,
so on the M3 Max (import tax Fails) the class's buffer was that parked one and
the test failed (job 3771). The class now skips only where the device's verdict
(Device::fresh_pages_pay) places no long buffer in fresh pages, and asserts that
holds only where held imports tax its submissions or it imports no host memory;
otherwise the texture path check holds the buffer to fresh pages as before.

Verification pending on the M3 (MoltenVK) and lavapipe.

(cherry picked from commit aa7385ade16d8adb671f3a921527528e02d0d783)
2026-11-07 08:09:32 -08:00
Anees Iqbal 78765d4b31 Submission checks: hold the loader word across whole steps where it was found overwritten; the cost half reads none of the checks' counts
On MoltenVK with each activity logged at once, device_commands still faulted in
the scheduler's vkAllocateCommandBuffers with every runtime call that the loader
serves under the word's lock (M3 job 3771): MoltenVK also names the device as a
Metal command buffer completes, and at the checks' import and object calls, not
only at their submissions. A device whose restore found the word changed now
records that (DeviceWord::overwritten), and there the checks hold the lock
across each whole step: making and releasing their objects and imports, and each
submission through the wait for its fence. Lock order stays queue slot then
word: a step that takes the word first takes no queue, and a submission takes
the word inside the slot and keeps it past the slot's release. On every other
driver the word never changes and nothing waits.

The cost half no longer reads the submit_check* fields of WorkCounts: they count
the device's own submission checks, which ran inside pass-bytes-srgb-decode-all-bytes
on the M3 in a fresh workspace (162 calls, one run) and are never a case's work.
The checks' relay marks already count apart from queue_submissions (By::Checks).

Verification pending: M3 device_commands repeated, the lane set as-is, and
cost --check for that case in a fresh workspace.

(cherry picked from commit 5477dcb5a45a96cf93a8fb6748630e70d0cdbc31)
2026-11-07 08:09:32 -08:00
Anees Iqbal de65076260 in_place_check metal-space test: each device's submission checks answer the import tax first
The test holds a device whose in-place check ran with the Metal space held
to the verdicts of one whose check ran with it empty. The Fresh class
checks only where a long buffer takes fresh pages, which follows the
device's submission checks' import tax: where load split all of a
device's tries it is unknown for the device's life, its Fresh class
unchecked, while the other device's answered. Each device is now one
whose checks answered (made again over the same cache, up to 3, where the
tries split; nothing is recorded then), printed with their report.

Suspected cause of development's lavapipe failure at 82360d7175 (um870);
the panic message is still to come.

(cherry picked from commit c7aad8bc1f7164d01f01a91073faed086fccb3e9)
2026-11-07 08:09:32 -08:00
Anees Iqbal 2402c1ed7a Lane tests: settle the submission checks where their thread breaks a test's premise; host image copy load outside the unsafe block
- exits::an_exit_runs_no_handler_beside_a_cpu_device_s_work failed 1 of 3
  on um790 lavapipe at 1733ba86c5 (base 57c0e50bbe 3 of 3; job
  m3-max-3627): release_the_gate printed hook_ran=1, the hook having run
  before it, so the scheduler ended with the work unsubmitted, the marker
  stayed unwritten and read_the_marker waited out its 10 s. The case
  registers release_the_gate after every runtime call of its own, so that
  the hook's last registration comes first; the checks' thread, still
  running, made sections that register the hook again (exit_guard.rs,
  'Registered again') after it. The case now settles the checks first.
- in_place_textures' sampled test now makes the condition its Fresh class
  needs instead of printing past it: its device is one whose submission
  checks answered (made again, up to 3 devices, where load split the
  import tax's tries, which leaves it unknown and unrecorded), and the
  class is skipped only where the device cannot place a long buffer in
  fresh pages: its held imports cost its submissions (import tax Holds) or
  it imports no host memory. Anywhere else a long buffer outside fresh
  pages fails the test.
- device/mod.rs: the host image copy table's loader moves out of the
  unsafe block around DeviceWord::restored (clippy: unnecessary unsafe,
  macOS job m3-max-3723).

(cherry picked from commit 0358ff7fe4c93009635ff51455be02aa666236c4)
2026-11-07 08:09:31 -08:00
Anees Iqbal 09d6a0a9f3 Submission checks: record their command buffers through the driver's own commands, counted among none of the device's
compressed_blits::extended_range_blits_write_metal_s_encoding_under_the_canonical_policy
failed on lavapipe (um790, ebf00511f0) with 3 vkCmdCopyBuffer between its
counts around a blit, which it reads as zeros written. lvpfix's probe
(m3-max-3592) printed for that blit 3 copies, 0 zero fills and 0 fresh-page
buffers, only while the submission checks had not answered, and none once
they had. WorkCounts::commands_recorded counts every command recorded on the
device, whatever the command buffer and thread, and the follows check
(Linux) records exactly three copies of its own, one a submission, through
the device's routed functions: those were the copies, not a zero fill.

The checks now record through the driver's own entry points
(recorder::unrouted, the inverse of recorder::through: the command the
device's slot stored, or the device's command where it took no slot), so
their begin, end, copy and barrier count among none of the device's
commands_recorded or copy sites, as their submissions count among none of
its submissions.

Test: submit_check_device's recall test holds a device that ran the checks
to the cmd_copy_buffer count of the one that recalled them (the follows
check's three made it differ on Linux before). Not yet built.

(cherry picked from commit 35435ee82de9c26b2c031284db21e8e8a13a870b)
2026-11-07 08:09:31 -08:00
Anees Iqbal 244085ebaa Hold the device's loader word across the submission checks' calls and the runtime's loader-served calls
At 14e55e0c6c on MoltenVK 1.4.2 (M3 Max) the device_commands lane test,
which logs each MoltenVK activity at once so that MoltenVK names the device
and writes ICD_LOADER_MAGIC over its first word, faulted at 0x1cdc0de in the
loader's vkAllocateCommandBuffers on the scheduler's thread (submit_batch,
hand_out) while the submission checks submitted beside it; it passes at
57c0e50bbe, before the checks (job m3-max-3626). Putting the word back just
before the call is not enough while another of the runtime's threads makes
the driver write it again between the restore and the loader's read.

The device's word is now a DeviceWord: each of the runtime's loader-served
calls (and Device::with_loader_word's call) runs under its lock through
DeviceWord::restored, and the checks' thread holds it across its
vkQueueSubmit calls and the relay's mark after them, taken inside the
queue's lock and let go before the wait for the GPU. The lock is reentrant
for its thread (a caller's device_proc_addr inside its with_loader_word);
with_loader_word's docs now say its call uses none of the runtime's
queues. A driver thread that writes the word on its own (MoltenVK's
completion handlers) stays unguarded, as documented.

in_place_textures: the Fresh class needs a buffer in fresh pages, which
the device's long buffers take only where its submission checks answered
that a held import adds nothing; under the lane's load at 14e55e0c6c they
did not answer, the 40 MiB buffer was a plain one, and its texture read as
inconsistent. The class is now a printed gap where no fresh-page buffer was
made (WorkCounts::fresh_page_buffers_made), with the checks' report.

Not yet built; the M3 lane and the Linux gates come next.

(cherry picked from commit 48c69cf106776d13cf43726cb5d89a5467a31d89)
2026-11-07 08:09:31 -08:00
Anees Iqbal b307f93e53 Relay: count the submission checks' marks apart; read a mark's fence only once its call returned
The M3 lane through MoltenVK at 14e55e0c6c failed 17 tests that pass at the
base before the submission checks (57c0e50bbe: 17 of 17; job m3-max-3626).
Two of the causes are the relay's:

- The checks' uses of the first VkQueue went through the relay as the
  runtime's (By::Runtime), so each made a mark counted among the device's
  submissions: commit_work and first_use counted 13 to 21 submissions the
  program never made. A new By::Checks counts the mark with the checks'
  calls (WorkCounts::submit_check_calls), and a failure attributed to it
  loses the device as the runtime's own does.
- A use pushed its mark into the log before its vkQueueSubmit, and another
  thread's use read the front mark's fence (done_marks), found it signaled,
  reset it and gave it back while the call still ran: the layer's
  UNASSIGNED-Threading-MultipleThreads-Read for vkWaitForFences and
  vkResetFences against m2v-submit-check's vkQueueSubmit, in 12 tests.
  A flight is now made once its call returns (Flights::made, for the
  batches too): done_marks takes no flight before that, and first_pending
  holds an unmade flight pending without reading its fence.

Tests: relay_facts gains a test that each use's mark is counted as its
user's, and one that a logged mark with a signaled fence is taken by no use
until it is made (both fail without the change on a relaying device). Not
yet run; the loader-word crash and the in_place_textures premise come next.

(cherry picked from commit 9627ced1ef673f10febb9f9bef20c5b9a5584cae)
2026-11-07 08:09:31 -08:00
Anees Iqbal 9d83dc8665 Bump RUNTIME_VERSION to 1794: binary archives take mesh pipelines and load a metallib as empty
The replay landing (group 11) changes runtime behaviour: a binary archive
keeps a mesh render pipeline's key (BinaryArchive::add_mesh_render_pipeline_functions,
new), a mesh state made fail-on-miss looks it up, and a metallib file loads
as an archive holding nothing. The runtime-sources pin is re-derived.
2026-11-07 08:03:27 -08:00
Anees Iqbal eac403512e Binary archives: the mesh key test's stage helper is a function, so its closures borrow nothing
The test's change closures called a closure local, so they were not
promoted and dropped while the loop still borrowed them (E0716 on
x86 Linux). A fn item lets them stay constant.

Verified: the runtime unit run of binary_archive tests compiles and passes (potluck).
(cherry picked from commit b83f7e220c6aaacad30651fc4117e3e07453e13c)
2026-11-07 08:02:57 -08:00
Anees Iqbal f118559e73 Binary archives: add mesh pipelines, and load a metallib as an empty archive
Two of the conformance ledger's every-venue rows, both of the runtime's
archive surface.

binary-archive-mesh-adder: BinaryArchive had three of Metal's four
pipeline adders. add_mesh_render_pipeline_functions
(addMeshRenderPipelineFunctionsWithDescriptor:error:) makes the state as
new_mesh_render_pipeline_state does with the default options, answering
its error, and keeps the descriptor's archive key (metal_key::mesh). A
mesh creation compiles its pipeline whole and looks in no archive, so
the add keeps no compiled artifact. Under FAIL_ON_BINARY_ARCHIVE_MISS a
mesh creation, which every listed archive missed before, now hits an
archive holding its key (binary_archive::mesh_missing). Which fields
Metal keys a mesh pipeline by is not measured, so the key holds every
field of the descriptor: a creation hits only an add of an equal
descriptor, where Metal's hits too, and one differing in a field Metal
does not key misses here where Metal's may hit, as the add's and
new_mesh_render_pipeline_state's docs say.

binary-archive-sources: Metal takes a metallib as an archive (the case's
M3 Max recording); container::read refused it as no archive of ours. A
file that parses as a metallib (Library::from_metallib, container tags
alone) now loads as an archive holding nothing: its lookups miss and it
serializes as one nothing was added to. What Metal's archive of a
metallib holds is not measured; new_binary_archive's doc says so.

The suite's runtime side answers the mesh add through the new call. The
ledger's two rows go; api_signatures.tsv gains the method, and
METAL-COVERAGE (coverage.tsv) marks the call implemented. Tests: unit
tests the_mesh_key_holds_every_field_and_a_lookup_names_the_mesh_function
and a_metallib_loads_as_an_archive_holding_nothing; lane test
a_mesh_add_is_found_by_its_own_descriptor_and_a_metallib_loads_as_an_
empty_archive (hit, miss before the add and for another color format,
the add's error, serialize and reload, the metallib's miss and nothing
to serialize). Verified by those tests and a whole lavapipe conformance
replay (see the tip report).

(cherry picked from commit adadb73f7c2063341e1dbe54fe887a5ceddf86b7)
2026-11-07 08:02:57 -08:00
Anees Iqbal f24d3bd094 Re-bless the authored compile census at 394b4db3f6
Its product fingerprint follows SEMANTICS 1981 and RUNTIME 1787.
Blessed on the M3 (s37-pl.sh censusbless --bless).

(cherry picked from commit 0ad7d2c117882a1f5e1c13eb03d9814339f78423)
2026-11-07 07:41:17 -08:00
Anees Iqbal 7e57099fa3 Extended-range blend tests: hold lavapipe to the half shadow it keeps beside its input attachment
Since the input-form shadow (1d1678f459 to d0cc0da26f), a pass that fetches through input
attachments holds an extended-range color's `half` shadow where its functions read and write it
beside them in the pixel interlock (the runtime's `framebuffer_fetch::holds_extended_shadows`:
the interlock, fragment stores, `R16G16B16A16_SFLOAT` as a storage image), which lavapipe has.
Three runtime-lane tests still read "fetches through input attachments" as "holds no shadow",
and failed on lavapipe at 82360d7175 and on: the clear test expected the stored-codes notice at
the one-draw pass between two codes and got none; the earlier-draw test expected the split pass
quiet and it announced; the unblended fetch test held lavapipe to the rule through the codes,
which 1204 of 8192 texels missed (805 of them on the unrounded decode).

The lane now asks the runtime's single-sample rule (`framebuffer_fetch::holds_extended_shadows`)
and keys the three tests' shadow branch on it, so on lavapipe they assert what a shadowed pass
gives: no stored-codes notice at the pass of two draws or onto the clear, one at the split pass
naming the color, and every texel of the unblended fetch on Metal's rule through the shadow. The
unrounded-decode allowance stays for a device that holds no shadow; lavapipe's shadowed pass
needs none. The three tests' docs say so.

Verified (m3-max-3884, gem10, lavapipe, Mesa 26.2.6, one job): at this tree the
extended_range_blends, moved_writers and framebuffer_fetch modules pass 71 of 71, the unblended
fetch with 0 of 8192 texels off Metal's rule and 0 held by the allowance; with the two files from
394b4db3f6 the three tests fail as above (7 of 10 pass). The same at the first cut of this change
(m3-max-3870, ms01).

(cherry picked from commit 9236c928d5d39559915355a6b282c1e83b051ba9)
2026-11-07 07:36:39 -08:00
Anees Iqbal e78dc20d62 Bump RUNTIME_VERSION to 1793: a split depth/stencil resolve draws its drawn aspect into its own texture
The replay landing (group 10) changes runtime behaviour: on a device
without MIN/MAX resolve modes, a stencil Sample0 resolve under a depth Min
or Max filter draws the depth resolve into its own destination after the
pass while the stencil resolves in the subpass through its scratch, where
it was refused. Both aspects drawn stays the typed refusal. The
runtime-sources pin is re-derived.
2026-11-07 07:28:51 -08:00
Anees Iqbal 66b746a390 Ledger: discard-quad-sum-placement's rows are a 128-bit lavapipe's grouping, scoped to the width
The three rows (counted_dependent, counted_store, counted_atomic at
case/<shape>/texels, "4 elements differ (I32), the largest difference
1") said their cause was not established: the device's compiler
moving the sum past the discard, or a fragment subgroup holding the
kept quad alone, gave the same numbers.

Established on x86-64 lavapipe (Mesa, LLVM 23.1.4, potluck job
m3-max-3813 on gem10): at its default 256-bit vectors (8-lane
fragment subgroups, two quads) the case reads announced and the three
shapes answer Metal's (1, 0, 0, 0); under LP_NATIVE_VECTOR_WIDTH=128
(4-lane subgroups, one quad, the width arm64 lavapipe runs) the same
three sites read the rows' exact answer, Metal 1 and ours 0 at the
first word of each kept texel. The module and the compiler are the
same in both runs; only the subgroup's width moved. So the answer is
the device's grouping of fragment pixels (Tier::PartialFragment),
which Metal permits, recorded as
PrecisionNote::FragmentSimdgroupGrouping and announced as
fragment-simdgroup-grouping. No exact form exists on such a device.
The note derives no tolerance, and replay::NATIVE_NOTES states that a
value a device's own answer moves stays a ledger row saying what
differs and whose answer it is, so the rows stay, rewritten to say
so.

The venue field was one build's name, llvmpipe (LLVM 21.1.8, 128
bits), so the x86-64 128-bit build read the rows as unlisted. It is
now the width, "128 bits)", which both 128-bit builds' names carry
and the 256-bit ones do not. The ledger test holds the rows on both
128-bit builds and on neither 256-bit build nor the M3 Max, and that
each row names the note. The case's module doc states the measured
cause; its declaration comment says why the note loosens no value.
CONFORMANCE-COVERAGE.md re-derives unchanged.

(cherry picked from commit 2ee9e30a4336496270a8c152d0ae2d74a7c4913f)
2026-11-07 07:28:21 -08:00
Anees Iqbal 16f1655627 Lane test: the kept separate samples' later Max resolve is built where the depth is drawn
split_depth_and_stencil_resolves_are_metals' keep case still expected a
drawn Max depth on separate textures to be refused; since the previous
commit a split resolve draws it into its own texture. The case now
expects it built wherever the stencil's subpass resolve is, as the
table's cases do. Verified on lavapipe: the lane test passes (see the
tip report).

(cherry picked from commit 9c403a058ca83f2e22a0941a70c216b792e6fed5)
2026-11-07 07:28:20 -08:00
Anees Iqbal 0d368fbfe7 Draw a split depth/stencil resolve's drawn aspect into its own texture
Metal resolves separate Depth32Float and Stencil8 textures with the
depth filter Min or Max beside the stencil filter Sample0, each into its
own resolve texture. On a device with no MIN or MAX depth resolve mode
(lavapipe) the runtime draws the picked depth after the pass, but a
split resolve (aspects resolving into different textures) refused any
drawn aspect NotImplemented(DepthStencilResolve): the draws wrote the
first step's scratch image, whose copy takes that step's aspect alone.

Now a split resolve draws its drawn aspect into that aspect's own
resolve texture (or a scratch image copied there, Destination::attach),
held as the resolve's drawn_into, which drawn_target prefers; the other
aspect resolves in its subpass step as before. Both aspects drawn, each
into its own texture, stays refused. The image separate textures render
through is made sampled where such a resolve may be drawn
(resolve::may_draw, which shares the filter-to-mode choice with
depth_stencil through aspect_modes), since the draws read its samples.

The ledger's two llvmpipe rows of resolve-stencil-under-depth-filters
(Sample0 under Min and Max) go. The lane test
split_depth_and_stencil_resolves_are_metals now expects every case but
both-aspects-drawn to be built and to hold Metal's answers; before this
change sep_min, sep_max, two_min, two_max and slices_max were refused
on lavapipe. Verified on lavapipe: the lane test and the conformance
replay (see the tip report).

(cherry picked from commit c2b4cbc80bf7f8f209d02ecbd5e5aec186b04d96)
2026-11-07 07:28:20 -08:00
Anees Iqbal 394b4db3f6 Bump SEMANTICS_VERSION to 1983 and RUNTIME_VERSION to 1792: vertex strides past 32 bits
The rows2 landing changes translation and the runtime: every stepped
pulled read (per vertex, per instance, captured vertex) checks its reach
past 2^32 bytes and reads zero there, both argument tables hold a stride's
low 32 bits (MTLAttributeStrideStatic as 2^32-1), and inline vertex bytes
at that constant read element 0 and then zeros, so
BindError::MissingVertexStride is removed.

rows2's 11b2a4e79f set SEMANTICS_VERSION to 1982, the number development
already held from the replay landing (027bb2e682), so the pick applied with
no change to it; this commit takes the next number. The runtime-sources pin
is re-derived; REFUSALS.md and the coverage document re-derive unchanged.
2026-11-07 07:22:46 -08:00
Anees Iqbal 4585297283 Re-record attribute-stride-inline-bytes' cost now that it translates, and contrast both new records
attribute-stride-inline-bytes was refused (Unsupported KernelStageIn,
NotImplemented) until 1edd55cb98, so its cost record held only a
refusal's counts; the case now translates, binds and dispatches, and the
cost check (orchestrator, m3-max-3760) read argument_objects_retained,
argument_tables_held_at_bind, bound_offsets_moved, command_barriers and
commands_recorded.* as "now gated, none in the record". The record's
contrast is that change: the case newly translates.

Job m3-max-3798 on the M3 Max (MoltenVK), for this case alone and for
attribute-stride-vertex-buffer (whose record cfd9c58154 took in one
shape only):
  conformance cost --runs 8 --write CASE
  conformance cost --runs 8 --alone --write CASE
each exit 0, both cases measured; the same job's replay of the two and
attribute-stride-buffer gated within their bounds.

(cherry picked from commit 15b03cff160d579136332e4ce62149ab1a991f69)
2026-11-07 07:21:50 -08:00
Anees Iqbal b6860e7915 Hold the sparse lanes to the measured charge of a slice past the texture
Two device lanes failed on MoltenVK and lavapipe after 636522137c
(orchestrator, jobs m3-max-3731 and m3-max-3666):
indirect_updates_map_what_the_buffer_holds_when_they_run and
updates_through_views_map_the_texture_s_own_tiles. Each maps a region
of a slice past the texture's own and asserted the heap's usedSize did
not move, which was the runtime's model before the measurement. Plain
Metal charges such an update a page a tile and maps nothing
(sparse-mapping-a-slice-past-the-textures, the M3 Max under macOS
27.0.1), which 636522137c implements for every update, so both lanes now
assert that charge and unmap the region to give it back before going
on:

- the indirect lane's four do-nothing regions: one page, for the one
  region of slice 1 on a one-slice texture, then 0 after its unmap;
- the view lane's slice 3 through a view of slices 1 and 2 (the
  texture's slice 4 of 4): four pages for its 2x2 tiles, then 9 pages
  again after its unmap.

The indirect form and the view form follow the direct update's rule;
neither is measured on Metal on its own.

(cherry picked from commit 4e35bcff173102409a5b2f34ac2359d7a318e331)
2026-11-07 07:21:49 -08:00
Anees Iqbal 20ffe3b558 Name the vertex stride case's private constants without links in its module doc
RUSTDOCFLAGS='-D warnings' cargo doc refused the public module's links to
the private VERTICES and UNWRITTEN (job m3-max-3734). Docs only.

(cherry picked from commit d9c71bcf889747d64344e8d1ad9dca6d08eb4c0c)
2026-11-07 07:21:49 -08:00
Anees Iqbal 0ab617d5d2 Write attribute-stride-vertex-buffer's cost and timing records on the M3 Max
Job m3-max-3735 at dce4bd753c (the fix in): conformance cost --write
(measured on the Apple M3 Max, MoltenVK) and conformance times --write
(both legs) of the one case, which the suite's tests ask of every case
(every_case_carries_a_cost_recording, every_case_carries_its_timing).

(cherry picked from commit cfd9c58154139e0f948da7aa4fb84049e68573d0)
2026-11-07 07:21:49 -08:00
Anees Iqbal 9b1a531a25 Re-derive the conformance coverage document for attribute-stride-vertex-buffer
python3 -I scripts/conformance-coverage/coverage.py: one more case module
and recording, and setVertexBuffer:offset:attributeStride:atIndex: on the
render encoder now exercised by the Metal leg (812 of the reachable).

(cherry picked from commit dce4bd753c2e298f3b1cbb84b5c808d2cabb85b1)
2026-11-07 07:21:49 -08:00
Anees Iqbal a80982a04b Read a vertex attribute past 2^32 bytes as zero, and MTLAttributeStrideStatic as 2^32-1
attribute-stride-vertex-buffer (recorded in the previous commit) shows
plain Metal's render encoder reads a layout of
MTLBufferLayoutStrideDynamic as the compute encoder does: a stride of
its low 32 bits, the constant's 2^32-1 included, and an element placed
in 64 bits, so any element past a small buffer reads zero. Ours read the
constant as no stride (stride 0) and wrapped a pulled vertex
attribute's 32-bit displacement back into the buffer.

- lower::stage_io::fetch: every pulled read with an element (per
  vertex, per instance, captured vertex, and the kernel steps as
  before) takes within_reach, so its bytes past 2^32 from the bind offset
  read zero on every device. The word estimate counts REACH_WORDS for
  those steps.
- runtime argument_table: per_bind_stride is the low 32 bits in both
  tables (one function, no compute flag); a render table holds the
  constant as 2^32-1.
- bind::graphics: inline vertex bytes at the constant are read like a
  buffer (the pulled variant, past maxVertexInputBindingStride), as an
  M4 read them: element 0 and zeros. BindError::MissingVertexStride had
  no other source and is removed (api_signatures blessed).
- Docs follow: fetch.rs, fetch_reach.rs, vertex_reach.rs,
  vertex_strides.rs, bind::state, and the device lanes' expectations
  (vertex_strides and inline_bytes: the constant reads vertex 0's word
  and zeros, no refusal).
- SEMANTICS_VERSION 1982.

Removed public item: metal2vulkan::error::BindError::MissingVertexStride.

(cherry picked from commit 11b2a4e79f1c91dc0efed7c2b4a5865b80f5c3e2)
2026-11-07 07:21:49 -08:00
Anees Iqbal 2ba37a2a3c Record attribute-stride-vertex-buffer on the M3 Max
Job m3-max-3706, plain Metal on the M3 Max under macOS 27.0.1, the
command buffer completed with no error. Each draw's four vertices read:

- stride 4: 0x10, 0x11, 0x12, 0x13 (the control);
- MTLAttributeStrideStatic: 0x10, then 0 three times, as the compute
  encoder's four forms read it: a stride of its low 32 bits, 2^32-1;
- 2^32-8: 0x10, then 0 three times;
- 2^31+4: 0x10, then 0 three times: vertex 2 lies at 2^32+8 bytes, past
  the 64-byte buffer.

Metal's API validation stops the draw at the constant ("providing
MTLAttributeStrideStatic to attributeStride when stride at buffer-layout
index 1 is dynamic"), which the validated leg records.

The same job's MoltenVK replay diverged at four words: the constant's
vertices 1-3 read 0x10 (the render table held no stride, so stride 0),
and 2^31+4's vertex 2 read 0x12 (the pulled fetch's 32-bit displacement
wrapped to 8). The next commit fixes both.

(cherry picked from commit d3b5b8ca174348bbc152807764d7d0a4ed90a836)
2026-11-07 07:21:49 -08:00
Anees Iqbal d2b9425c63 Add a conformance case of the render encoder's vertex strides past 32 bits
attribute-stride-vertex-buffer binds one small attribute buffer through
setVertexBuffer:offset:attributeStride:atIndex: under a layout of
MTLBufferLayoutStrideDynamic at four strides, one draw of four points
each, rasterization disabled, each writing its own segment of out:

- 4, the control (every element inside the buffer);
- MTLAttributeStrideStatic, which the compute encoder holds as 2^32-1
  and the render table holds as no stride: Metal's render answer is the
  question;
- 2^32-8, whose elements past the first lie past the buffer in 64 bits
  and in 32 bits alike;
- 2^31+4, whose vertex 2 lies at 2^32+8 in 64 bits, past the buffer,
  and at 8 in 32 bits, on element 2: the row a 32-bit displacement
  reads wrongly.

The render step vocabulary gains RenderStep::VertexBufferWithStride
(both sides, its call name, parameters and the chain test). The
indirect-commands family's program and fixture helpers become
pub(super) so the case reuses them. Not yet recorded; the recording
follows from the M3.

(cherry picked from commit 5a30b8ee4d81eb2a8d7f6f94b3068bf07591c3f0)
2026-11-07 07:21:49 -08:00
Anees Iqbal 9c4a590412 Say what a nonzero stage-in region origin does in bind::dispatch's module doc
The module doc still said a dispatch whose kernel steps by a rate above 1
or by index, with a nonzero region origin on that axis, is refused
Unsupported{KernelStageIn, NotImplemented}. No such refusal is left in
the code: the origin is added to the quotient and to the looked-up index,
as an M4 and an M3 Max read (lower::stage_io::stage_in;
tests::engine_kernel_stage_in::a_nonzero_origin_adds_to_the_quotient_and_the_index).
Docs only.

(cherry picked from commit adcbe6478108f6bd2f33195bfc304558d4305e41)
2026-11-07 07:21:48 -08:00
Anees Iqbal e39a0cab5c Conformance: a tile state's thread limit follows its dispatch's device-gap ruling
tile-simd-blur-columns and -rows on llvmpipe compared the tile state's
maxTotalThreadsPerThreadgroup, Metal's 1024 against the runtime's 960,
as a divergence of ours, while the same case's 32x32 dispatch, refused
typed with Feature::LocalSize and a Capability::Limit, already read as
the device's gap (a_dispatch_the_device_cannot_take_is_the_devices_gap).
960 is lavapipe's: its emulated 32-lane simdgroups hold 960 threads of
the blur's pipeline, and the runtime reports the device's lower limit
by contract (pipeline/tile.rs).

Now the tile_threadgroups family, where the device refused a dispatch
Metal ran of the state as its gap and the state's descriptor states no
limit, states the state's maxTotalThreadsPerThreadgroup site as that
gap (Sites::device_gap), and the comparison reads a value site our side
stated so as a DeviceGap instead of a divergence (compare.rs, before
any allowance, as a refused site's gap). A state whose answer matches
Metal's records nothing; an unstated difference still diverges.
Metal's side never states one: its failures carry no lacks.

The two llvmpipe ledger rows go; the cases now read lacks-feature
there. Test: a_getter_our_side_states_is_the_devices_limit_is_the_
venues_gap holds both directions (stated reads lacks-feature, the same
answer unstated reads divergent, a stated site matching Metal exact).
Verified by the conformance unit tests and a whole lavapipe replay
(see the tip report).

(cherry picked from commit ffa0411fb87a3dc61ca14a5418b16a60e06c3fa2)
2026-11-07 07:20:06 -08:00
Anees Iqbal 01749f42c2 Conformance: a venue's own answer on a compressing venue leaves a differing site its one row
On the M3 Max (MoltenVK) compressed-blits-rg11b10f and -rgb9e5f read
ten unlisted divergences at case/<site>/*: "the case loosens this
site, and the venue presents a Mac that keeps textures compressed".
Since 17337510f4 declared replay::without_compression at those sites,
a site that differs on a venue presenting Metal's compression noted
the declaration as a bad allowance where it fired, so each site's gap
read twice: once at the site (the ledger's row, which still holds)
and once at the declaration's own path. The up-front check already
held that naming the declaration is no fault on such a venue; the
walk did not. The ledger keys a row by the site (README, "A row's
identity is its case, the verdict it expects, the site and the
answer"), so the fix is the replay's, not ten more rows for the same
gaps.

Unjustified::faults_the_case says which reasons fault the case
(every one but VenueCompresses); the up-front check, the walk's
value allowances and its refusals all read it. On a compressing
venue the site now compares as if nothing were loosened, and the
declaration counts as unfired with the venue as its reason, as
before. On a venue keeping no compression nothing changes.

Test: tests::a_venues_own_answer_on_a_compressing_venue_leaves_the_site_its_one_row
(fails without the change: one bad allowance at case/blit/*, for a
value and for a refusal).

Verified: see the follow-up evidence in the hand-off (conformance unit
tests and lavapipe replay on Linux, the compressed-blits replay on the
M3 Max).

(cherry picked from commit cc1ad3606fbffce5aca94bb226b4c8f6fe367254)
2026-11-07 07:19:35 -08:00
Anees Iqbal 658b4c3536 Bump RUNTIME_VERSION to 1791: a commit that submits at commit still wakes the scheduler
The lvpfix landing (the plain-commit wake regression) makes
Scheduler::submit_at_commit end its pass by waking the scheduler thread,
once per sleep as any waker does, after the submissions and their
handlers. The runtime-sources pin is re-derived.
2026-11-07 07:16:46 -08:00
Anees Iqbal ff870f6403 Scheduler: a committing thread's pass ends by waking the scheduler's thread, as a commit does
Since a committing thread's batch went alone on a grouping driver (4d4e103471), a
`commit_and_submit` that submitted its batch itself no longer woke the scheduler's thread;
before it, on such a driver, that batch was left to the thread, whose wake came with it. The
thread so slept across those commits, and the plain `commit`s made beside them often fell into
a slow mode: in the completion-latency lane (three shapes committed in turn 2 ms apart), the
plain shapes' p50 was slow in 4 of 6 rounds (three jobs) without the wake and in none of 10 with
it, before the alone path or after this change.

Mechanism (gem10, RX 7900 XTX, RADV, Mesa 26.2.6, exclusive; m3-max-3816, a probe build):
the thread's own counts over the lane show the wake source: before the alone path, sleeps 6000,
woken by a commit 4000 and by the host 2000 (the committed batch left to it), batches submitted
at commit 0; at 3e9230adf2, sleeps 4000, commit 4000, host 0, at commit 2000; with a wake after
the committing thread's submissions, sleeps 6000, commit 4000, host 2000, at commit 2000. The
latency followed: in 3e9230adf2's slow round, the plain shapes' thread wake p50 4.5-10.6 us
(p90 51-104) and commit to watch p50 56-104 us, `vkQueueSubmit` itself 27-62 us at the median,
on every thread, the committing one's included; with the wake, both rounds at the old figures. The system-wide
cpuidle counts (entries and residency of each state, the menu governor, amd-pstate-epp) did not
separate the legs, so the idle-depth part of the account is not shown by them.

Fix: `Scheduler::submit_at_commit` wakes the thread after its pass, for what it left
(`Woken::Host`, as before) or else for the commit itself (`Woken::Commit`), once a sleep as any
waker. The wake comes after the submissions and their submission handlers, so nothing on a
command buffer's way to its `VkQueue` waits for it. Docs: the scheduler module, `submit_at_commit`,
`Woken::Commit`, `CommandBuffer::commit_and_submit`, `WorkCounts::scheduler_wakes_commit` and
`scheduler_wakes_host`, the runtime README's item, and FAST-PATHS row 37's figures for the alone
path. New test: `tests::scheduler_wakes::a_commit_and_submit_wakes_the_sleeping_thread_as_a_commit_does`
(ten `commit_and_submit`s after idle gaps, each submitted at commit, each a commit's waking).

Verified (m3-max-3823, gem10 exclusive, release, base = the three scheduler files before
4d4e103471, dev = development's scheduler, fix = this; two alternating rounds of both lanes):
- the plain shapes back at base: commit to watch p50 31.3-37.0 us against base 29.9-39.4 (dev
  33.4-169.9), the thread's wake p50 4.1-4.5 us against 4.0-4.2 (dev 4.3-51.0);
- commit_and_submit keeps its gain: a checked fill's commit to submission handler p50 30.7-32.2
  us against base 34.2-70.0, 520 of 520 submitted at commit; the call returns at 32.0-33.5 us
  against dev's 31.8-33.8; the shape in turn with the plain ones, commit to watch p50 31.3-31.6 us
  against base 31.3-39.5 (dev 29.6-102.4).
Tests alone on RADV (each `--exact`, one thread): commit_and_submit, deferred_calls and
scheduler_wakes, 31 of 31 pass at the fix; with development's scheduler 30 of 31, the new test
failing with 0 commit wakings of 10. Clippy (plain, m2v_gpu, m2v_cpu_icd) and rustdoc with -D
warnings pass (m3-max-3824, um870).

(cherry picked from commit b80e092759fb412a0154365bfb378ee38e096f56)
2026-11-07 07:16:37 -08:00
Anees Iqbal 2d194d6c4a Re-bless the authored compile census at 78384af08d
Its product fingerprint follows SEMANTICS 1981 and RUNTIME 1787.
Blessed on the M3 (s37-pl.sh censusbless --bless).

(cherry picked from commit 0528566d35ea3240689cb3795ee1af1df0c614b8)
2026-11-07 07:04:58 -08:00
Anees Iqbal 07393c7cb4 Bump RUNTIME_VERSION to 1790: one zero buffer per length when threads first ask at once
The lvpfix landing (05137) makes neutral_zero_buffer look up, make and
insert under the neutrals' one lock, so two threads that first ask for a
length at once share one buffer and none leaks to vkDestroyDevice. The
runtime-sources pin is re-derived.
2026-11-07 06:59:44 -08:00
Anees Iqbal 32fe7f9fdf Neutral zero buffers: make one under the neutrals' lock, so threads that first ask at once share it
neutral_zero_buffer looked its length up under the neutrals' lock, let
go of it, made the buffer and took the lock again to insert it with
entry().or_insert(): threads that first asked for one length at once
each made a buffer, and every buffer but the inserted one was dropped
with its VkBuffer and its memory never released. The validation layer
reported it as VUID-vkDestroyDevice-device-05137 on lavapipe (Mesa
26.2.6) in runtime_lane::cache::makings_on_several_threads_each_read_
their_own_cache, whose cases make pipelines on several threads: a probe
that named each VkBuffer's creation site matched the leaked handle to
neutral.rs's vkCreateBuffer of the zero buffer (65536 bytes, uniform
and transfer-destination usage, on a maker thread).

The zero buffer is now made under the neutrals' lock, as the device's
neutral images and texel buffers already are (the same lock order:
neutrals, then memory and first moves). A new test releases eight
threads at once onto each of sixteen new lengths and requires one
buffer a length, handed to every thread. Verified on lavapipe in the
job named in the tip's report.

(cherry picked from commit d8143bf82fd959724985671ea8c17879166daf1c)
2026-11-07 06:59:35 -08:00
Anees Iqbal 78384af08d Bump RUNTIME_VERSION to 1789: a compute state reports the kernel's own static threadgroup length
The replay landing (group 13) changes what the runtime reports: a compute
pipeline state's staticThreadgroupMemoryLength is the static part of
Metal's own layout, and a dispatch whose total (static memory, the
emulated simdgroup arena, the vote word and the scratch) does not fit is
refused typed. The runtime-sources pin is re-derived.
2026-11-07 06:57:20 -08:00
Anees Iqbal 027bb2e682 A compute state's static threadgroup length is the kernel's own, as Metal reports it
ComputePipelineMetalInfo::static_threadgroup_memory_length answered, on
a device that emulates simdgroups, the declared arena plus the scratch
of the most threads (32768 on lavapipe for compute-threadgroup-simd-
scratch, whose kernel declares 24 KiB), and elsewhere the kernel's
static part plus a predicated walk's vote word. Both additions are
ours: Metal's staticThreadgroupMemoryLength is the static part of the
kernel's own layout (KernelFacts::static_threadgroup_bytes), and the
getter now answers exactly that.

The planner keeps counting the scratch and the vote word in each
dispatch's total (bind::plan::compute: the arena from
RuntimeFact::SimdgroupEmulation, the vote beside it, the scratch rule
per region), so a dispatch whose threadgroup lengths fit beside the
reported length but not beside the scratch is refused
ThreadgroupMemorySize, the device's gap, where before the inflated
getter kept a well-behaved client from asking. The emulated tests
check both: region_k reports 0, a Metal client's remainder beside it is
refused at the most threads, and a region that fits beside the arena
and the scratch runs; barrier_k reports its own 31 KiB.

The compute-threadgroup-simd-scratch llvmpipe row goes. The runtime
getter's doc names the refusal. SEMANTICS_VERSION 1980 -> 1982 (1981 is
rows2's).

Verified: runs next (targeted translator tests, lavapipe replay).
(cherry picked from commit dd3d0a893bf900fbf11cb885f5fb9a7b7cfd9055)
2026-11-07 06:57:11 -08:00
Anees Iqbal 3e9230adf2 Bump RUNTIME_VERSION to 1788: a committing thread submits a batch alone on a grouping driver
The lvpfix landing (commit_and_submit) changes where a batch's checks and
submission run: on a grouping driver, a batch a committing thread submits
goes alone where its VkQueue runs at most one earlier submission not seen
complete, and a grouping line's look-ahead waits behind checks a committing
thread still runs. The runtime-sources pin is re-derived.
2026-11-07 06:47:59 -08:00
Anees Iqbal 6126e8a237 FAST-PATHS: the Grouped row's figures for a batch a committing thread submits alone
Measured in job m3-max-3640 (homelab-gem10-1, exclusive, release test
binaries of the fix's tip and of the form before it, alternating, two
rounds each): tests::completion_latency::runtime_commit_to_submission
and runtime_completion_latency on RADV (RX 7900 XTX, Mesa 26.2.6,
whose submission check finds merges: 520 batches submitted at commit
at the tip, 1 before) and on lavapipe (whose check finds none: the two
forms alike). The plain commits interleaved with commit_and_submit ones
saw the scheduler thread wake later at the tip, in three of four rows;
the row states it.

(cherry picked from commit d94a28e714c46ca24fe764700ee5017c2041c297)
2026-11-07 06:47:43 -08:00
Anees Iqbal 20a24a00b2 commit_and_submit tests: let the checked order test's queue drain every fiftieth commit
On RADV (Mesa 26.2.6, RX 7900 XTX), whose submission check answers that
submissions merge, checked_command_buffers_keep_commit_order_across_
commit_and_commit_and_submit found 0 of 1000 checks on a committing
thread at the fix's tip (160 batches submitted at commit): a committing
thread takes a head's checks only where its VkQueue runs at most one
earlier submission not seen complete, and under the two threads'
backlog the scheduler's look-ahead took every head's checks first, so
the test's order assertion compared checks of one thread only.

Every fiftieth commit, a commit_and_submit, now first waits for the
commit before it to complete, so a committing thread meets a drained
queue there on every device and the order is held across both kinds of
thread. Verified on RADV and lavapipe in the job named in the tip's
report.

(cherry picked from commit c6cb3d016beecfcc01f60edfa537cd5a19dac4eb)
2026-11-07 06:47:43 -08:00