Commit Graph
1750 Commits
Author SHA1 Message Date
Anees Iqbal 963f0e64f1 Re-bless the authored compile census at stack 36's build
The census on the stack 36 tree (corpus-triage --audit authored-compile, 2262 cases, 47502 cells,
49326 compiles, none cached) found no failed cell, no difference and no regression: 46395 compiled,
1107 refused, 327 uncovered. The shared heap sampler capacity refactors how link sizes set 1 and
moved no cell's outcome or SPIR-V digest; --bless wrote the table's artifacts_at line at this
build, whose product fingerprint moved. Slowest compile 1347 ms, peak worker RSS 233 MB.

Verified: the audit ran on the M3 (potluck s36 census leg, then the bless m3-max-2696) with the main
checkout's private corpus; failed=0, differences=0, regressions=0, moved_artifacts=0.
2026-11-05 19:56:05 -08:00
Anees Iqbal d808da4b93 Re-record the conformance costs at stack 36's tree
The moved fields are the scheduler's: its passes, sleeps and host wakes, host-step head holds,
spared wakes, waiter passes and sleep slices, batches submitted by waiters and held past a look,
gate sleeps and submit stalls on work. A few cases' primaries begun ahead, command buffers begun,
draw shapes reused, pipelines looked up and draw states recorded also moved. A thread's own pass
now takes the ready heads not behind, so where the scheduler thread runs a pass and sleeps moves
with it. A whole-set run (`conformance cost --runs 8 --write`), then each changed case alone (`cost
--runs 8 --alone --write`), re-recorded 602 cases on the Apple M3 Max. No case gained a first
record.

Verified: both runs exited 0 on the M3 (potluck m3-max-2662). The conformance suite and
`conformance cost --check` rerun on this tree next.
2026-11-05 19:49:45 -08:00
Anees Iqbal cbc30cb2c5 Bump RUNTIME_VERSION to 1775: commits not behind submit at once, counts in encoder tallies, batched page logs
A thread's own pass and a claim of checks take the first ready head not behind, so a commit on one
queue no longer waits for the scheduler thread behind another queue's held head. A command's
counts go into a tally its encoder owns. A write to a log of host pages is reported in one batched
call per log. A filter notice reads the format a slot's binding presents. The argument-buffer
sampler answer and its make-time check share the set-1 array's derivation. Each changes what the
runtime does for the same calls, so warm records made before them are not reused. The runtime
sources' pin is recomputed at this tree.

Verified: the pin is pin-compute.py's at this tree; the stack 36 gate runs next.
2026-11-05 19:00:57 -08:00
Anees Iqbal e8df3cf057 Build the device test's sampler options as one literal
What: argument_sampler_count's SamplerStateOptions is a struct literal.
Why: clippy's field_reassign_with_default under --cfg m2v_gpu (potluck job m3-max-2549).
Verified: by the next m2v_gpu clippy.
(cherry picked from commit 86b5621e27385c935b2b01fdbf6608e869f2bea0)
2026-11-05 18:59:21 -08:00
Anees Iqbal 547ca6f36b Say which pipelines read fewer argument-buffer samplers than the answer
What: the max_argument_buffer_sampler_count docs now say fewer *can* be read, and where:
a pipeline with smaller set-1 arrays, other live Vulkan samplers, other sampler-ID holders.
Why: the earlier wording read as if each case always reads fewer.
Verified: rustdoc at the branch tip (in the report).

(cherry picked from commit ba88cf41c09ab400cf1a7e2f70de4d7e272636a8)
2026-11-05 18:59:21 -08:00
Anees Iqbal 9f0b63d3da Bind the committed descriptions the argument sampler test borrows
What: the unit test argument_buffer_samplers_are_one_fewer_than_the_array_and_the_sampler_limit
iterated a temporary its map of answers borrowed past the loop (E0716).
Why: the lib test did not compile (potluck job m3-max-2541, clippy).
Verified: by the next build.

(cherry picked from commit 3eded217cacab74506636ca1a8e15b0627b5326e)
2026-11-05 18:59:21 -08:00
Anees Iqbal 570df3cc95 Answer maxArgumentBufferSamplerCount from the set-1 sampler array and the sampler limit
What: `DeviceProperties::max_argument_buffer_sampler_count`, Metal's
`maxArgumentBufferSamplerCount`: one fewer than the smaller of a set-1
sampler array's elements and the device's maxSamplerAllocationCount
(element 0 of the array, and one of the device's samplers, are the
neutral sampler's; each state the array holds takes an element and a
sampler of its own). The array's elements are a new public translator
function, `pipeline::heap_sampler_capacity`: link's heap capacity for a
heap of one sampler array with set 0 counting no sampler, the least of
the handle table's 65536 entries (TABLE_CAPACITY) and the two
update-after-bind sampler limits, 0 where a function cannot read a set-1
sampler array (the layout's features or the module's non-uniform
sampled-image indexing). Link's heap_capacity now reads the same limit
table (`heap_limits`) and arithmetic (`room`), and heap_set the same
layout-feature check (`heap_layout_lacks`), so the sizing and the answer
cannot drift. The runtime's `Device::sampler_array` (each state's
creation-time check) now calls it too: it was the two update-after-bind
limits without the handle table's reach, 500000 on MoltenVK where link
makes 65536 elements, so a state past 65535 was not announced as it was
made. The device's SamplerCount and the answer read one value, the
identity's maxSamplerAllocationCount.

Why: the consumer computed it as the least of the two update-after-bind
sampler limits and maxSamplerAllocationCount; that misses the handle
table's reach (500000 against our 65535 on the M3) and the neutral's
element (32768 against 32767 on lavapipe, 4000 against 3999 on NVIDIA).

Metal on the M3 Max (macOS 27.0.1) answers 500000 (a Swift query of
MTLCreateSystemDefaultDevice, potluck job m3-max-2496), recorded in the
field's docs and docs/API.md's accepted differences.

Tests: engine_handles::an_argument_sampler_array_has_the_heap_sampler_capacity
(link's array equals the function on every committed profile, follows
lowered limits, 0 without the features); capabilities::
argument_buffer_samplers_are_one_fewer_than_the_array_and_the_sampler_limit
(every committed profile, pinned venue values); the device test
argument_sampler_count (the kernel's array, the device's count, the
driver's limit and the answer agree; elements-1 states unannounced, the
next announced). Verification follows in the branch's report.

(cherry picked from commit 7a2b84f15a1dde81e35cbc0b9367962e54d8332f)
2026-11-05 18:59:21 -08:00
Anees Iqbal 296723b362 Test a filter notice's bound format against the format the slot's binding presents
The consumer's own-format view test died on the M3 Max (MoltenVK) in strict mode at a sample of
an 8-bit 4:2:0 texture's 2D array view in its own format: `ycbcr-filter-not-exact`, "texture 0
bound as YCBCR84202P". That view is the luma view (`Texture::luma_view`): an `R8G8B8A8_UNORM`
image of the codes, read as the code-reading format `RGB8_420_2P` through a swizzle, which
Metal's own sampler filters as Metal filters that format (the lane already holds the view's
linear sample to that format's, and Metal's view to it bit for bit). The binding plan reads the
bound record's format (`ViewRecord::bound`, `RGB8_420_2P`), but the notice's bound-format test
read `Texture::pixel_format`, the view's own (`YCBCR8_420_2P`), whose class carries the 1/2048
field `FloatSampleFilter`'s clause tests. So the note was wrong: no float texels are filtered
there. The 10-bit views (`RGB10_420_2P` codes, `A2B10G10R10_UNORM_PACK32`) and the `_sRGB`
twins' views announced it alike.

