The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: dma_buf/parked.rs's release enters a section of the exit guard around each parked image's
vkDestroyImage (its shared.vk() included), leaving the image to the process's end while it exits,
as DmaBufPages's drop leaves the import. FixedPages releases its parked images inside its own
section and before its memory is freed or recycled (and before the free on a lost generation),
as the parked.rs docs say. The exported parking test now has the residency thread's own pass
release the parked images (import tax forced Holds), not the test thread's sweep.
Why: on the 780M, tests::exported_textures::an_nv12_picture_s_planes_over_exported_memory_go_in_place_naming_its_handle_type
ended in SIGABRT in parallel runs (m3-max-38587, and run 2 of 3 in m3-max-38611):
"metal2vulkan: the runtime's thread metal2vulkan-residency reached the device outside an
exit-guard section". The residency thread's pass (release_idle_parked) calls parked::release,
whose shared.vk() was read outside any section; a test build ends the process there
(exit_guard::check). Since exported images park (RUNTIME 2505), RADV's residency releases them
at its next pass, so the path runs on the thread in most tests over exported memory; the
host-page parked images took the same path before.
Verified: the 780M (m3-max-38630): the parallel 7-test set (exported_textures and
dma_buf_parked_images) 3 times, 7/7 each, no abort (before: 2 of 4 parallel runs aborted,
m3-max-38587 and m3-max-38611). msi: clippy --cfg m2v_gpu and the archive (m3-max-38621);
plain and --cfg m2v_cpu_icd clippy, lavapipe 20/20 (m3-max-38622).
What: many_passes_over no longer settles the device's in-place check before a target over host
pages, nor prints its verdicts; the expected form still follows the verdicts (merges_on_host).
Why: the lane's devices take the exact answers (HostPageTexturePolicy::Shadow, in_place_textures.rs
in_place), under which no check runs, settle_in_place_checks answers false at once and every verdict
stays pending: the settle's assertion failed both legs in 0.1 s on the XTX (m3-max-38616 at
00142dfb2c). So the cause the commit before named was not a check still running when the passes
began but none at all: under these policies every shadow over host pages merges on the host
(shadow_splice::splices takes a pending verdict) and joins no run of passes, on every device, and
the passes keep for themselves, as merges_on_host reads from the pending verdicts.
Verified: the tip's XTX run, in the lane report.
What: many_passes_over settles the device's in-place check before a target over host pages, and
expects the shadow's passes to keep twice as one run only where its merges stay the GPU's; where
the settled check of host pages (Pointer) failed or did not answer a copy's or a shader write's
texels in lines beside other bytes (shadow_splice::splices), each pass keeps every texel for
itself. Where those passed but another class failed its copies and passed its reads, either form
is accepted, as the report states no memory flags (in_place::copies_verdict). A copied buffer's
merges stay the GPU's. The verdicts read are printed.
Why: since RUNTIME 2432 (518d6d8443) such a texture joins no run of passes (render.rs, the join's
!merges_on_host), as pass_runs.rs and shadow_splice.rs say; the runtime crate's copy of this test
(tests/merge_scratch.rs) took that branch and settles the check first in RUNTIME 2433. This copy,
with a fresh shader cache and no settle, ran its passes while the XTX's check was pending or
failed: m3-max-38545 (ea202ab28f) kept 706 times every texel (54220800 and 50832000) against the
two of one run. Unsettled, a check that answers midway could also split the passes between the
two forms.
Verified: the fix tip's XTX run, in the lane report.
What: command_buffers_one_after_another_are_each_timed_on_their_own commits one untimed fill of
its new private buffer, and waits for it, before the counted window, so the eight timed fills
carry no first work.
Why: since RUNTIME 2466 (35ac917d6f) a timed command buffer whose first batch carries first work
(here the new buffer's zeros) writes its start in that work's command buffer, before the work
(command_buffer/submit.rs, GPU times), not in its first encoder's prefix, so it is no prefixed
start. The XTX lane (m3-max-38545, ea202ab28f) counted (7, 0, 0) prefixed, kept and reused
against (8, 0, 0), command buffer 0's GPU span 12.0 us against 3.6 to 5.4 us for the others.
The product does what its docs say; the test's claim missed the first work. The start of a batch
with first work is start_stamp.rs's test.
Verified: the fix tip's XTX run, in the lane report.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
A batch's first work of Managed uploads alone ended with a barrier
TRANSFER/TRANSFER_WRITE -> ALL_COMMANDS/MEMORY_READ|MEMORY_WRITE. On a
device that orders its batches by their ends, where the first work
already takes no leading barrier (first_move::Earlier::Ended), its
second scope is now the union of the stages and access types the
batch's encoders' uses of those buffers name (first_move::Later::Batch,
from the parts' tracker summaries). Every later batch on the VkQueue is
ordered by the batch's end, Barrier::to_all, whose first scope includes
all earlier commands at ALL_COMMANDS/MEMORY_WRITE (the uploads among
them) and whose second includes every later command; another VkQueue's
command buffers wait for the batch's signal, whose first access scope
includes all memory access performed by the device. The barrier keeps
ALL_COMMANDS under the exact batch order, and wherever the batch's use
is unknown: a command may reach memory no use names, a heap's set is
bound, the work may write through its residency, an upload names no
key, or the batch's uses name none of a buffer.
Probe (64 B inline, GPU p50; probe-only branches, never landed): the
global barrier narrowed to COMPUTE_SHADER/SHADER_READ|SHADER_WRITE took
the RTX 2080 from 23.85 to 18.25 us (none 12.4) and the RTX 3090 from
32.25 to 25.05 us (none 21.8); a buffer-range barrier measured the same;
on the RX 7900 XTX the trailing barrier costs nothing (9.7 us either
way).
New counter WorkCounts::managed_upload_barriers_narrowed; device tests:
the WAR test counts it, a later batch reads the upload at a stage the
upload's batch never used, and the barrier's scope names both stages of
a batch whose kernel and blit both use the buffer (a test-only record of
the scopes).
The second commit (263b155a4a) prints vk flags as raw words; Later derives no Debug.
Verified: m3-max-38590 (m2v_gpu and release archives, clippy --cfg m2v_gpu) and m3-max-38591
(clippy plain and --cfg m2v_cpu_icd, rustdoc -D warnings) clean; device tests managed_inline,
host_ram_managed and managed_copy_device 49/49 on the RX 7900 XTX (m3-max-38597) and the RTX
2080 (m3-max-38600): the WAR test counts the barrier narrowed (0 under the exact order and in
its negative control), the later-batch test reads the upload at TRANSFER, and the scope test
finds COMPUTE_SHADER|TRANSFER and SHADER_READ|TRANSFER_READ. The base-vs-tip benches on the
2080 (m3-max-38610) and 3090 (m3-max-38612) follow the merge.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: a texture over a buffer of the runtime's memory exported as a dma-buf, or in a block of its
buffers allocated exportable as one (Holds::FdDmaBufs), where no image binds in that memory
itself, takes a DRM_FORMAT_MOD_LINEAR image bound to a dedicated import of the memory's own
dma-buf. That image now parks as its texture goes, under the buffer's pages (FixedPages), and the
next texture over the same buffer of the same plan at the same texels and pitches takes it: no
vkGetMemoryFdKHR, no import, no VkImage made. The parking machinery of dma_buf/parked.rs is
shared: ParkSpot and the residency note a ParkHolder (HostImport or FixedPages) instead of a
HostImport, so the same bound (PARKED_MOST), windows and release passes apply, and the same
refusals (a handed-out VkImage, the device's check's textures, a detached image). Parked images
go with the buffer's pages, before their memory is freed or recycled, and on a lost generation.
New WorkCounts: exported_dma_buf_images_parked, exported_dma_buf_images_taken,
exported_dma_buf_images_parked_released (api_signatures.tsv blessed). HostImport::device, used
only by the residency's parked ages, is gone: the device comes from the parked images.
Why: a consumer's 780M walk (RADV) made and freed two such textures each frame over its surface
caches: 120 dma_buf_import_calls a second at ~333 us each (~40 ms of CPU a second), with
exported_dma_buf_images +120/s and nothing parked or taken, as this route never parked.
The second commit (622807d05b) reuses Buffer::fixed_pages (now pub(super)) and coerces each
ParkSpot holder's Weak through a binding of its concrete type.
Verified (msi): runtime clippy, all targets and features, plain and under --cfg m2v_cpu_icd
(m3-max-38572) and --cfg m2v_gpu (m3-max-38573) clean; rustdoc and the signatures check clean
(m3-max-38576); on lavapipe (m3-max-38572) exported_textures, dma_buf_parked_images,
dma_buf_shared_files and dma_buf_pieces 20/20, the host-page parking through the new holder
included. The new test a_texture_over_a_dma_buf_block_takes_the_image_the_last_one_parked is
not reached on lavapipe (its images bind in the memory itself); its 780M run and the release
bench exported_park_bench follow the merge (m3-max-38587).
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: copy_texture_from_host_ram / copy_texture_to_host_ram staged through the CPU (first touch,
a chunk that takes no import) recorded the GPU's copy between the arena and the texture as one
region at the surface's pitch, bufferRowLength = pitch / texel bytes, for any region of more than
one row. A pitch past 2^31 - 1 bytes (and up to texel x (2^32 - 1)) so recorded a
vkCmdCopyBufferToImage / vkCmdCopyImageToBuffer region breaking
VUID-vkCmdCopyBufferToImage-bufferRowLength-09108 and
VUID-vkCmdCopyImageToBuffer-bufferRowLength-09108 (bufferRowLength times the texel block size at
most 2^31 - 1); a wider pitch was refused (Problem::HostRam) where the texels overflowed a u32.
The copy straight on the imports already joined no rows past that pitch.
How: one rule, `joining_pitch` (more than one row, a pitch of at most 2^31 - 1 bytes), now used by
both paths; the staged path builds its regions with `staged_regions`: the one region of all the
rows where they join, else one region per row at the row's byte of the arena's region
(bufferRowLength 0, one row high). The same bytes either way; the arena's region is unchanged
(the whole span, which a device that cannot make a buffer that long refuses at the host step,
failing the command buffer, as before).
Verified: m3-max-38558 (msi): runtime clippy (all targets, all features) and rustdoc
clean; tests::host_ram_texture_rows 3/3 with the new
a_staged_copy_s_rows_past_a_pitch_of_2_31_minus_1_bytes_are_a_region_each, which fails with the
pre-fix rule restored in the same job (1 region, not 3). m3-max-38559 (lavapipe): runtime clippy
under --cfg m2v_cpu_icd clean; tests::host_ram* 94/94.
a_command_buffer_naming_host_pages_is_submitted_at_its_commit asserted that no commit was left
for slow calls. On a loaded host lavapipe's vkQueueSubmit calls can stay past the bound for a
stretch of the queue's last calls, so RUNTIME 2496's rule rightly leaves those commits to the
scheduler's thread: the pin round's lavapipe leg (m3-max-38535, um790 under load) left 5 of 200
plain-leg commits so, with 195 at commit and the final call floor 2.3 us. The test's claims stay:
no commit left for a host step, no host step recorded, the host pages' encoders keep their logs,
and at least half the batches go at commit. The slow-call leave is counted and printed;
a_queue_whose_calls_are_slow_leaves_its_batches_to_the_scheduler_s_thread proves that path.
With the check standing by for the device's work (RUNTIME 2501), the type 9 hang scenarios no
longer wait for its answer before they begin (ac9cad48bf): the check runs from the device's making
on a fresh scratch cache, beside the scenarios, as it does beside a program's first work. Once
they ended the test waits for its answer and prints it with WorkCounts::device_checks (its
stand-bys). For the NVIDIA run that shows the other queue's Scheduled latency with the check
beside it.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: a command buffer's transition to Completed that waited on the GPU for another queue's
command buffer X now waits for X's transition to reach its completed handlers wherever nothing
before X's transition in X's queue's context may block: no item there, nor what a thread runs
there, runs a scheduled or completed handler of the program's or waits for a submission handler
(Run::may_block; completion-seen handlers never block). Before, it waited only where X's
transition was first in its context or already running, so behind an earlier command buffer's
handler-free transition still queued, or run by a thread the host kept off the CPU, it went on
and the program's completed handler of the waiter could read X short of Completed. Behind an item
that may block it still goes on, as Metal's does
(a_blocked_handler_of_the_signaller_s_queue_holds_back_the_signaller_and_not_the_waiter).
How: each item posted to a context takes a place (a counter over all lines); a line keeps the
places of its items that may block and whether what a thread runs of it may. Follow keeps its
transition's place (an AtomicU64 store where it kept an AtomicBool) in place of the command
buffer's address, so Lines::leads is one look at the line's first item and first place that may
block: no walk of the line (the old lead check walked it where a thread ran the line), no new
lock. Cost: a u64 per queued item, a u64 per queued item that may block, a deque push and pop for
those. Item::finishes, which only the walk used, is gone.
The validation test a_shared_event_wait_for_a_kept_group_s_signal_ends_at_the_next_completion_turn
now checks what the program can rely on: X reads Completed in Y's completed handler, and Y's GPU
work began after X's ended where the device's own timestamps place both. It no longer compares
the two completed handlers' start instants, which Metal does not order either (an M3 Max under
macOS 27.0.1 started the waiter's first in up to 6% of rounds with a plain event, 0.1% with a
shared one).
The contexts tests name items by their places, so Ends carries no name (353257e382).
Verified on lavapipe (msi, m3-max-38523): clippy (cpu_icd, runtime and
validation, all targets and features) clean; runtime tests 63/63
(tests::contexts with the new an_item_leads_its_line_behind_what_may_not_block,
the three completion_order follow tests, unshared_hold, queue_turns,
submission_turns, scheduler_held_wakes); validation grouped_submissions 16/16.
A scratch diagnostic of the same shape, 5 rounds under each of Fair and
CommitOrder: X read Completed in Y's handler in 10 of 10 (before the fix,
m3-max-38464: X still Scheduled in 2 of 10). m3-max-38524: workspace clippy
(all targets, all features), clippy with --cfg m2v_gpu, workspace rustdoc
with -D warnings: all clean.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
A batch whose first work is only Managed uploads (copies or inline
vkCmdUpdateBuffers into device copies) recorded, in its first-work
command buffer, an execution barrier ALL->ALL before its GPU start and a
lead barrier ALL_COMMANDS/MEMORY_WRITE -> TRANSFER before the uploads.
On a device that orders its batches by their ends (batch_order::by_ends:
RADV, NVIDIA, ANV) both are redundant: every earlier command on the
batch's VkQueue is a batch's, followed in submission order by its end
Barrier::to_all (ALL_COMMANDS/MEMORY_WRITE -> ALL_COMMANDS/
MEMORY_READ|MEMORY_WRITE), whose first synchronization scope "includes
all commands that occur earlier in submission order" and second "all
commands that occur later in submission order" (vkCmdPipelineBarrier),
the uploads among them. Earlier reads of the device copy run before them
(WAR needs only an execution dependency), earlier writes are available
and visible to their writes (WAW), and the start timestamp at the top of
the pipe is held there as a first encoder's prefix start already is. The
one other kind of submission on a batch VkQueue, an internal one
(device/submit.rs), ends with no such barrier: the batch skips both only
where no internal submission the host has not seen complete was made,
read while it holds its place in the first work's order, which an
internal submission takes before it is made. Another VkQueue's command
buffers stay ordered by the batch's semaphore waits. Under the exact
batch order (to_host ends) both barriers stay; the trailing barrier stays
everywhere.
New counter WorkCounts::managed_uploads_unbarriered. New device tests in
tests::managed_inline: an upload behind a batch whose kernel still spins
on the device copy's word lands after its reads (default order, counted
unbarriered on a by_ends device; exact order, kept), and an ignored
negative control forcing it unbarriered under the exact order. The bench
prints the counter.
The write-after-read test's buffers take their first work before its steps
(e54dbd08b3) and its doc says where it can fail (5cbadadeef).
Verified: clippy in three configurations and rustdoc passed
(m3-max-38492, m3-max-38530); the managed_inline device tests on the XTX
47/47 (m3-max-38511); the write-after-read legs on the 2080 passed
(m3-max-38527). Measured (release, inlinemanaged bench, 64 B inline):
the XTX's GPU gap over no upload fell from +5.6 us to +3.5 us
(m3-max-38521; 2.1-2.9 us across sizes); the 3090 showed no measurable
change (m3-max-38522). The 2080 rerun follows the merge.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: the view check (RUNTIME 2495/2498) ran from the device's making beside the program's first
work. Before each of its eight kernels' making and each of its timed dispatches it now stands by
until the device's work is quiet (DeviceShared::work_quiet_for): no batch committed waits for
its submission (Scheduler::holds_none), none submitted is in flight on any VkQueue, and no use of
a VkQueue has been under way for step_aside::QUIET (20 ms) before a making, which cannot stop
once begun, or queue_quiet::SETTLE (1 ms) before a dispatch, or since the check's own last
dispatch where that was the last use. It stands by for no one while a call waits for its answer
(settle_view_check), and stops as the device's holds stop. Each kernel's making is a step of its
own, inside its own exit-guard section, after the allocation step-aside the rounds already took.
QueueQuiet::unused_for reads how long no queue use has been under way. Counted:
WorkCounts::device_checks.view_check_stand_bys and view_check_stand_by_nanos. The module docs
also correct one claim: the check's dispatches are internal submissions counted as the device's.
Why: on the RTX 5080 Laptop GPU beside the runtime lane (b5080 m3-max-38412), on a fresh cache,
the check's kernels' making (compute_pipeline_create_nanos +833 ms, an 18.5 ms vkQueueSubmit)
overlapped the type_nine hang test's first scenario, whose other queue's command buffer read
Scheduled 103.2 ms after its commit, and its rounds' internal submissions landed in later
scenarios' counted passes. Each dispatch is an internal submission (device/submit.rs,
submit_internal_taking): it holds the device's internal lock from before its recording through
its vkQueueSubmit on the device's first VkQueue and the wait for its fence, so it waits behind
the work submitted there before it and holds every other internal submission meanwhile; a
kernel's making holds the driver for its compile. The other checks step aside only for the
device's allocations and frees (step_aside.rs) and make no pipelines.
With it (folded): its quiet counted from no earlier than its start, so its first kernel waits for the program's first work (a device that had used no VkQueue read as quiet for ever, so the first kernel's making began at the device's making); the runtime README says when the check stands by and that a device whose work never pauses that long gets its answer once it does (or from the record next start).
Residual, unmeasured: a compile already begun when guest work arrives still runs to its end; 20 ms of full quiet first makes that unlikely, not impossible.
Tests: tests::view_check_device::the_check_stands_by_while_the_device_s_work_goes_on (lavapipe: while a queue keeps a command buffer committed or in flight for 900 ms, from 300 ms on the check makes no kernel and submits no dispatch and its answer stays pending; once the work stops it answers, having stood by for at least 600 ms).
Verified (msi, at 85ca74cc15): m3-max-38482 clippy -p metal2vulkan -p metal2vulkan-runtime --all-targets --all-features 0, rustdoc -D warnings 0, api_signatures/api_surface 15/15; m3-max-38481 clippy --cfg m2v_gpu 0; m3-max-38480 clippy --cfg m2v_cpu_icd 0, lavapipe view_check|submit_check|queue_switch|in_place_check|tiling_check|tiling_cost|step_aside|queue_quiet 59/59. An NVIDIA run follows the merge.
What: the engine fixture uniform_texel_windows (.metal, its .ll and .air.ll) and its TOOLCHAIN line.
Why: since SEMANTICS 2142 the uniform_texels tests run on indexed inline kernels and the view check
builds its own kernels (bind::view_check_module); nothing references the fixture (git grep finds only
its own files and its TOOLCHAIN line). No dead fixtures.
Verified: in the check job named in the landing.
runtime_lane::pitched_surfaces::a_pass_s_copies_in_share_their_barriers and
runtime_lane::private_primitives::type_nine's hang scenarios each make a device over a fresh
scratch cache, which holds no record of the device's view check, so the check (RUNTIME 2495,
f2367d8956) runs from the device's making on a thread of its own. Beside the runtime lane on the
RTX 5080 Laptop GPU it ran into what the tests count and time:
- The barrier count is the device's: in the last counted pass the view check's internal
submissions (one dispatch between two timestamps each, a barrier before) added 2 and 15
barriers (1 against 3 and 16, internal_submissions +3 and +14), the pass's own staying 1.
- The hang test's first scenario overlapped the check's making of its pipelines
(compute_pipeline_create_nanos +833 ms, an 18.5 ms vkQueueSubmit, steps_aside 2 -> 8): the
other queue's command buffer read Scheduled 103.2 ms after its commit, past the hang, with no
cross-queue hold counted (heads_held_for_earlier_commits, batches_held_for_another_queue,
heads_held_for_unshared_commits and heads_held_for_queue_turns 0 in every scenario).
Both now wait for the view check's answer (Device::settle_view_check) right after making the
device. Found with counter prints of every moved WorkCounts field (b5080 m3-max-38412, two runs
beside the runtime_lane::p* tests).
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: BlitCommandEncoder::copy_texture_from_host_ram / copy_texture_to_host_ram made one VkBufferImageCopy per row piece (bufferRowLength 0), and laid_over never joined runs that continue one another in host memory, so a surface given as one run per page was cut at every page end. Now host-contiguous runs merge within a row (as the buffer forms already do), and joined_rows makes pieces that share an import, a first texel and a texel count, in rows one after another with each row's import offset one pitch past the row before, into ONE region: bufferRowLength = pitch / texel bytes, imageExtent.height = its rows. Rows join only within a round, so a copy out whose pieces name a host byte twice keeps its order. A pitch over 2^31-1 bytes joins nothing (VUID-VkBufferImageCopy-bufferRowLength-09108). Rows that cross a chunk boundary keep their pieces.
Why: the consumer measured first fills of ~16 MiB surfaces from guest RAM on the Radeon 780M at 0.137 ms/MiB into images against 0.038 ms/MiB through copy_from_host_ram into a buffer (3.6x; +1.9 ms x 349 presents in one scene), and copies out over a walk with ~1000 downloads at Iris 75 -> 415 ms, 780M 56 -> 198 ms.
Measured (release, median of 10, a 2560x1600 BGRA8 surface given as 4000 page runs in 2 MiB blocks; regions per copy 4800 -> 20): 780M (m3-max-38432) fill 2.330 -> 0.510 ms, copy out 2.737 -> 0.494 ms, beside the buffer gather 0.488 and scatter 0.49 ms; XTX (m3-max-38429) fill 3.097 -> 2.452 ms, copy out 2.496 -> 2.484 ms (PCIe-bound), buffer gather 2.291 ms.
Tests: rows_over_host_bytes_in_a_row_are_one_region_on_their_import_both_ways (exactly 4 regions each way for 200 rows across a chunk end; bytes exact at a padded pitch, a tight pitch and a sub-rectangle; at the parent it makes at least one region per row); the scattered-pages test's count from a model of the rule; the bench host_ram_texture_bench (ignored by default). Docs: HOWTO, the runtime README, WorkCounts::host_ram_copy_regions.
Verified (msi, at ef7383646f): m3-max-38440 clippy -p metal2vulkan-runtime --all-targets --all-features 0, host_ram_texture_rows 2/2; m3-max-38441 lavapipe host_ram 129/129. clippy --cfg m2v_gpu / m2v_cpu_icd, rustdoc and the Iris bench (m3-max-38434) run after the merge.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
pinreds' lavapipe counts (m3-max-38335) under Fair: submission_turns' committing-pass check had
0 completion wakes, 1 sleep slice and 1 slice rescue; grouped_submissions 4-5 completion wakes
for 6-7 turn holds and 1-2 rescues. Read, not a missed completion wake:
- A sleep the scheduler's thread ended at a held head's bound (await_room's wake_by: the time
the oldest batch's run brings its queue's work under the budget, the turns' designed wake) was
counted as a sleep slice and its pass as a slice rescue, though WorkCounts calls a slice the
thread's longest wait with nothing having woken it. A bound shorter than the slice now ends
the sleep as no slice does (short, as the idle's length before a driver's stall), on the
condition variable and on the GPU.
- A turn-held head was gated on the oldest batch in flight, so every completion before the one
that lets it go woke the thread to hold it again. Flight::own_ahead now gates it on the batch
whose completion lets it go, or makes the batch of its queue whose run does so the oldest
(turn_through), so the timer can be set then; a queue of unknown run on its first batch.
Flight::turn adds the time another queue's last batch is 50 ms old where 2 ms holds the head
and 16 ms would not, which the oldest's completion caught before.
Tests: queue_turns::a_held_batch_waits_for_the_completion_that_lets_it_go (the gate is the
fifth's predecessor, not each completion); the two turn unit tests' holds now carry the gate and
the quiet timer; queue_share_device's turns test asserts 0 slice rescues, at most a completion
wake per burst command buffer, and each submitted within 20 ms of the GPU end before it.
Verified (msi, at d4074ffeaa): m3-max-38421 runtime clippy --all-targets --all-features 0, unshared_hold|queue_turns 25/25, rustdoc 0, fast_paths 36/36; m3-max-38422 clippy --cfg m2v_gpu 0; m3-max-38423 lavapipe clippy --cfg m2v_cpu_icd 0, unshared_hold|queue_turns|submission_turns|scheduler_held_wakes|queue_share_device 64/64 (the turns test under Fair: 14 looks held, 0 slice rescues, 7 completion wakes for 12 command buffers, each submitted by the previous one's end). Open: validation grouped_submissions 14/15 in m3-max-38424 (a_shared_event_wait_for_a_kept_group_s_signal_ends_at_the_next_completion_turn, "Y completed before X"); its A/B against the parent (m3-max-38439, 38442) runs after the merge.
What: the view check bullet gains the verdicts it measured at the RUNTIME 2498 rule, and a cold
run's wall and GPU time. RTX 3090 and RTX 2080 take UniformBufferPerLaneReadsSerialize alone,
the Iris Xe of RPL-P takes ExternalUniformReadsSkipACache alone, and the Radeon 780M, the RX 7900
XTX and lavapipe take neither. Cold wall 28 to 136 ms on the GPUs (268 ms on lavapipe), GPU time
7.9 to 43.2 ms. Also rewraps the bullet's one overlong line. No product change.
Why: the brief asks the README to carry the check's cost and verdicts; it carried the memory
alone.
Verified: every number is from the jobs' "view check on" lines at e20054b908's archive (Iris
m3-max-38378, 3090 m3-max-38379, 2080 m3-max-38380, 780M m3-max-38382, XTX m3-max-38389,
lavapipe m3-max-38359); GPU time is the sum of the 24 medians times 8 rounds. cargo fmt.
Two tests failed on lavapipe since RUNTIME 2490 (8f1e4157d8, fair queue turns). Both still
passed at 44505b3807, and both fail at b874899768 and 20844a0232:
- runtime_lane::grouped_submissions::completions_wake_the_scheduler_only_once_a_head_may_go
failed 3/3 with "5 wakings by completions" (wakes <= 1).
- tests::submission_turns::a_committing_pass_ends_at_its_own_submission_handlers_grouped failed
with (Some(3), 1) vs (Some(3), 0): one scheduler slice rescue.
Cause (a diagnostic run printing the turn counters, lavapipe, msi job m3-max-38335, 3 runs):
- lavapipe has one graphics VkQueue, so each test's two command queues share it, and under the
default `QueueTurnPolicy::Fair` the scheduler holds a queue's batch for its turn while its own
work is in flight there.
- grouped_submissions: 6-7 heads held for queue turns (`heads_held_for_queue_turns`), 3-5 let go
idle, 1-2 slice rescues; 4-5 completion wakes. Those wakes are the turns letting the fills'
queue go on, not the checked head's.
- submission_turns: 2 heads held for queue turns, 0 completion wakes, 1 slice rescue. The later
batches the committing pass left were held for their turns, not sent at its wake.
Neither test is about the turns: one checks when completions wake the scheduler for a head
waiting on a GPU signal, the other the wake a committing pass gives for the batches it leaves.
So both now make their device with `QueueTurnPolicy::CommitOrder`, as queue_share_device's tests
do for the sharing they measure; `tests::queue_turns` tests the turns themselves.
The slice rescue under Fair (a turn-held head let go by the sleep slice, no wake having come) is
reported to the turns' owner, not hidden here.
Verified: lavapipe runs of this commit (named in the tip report).
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: the view check's imported-page arms gain the per-lane reads (uniform buffer and uniform
texel buffer, both windows: 24 arms, CHECK_VERSION 2). ExternalUniformReadsSkipACache is judged
on the reads the fact moves to the texel view (lower::access::view_kind): the uniform reads, and
the per-lane reads where the per-lane fact does not hold (where it does, those keep their storage
view). It holds where, over imported pages at both windows, the texel buffer took less than the
uniform buffer's time in every such read (TEXEL_NO_SLOWER 1.0) and less than 0.7 of it in at
least one (TEXEL_FASTER). ViewCosts' `texel` gives way to `texel_fastest` and `texel_slowest`;
the report names both.
Why: on the Iris Xe (job m3-max-38288) the check gave no texel fact, so the Iris lost the texel
route its identity row gave it. The old rule asked the uniform walk to be below 0.7 at both
windows, a bound set from the records' one-word rows, while the arm walks the window. The
check measured what the records measure for a walk: texel/uniform over imported pages 0.48
(1 KiB) and 0.755 (4 KiB), the uniform buffer over imported pages 2.05 and 1.22 times its own
over device memory, the texel buffer 1.006 and 1.022. The records (job m3-max-37780, worked
out from each pattern's ratios to the uniform buffer over device memory) put a workgroup's walk
at 0.23 to 0.32 (1 KiB) and 0.83 to 0.86 (4 KiB), each invocation's walk at 0.026 to 0.058 and
0.16 to 0.17, each its own word at 0.081 to 0.084 and 0.19 to 0.23, every invocation one word
at 0.41 to 0.49 and 0.49 to 0.55. A uniform walk of 4 KiB is not where the cache loss shows,
and no bound on it alone separates the Iris (0.83 to 0.86 in the records) from RADV on the
Radeon 780M, whose uniform buffer keeps its cache over imported pages (0.93 and 0.97, job
m3-max-38330). So the rule now asks that no moved read is slower (1.0, above every Iris record
row) and one is clearly faster (0.7, between the Iris rows and the 780M's tie).
Verified (msi, at e20054b908): m3-max-38360 clippy -p metal2vulkan -p metal2vulkan-runtime --all-targets --all-features 0, rustdoc -D warnings 0, api_signatures/api_surface 15/15; m3-max-38359 clippy --cfg m2v_cpu_icd 0, lavapipe view_check|uniform_texels 11/11 (facts {}: per-lane imported texel/UBO 0.859, uniform texel 1.84 slower); m3-max-38358 clippy --cfg m2v_gpu 0. The Iris, 3090 and 2080 verdicts run after the merge.
an_answer_with_facts_makes_the_measured_compile_device read lavapipe's committed profile through
env!("CARGO_MANIFEST_DIR"), the building machine's path, so a test archive carried to another node
(the RX 7900 XTX run, um790 job m3-max-38286) panicked reading it. It reads it through
metal2vulkan_devtools::validation_dir(), as the runtime's other profile-reading tests do.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
m3-max-38270: RADV on um790's Radeon 780M (PHOENIX), queue_share built at 037f1959bf
(m3-max-38259), frames, 5 s per run, load 1-3. Three 30 ms command buffers in flight beside a
draw every 16 ms: CommitOrder p50 71.1 ms, max 89.4 ms; Fair p50 17.6 ms, max 56.7 ms, every one
of the 313 draws run. Eight 4 ms in flight: CommitOrder p50 23.8, max 36.8; Fair p50 4.0, max
17.7, the GPU idle 1.68% against 0.08%.
cross_queue_burst_turns ran every case (m3-max-38188, 38240 on the M3 Max; 38189, 38241 on the
MacBook Pro's UHD 630 and Radeon Pro 5300M). The M3 runs a second queue's small command buffer
among a first queue's burst of 64 and beside its one 244 ms command buffer; the 5300M runs a blit
or render one among the burst but a compute one after the burst and after the long one; the 630
runs it after them in every case. The probe header records each case; the FAST-PATHS queue_turns
row, its known gap, queue_turns.rs and QueueTurnPolicy's docs said Metal ran it beside a 200 ms
one on the 630 and the 5300M, which the probe's compute one-long case contradicts, and now say
what was measured.
`a_pass_s_copies_in_share_their_barriers` failed on the RTX 5080 Laptop GPU on every run at
24a0613783 and later: "a pass reading 1 shadowed texture recorded 2 pipeline barriers, one
reading 4 recorded 1". That is 3/3 at a124d8c24d and 3/3 at 24a0613783 (b5080 entry
pinreds-lane-163117). It passed there at 44505b3807.
Cause (a diagnostic run printing each pass's work-count moves, b5080 entry
pinreds-diag6-164726): the test counts the barriers recorded from the encoder's end through the
wait, i.e. at commit and submission.
- The pass of 1 recorded one more: its commit began one more command buffer
(`command_buffers_begun_kept_barriers` +1) and recorded a kept stamped barrier buffer
(`stamped_buffers_kept` 0 -> 1).
- The pass of 4 after it took that buffer again (`stamped_buffers_reused` 0 -> 1) and recorded one
barrier.
- Since RUNTIME 2466 (35ac917d6f), a batch with first work writes its start stamp in that work's
command buffer. The warm-up pass has first work (`new_buffer_zero_fills` +1), so it kept a plain
barrier buffer (`barrier_buffers_kept`). The stamped one, which every later command buffer with
no first work takes, was first recorded in the first counted pass.
So the steady state is the same for both passes (one barrier each); the second barrier was a
one-time recording that the single warm-up no longer covers. This is not a change in how copies
in share their barriers.
Now two passes of the shape run before the counted ones. The second records the kept stamped
buffer, and the counted passes of 1 and of 4 both take it again.
Verified: the 5080 run of this commit (named in the tip report).
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: each VkQueue keeps the time of its last 15 batch vkQueueSubmit calls, whichever thread made
them, timed under the queue's lock in submit_logged (device/submit_calls.rs), and publishes their
floor, the least of them. Where that floor is 100 us or more, a committing thread's pass
(commit_and_submit) leaves the VkQueue's batches to the scheduler's thread, which it wakes at once
through the existing left_over wake, counted as LeftAtCommit::SlowCalls
(WorkCounts::scheduler_at_commit_left_slow_calls, new). Below it the committing thread submits as
since RUNTIME 2461. A thread about to wait for a command buffer still submits for itself whatever
the cost. No batch is reported as left for a host step with none due.
Why: a REGRESSION of RUNTIME 2461, which let a committing thread submit a batch that holds segments
with no host step due. On a host of unified memory every guest batch names host imports, and RADV
lists every import in each kernel submission, so on the Radeon 780M each such call took about 245 us
(p50; 394 p90), now on the guest's committing thread: the consumer measured the walk per render
encoder 84.0 -> 130.9 us and the commit call per part 19 -> 256 us, with 2461's one plain() line
undone matching the parent on every row. The cost is the driver's and the kernel's, so the decision
reads the measured call time, not a driver, GPU or memory kind. The floor rather than the median:
in m3-max-38258 a fresh lavapipe device's first calls held the median of 15 past 100 us for 14 of
200 commits while its calls then took 5.3 us at the median; load and a driver's rare long calls
lengthen calls and never shorten them, as the submission checks' floors already assume
(submit_check.rs), and the import tax this rule is for is paid by every call. Of the guest's
~290 us per inline part, ours before the call is ~43 us (~15%, the consumer's trace).
Tests: commit_and_submit::a_queue_whose_calls_are_slow_leaves_its_batches_to_the_scheduler_s_thread
(each batch call made 150 us slower through a cfg(test) hook, Device::slow_submit_calls: 0 of 40
batches at commit, 40 left for slow calls, floor 207.8 us; without the rule every batch goes at
commit); a_command_buffer_naming_host_pages_is_submitted_at_its_commit warms 15 rounds and asserts
the floor below the bound and nothing left for slow calls (200/200 at commit, floor 2.6-3.1 us).
The guest-shaped bench's SubmitCost leg puts its 250 us stand-in inside the timed call, with two
legs of the other forms (SubmitCostAtCommit, HostPagesHandedOff); on lavapipe release
(m3-max-38261) the hand-off cut the commit call 65.5 -> 8.2 us with commit -> GPU start p50 4089
against 4086 us, and a forced hand-off of the 0.4 us host-pages calls showed no start latency
(2598 against 2606 us).
Docs: scheduler module docs and plain_ready, unshared_hold.rs, commit_and_submit's doc, the runtime
README, RUNTIME-PORTING.md, FAST-PATHS.md's unshared-hold paragraph; api_signatures blessed.
Verified (msi, at f0a34f5d9b): m3-max-38277 clippy 0, lavapipe scheduler/queue/turns suites 101/102
and validation joined_completions|grouped_submissions 19/20 (the two failures fail at the base
b874899768 too, m3-max-38299: grouped_submissions::completions_wake_the_scheduler_only_once_a_head_
may_go 3/3 at both; submission_turns::a_committing_pass_ends_at_its_own_submission_handlers_grouped
1/3 at base alone); m3-max-38302 clippy --cfg m2v_gpu 0, --cfg m2v_cpu_icd 0, rustdoc 0. The 780M
before/after (m3-max-38281) and the Iris run after the merge.
`a_pass_s_submission_handlers_run_while_it_goes_on_grouped` (RUNTIME 2437) failed on the RX 7900
XTX (RADV) in the 596d917dfe round (m3-max-38205) at submission_turns.rs:351: "the later command
buffer was submitted before the earlier one (Grouped)". Its line said "their submissions
returned 0.4 and 0.4 ms after the held one's", and its stderr held the group notice: "2 batches
of command buffers on one queue: the scheduler found them ready together".
RADV has one graphics queue, so both command queues share one VkQueue. Under Grouped, the pass
after the held one took `earlier` and `later` in together and grouped them into one kernel
submission. `submit_returned_time` is the instant the submission carrying a command buffer's last
batch returned, so both command buffers read the same instant. The strict `<` read that tie as
the later one going first. Inside one vkQueueSubmit the batches run in the order the pass took
them, which is commit order. So this is a tie the test misread, not a product order bug.
The check now passes on a strictly earlier return, or on an equal one where the pass grouped
batches (`WorkCounts::batches_grouped` rose across the two commits). Two separate submissions
still have to return in commit order.
Verified: the build and the test on the XTX (named in the tip report).
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: the two constant-window view cost facts no longer come from a GPU identity.
- metal2vulkan: DeviceDescription::measured (a set of DriverWorkaround, serde default) is a
profile input: the profile takes those workarounds beside its identity's, so the fingerprint and
every cache key follow it. The identity rows of UniformBufferPerLaneReadsSerialize (RTX 3090,
RTX 2080, RTX 5080 Laptop) and ExternalUniformReadsSkipACache (ANV on the Iris Xe RPL-P) are
gone, and NVIDIA_RTX_2080 with them (nothing else used it).
- The texel form now applies only to a slot with an indexed read (SlotPlan::indexed_read, from
Provenance::indexed_constant_reads, marked on a profile with the texel fact): a slot read at
constant offsets alone keeps its uniform buffer, whose ranges ANV pushes into registers (Mesa's
brw_nir_analyze_ubo_ranges; read, not measured), as reims's Iris Geekbench pair 2 suggested.
With both facts, view_kind gives a per-lane slot storage, an indexed-uniform slot the texel view,
a constant-offset slot the uniform buffer: no conflict.
- bind::view_check_module (CheckView x CheckReads): the check's kernels, built and verified like
any crate module (push-constant window mask, uvec4 reads, uniform / per-lane / fields).
- metal2vulkan-runtime: view_check.rs, a device check on its own thread, started as the device is
made, once per driver + release + runtime, its medians kept in the shader cache's directory:
8 kernels x 1 KiB / 4 KiB windows in device memory, and UBO / texel uniform reads over imported
host pages; 7 interleaved rounds after a warm-up, medians of timestamps x timestampPeriod. Facts:
per-lane where storage/UBO per-lane < 0.3 at both windows (NVIDIA 0.011-0.107, RADV 0.96-1.00);
texel where texel/UBO uniform over imported pages < 0.7 at both (Iris 0.40-0.49). Unchecked
(no fact) without timestamps or on any refusal. Device::settle_view_check, view_costs
(ViewCosts, ViewVerdict), view_check_report.
- Timing: creation never waits. Device::compile_device returns the description's compile device
until the check answers with a fact, then the one with the facts measured (made before the
answer is published, held in the line's Invariant); a recorded answer applies from the first
pipeline. pipeline::Sources reads the compile device once per creation or variant, so one
compile and its link never straddle the answer. The runtime's own tests fix the facts
(DeviceOptions::view_facts, cfg(test), default none) unless a test runs the check; it replaces
compile_as.
Tests: device::tests::profile view_facts_come_from_the_measured_set_alone (no committed profile
nor the 3090/2080 IDs carries either fact by identity; each measured set its own fingerprint);
engine_lane_reads (the fact from the measured set on NVIDIA's and RADV's captures; NVIDIA
identities without it keep UniformWords; both facts compose: Storage / UniformTexel /
UniformWords); engine_access (the texel form for an indexed read, a constant offset keeps the
uniform buffer, nothing measured keeps it); bind::view_check validity on every committed profile;
runtime view_check::tests (facts on both sides of each bound, the measured GPUs' ratios, the record
round trip, the measured compile device and its fingerprint); view_check_device (lavapipe: settles
Measured with its medians, the compile device carries exactly its facts, a later device reads the
record); uniform_texels on indexed inline kernels under fixed facts.
Docs: API.md (DeviceDescription::measured, the texel form's indexed-read rule), runtime README
(the check, its cost, its verdicts, when translation takes them), FAST-PATHS known gap, api
signatures blessed, api_surface entries, REFUSALS regenerated (unchanged).
Verified so far: msi job m3-max-38239 at 5d493d44f7: clippy -p metal2vulkan -p
metal2vulkan-runtime --all-targets --all-features -D warnings CLIPPY=0.
With it (folded): View check: the inline kernels' module metadata llvm-as takes; the windows' descriptor alignment checked
The engine_access and uniform_texels inline kernels named llvm.module.flags and air.version with
the version tuples of air.version and air.language_version, which llvm-as rejects (msi job
m3-max-38254: engine_access's texel test panicked in assemble_text). The view check refuses a
window or out buffer whose VkBuffer offset lies off 256 bytes, the most any descriptor offset
alignment Vulkan bounds may ask, rather than write such a descriptor.
Verified: m3-max-38239 (msi) at 5d493d44f7: clippy -p metal2vulkan -p metal2vulkan-runtime --all-targets --all-features 0. m3-max-38262 at f941e38fab: clippy --cfg m2v_cpu_icd (runtime) 0; lavapipe 21/21 (uniform_texels, uniform_bind_offsets, view_check_device, view_check unit tests); lavapipe verdict Measured, no facts (per-lane storage/UBO 1.17-1.44, texel/UBO over imported pages 1.99-2.30, fields texel/UBO 1.99-2.09; the check took 267-487 ms; a second device read the record). m3-max-38254 at 46e4aaab03: translator 146/147 (engine_access's inline IR, fixed in the second commit). clippy --cfg m2v_gpu, rustdoc, the translator rerun and the device verdicts (2080, 780M, XTX, 3090, Iris) run after the merge.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: unshared_hold's flight split a completion's run equally among the other queues' batches seen
complete in it. It now shares the run in proportion to each batch's expected run at its submission
(unshared_hold::Shares): a light batch seen complete with a long one keeps a light run, the long one
its own. Batches of queues with no run seen take the run beyond the others' expected runs, an equal
part each, at least 1 ns; when every batch is of unknown length they share it equally, as before.
Equal expected runs split as before, so the unshared hold's tests keep their numbers.
Why: a REGRESSION of RUNTIME 2490's Fair default. Under QueueTurnPolicy::Fair a compositor's plain
queue takes such a share: its light draw, seen complete together with the application's 30 ms
command buffer it waited behind, got half the run, about 15 ms, as its queue's expected run. With
2 ms of its own work allowed in flight, one draw in flight then held the next until that draw
completed, behind the application's next batch: one draw per application batch. On RADV PHOENIX
(m3-max-38213, frames, a draw every 16 ms beside three 30 ms command buffers in flight) the
compositor fell 2 s behind (p50 1192 ms, max 2062 ms, against CommitOrder's 77.8 and 106.3 ms).
2 ms stays the budget: 4 ms was worse for the compositor in both shapes measured.
FAST-PATHS: the queue turns row says how a grouped run is shared, and that the Macs disagree on
bursts (cross_queue_burst_turns: the M3 Max ran a second queue's small command buffer ahead of 56 to
62 of a first queue's 64; the UHD 630 after 60 to 63 of them; m3-max-38188, m3-max-38189).
Tests: queue_turns::a_light_batch_seen_complete_with_another_queue_s_long_one_keeps_its_light_run
fails under the equal split (the compositor's next draw is held);
a_batch_of_unknown_length_takes_the_run_beyond_the_others_expected_ones.
Verified (msi, at 7f6f9c4c6b): m3-max-38234 runtime clippy --all-targets --all-features 0,
unshared_hold|queue_turns 24/24, fast_paths 36/36, rustdoc 0; m3-max-38235 clippy --cfg m2v_gpu 0.
Lavapipe clippy and the queue_share_device / scheduler_held_wakes device tests (m3-max-38236) and the
PHOENIX rerun of both shapes run after the merge.
Both tests failed on the RTX 5080 Laptop GPU's validation leg (596d917dfe round) at
layer_claim.rs:293 with the runtime's `metal2vulkan-queue-limits-reached`: "the program's
command queue 2 on a round robin of 1 VkQueue(s), took VkQueue 0, which another took, where the
plan's 14 give it one of its own".
The lane makes its devices under `LANE_QUEUE_LIMITS` (one round-robin VkQueue). Its documented
rule (runtime_lane.rs, `LANE_QUEUE_LIMITS`) is that this notice fails the run, and that a test
whose work places a second command queue, or an unshared one, makes its device with its plan
through its own adjust (`at_plan`). Neither test did:
- `alone_batches::a_batch_that_goes_alone_is_counted_once_by_why` (3a0e4b35a2, 25c7f896f9) uses
`first`, `queue` and an unshared queue.
- `joined_completions::an_unmarked_command_buffer_is_seen_complete_at_its_own_end` (c9bad0206e)
uses `queue` and `aside`.
Only a device whose families have queues to spare (NVIDIA's 16) is affected, because elsewhere
the limits leave the plan as it is. Neither test had run on NVIDIA before this round.
The fix is the existing rule, one rule for both: each test's adjust calls `at_plan`. Our notice
stays a failure in the lane, as the lane's queue-limit contract says.
Verified: the 5080 run of this commit (named in the tip report).
nocopy_alias_one_encoder (m3-max-38211 on the M3 Max, m3-max-38212 on the MacBook Pro's UHD 630
and Radeon Pro 5300M, 20 rounds a case): a fill through one no-copy buffer and a copy through
another over the same pages, in one blit encoder, are ordered on the 630 only; the M3 and the
5300M let the copy read part of the fill. Through one buffer, all three order them.
cross_queue_burst_turns (m3-max-38188 on the M3, m3-max-38189 on the MacBook Pro): the M3 runs a
second queue's small command buffer among the first queue's 64-command-buffer burst; the 630
runs the burst first. Both jobs ended at their timeouts in same-queue: B was made on A's queue
while A's 64 command buffers were uncommitted, at the queue's default limit of 64, so
commandBuffer waited for a free one forever. A's queue now allows BURST + 2; same-queue,
one-long and the 5300M are recorded as not measured yet.
In one blit command encoder of one command buffer, fillBuffer: writes a value through no-copy
buffer 1, then copyFromBuffer: reads no-copy buffer 2 over the same page-aligned pages into a
third Shared buffer; committed, waited for, and the copy's words compared with the fill's value,
20 rounds with a value each. The control copies through buffer 1 itself and must see the fill.
The runtime orders the two as one resource's (host_aliases.rs); this measures whether Metal does,
for a decision on the order the runtime keeps there.
Conformance-only: an Objective-C probe with its build command in its header, not built by cargo.
Not yet run; its header records the measurements once it is.
The previous commit (9a7e59b1dd) runs `inside`'s fill-then-copy checks in one encoder only
where the second buffer is bound inside the first's import, and in two command buffers where it
is a copy. Metal's answer is now measured, and the comment cites it.
The conformance probe `probes/nocopy_alias_one_encoder.m` (landing with the fairqueue branch)
fills through one no-copy buffer, then copies through a second no-copy buffer over the same
pages, in one blit encoder, 20 rounds each:
- Apple M3 Max, macOS 27.0.1 (m3-max-38211): part of the fill in 20/20.
- Radeon Pro 5300M, macOS 26.7.1 (m3-max-38212): part of the fill in 20/20, mostly the old bytes.
- UHD Graphics 630, macOS 26.7.1: the whole fill in 20/20.
The one-buffer control saw the whole fill in 20/20 on all three. The Macs disagree, so ordering
across two aliasing no-copy buffers in one encoder is outside Metal's contract. The test asserts
it only where the runtime binds the second buffer inside the first's import (the in-place path
the test is named for), never where the second is a copy (HostBacking::Copied, the
copied-host-pages notice), as on the RTX 5080 Laptop GPU's 615.71.09.
Comment only; verified by the build and clippy of this commit (named in the tip report).
`inside` (RUNTIME 2453) checked unconditionally that a fill through the first buffer and a copy
through the second, of the bytes they share, see each other in ONE blit encoder. Where the
driver takes the first buffer's dma-buf import only dedicated to its buffer, as the RTX 5080
Laptop GPU's 615.71.09 does, the second buffer is a copy (HostBacking::Copied, the
copied-host-pages notice). A copy agrees with the pages only at its commit and its completion
(copied.rs, "Coherence"), and Metal orders no two no-copy buffers over one allocation
(host_aliases.rs, "Not joined"). So the test failed at dma_buf_beside.rs:449 on the 5080, both
at 596d917dfe and at 24a0613783 (b5080 entry pinreds-parent-161559). The sibling test over_part
already ran its in-one-encoder checks only where both buffers lie in imports.
Now both orders run in one encoder where the second buffer lies in an import, as before. Where
it is a copy they run in two command buffers, which checks what the copy does promise: the
first's fill is copied in at the next commit, and the second's fill is merged back into the pages
at completion.
Verified: the 5080 run of this commit (named in the tip report).
The test compared the 8-bit codes exactly. The RTX 5080 Laptop GPU (615.71.09) drew `shade`
as [64, 127, 191, 255], where the M3 Max stores [64, 128, 191, 255]. `shade`'s green is 0.5,
which scales to 127.5, a tie. Vulkan 1.4, 3.10.2 lets the float-to-unorm conversion return
either of the two codes nearest f x (2^b - 1) and only asks it to round to nearest. The fragment
module records `PrecisionNote::DeviceColorConversion`, whose documentation names this exact case:
NVIDIA's 615.71.09 stores 0.5 as 0x7f where Metal stores 0x80. Under owner rule 1 the device's
conversion stands, so a test that expects Metal's bits there is wrong.
Each channel is now compared within one code of Metal's answer, for both the gated-off and the
gated-on draws. The test still proves what it is for: `shade` (64, 128, 191, 255) and `color`
(191, 64, 64, 191) lie 127 codes apart in red, so a gated-off state that read the attribute
still fails.
Verified: the 5080 run of this commit (named in the tip report).
RUNTIME 2455 gave the begin-ahead thread `BeginTargets` (spares.rs), which keeps an
`Arc<Functions>` so the thread can begin a spare pool's primaries without holding the device.
`only_the_listed_modules_keep_the_device_s_functions` failed on every venue since
("copies of the device's functions outside the listed modules: spares.rs: ...functions:
Arc<Functions>..."; seen on the RTX 5080 leg of the 596d917dfe round).
The copy cannot be called after the device's teardown: each begin runs inside a section of the
exit guard, and the teardown stops and joins the thread (`BeginAhead::stop`) before it releases
the spares and before vkDestroyDevice (device/mod.rs). So spares.rs joins KEEPERS with that
reason.
Verified: the test passes in the msi job that compiled this commit (named in the tip report).
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
A batch whose first work is a Managed buffer's uploads alone (copies or inline writes of
did_modify_range ranges into its device copy) recorded the barriers every first work takes: from
ALL_COMMANDS to ALL_COMMANDS (MEMORY_WRITE -> MEMORY_READ|MEMORY_WRITE) before, and from TRANSFER
to ALL_COMMANDS|HOST with HOST_READ after. Uploads are transfers and carry no acquire, so the lead
barrier keeps its first scope (every command before, every write before) and narrows its second
to TRANSFER (TRANSFER_READ|TRANSFER_WRITE; the spec: the second access scope only includes
accesses of the stages in the destination stage mask). The device copies they write are never
read by the host (contents maps the host copy), so the trailing barrier drops HOST and
HOST_READ: no domain operation to the host (the spec: HOST_READ/HOST_WRITE in the destination
access mask perform that domain operation). Every other first work keeps its barriers.
Also: the INLINE_BYTES doc carries its XTX and 2080 numbers (a9df804b7f, which missed RUNTIME 2491's
landing). RUNTIME_VERSION 2492.
Verified: msi m3-max-38180 at dc5ffee24e: fmt 0; clippy -p metal2vulkan-runtime --all-targets
--all-features -D warnings plain 0, --cfg m2v_gpu 0, --cfg m2v_cpu_icd 0; rustdoc -D warnings 0. The managed
suites and the bench (development against this, inline against none at 64 B) on the XTX and the 2080
follow.