`Tables::bound_format` now reads the format the texture's bindings present
(`Texture::bound_pixel_format`, `ViewRecord::bound`), the one its slot's code was specialized
for. That changes what the bound-format notices test and name for every texture that reads its
image in another format: the luma views; views in other channels of their image's bits, whose
class is their image's; and converted textures over a P3 surface, whose image is the
code-reading format's codes. A P3 texture's linear sample is no longer announced: Metal's
filter of it is not measured, now a FAST-PATHS known gap. Notices only: no pipeline, binding or
answer changes.

Docs: ycbcr.rs (views; linear filtering, with the in-place form's 4:2:0-only reach), the
YCbCrFilterNotExact declaration and its API.md entry, and the FAST-PATHS known gap.

Verified: cargo fmt. The lane check of the previous commit fails without this on the M3 Max;
device runs follow.

(cherry picked from commit 37a50861dd4e105619690a520a290c30bd3208d5)
2026-11-05 18:59:20 -08:00
Anees Iqbal 4129709376 Print the images the 4:2:2 and 4:4:4 lane keeps for their layout
The lane's YCBCR-BETWEEN line now names, per format, how many textures kept their image for
their layout (WorkCounts::ycbcr_images_kept_layout), the route a 4:4:4 texture takes on a device
that reads 4:2:0 planes in place. Verified: cargo fmt.

(cherry picked from commit 0ce54db4a991c38e5cf893e90e12ac19d7266aa8)
2026-11-05 18:59:20 -08:00
Anees Iqbal 38681dd59f Hold a luma view's samples to no filter notice, and 4:2:2 and 4:4:4 samples between texels
Two lane checks for the consumer's report that two 8-bit YCbCr shapes die on the M3 Max with
`ycbcr-filter-not-exact` in strict mode.

- `retyped_views_read_their_luma_codes` now also asserts the run's filter notices: a view of a
  two-plane YCbCr texture in its own format as a 2D array is the luma view, whose bindings present
  the code-reading format (an `R8G8B8A8_UNORM` or `A2B10G10R10_UNORM_PACK32` image of the codes,
  `Texture::luma_view`), and whose linear sample the test already holds to that format's own
  sample. So it announces no `ycbcr-filter-not-exact`; only a texture the device converts itself
  does, where it is made. Expected to fail on MoltenVK at this commit: the notice's bound-format
  test reads the view's own format (`YCBCR8_420_2P`), not the format its binding presents.
- `four_two_two_and_four_four_four_textures_read_what_metal_reads` now also samples each texture
  linearly between its texels and holds each value to `Between` (Metal's step where the planes are
  read in place, else the kept image's filter within its bound), printing per format how many
  values are off Metal's step. No 4:2:2 or 4:4:4 texture reads its planes in place
  (`bind::YCbCrInPlace::of` takes 4:2:0 alone), so on MoltenVK this measures the filter
  `ycbcr-filter-not-exact` announces for `YCBCR8_444_2P`.

Verified: cargo fmt. Device runs follow on the M3 Max (MoltenVK 1.4.2).
(cherry picked from commit 4137b901b22c0c92456c1bbefc12e2d454853fd3)
2026-11-05 18:59:20 -08:00
Anees Iqbal f1f471fadc Copy a log's runs of a write as one slice, found by binary search
The bench (DIRTY-RUNS-BENCH, release, M3) showed the batched report's time was the runtime's
own gathering: one call a report, but 17 us to walk all 9,000 runs of the surface's window and
push each, about what the 9,000 per-run calls had cost in all (17.7 us before); and a source
keeping only the per-run hooks took twice that (33-35 us: the gathering, then the default
loop's 9,000 calls).

LogOf now keeps the object's first byte of each run and the source's offsets of the runs in
two arrays. The runs a write meets are found by binary search over the first bytes, copied as
one slice, and the first and last cut to the write: the same runs in the same order, without
a walk over every run of the window for each write, so a small write into a large scattered
object no longer looks at all its runs.

Verified: tests::dirty_runs (partial runs at both ends of a range, pieces around a shadow's
merge, blocks, a CPU write) and the bench, on the M3 (potluck).

(cherry picked from commit f2f270a3e84b5606a95acd8adae6f1e43fb7e44c)
2026-11-05 18:59:20 -08:00
Anees Iqbal 23f487e523 Let the report's scratch borrow auto-deref, as clippy asks
clippy::explicit_auto_deref (under -D warnings) refused the explicit reborrow through the
RefMut in with_scratch; the call takes &mut scratch as it is.

Verified: clippy --cfg m2v_cpu_icd on the M3 named this line alone (job m3-max-2303).
(cherry picked from commit 159e12772c934a8b718e279e2b2d7d50b2d9140b)
2026-11-05 18:59:20 -08:00
Anees Iqbal a2b99ee4f6 Report each write to a log of host pages in one batched call
The consumer measured DirtyCommit::report_host_writes at 77.7% of its present path on the
RTX 5080: PagesLog::wrote_but called the source's hook once per run of the object's window in
a guest RAM's log, about 9,000 calls a report for a 3840x2400 BGRA8 surface over scattered
4 KiB pages. PagesLog::wrote, wrote_as and a shadow's report did the same.

DirtyPages gains wrote_runs(&[Range<u64>]) and wrote_runs_as(&[Range<u64>], writer), whose
defaults call wrote or wrote_as once a run, in order, so existing sources keep working. Every
write the runtime reports now comes to each log as one call carrying all its runs there: each
range of a command buffer's writes in place (the bytes no shadow wrote, the gaps between the
shadows' writes, in order), each shadow's write to the other logs, a copied host buffer's merge
back (all its blocks, one call per log and copy, where it was one call per run of each block), a
CPU write, and a shadow's copy back or merge (one run). For each source, the runs, their order
and their writers are what the per-run calls carried. The runs gather in a thread-local buffer
kept for the thread's next report, so a warm report allocates nothing (wrote_but also no longer
builds a Vec per range to cut out the shadows' writes: one sorted list, swept). The internal
DirtyHook calls the batched forms alone; its per-run methods went.

The read side needs no batching: changed and changed_except already hand back every run of a
query in one call. watch stays per run: a copied host buffer watches its runs once, at its
making, not per report.

Docs: the trait's contract for the runs (never empty, each non-empty, in the order of the
object's bytes, apart in the object, not sorted by offset over scattered pages), its Batches
paragraph, HostMemory::with_dirty_pages, the runtime README and HOWTO's guest RAM log; the
api_signatures table blessed (two trait items).

Tests: dirty_runs checks, over a memory log and a guest RAM log of 24 scattered pages, that a
command buffer's report, a write with a shadow's merge inside it, a copy's merge back of three
blocks and a CPU write each reach each log in one call per range carrying exactly the runs
worked out from the window, and that a log keeping only wrote/wrote_as hears every run in the
same order with the same writers. The bench gains a batched trivial log.

(cherry picked from commit b69d6b70c49af0b0ab08db5fe2f8b78cd61ed2fe)
2026-11-05 18:59:20 -08:00
Anees Iqbal 2a87b64118 Bench a command buffer's write in place reported to a guest RAM's log
A release bench (ignored) of DirtyCommit::report_host_writes for a 3840x2400 BGRA8 surface
imported in place over 9,000 scattered 4 KiB runs of a guest RAM, written whole by one command,
to a trivial log (one fence and one load a call). It prints the median and 90th percentile of
200 reports and the log's calls a report, the cost the consumer measured at 77.7% of its
present path (one hook call per run).

Verified: built and run in release on the M3 (potluck).
(cherry picked from commit d4c842a69bb8de29e33667843da79c0255979dcc)
2026-11-05 18:59:19 -08:00
Anees Iqbal 6b0a613b94 Test that two threads' encoders count whole, read open and ended
What: tests::command_counts (device test, m2v_gpu and m2v_cpu_icd). One
thread's pass of 4,000 rectangle draws, each after a vertex buffer
offset and fragment bytes set (binds that change the stage tables'
slots alone), gives ten command counts (draws_rebound, draws_as_before,
stage_tables_read, stage_tables_read_in_part, draw_states_recorded,
set_zero_writes_pushed, set_zero_sets_reused,
argument_tables_held_at_bind, bound_offsets_moved,
commands_noted_as_before). Then two threads, each with its own queue,
open an encoder and draw the same pass at once behind barriers; the
device's counts read while both encoders are still open, and again once
both ended, must each move by exactly twice the one thread's. A count
read lower than an earlier read shows as a negative difference.

Why: the counts commands add go into tallies their encoders own while
open; a count must stay exact for a reader whatever thread recorded it
and whether the encoder still runs.

Verified: passes on the M3 (MoltenVK), lavapipe (3 of 3 runs) and the
RTX 5080 (NVIDIA). Fails under both negative controls, 3 runs of 3 on
each device: every encoder sharing tally 0 ("read while both encoders
were open": additions lost to the two threads' loads and stores), and a
read that sums only given-back tallies (a fold at the encoder's end:
the same assertion on lavapipe and the 5080; on the M3, at the test's
form before its differences went signed, a count read lower than the
read before the encoders opened).

(cherry picked from commit 1e6d802f42b4dbce8616e538bfd1f98b988957c2)
(cherry picked from commit 0349e6c8c30cb0530b508696be1da2e1fbcb4cde)
2026-11-05 18:59:19 -08:00
Anees Iqbal f1e7a97d56 Give 64 threads count shards of their own
What: shards::SHARDS goes from 16 to 64, the most the owners' bitmask
holds, as the encoders' tallies have. Threads past the owned shards
share one by an atomic add: the recorder's command counts and the
counts made with no encoder's core at hand.

Why: a process where more than 16 threads have counted (a consumer's
walk threads beside its other encoding threads) put every later thread
on the shared shard, each of their commands an atomic add the others
contend for. Memory: 48 more shards of 512 bytes (24 KiB) a device for the
core-less command counts, and 24 KiB more for each of the recorder's 8
slots (static).

Verified: neutral in the lanes once the tallies took the per-draw
counts: game_draws_threads beside 16 idle threads that drew, 5080
(pinned, 5 rounds) 589 -> 582 ns a draw, M3 703 -> 695, both within the
rounds' spread; four threads alone 5080 538 -> 562, M3 684 -> 604, the
same. tests::recorder_shards (at 64: 67 threads where some share) pass
on the M3 (nextest), lavapipe and the 5080 (one process, one test at a
time).

(cherry picked from commit e7e0c189e7de72c9faba60df76a7e65400c5695c)
(cherry picked from commit dec97514e41c7a430d2866be0e0ace5f45b1a853)
2026-11-05 18:59:19 -08:00
Anees Iqbal 630deb9385 Count each command into a tally its encoder owns while it is open
What: the 58 counts a draw, dispatch, tile dispatch or bind adds as its
encoder records it (the 23 that were sharded by thread, draws_rebound,
stage_tables_read, stage_tables_read_in_part, draw_states_recorded,
set_zero_writes_pushed and resident_uses_* among them, and 35 that were
one shared AtomicU64 each, set_zero_sets_reused/found, no_copy_lies_read,
draw_shapes_*, graphics_pipelines_looked_up, draws_settled and the rest)
move into one struct, CommandCounters, kept in shards (shards.rs):

- by encoder: each EncoderCore takes one of 64 tallies as it opens
  (Tally::take; a process-wide bitmask, lowest free bit) and gives it
  back as it drops. Where the count is made with the core at hand
  (EncoderCore::counts, Counters::of), it adds into that tally by a
  plain load and store: no thread-local lookup and no atomic
  read-modify-write. An encoder is recorded by one thread at a time
  (EncoderCore is not Sync; under the Worker policy its lowering sits
  behind a mutex, render/deferral.rs), so the tally has one writer.
  Encoders past the 64 open at once share one more by an atomic add.
- by thread: counts made with no core at hand (a no-copy buffer's lie
  read, a pipeline lookup, a bound offset moved, the ycbcr binds, ...)
  go into the calling thread's shard (Counters::thread), as the draws'
  sharded counts did. The lowering thread takes its own shard as it starts.

The fold point is the read: Device::work_counts() sums every tally and
every thread shard, open encoders' included, so a count is whole whenever
it is read. Lanes and tests read the counts while encoders are open
(dispatch_work, dynamic_multi_variable, neutral_zeros_shared,
uniform_bind_offsets among others), so a fold at an encoder's end would
leave those reads short. A tally given back keeps its counts; its next
owner adds on top (release on give-back, acquire on take).

Why: the consumer's profile of game_draws-like frames (about 12k draws a
frame on several walk threads) spent 0.094 samples a frame in the work
counts, 0.077 of them in draws_rebound: each count took two calls on
macOS for the thread-local shard, and the shared ones were atomic adds
every walk thread contended for. Nobody read the counts in that run.
No public item changes: WorkCounts keeps its fields.

Verified, release builds of the runtime_lane game_draws lane (two object
passes of 6,001 draws each, 12,002 a frame; a measurement branch carries
the lane), ns of the encoding thread's CPU a draw, median of 5 rounds,
before (e1b342d1b9) -> after -> a floor build with every per-draw count
left out:

- RTX 5080 Laptop host (Core Ultra 9 275HX, encoding pinned to P cores
  by taskset, a sitting of its own): bytes 437 -> 423 (floor 425),
  8605 -> 8536 instructions a draw (floor 8446); chunks 532 -> 523
  (floor 517), 10900 -> 10867 (floor 10738); four threads encoding at
  once 669 -> 538, their chunks 763 -> 661; four beside 16 idle threads
  that drew once 903 -> 589 (the floor's 660, 728 and 687: the floor
  build's layout is no bound there).
- M3 Max (macOS 27.0.1, unpinned, other jobs on the host; 3 rounds
  single-threaded): bytes 416 -> 414 (floor 400), chunks 565 -> 566
  (floor 550), within the runs' spread there (another round read 462 ->
  473, floor 467); four threads 760 -> 684, their chunks 957 -> 779,
  beside 16 idle threads 1143 -> 703.
- frame_costs_plain (402 draws a frame): 5080 2.12-2.14 -> 2.11-2.23 ms
  of CPU a frame, M3 2.42-2.44 -> 2.38-2.44.
- Every count a frame of game_draws bytes, chunks and threads is equal
  before and after on the M3.

Tests, with the next two commits' changes on top: the runtime's
device tests that read a moved count (draw_again, dynamic_multi_variable,
neutral_zeros_shared, no_copy_lies, resident_uses, set_zero_at_offsets,
uniform_bind_offsets, deferred_calls, recorded_at_the_call and the rest,
with the shard tests and the new command_counts) pass on the M3 under
--cfg m2v_gpu (297 of 297) and on the 5080 (296 of 296), and the lane
modules that read one (dispatch_work, draw_work, frame_costs,
replayed_frames, provoking, line_widths and others) on the M3 (251 of
251); on lavapipe, 295 of 296 before command_counts' first precondition
was loosened. The three new tally unit tests pass on all three; under
a control where every encoder shares tally 0 all three fail (lost
additions), and under one where a read sums only given-back tallies (a
fold at the encoder's end) the two that read fail. clippy --all-targets
--all-features -D warnings on metal2vulkan-runtime is clean in the plain,
m2v_gpu and m2v_cpu_icd cfgs (Linux, the final tree; plain and m2v_gpu on
macOS too), and so is rustdoc -D warnings.

Resolved onto stack 35 (3e3eb3981f): resident_keys_settled, which stack
33 added to the draws' thread shards, joins CommandCounters and counts
into the encoder's tally at both of its draw paths (render.rs,
draw_again/rebound.rs); resident_uses_geometry_checked keeps stack 33's
walked count, now through the tally. host_alias_lookups stays the alias
table's own atomic: it counts only a lookup under that table's mutex
(host_aliases.rs augment_into), which a command whose keys are quiet
skips, so the add rides with the lock it counts. Two module docs that
still said a draw's counts went into its thread's shard now say its
encoder's tally (draw_again.rs, rebound.rs).

(cherry picked from commit 834354cb55a139b7ce01fb83ff30d7ced45742b6)
(cherry picked from commit 777714ca010d0bb476a8457596c4fc54030cd6b5)
2026-11-05 18:59:19 -08:00
Anees Iqbal b18b105cc0 Let a thread's own pass take the ready heads not behind, as the scheduler's does
A committing thread's pass (commit_and_submit) and a waiting thread's took
only the line head committed first of all (Order::take_first, and
claim_check's first_mut): any earlier commit held on any queue, its checks
waiting for a signal to land or run by the scheduler's thread, sent every
later commit to the scheduler's thread, a wake and a hop each, even a ready
one on another queue. A consumer's video round (5080, 1 s windows) showed it:
879 commits, 741 passes at commit, 358 batches submitted there, the other
~521 batches the scheduler's (batches_held_past_a_look 522, heads held for
checks 718, for check signals 129, for earlier commits 46; no event-value,
host-step or binary-semaphore holds), scheduler_wakes_host 668.

submit_plain_ready now takes its heads with Order::next and is_behind, the
scheduler pass's own selection: the first ready head in commit order that
waits behind no earlier commit keeping its place. claim_check takes the first
head in commit order whose checks the thread may run and that is behind no
earlier commit (no check before the batch it waits behind is submitted, as
check_heads keeps). A held head so holds back only the later commits that
wait behind it: its own queue's, and another queue's whose footprint runs in
commit order with it. Order::take_first and first_mut, now unused, go with
their two unit tests; the scheduler's next is tested by the rest of
tests::scheduler.

Test: commit_and_submit
a_head_held_for_its_check_holds_back_only_the_commits_behind_it holds queue
A's check on the scheduler's thread, then commits B (same buffer, behind A)
and C (another buffer) with commit_and_submit: C is checked and submitted on
the committing thread inside its call while A's check runs, B on the
scheduler's thread after A; handlers in submission order C, A, B; one batch
checked and submitted at commit. Before this change C's check ran on the
scheduler's thread after A's (expected; the run's evidence goes with the
landing report).

(cherry picked from commit ff664020a1c7fe171ff15422e17b3c846624d94c)
2026-11-05 18:59:00 -08:00
Anees Iqbal 217961dd48 Measure commit_and_submit's way to its submission in the latency lane
runtime_commit_to_submission (ignored, a measurement): a device under
RenderLoweringPolicy::Worker, checked command buffers committed with
commit_and_submit 2 ms apart, 500 of each shape in a row: a fill alone on its
queue; a fill on queue 0 right after queue 1's head was committed waiting for
a shared event that queue 2's 64 MiB fill signals, so that head's check waits
for the signal to land; and a render pass whose end the lowering thread has
not lowered at the commit. It prints commit -> return and commit ->
submission handler percentiles, which threads the handlers ran on, and what
the scheduler's work counts moved by over each shape (passes and batches at
commit, wakes, heads held for checks and landing signals, holds).

The second shape is the consumer's fallback: the at-commit pass looks only at
the head committed first of all, so another queue's head waiting for its
check sends every later commit to the scheduler's thread.

(cherry picked from commit 5667b2a735db82a8d287a6ae6ee7d02194778b54)
2026-11-05 18:59:00 -08:00
Anees Iqbal 8a516f2255 Submit a queued commit_and_submit on the thread that runs its commit
Under RenderLoweringPolicy::Worker a commit whose last render encoder's end
the lowering thread has not lowered returns at once and leaves its own work
to the thread that lowers the end (render/queued_commits.rs). That run
committed with Hand::Wake whatever the call was, so a commit_and_submit left
so lost its inline pass: the scheduler's thread was woken for it and ran its
checks and handlers.

The queued commit now keeps the call's hand (State::queued_commit is
Option<Hand>), and commit_queued makes commit_and_submit's pass on the thread
that runs it (the lowering thread, or a program thread that settles it before
a wait), with Hand::Wake on a thread command buffers' completion depends on,
as commit_and_submit does there. The pass's submission checks and handlers
then run on that thread. A render encoder opened there (by such a check or
handler) lowers its calls at their calls: one that handed them to the
lowering thread could wait for itself in reserve_end or wait_for_room.

Test: deferred_calls
a_commit_and_submit_after_an_end_in_flight_is_submitted_by_the_lowering_thread
holds the slot so the end is in flight at the commit, then checks the check
and handler ran on metal2vulkan-lowering, one pass at commit submitted and
checked the batch, and an encoder the handler opened lowers at its calls.
Without the hand kept the check runs on metal2vulkan-scheduler and
scheduler_passes_at_commit stays 0; without the guard lowers_at_call is false.

(cherry picked from commit bed9dc881cc1e6f18df708796da144a9072b9fb1)
2026-11-05 18:59:00 -08:00
Anees Iqbal 21a1cf7218 Give the commit hand-off's cost from idle too, and name commit_and_submit its inline form
docs/FAST-PATHS.md gave the scheduler thread's wake as 5 us on the RTX
5080 Laptop GPU, true for commits back to back, where the thread is
awake. From idle it is far longer: with one fill committed every 2 ms
(the completion latency lane), a commit's batch was watched 140 to 165 us
after the call at the median on that GPU, against 5 us for vkQueueSubmit,
and a parked thread's wake took 80 to 105 us at the median on that host.
The row gives both, and names CommandBuffer::commit_and_submit as the
inline form a program that needs the latency takes.

(cherry picked from commit 880ffe3b551b585a7593784165a7b4ac11bc50ec)
2026-11-05 18:58:59 -08:00
Anees Iqbal 10cb2efa05 Trace a commit's way to its submission in the latency lane
The runtime lane timed commit -> watched as one span: 140 to 165 us at
the median on the RTX 5080 against 5 us for vkQueueSubmit. The trace now
marks the steps between, in device-test builds only: the commit posted to
the scheduler's inbox, the scheduler's thread woken by it and waking, the
commit taken in by a pass, and the driver's submission called and
returned (relay.rs submit_logged, which every batch's submission goes
through). The lane commits a third shape, the completion-seen handler
alone with commit_and_submit, between the other two, and prints each
shape's commit call return and the split of its way to the watch.

A measurement change only (an ignored test and test-only trace points).

(cherry picked from commit 60905d60311824b51aaa077bd7baaa7227b095da)
2026-11-05 18:58:59 -08:00
Anees Iqbal 777ddc1285 Re-bless the authored compile census at stack 35's build
The census on the stack 35 tree (corpus-triage --audit authored-compile, 2262 cases, 47502 cells,
49326 compiles, none cached) found no failed cell, no difference and no regression: 46395 compiled,
1107 refused, 327 uncovered. 154 cells of 13 authored mesh cases moved their SPIR-V digest, every
one a case with an object or mesh function (object grids, payloads, mesh barriers, generated
partners): the object stage now carries its threadgroup's own thread count and the payload takes
the descriptor's length (SEMANTICS_VERSION 1972). No cell's outcome moved. --bless wrote those
digests and the table's artifacts_at line at this build. Slowest compile 2023 ms, peak worker RSS
232 MB.

Verified: the audit ran on the M3 (potluck m3-max-2413, then the bless m3-max-2473) with the main
checkout's private corpus; failed=0, differences=0, regressions=0.
2026-11-05 18:03:17 -08:00
Anees Iqbal 557f0e535b Re-record the conformance costs at stack 35's tree
The two mesh-object-draws-partial-threadgroup cases now run their draws where they were refused
before, so their records gain the shader modules, stage entries, render passes, runs and queue
sharing a drawn case makes. The other moved fields are the scheduler's (passes, sleeps, host wakes,
host-step head holds, spared wakes, waiter passes) and a few cases' command buffers begun and draw
states recorded. A whole-set run (`conformance cost --runs 8 --write`), then each changed case
alone (`cost --runs 8 --alone --write`), re-recorded 292 cases on the Apple M3 Max. No case gained
a first record.

Verified: both runs exited 0 on the M3 (potluck m3-max-2448). The conformance suite and
`conformance cost --check` rerun on this tree next.
2026-11-05 17:54:36 -08:00
Anees Iqbal 919012a3da Re-bless the golden hashes for the mesh object stage's partial threadgroups
The six engine fixtures with an object function (icb_mesh_template, mesh_barrier, mesh_draws,
mesh_object_grid, mesh_order, and their .air.ll twins) translate to new SPIR-V: an object
function's dispatch now carries its threadgroup's own thread count, so a partial object threadgroup
runs as Metal runs it. No other fixture's digest moved.

Verified: bless_golden_hashes on stack 35's tree (potluck m3-max-2399) moved only these 12 rows,
and golden_hashes_match_the_table passed after it.
2026-11-05 17:23:25 -08:00
Anees Iqbal 3e3eb3981f Bump RUNTIME_VERSION to 1774: completion-seen handlers where seen, mesh pipeline limits
A command buffer's completion-seen handlers run where its completion is seen, even beside completed
handlers. Mesh render pipelines take Metal's descriptor limits, answer its state queries, refuse
what Metal refuses with typed problems, and run a partial object threadgroup. Both change what the
runtime does for the same calls, so warm records made before them are not reused. The runtime
sources' pin is recomputed at this tree.

Verified: the pin is pin-compute.py's at this tree; the stack 35 gate runs next.
2026-11-05 17:15:12 -08:00
Anees Iqbal 7d813def6f Regenerate the derived tables at stack 35's picks
The private-doc-link mend shortened the degradations! macro's note link and a refusal's doc link
to in-scope paths, which moves the macro's template in api_signatures.tsv and one row of
docs/REFUSALS.md; no item's signature changed for a consumer. The mesh change runs a partial object
threadgroup, so the two mesh-object-draws-partial-threadgroup cases leave the conformance ledger
(1378 rows to 1376) in docs/CONFORMANCE-COVERAGE.md, whose conflict the pick resolved to the
earlier text.

Verified: signatures.py --check, refusal_surface.py --check and conformance-coverage --check pass
on this tree; metal-coverage is current.
2026-11-05 17:14:20 -08:00
Anees Iqbal 11ed058377 Expect an emulating device's Metal3 payload row to follow its workgroup memory
mesh_rows_follow_how_the_device_runs_mesh_stages asserted the mesh payload row exact on every
profile that runs mesh stages as compute work; the M3 run (m3-max-2232) failed it on
roadmap-2022, whose 16384 bytes of compute workgroup memory cannot hold Metal3's 16384 payload
bytes beside the object wrapper's 12. The row's refusal there, naming
maxComputeSharedMemorySize, is right; the test now expects it wherever the memory falls short
and the exact row elsewhere.

(cherry picked from commit 00580a43e543ef12d75b0c25210ba7f327e020d2)
2026-11-05 17:12:38 -08:00
Anees Iqbal 00b1974975 Answer a mesh state's grid limit as Metal does whatever the object function's attribute
The probe's new cases on the M3 Max (macOS 27.0.1, plain and with MTL_DEBUG_LAYER=1) show
that an object function's [[max_total_threadgroups_per_mesh_grid(4)]] changes nothing Metal
answers: maxTotalThreadgroupsPerMeshGrid is 1048576 without a descriptor maximum, and the
descriptor's 8 or 2 with one, above the attribute too. So the grid limit is the descriptor's
maximum, else 2^20, and the kernel fact that carried the attribute
(KernelFacts::max_mesh_threadgroups) goes, with its codec field. ARTIFACT_FORMAT_VERSION 489
and SEMANTICS_VERSION 1972 for the changed artifact and answers.

The same run confirms the rest of the rules the previous commit refuses and answers: a mesh
function's [[max_total_threads_per_threadgroup(64)]] beside a descriptor mesh maximum of 32 or
128 is code 3 ("Kernel specified ... must match ..."), as the object stage's is, and of 64 is
made; a required mesh size of 32 beside the mesh function's 64 alone is made, answering 64; a
required size equal to its stage's maximum is made. The probe's header now records every case's
answer. engine_mesh's tests follow: the object function's 16 threadgroups change no grid, and a
required mesh size beside the function's own maximum alone is made.

(cherry picked from commit b3be29725befbd7bfcdfdfb23b3a7a4207a527c2)
2026-11-05 17:12:38 -08:00
Anees Iqbal 4872534486 Judge Metal3's mesh rows by how the device runs mesh stages
The mesh shading, indirect mesh draw arguments and ICB mesh draw rows asked meshShader and
taskShader of every device, so a device that runs both stages as compute work (MoltenVK, ANV on
the Iris Xe) was refused for features it never uses. They now ask them only where the device
runs the stages natively (DeviceProfile::emulates_mesh_shading). On an emulating device the
mesh grid, object grid and payload limit rows answer by the compute stage's limits.

The rows stay refused on every device: a drawMeshThreads partial object threadgroup of an object
function that waits at a threadgroup barrier is not built (NotImplemented(MeshShading)), so
Metal3 stays false; the MeshShading row's doc says so and what each kind of device needs before
it.

Test: mesh_rows_follow_how_the_device_runs_mesh_stages over every committed profile, printing
each profile's Metal3 blockers. Not yet built.

(cherry picked from commit 4ec3136921d7d06e129944eb8f183b4f043e0a1f)
2026-11-05 17:12:37 -08:00
Anees Iqbal c305c66a7f Give mesh pipelines Metal's descriptor limits, state queries and refusals
The mesh descriptor gains Metal's fields, with Metal's defaults:
max_total_threads_per_{object,mesh}_threadgroup, max_total_threadgroups_per_mesh_grid,
the two threadgroup-size-is-multiple-of-width flags, payload_memory_length,
max_vertex_amplification_count (1) and required_threads_per_{object,mesh}_threadgroup. The
descriptor key reads every one.

A compiled mesh pipeline carries MeshPipelineMetalInfo (RenderPipeline::mesh_info), and the
runtime's RenderPipelineState answers Metal's five mesh queries from it, plus the two required
sizes. Each thread limit is the descriptor's maximum, else the function's
[[max_total_threads_per_threadgroup(n)]], else 1024, held to the device's own limit where that is
lower: the task and mesh stages' invocations with VK_EXT_mesh_shader, the compute stage's where
both stages run as compute work. The widths are 32. The grid limit is the descriptor's, else the
object function's [[max_total_threadgroups_per_mesh_grid(n)]], else 2^20, held to
maxMeshWorkGroupTotalCount where mesh functions run natively. Without an object function the
object stage answers 0 and 0, where the M3 Max answers 3 and 32 (an accepted difference).
DeviceProfile::emulates_mesh_shading says how a device runs the stages, so a consumer no longer
copies the compile layer's rule; with the getters, no separate per-stage query is needed.

What Metal refuses is refused as Metal's rule, DescriptorError::MeshPipeline with a
MeshPipelineProblem, measured on the M3 Max (mesh_pipeline_limits.m, plain and under
MTL_DEBUG_LAYER): a required size with an axis of 0, past 1024 threads or past its stage's
maximum, or for an object stage without an object function (process ends); a maximum past 1024,
a function maximum other than the descriptor's, a mesh stage's required size of other threads
than its maximum, and a payload past 16384 bytes (creation errors, codes 3 and 2). An
amplification count of 0 is VertexAmplificationCount, as a render pipeline's; one above 1, which
Metal makes, is NotImplemented(VertexAmplification), recorded in FAST-PATHS' known gaps.

payloadMemoryLength widens the object and mesh functions' payload arena past the declared type
(LoweringInputs::object_payload now reaches the object stage too); an object stage compiled on
its own without it is NeedsInput(ObjectPayload). SEMANTICS_VERSION 1971 and
ARTIFACT_FORMAT_VERSION 488 for that and the new artifact field; the runtime's warm record
format 4 for the descriptor's fields.

Docs: the new_mesh_render_pipeline_state doc now says how each device runs mesh stages, and
what it refuses; API.md's accepted differences gain the mesh pipeline rows. api_signatures
blessed (it also records RuntimeFact::PartialObjectThreadgroups from the partial-threadgroup
commit), api_surface lists MeshPipelineMetalInfo and MeshPipelineProblem, REFUSALS.md,
METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated.

Tests: engine_mesh's a_mesh_pipeline_answers_metals_mesh_queries_within_the_device and
a_mesh_descriptor_metal_refuses_is_refused_as_its_rule over every committed mesh and
emulating profile; the validation lane's
a_mesh_state_answers_metals_queries_and_refuses_what_metal_refuses on a device. Not yet built:
the next steps are the M3, lavapipe and RTX 5080 runs.

(cherry picked from commit d6934967fad363ca2185c49935204141f253b416)
2026-11-05 17:12:37 -08:00
Anees Iqbal a3990476a0 Probe a mesh function's own thread maximum and an object function's grid maximum
Adds cases to the mesh pipeline limits probe: a mesh function of
[[max_total_threads_per_threadgroup(64)]] beside descriptor maxima of 32, 64 and 128 and a
required size of 32; an object function of [[max_total_threadgroups_per_mesh_grid(4)]] with
and without a descriptor grid maximum; and a required size equal to its stage's maximum. The
functions of the new attributes compile apart, so a refusal of theirs leaves the other cases.

Not yet run; the results go into the header with the next probe commit.

(cherry picked from commit b27179d7a36fd9c841f95dcff7d195365a6566a1)
2026-11-05 17:12:37 -08:00
Anees Iqbal 427fc82943 Add a Metal probe of a mesh render pipeline's limits and queries
What: probes/mesh_pipeline_limits.m makes one mesh render pipeline a
process with a descriptor's thread maxima, mesh-grid maximum, payload
length, vertex amplification count or required threadgroup sizes, and
prints Metal's error or the made state's eight queries.
Why: the mesh descriptor's new fields follow Metal's creation rules and
the state's queries answer as Metal's; this measures them on the M3.
Verified: run on the M3 Max in the commits that use its answers.

(cherry picked from commit 4296206a64bc7502ec045c50980a68310ef0660b)
2026-11-05 17:12:37 -08:00
Anees Iqbal 00cf6f5f33 Give the binder's mesh test template its partial_groups field
What: the bind::graphics tests' mesh_template sets MeshTemplate's new
partial_groups field (false), which the previous commit added.
Why: the lib test target did not compile without it.
Verified: the potluck clippy and test run that follows.

(cherry picked from commit 44b6ece8ac97963372952413978c196707588bfb)
2026-11-05 17:12:37 -08:00
Anees Iqbal ead2c31249 Run a partial object threadgroup of drawMeshThreads as Metal does
What: a drawMeshThreads with an object function whose threads leave a
partial object threadgroup now draws instead of failing with
NotImplemented(MeshShading). The binder launches the object threadgroups
the threads fill, rounded up, at their whole size, under MultiRegion 1,
with Metal's threads in region[1].xyz and the new flag
lower::dispatch::NONUNIFORM in region[1].w (a folded variant's record
carries it in word 7). An object function whose body holds no workgroup
barrier (lower::mesh::plan_partial_groups, RuntimeFact::
PartialObjectThreadgroups) reads the flag: its threadgroup answers
min(L, threads - group * L) per axis as threads_per_threadgroup and in
its simdgroup counts, its thread position is lin unflattened over that
size, and its invocations past it return before the body. The emulated
wrapper's payload copy strides by the dispatched threads so those
invocations still copy. A body that holds a barrier keeps the uniform
form and its partial draws stay NotImplemented(MeshShading), since the
returned invocations would not reach the barrier (FAST-PATHS known gap).

Why: Metal (M3 Max, macOS 27.0.1) draws these: 6 threads in object
threadgroups of 4 run a threadgroup of 4 and one of 2 whose
threads_per_threadgroup is 2, as dispatchThreads runs a kernel.

Tests: lower::dispatch's partial_object_threadgroups_match_metal (each
Metal thread live once with Metal's builtins, Spec and Flat forms);
the binder's object_draws_specialize_each_stage_within_its_limits (the
flagged region, MultiRegion 1, refused without the fact); engine_mesh's
emulated and native partial draws and
a_partial_object_threadgroup_of_a_body_with_a_barrier_is_not_implemented;
the lane test object_draws_store_metals_words now requires Metal's words
for both Threads rows; the conformance ledger's two partial rows are
removed. SEMANTICS_VERSION 1970. Verification in the following commits'
potluck runs.

(cherry picked from commit 1707d3428bcd641faba462d4c35b13148df83a91)
2026-11-05 17:12:36 -08:00
Anees Iqbal ee8cd191b0 Arm the latency lane's armed waiter ahead of its submission, and count late arms
The raw lane's armed variant asked its waiter thread to wait just before
the submission, so on the RTX 5080, whose 4 KiB fill ends 16 to 35 us
after vkQueueSubmit, the waiter's own wake (80 to 100 us at the median on
that host) often came after the GPU end: in one of the two rounds its
wait entered 55 us after the GPU end at the median, which is the woken
variant's shape, not the armed floor. It now asks a millisecond ahead.

Each raw and runtime line now also counts the waits entered after the
GPU end, where the time to the wait's return holds the waiting thread's
wake and not only the driver's.

A measurement change only (an ignored test).

(cherry picked from commit 782b3e90151195baaf69a2533204dca67c644de2)
2026-11-05 17:12:28 -08:00
Anees Iqbal 5878ad9847 Build the completion trace only with the device tests that read it
The trace of the queue waiters' steps was compiled into every test build,
but only the completion latency lane reads it, and that lane is a device
test (m2v_gpu, m2v_cpu_icd). In a plain test build its fields and its
start and stop went unread, which clippy -D warnings refuses. The module
and its hooks now take the lane's cfg.

Verified: clippy --all-targets --all-features -D warnings in the plain
configuration on the M3 (it failed with six dead-code errors before).

(cherry picked from commit 7bfc5f56e37ead4fd8aadeb6721e63f65047d4ce)
2026-11-05 17:12:27 -08:00
Anees Iqbal 60622e6b51 Hold completion_here to the completion-seen handlers' new thread
With a completed handler besides, a command buffer's completion-seen handler
now runs where its completion is seen (at least once of the rounds, as
without one: an earlier transition may hold the context), still before the
completed handler, which runs on the queue's handler thread.

(cherry picked from commit 75d71b2edb211e1b8ac6ee082f3b0c3f7be968f8)
2026-11-05 17:12:27 -08:00
Anees Iqbal 1f2b0f2d39 Run a command buffer's completion-seen handlers where seen even with completed handlers
A command buffer with completed handlers ran its whole transition to
Completed on its queue's handler thread, its completion-seen handlers
included, so they started a thread wake after the queue waiter's turn: the
consumer's handler_cost bench (a completion-seen and a completed handler on
each 4 KiB fill) put that wake into the completion-seen latency. On an idle
M3 Max (MoltenVK 1.4.2) the turn-to-handler time was 22 us at the median
with a completed handler against 1 us without.

Now the waiter runs such a transition to its completion-seen handlers
(To::Seen: its status final, those handlers run) where its queue's context
is idle, and posts the rest (To::Rest: follow release, completed handlers,
slot, releases, gate) to that context while it still runs it, so the queue's
later items stay behind the rest. The rest holds its own Hold, so the gate,
and wait_until_completed, open only after the completed handlers and once
the context is done with the rest (the order a10704b730 set). A command
buffer with a Follow (it signals at its end an event another queue's
command buffer may wait for) keeps the whole transition on the handler
thread, so the cross-queue order (follow.rs) is untouched. Where the waiter
cannot run it here (the line busy, a deallocator held), the transition goes
whole, as before (Item::whole).

complete() is split into complete_seen() and complete_rest(), unchanged in
order. Docs: add_completion_seen_handler, completion.rs, the runtime README
and RUNTIME-PORTING.

Not yet run on a device.

(cherry picked from commit e1f36ec2f08735c92872a3d5eed8689b398373ce)
2026-11-05 17:12:27 -08:00
Anees Iqbal 582d3ba040 Test the orders a command buffer's two handler kinds run in
Each command buffer with a completion-seen handler and a completed handler:
its status reads Completed in its completion-seen handler, which returns
before its completed handler starts, and its wait returns after that one
returned; on one queue, an earlier command buffer's completed handler
returned before a later one's completion-seen handler starts; and a command
buffer that waited on the GPU for another queue's end-of-command-buffer
event signal runs its completion-seen handler after the signaller's, the
signaller reading Completed there. Also that at least one completion-seen
handler of such a command buffer ran where its completion was seen
(WorkCounts::completion_seen_handlers_where_seen), which fails today: with a
completed handler, the whole transition goes to the handler thread.

Not yet run.

(cherry picked from commit a79dd6cbbb438c8e57171f55c3b500fff39337fd)
2026-11-05 17:12:26 -08:00
Anees Iqbal 9420639401 Interleave the two handler shapes in the runtime lane
A host's wake costs move with its load (an M3 Max's turn-to-handler time fell
from 22 us idle to 2 us beside another build), so the shapes alternate
command buffer by command buffer and meet the same host.

(cherry picked from commit dc32082f78a064637e22df508218dc92d79d3faf)
2026-11-05 17:12:26 -08:00
Anees Iqbal fbea282fd7 Time the runtime's completion with and without a completed handler
A command buffer with a completed handler runs its whole transition, its
completion-seen handlers included, on its queue's handler thread, a thread
wake after the waiter's turn; one with completion-seen handlers alone runs
it on the waiter. The lane times both shapes, and splits the turn over the
turns that marked both ends of each step.

(cherry picked from commit 90394fe9832bd1588b25831a4560a8659280975c)
2026-11-05 17:12:26 -08:00
Anees Iqbal 74768ebea1 Split the turn by each step's first mark after it
A turn of batches that end no command buffer can follow a command buffer's
turn before the next one's, so its steps are not all the command buffer's own:
take the first mark of each name after the turn.

(cherry picked from commit 68b114b10312e843b96d7b1cb6c5c86b166baab9)
2026-11-05 17:12:25 -08:00
Anees Iqbal 02ca2a2c20 Trace the completion turn's steps in the latency lane
finish() marks, in test builds only, where its events were reached, its fences
settled and its GPU times placed, so the lane splits the time from the turn
to the completion-seen handler.

(cherry picked from commit 66ecc26c9ce04f92e7747c8f873e04fcbca18641)
2026-11-05 17:12:25 -08:00
Anees Iqbal 587d155705 Measure the plain driver's untimed fence wait too, and every wait from its submission
On MoltenVK the runtime's command buffers write no timestamps (GPU times from
the host) and a timestamp costs a pass of its own, so the plain driver's fill
with no timestamps, waited for at its fence and timed from vkQueueSubmit, is
the floor the runtime's commit-to-seen time compares with there.

(cherry picked from commit 9bc2b4cdaaf7553bb358414735aec945ee760978)
2026-11-05 17:12:25 -08:00
Anees Iqbal 1f0a6dc285 Measure the completion latency: the plain driver's floor and the runtime's steps
A measurement lane (ignored by default): RUNS fills of 4 KiB submitted 2 ms
apart, timed from the GPU's calibrated end to each wait's return, on a plain
Vulkan device of the test's own (timeline, fence, sync_fd, a waiter armed
before the submission, one woken after it, a spin on the counter), and on the
runtime: GPU end to the completion-seen handler, with the queue waiter's steps
between from a test-only trace (watch, the driver's wait entered and
returned, the turn's seen time).

Not yet run.

(cherry picked from commit 2466895c03e6923172d6c549ff362550eb5299b5)
2026-11-05 17:12:25 -08:00
Anees Iqbal 8e65408e85 Resolve the runtime's broken private intra-doc links, and lower its ceiling to 0
CI's private intra-doc link step reported 148 for metal2vulkan-runtime on
macOS and 149 on Linux at 3b176b8bd4, against a ceiling of 70, so the step
was red on both runners:

- 119 links whose explicit target is the item their label already
  resolves to (`redundant_explicit_links`): 73 from the `degradations!`
  macro, one per precision-note kind's `PrecisionNote::<note>` link, and
  46 written by hand. The target is dropped; the rendered link is the same.
- 17 links to `RenderCommandEncoder::<method>` for methods that are the
  lowering's (`RenderLowering`) since the program's encoder was put in
  front of it: assemble, begin_current_draws, begin_inline_split,
  finish_replay, flush_inline, gathering, group_turn, inline_begin (2),
  inline_split, plan_one, replaying, settle_draw, settle_draws,
  snapshot_fallback, snapshot_wanted and watched. Each links
  `RenderLowering::<method>`.
- render.rs: `check_tile` (a `ShapeInputs` method) linked
  `Self::kept_imageblock_bytes`, and `kept_imageblock_bytes` (a
  `RenderLowering` method) linked `Self::pass_sample_length`; each links
  the other type's method by its type. The `plain_drawn` field linked its
  sibling field `replay_plain` by its bare name; it links `Self::replay_plain`.
- scheduler: `Order::behind` is `Order::is_behind`.
- event_timeline.rs: `Signal::after` is the `after` field of the
  `Signal::Kept` variant.
- pipeline/libraries.rs: `GraphicsContent` is linked by its path in the
  sibling module (`super::graphics`).
- Items built for tests alone are named without a link, as the translator's
  `DIRECT_ARGUMENTS_FROM_AIR` is: `Allocations::limit_to`,
  `patched_slot_uses` and `state_locks`.
- exit_guard.rs: the module docs describe both exits, but `end_at_once`
  and `AT_ONCE_NOTICE` are built on Linux with the GNU C library alone and
  `BOUND` and `MAKING_BOUND` everywhere else, so each runner failed on the
  other's; the four are named without a link.

Docs only; no behaviour changes, so no version moves. The runtime-sources
pin moves with these files; the stack re-pins it.

Verified (potluck): the counts before are from `RUSTDOCFLAGS=-Dwarnings
cargo doc -p metal2vulkan-runtime --all-features --no-deps
--document-private-items` on the M3 (macOS 27) and msi-laptop (Linux).

(cherry picked from commit b4d88f87c6d6fa4c1dfc3fa9774b2fc540c6b297)
2026-11-05 17:12:18 -08:00
Anees Iqbal 4515a9ab3b Resolve the AIR crate's last private intra-doc links, and lower its ceiling to 0
CI's private intra-doc link step reported 3 for metal2vulkan-air at
3b176b8bd4 (macOS and Linux alike), against a ceiling of 3:

- abi/keys.rs: `Key::parse` linked `KEYS`, the spelling table its test
  holds the matches against, which is built for tests alone; it is named
  without a link.
- abi/core_image.rs and abi/visible.rs: two `AbiError` links carried an
  explicit target the label already resolves to; the target is dropped.

Docs only; no behaviour changes, so no version moves.

Verified (potluck, M3 and msi-laptop): `RUSTDOCFLAGS=-Dwarnings cargo doc
-p metal2vulkan-air --all-features --no-deps --document-private-items`
reported 3 before; the count after this commit is in the next job's log.

(cherry picked from commit dde8a1cd07867b6fa9f71ac6c9cf8a7442f85b11)
2026-11-05 17:11:57 -08:00
Anees Iqbal b10227d09f Re-bless the authored compile census at stack 34's build
The census on the stack 34 tree (corpus-triage --audit authored-compile, 2262 cases, 47502 cells,
49326 compiles, none cached) found no failed cell, no difference and no regression: 46395 compiled,
1107 refused, 327 uncovered. --bless wrote the table's artifacts_at line at this build, whose
product fingerprint moved; no cell's outcome or SPIR-V digest moved. Slowest compile 1600 ms, peak
worker RSS 232 MB.

Verified: the audit ran on the M3 (potluck m3-max-2161, then the bless m3-max-2377) with the main
checkout's private corpus; failed=0, differences=0, regressions=0.
2026-11-05 17:02:07 -08:00
Anees Iqbal d3b40aa488 Re-record the conformance costs at stack 34's tree
The moved fields are mostly the scheduler's: its passes, sleeps and host wakes, host-step head
holds, spared wakes, waiter passes and sleep slices, with a few cases' command buffers begun,
primaries begun ahead, pipelines looked up and draw states recorded. A completion pool that keeps
its hold until a command buffer's completion lines are done, and textures over IOSurface planes
taking more shapes, change when the scheduler runs a pass and what a few cases begin and record.
A whole-set run (`conformance cost --runs 8 --write`), then each changed case alone (`cost --runs 8
--alone --write`), re-recorded 378 of the cases on the Apple M3 Max. No case gained a first
record.

Verified: both runs exited 0 on the M3 (potluck m3-max-2343). The conformance suite and
`conformance cost --check` rerun on this tree next.
2026-11-05 16:54:23 -08:00