The consumer's Iris walk at pin 73 (appwalk10 w-iris-26) failed one guest command buffer during
login with the runtime's own invariant "a batch's end recorded where the batch does not end"
(command_buffer/submit.rs), read as VK_ERROR_UNKNOWN (-13): the first tagged sighting of the -13
seen untagged three times on the 3090 and the 780M since pin 59.
Cause: a texture's face turn (texture/faces.rs turn_face) and a storage-form switch need the
device's Uncommitted count at 1 and the scheduler holding nothing. Both held for a command buffer
B in commit_now between slot.committed() and scheduler.commit(), where B's end is folded into its
last command buffer (face_swaps.any() false). Interleaving: B encodes an attached-read pass that
copies into the texture's other face G; B commits and folds its end; before B reaches the
scheduler, A opens a pass that turns the texture F -> G; at B's submission record_face_fixes finds
A's record and pushes a back copy G -> F after B's folded command buffer, so work.last() is not the
folded one and the command buffer fails. The same back copy would also have written stale texels
over B's rendering in F.
Now a committing command buffer stays in the Uncommitted count until scheduler.commit holds its
batches (Slot::handed; held.open still drops at committed(), so slot_wait is unchanged): no turn
or storage-form switch lands between the fold and the submission. Only turn_face and
storage_form_switch read the count, and both refuse rather than wait (Unturned::Busy and the
copy-in path; no switch), so nothing waits on it.
Verified (batchend, 42e70c6642 on 33de04117d), lavapipe on msi: new device tests holding B at a
new trace point Point::Committing while A's pass opens. Negative control (the tip without the fix,
26731): the folded test panics on the invariant (submit.rs:1145), the apart test finds B's pixels
clobbered (4096 bytes differ). Tip (26755): 6/6, finale folded 1 / apart 1 as built, Moved {swaps
0, busy 2, fixes 0}, B's pixels right at every step. Turns still happen: the existing
a_texture_s_faces_take_turns_for_its_attached_reads shows swaps 1 in each of its turn cases, the
same at base and tip. clippy --cfg m2v_cpu_icd (26758), --cfg m2v_gpu (26726), plain (26693) and
rustdoc (26725) 0. The command_buffer/submission/queue/storage_form/attached-read suites on
lavapipe (26759) and the XTX leg follow on development.
RUNTIME_VERSION 2242 -> 2243.
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.
An indirect command buffer's CPU setters, after RUNTIME 2238's dense table and one hold: every
setter write now goes through one per-command batch (one storage pointer, one count of the writes
made without the lock), written into in place rather than handing back a ~180-byte plan (which
made a first form slower than before). The written flag (SEMANTICS 2097) is set in the one write
helper, write_field, by the rule unchanged: every setter write sets it, a write of the reset
record clears it. A draw, a dispatch, a set barrier and a cleared barrier the edits' summary
already holds, like a buffer slot before, take no lock where the GPU may not have written the
buffer, checked against an atomic mirror of the summary set under the lock; a pipeline state the
command already names is set again with no lock and no CallHold (an atomic (id, serial, kind)
mirror per command; a recovery's carry forgets it, so the next set redoes every check). New
public calls IndirectCommandBuffer::set_render_command / set_compute_command (an index and a list
of sets, no handle and no Arc clone; index and kind refusals at place 0) and the handle's
set_each; borrowed RenderAt/ComputeAt views. docs/API.md says which setter writes take no lock;
the carry docs say a write made without the lock does not wait for a carry (as buffer slots'
did; a set racing a device recovery may write through the old mapping).
Verified (icbset, f403b6e922 on 33de04117d), ns a command, median, 16384 commands, msi lavapipe
(26658, two passes), development e93b3f192e -> tip: full render slot 142.6/147.6 -> 100.7/100.1;
compute slot 119.3/123.0 -> 77.5/77.5; three fields 77.1/78.8 -> 71.8/71.9; draw only 43.5/43.9 ->
34.0/34.0; set_render_command 94.7, set_compute_command 78.9. 780M (26754, 256 commands): full
slot 154.3/167.7 -> 111.0/117.0, compute 123.3/122.7 -> 93.1/87.8. lavapipe ICB set 154/154,
including a test of which way each write went and set_each/set_render_command against one setter
at a time; negative control (a whole-record read-modify-write in write_field) fails the
strengthened two-thread test (26658). 780M: the 6 ICB device tests and set_states pass. clippy
plain / --cfg m2v_gpu / --cfg m2v_cpu_icd and rustdoc 0 (26682, 26756).
RUNTIME_VERSION 2241 -> 2242.
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.
On the consumer's XTX Launchpad walk ~40 inline render encoders a present end keeping nothing
though none of their draws was counted unkept (keepdraws' read of lp72-xtx): every logged call
but a direct draw, a bind, a pipeline state set and a render state set forgets the encoder's kept
draws (render/replay.rs log -> forget_again), and the guest orders its heaps between encoders
with fences (updateFence after the last draw, useResource(s)/useHeap(s) before).
A kept draw, and those set aside, now survives:
- update_fence: it records nothing;
- wait_for_fence where the encoder used no shadowed texture (a wait over a shadowed texture marks
it written, so later commands take its copy again: that wait still forgets);
- use_resource(s) / use_heap(s), but a memoryless use (which fails the command buffer): a use
that changes the residency gives it a new generation, which Under holds, so the next draw takes
every step; a repeat use changes nothing.
Every other logged call still forgets. New WorkCounts: kept_draws_kept_across_{fence,use},
kept_draws_let_go_{fence,use,barrier,store_action,visibility,other} (the kept draw a logged call
let go, by kind), encoders_last_draw_empty.
Verified (keepdraws, 77437d3277 on adaccf2367): lavapipe debug 64/64 over kept_across_calls,
draw_again, carried_draws, snapshot_reader, deferred_calls (26714); the new
tests::kept_across_calls 2/2 (draws after updateFence, waitForFence, a new useResource, the same
use twice, a new useHeap, the same heaps, updateFence, against the same calls plus a forgetting
call: pixels and commands equal; kept across fence 3 and use 5, drawn again 3, unlike_kept_under 2
for the two residency-changing uses; a barrier test let_go_barrier 1, encoders_last_draw_empty 1).
Negative control (26721: a draw again recording its Vulkan draw twice) fails the pixel test (48
vs 36 a channel). clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd and runtime rustdoc 0 (26715).
An XTX run follows on development.
RUNTIME_VERSION 2240 -> 2241.
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.
On the consumer's XTX Launchpad walk ~59% of render encoders end keeping nothing though they would
fit the next encoder (WorkCounts::encoders_none_kept_next_fits, RUNTIME 2229), and ~75 draws a
present read their own color attachment through a snapshot (render/snapshot.rs), a draw that kept
nothing and so took every step each time.
A direct draw that reads through snapshots (not in place), pins nothing, and otherwise meets every
plain-draw condition (records into its instance as it stood, a pipeline made ahead, one push, one
Vulkan draw, whole draw state, its only push hole SnapshotPhase, no write but its snapshots' uses)
now keeps a Kept with a reader part (slots, feedback colors, the phase hole, the pipeline's own
write masks, its layout). A draw again records exactly what the first did, the snapshot draw
(masks 0, phase 1) then the drawing draw (own masks, phase 0), with their barriers and query,
re-deriving only what changes with no call (the reader's ordinal, its learned coverage and the
area/coverage decision, peeked first; if it would no longer take the snapshot the draw takes every
step). A rebind re-derives the reader decision through side-effect-free cores of the functions
every step runs (in_place_wanted, snapshot_wanted, area/coverage, snapshot_holds, snapshot_apart),
binding::rebind_into rewrites a changed slot's SnapshotTexels source, and record_rebound records
the two recordings with their pairs. A carried reader's snapshot conditions are checked at its
rebind beside carried_stale (WorkCounts::draws_carry_stopped_snapshot), begin_carried passes its
feedback to inline_begin, and a carried draw retains its pipeline objects into its encoder.
Set-aside kept readers are exempt from a reader's forget of its colors' readers: their reads go
through their own pair, whose first barrier orders every earlier color write. In-place readers,
pinning readers and readers recording into a new instance stay unkept. New WorkCounts:
reading_draws_snapshotted_again, draws_rebind_stopped_snapshot, draws_carry_stopped_snapshot.
A lane bench (runtime_lane reader_costs) measures the CPU per draw of encoders ending in a reader.
Expected reach (keepdraws' read of the consumer's lp72-xtx counters): readers never sit in an
unsplit inline pass, so this reaches the ~22 fitting encoders a present that are not inline.
Verified (keepdraws): clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd and rustdoc 0 at adaccf2367;
lavapipe 43/43 (no snapshot path there: pixels only); XTX and 780M debug at e4961c98ee 91/92, the
one miss (a carried draw's later draw again) fixed by 8e219f8bad. XTX/780M reruns at the tip,
negative control and the release bench are queued and follow on development.
RUNTIME_VERSION 2239 -> 2240.
Two runtime_lane indirect_dispatches tests (an_indirect_dispatch_reads_the_arguments_the_work_before_it_wrote,
an_unaligned_offset_reads_at_the_multiple_below) expected a SplitDispatch notice on every device. A
10x3 grid in 4x2 threadgroups runs on the kernel's partial-threadgroups variant where the device
compiles it (compute.rs partial_direct), as Metal runs the dispatch its arguments state with partial
threadgroups, so nothing splits; on the RTX 5080 both failed on the notice alone, their outputs
matching the direct dispatch's, at 045c6fedf9 (26552) as at e93b3f192e (26537).
ragged_splits(device) compiles the fixture's kernel through the public compile layer under
VariantKey::partial_threadgroups (the variant settle_partial asks for) and answers "split" where
that compile is refused, which is what makes the runtime keep the split; the kernel uses no
simdgroup function and binds plain buffers, so that key is the runtime's. The two tests expect
SplitDispatch where it holds; an_indirect_dispatch_runs_as_the_direct_dispatch_of_its_arguments
expects it where ragged_splits holds or maxComputeWorkGroupCount[1] < 65536, so its 65536-group case
still checks the split notice on the 5080 (limit 65535).
Verified (radvcompile, 1eb49b23b6 on e93b3f192e): clippy -p metal2vulkan-validation --all-targets
--all-features --cfg m2v_gpu = 0 and the gpucfg test build = 0 (26569); RTX 5080 runtime_lane::
indirect_dispatches 10/10 (26585). The predicate's "split" side has not run on a device yet (CI's
lavapipe device job runs it). Test only; no version bump.
The census at the pin-74 tip (m3-max-26572): 2369 cases over 21 profiles, 48670 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions, 348 uncovered cells as at pin 73. 88 cells'
artifact hashes move with SEMANTICS 2097 (indirect command buffer encoders store each command's
written flag), each still compiled. Slowest compile 2.6 s, peak worker 235 MB, wall 161 s.
The golden tables at the pin-74 tip (m3-max-26571; inventory, golden and printout blesses each
exit 0): 88 golden hash rows move under unchanged keys, every one an indirect command buffer
encoding fixture (engine icb_*_encode, icb_merged_*, icb_replay_*, icb_reset_encode,
icb_routed_writes, mesh_commands, resident_draws, kernel_icb_encode_*), with SEMANTICS 2097: the
lowered encode operations and copy_command store each command's written flag. The inventory and
the printouts are unchanged. Test data only.
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.
An indirect command buffer's records live in Shared host memory by design (the host step reads
them on the CPU, and plain Metal lets the CPU write a Private ICB's commands), so a blit's reset
of a whole ICB was a vkCmdFillBuffer over every record across the link: on the consumer's Modern
Rendering sample (45k commands, 101 MB of records) 56.9 ms of GPU time a frame on an RTX 2080
over PCIe x4, against 0.26 ms for the same fill in device-local memory, while the sample writes
~1.3k commands a frame.
Each command now has a u32 written flag in an optional tail after the records (16 +
capacity*2248 + 4*i; CommandBuffer::initialize and decode unchanged). The lowered encode
operations and copy_command store 1 through the contained wide_at (no tail: the sink; a faulting
operation stores nothing); the CPU setters and edit mark it, and a CPU write of the reset record
(reset_with_range) clears it; a blit copy fills the destination's flags with 1. A blit reset is
one dispatch of the new owned kernel bind::icb_reset_module per run of commands, a workgroup a
command that zeroes a flagged record with 8-byte stores and clears its flag; the overflow clear
stays a fill. The carry copies the whole storage, flags included; a lost carry rewrites the header
and zeroes the flags.
Verified (radvcompile, at 273dbba28c on 045c6fedf9):
- 2080 (26425, 26442; 45k commands): old reset 56.8-56.9 ms in every shape; flagged reset 0
written 0.256 ms, ~1.3k written 1.736 ms, all written 60.47 ms (+6.5%: 8 bytes is the widest
store every record allows; recorded in blit_indirect.rs "What a reset costs"). A culling-shaped
encode kernel (45k render commands, 3 operations each): 19.80 -> 20.11-20.16 ms.
- msi 26494: engine and interpreter round trips with flag asserts and the reset kernel's tests
59/59, runtime unit tests 1536/1536; clippy workspace all features, each feature alone, runtime,
--cfg m2v_gpu all 0; rustdoc -D warnings and the API reference check 0.
- RTX 5080 (26478, the change before the rebase): 281/282, both new device tests passing
(a_reset_resets_what_each_writer_wrote_since_the_last on the host step;
an_execution_on_the_gpu_alone_runs_what_a_reset_left); the one failure, a getter test's old fill
count, fixed in this commit. Negative control (26505, the kernel's flag store removed): both new
tests fail. A device rerun at the landing tip is queued.
SEMANTICS_VERSION 2096 -> 2097 (the lowered encode operations store the flag), RUNTIME_VERSION
2238 -> 2239.
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.
An indirect command buffer's CPU setters cost ~290 ns a command in the runtime alone on lavapipe
(the consumer's icb_slots_cost at pin 72: 16384 render commands of 5 fields; a Mac does ~5 ns),
the largest frames CallHold's drop, the setters' edit, and a BTreeMap<u32, CommandState> insert per
command. Two cuts:
- The per-command state is a dense table: a u32 a command indexing a small table of distinct
CommandStates, each counted by the commands that name it (set_states.rs); a set checks the last
state it set, then a map. A recovery's carry walks the distinct states. An entry goes when its
count reaches 0, so nothing is held past what the map held.
- A render or compute pipeline set took 4 CallHolds (the setter's, program(),
can_encode_indirect_commands(), indirect_command_writes()), 8 mutex takes; it now takes one, and
a set of a state the table already names reads no program at all.
Also: icb_encode_bench gains a full render slot (pipeline + 2 vertex + fragment + draw) and a
compute slot (pipeline + 2 kernel buffers + dispatch) a command.
Verified (icbset, msi lavapipe release, one A/B job m3-max-26475, binaries alternated, two passes,
host load ~20 so passes drift; median ns a command at 16384 commands): full render slot base
232.7/291.6 -> dense 215.7/253.9 -> + one hold 135.2/185.8 (-42%/-36%); compute slot 212.0/263.4 ->
196.8/217.6 -> 116.6/151.5 (-45%/-42%). ICB, released-program, write-route, recovery and kept tests
on lavapipe running (26484) at the branch tip. The batched setter (set_each) and the unlocked
action/pipeline setters follow after the ICB reset's dirty flags land.
RUNTIME_VERSION 2237 -> 2238.
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.
RUNTIME 2228 (3969e96010) records no Vulkan dispatch for a kernel with no loop that writes only its
own threads' and threadgroup memory, but compute::record returned at the top for such a pipeline,
before the dispatch's uses were made. Its bound buffers were never named by the batch, so a
Managed buffer the CPU wrote with didModifyRange kept its modified range for the next command
buffer that named it: the guest's timed kernel, which then paid a fill-queue submission and the
bytes over the link. Metal (and pin 69) copies it in with the command buffer that binds it. The
early return also skipped the detached/rebound check, holding resident buffers, the offset and
function-table checks, the stage-in reach check, fills and first work for what it binds, and the
table retain.
Now an inert dispatch plans and makes its uses as any dispatch, passes the detached-buffer check,
and names them (EncoderCore::name_uses: keys kept, host-page buffers held and named, resident ones
held; no hazard tracking and no write noted, as it runs nothing), retains its table, counts
dispatches_skipped_inert and records no vkCmdDispatch.
Found by gbreg from the consumer's Geekbench traces on the RTX 2080 (gbt pin 69 vs gbi
a2ac4433ca; the split run gbh, their tree on our pin-69 runtime, put the rise in our runtime):
solo import_image_rgba_to_rgb 0.228 -> 1.118 ms, color_look_up_tetrahedral 0.769 -> 2.651 ms.
Verified (gbreg, 5ac162c1ba on 84f68cc6d9):
- 2080 release harness examples/inert_uploads (26460; 330ca5a282 / a2ac4433ca / 84f68cc6d9 / fix,
medians, two passes): batch shape (40 x 8 MiB Managed, CPU-written; A = 40 inert dispatches
binding them, B = 40 dispatches reading 4 KiB of each): B 0.36 / 169.6 / 169.5 / 0.39-0.45 ms
(the 335.5 MB copy-in back in A); frames shape (FT-like): frame wall 0.56 / 1.2-1.34 / 1.2 /
0.17-0.20 ms, fill-queue submissions per frame 0 / 1 / 1 / 0. Inert dispatches alone: GPU 0.006
ms at the fix as at a2ac4433ca (the skip's win holds); encode 0.9 us per inert dispatch.
- lavapipe inert_dispatch 5/5 (26452); negative control (fix reverted, tests kept) 4/5, the new
detached test failing Completed vs Error(DetachedBacking) (26454).
- Owed on development: 2080 copy-in test runs, clippy in three configurations, rustdoc.
RUNTIME_VERSION 2236 -> 2237.
The census at the pin-73 tip (m3-max-26357): 2369 cases over 21 profiles, 48670 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions, 348 uncovered cells as at pin 72. Only the
product digest line moves (RUNTIME 2234-2236 and SEMANTICS 2096 change the product's sources);
no cell's artifact hash moves. Slowest compile 3.0 s, peak worker 235 MB, wall 178 s.
The golden tables at the pin-73 tip (m3-max-26356; inventory, golden and printout blesses each
exit 0): the four ANV profiles' fingerprints move (intel-arl-anv, intel-irisxe-anv,
intel-irisxe-rplp-anv, intel-uhd770-rpls-anv) with SEMANTICS 2096's second ANV stage bound in the
device profile; no golden hash row under them moves. The inventory and the printouts are
unchanged. Test data only.
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.
RUNTIME 2231 split the guest's encoder at each synchronize of a Managed buffer into its own
deferred segment (Deferred::SyncOut): every command buffer holding one paid an extra continuation
VkCommandBuffer and a segment VkCommandBuffer, its batch could no longer fold its end (an extra
VkSubmitInfo), and the copy was decided at submission. On the consumer's 2080 Geekbench walk that
showed as ~1 extra no-dispatch command buffer per synchronize.
Now the copy is decided at encode, from the kept writes of other command buffers plus this command
buffer's own writes before the synchronize, and recorded in place with only the written regions;
an unwritten synchronize records nothing. The copy is whole where an earlier segment is unknown,
the command buffer writes memory no use names, or the buffer was handed out. At submission,
settle_syncs_out adds a top-up command buffer just before the part holding the copy, covering only
writes from other command buffers noted after the encode, between two all-stage barriers
(WorkCounts::managed_synchronizes_topped_up, new). The SyncOut segment is gone (deferred.rs is
back to its 041038a914 form); may_fold folds again.
Verified (mansync, 4e3e22f4d6 on 8a81350e13; 2080 release, one run each, 26257), per command
buffer, 041038a914 / 8a81350e13 / fix:
- all (40 written): VkSubmitInfos 1/2/1, VkCBs 2/4.1/2, GPU 95.61/95.66/95.62 ms
- mixed (30 written, 10 CPU did_modify_range): VkSubmitInfos 2/3/2, VkCBs 3/5/3, copied
176/132/132 MB, GPU 95.4/71.6/71.6 ms
- none (40 unwritten): VkCBs 1/3/1, GPU 95.05/0.014/0.007 ms
- small (import shape: 1 MiB fill + 2 unwritten 335,872 B no-copy synchronizes): VkCBs 2/4/2,
commit-to-completion 0.519/0.111/0.116 ms (keeps ~4.5x)
vkQueueSubmit calls equal in every row; topped_up 0 in every fix row. Tests on the 2080 (26258):
managed_copy_device, detached_contents, kept_padding, device_memory_overflow 41/41, with two new
steps (a write committed before but encoded after the synchronize: topped up 1 and every byte read
back; a write committed after: nothing copied, the next synchronize copies exactly that range).
clippy plain 26228, --cfg m2v_gpu 26227, --cfg m2v_cpu_icd 26229 all 0; rustdoc 26230 = 0.
RUNTIME_VERSION 2235 -> 2236.
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 compute or tile pipeline state's creation that found its function in the shader cache directory
also read, checked and decoded the pipeline's own artifact (68 KB on the 16,348-word ccb_conv_array
kernel: read, XXH64, scan, decode ~11 us plus its file read), and a creation that translated
encoded and wrote both. A compute pipeline is its one function relocated, with the layout and
interface its link derives from that function, so the link translates nothing and costs less
than the artifact (5.9 us on the same kernel).
Sources::kernel now takes the memo's live variant, else a binary archive's pipeline, else links it
from the compiled function (compile_compute_pipeline / compile_tile_pipeline), and keeps it in the
memo weighed by the new translator fn ComputePipeline::footprint. The directory keeps no compute
pipeline (EntryKind::ComputePipeline stays for binary archives). ShaderCache's compute pipeline
load/store, Looked::ComputePipeline and ShaderCacheStatistics' compute_pipeline_hits/misses
(always 0 now) are removed. The new public fn changes SOURCE_DIGEST, so cache directories start
fresh. RUNTIME_VERSION 2234 -> 2235: a run's pipelines now come from another path.
Also: compute_create_bench times "function decoded + pipeline linked" (test only).
Verified (warmskip, at 222d95ea69 on 18060aa638's base): clippy plain 26268, --cfg m2v_gpu 26269,
--cfg m2v_cpu_icd 26271 all 0; rustdoc -D warnings 26270 = 0; touched tests on lavapipe 26262
158/158 (runtime suite + validation lane cache, binary_archives, pipeline_records). Lavapipe A/B
release (msi 26316, legs B A B A, host busy so ~30% above quiet), creation medians before ->
after: CONV memo-1 settled 88.4/88.2 -> 74.0/72.4 us; CONV after a warm pass 194.8/177.8 ->
136.3/137.8 us; SMALL memo-1 32.4/32.0 -> 19.8/26.9 us; CONV warm same device 18.7/18.9 ->
18.8/19.4 (memo, unchanged). XTX before/after pending (26300).
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 warm pass made every record's creation again at every boot, refusals
included: on the Iris Xe under ANV six Cycles kernels past the stage bound
its driver compiles intact (Unsupported{StageSize}) cost 1.4-2.4 s of
warm-thread work a boot, one record 1397 ms before its refusal. Nothing kept
the refusal: it is decided in the translation, after the shader cache's
lookup missed, and only translations are stored.
Now a warm creation's failure that is a fact of the record on this device
(a typed refusal, Error::Unsupported, or a translator outcome the translator
states permanent for its input; never a missing input, a deadline, a
cancellation, a failed host allocation, out of memory or a lost device) is
kept in the build's directory, named by the record's bytes and the driver's
identity (vendor, device, driver version, pipelineCacheUUID) under the
profile fingerprint and RUNTIME_VERSION (shader_cache/warm_refusals.rs). A
later pass looks the record up there before reading it and answers it as
failed of the same kind at once, counted in the new
WarmStatistics::records_failed_before and announced as before. The
program's own creation still translates and meets the refusal itself.
Tests: warm::a_refusal_for_good_answers_a_later_pass_at_once (a 256 KiB
private array every device refuses: a later device over the directory
answers it with no stage decoded and no lookup; an Invalid failure is made
again by each pass), pass::only_a_refusal_for_good_is_kept,
shader_cache::a_warm_refusal_is_found_by_its_own_driver_only,
warm_refusals' frame test.
Why: on the Iris (ANV, pin 71) every boot's warm pass retried 6 records refused StageSize /
DriverDefect, 1.4-2.4 s of warm-thread work a boot (one record 1397 ms). Verified (warmskip, msi,
lavapipe, at cedc049cf1 on 86d362e2aa): warm and shader_cache tests 73/73 (26206); negative control
with the lookup disabled fails, records_failed_before 0 (26215); clippy plain 26209, m2v_gpu 26224,
m2v_cpu_icd 26216, rustdoc -D warnings 26225, all 0.
RUNTIME_VERSION 2233 -> 2234 (the warm pass answers kept refusals).
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.
ANV's compiler takes memory that grows faster than the stage it compiles, inside the process that
creates the pipeline, well below the 2^20-object bound the serialized stage already keeps under.
Measured on the Iris Xe of RPL-P (Mesa 26.2.6), compute modules created cold through
vkCreateComputePipelines, the resident set sampled every second (job m3-max-26147): entry weights
73,814, 75,886 and 99,109 were created in 45 s, 47 s and 132 s at peaks of 1.76, 2.24 and
3.65 GiB; a module of entry weight 532,213 passed 16 GiB at 358 s without finishing. Job
m3-max-26086: a module of entry weight 796,525, its heap raw-texture arms dead, passed 20 GiB in
under two minutes. Both under the old bound (786,432) would have been handed to the driver: one
pipeline creation that can take a host's memory.
- DriverWorkaround::CompilerMemoryGrowsWithStageSize, keyed on ANV whatever its GPU and release
(device::derive), documented with those points.
- stage_bound: StageBounds holds both bounds (SERIALIZED_STAGE_WEIGHT 786,432;
COMPILED_STAGE_WEIGHT 99,109, the largest measured to compile, no margin below it as nothing
above it is measured to compile). emit keeps a module under every bound its profile's defects
set, with the same widest-pin retry; a refusal (StageSize, DriverDefect) names the serialized
stage's defect past 786,432 and the compiler's memory below it. The bound rises when a larger
compile is measured within host-sized memory.
- The test hooks (compile_bitcode_bounded, compile_stage_bounded) take StageBounds.
Docs: stage_bound's module docs and FAST-PATHS' known-gaps entry state both bounds with the
measured points only (weights, never names), and restate the serialized bound's figures in
entry_weight's units: the faulting stage 1,603,989 (0.683 objects per unit, was 1,565,083 and
0.70 by a count 2.4% lower), the other 21 stages' ratios as counted by that count, which ran 1.9
to 2.7% below entry_weight on the five modules both counted; the shader-object figure likewise
1,603,989. Feature::StageSize's docs and its reach line cover the memory bound; REFUSALS.md
regenerated. api_signatures.tsv blessed with the new variant (the bless also moves
scheduler_slice_rescues to the script's own order).
For a consumer on ANV: a module of entry weight past 99,109 and up to 786,432 that was handed to
the driver is now refused (Unsupported, Feature::StageSize,
Needs::DriverDefect(CompilerMemoryGrowsWithStageSize)) unless its pinned plan fits. Other drivers
are unchanged.
Tests:
- engine_simd_lockstep::a_kernel_past_the_stage_bound_keeps_the_widest_pin_or_is_refused covers
both defects: for each, under a bound the emulated module passes the kernel is planned again
pinned (exact at 32 lanes), under one its pinned module passes too it is refused naming that
defect, and past both the serialized stage's defect is named; RADV emits under every bound.
- engine_simd_lockstep::a_kernel_past_the_stage_bound_gets_one_answer_through_either_path on the
serialized bound through StageBounds.
- device::tests::profile::large_module_defects_are_keyed_on_anv includes the new workaround.
Verified, on msi, read from inside each job:
- m3-max-26184 (this change on 86d362e2aa): cargo fmt --check 0; clippy --workspace
--all-targets --all-features -D warnings 0; clippy -p metal2vulkan --no-default-features 0;
clippy with --cfg m2v_gpu (all features) 0; nextest over device::tests, engine_simd_lockstep,
fast_paths and the refusal_surface, api_signatures, api_surface and feature_vocabulary
binaries: 189 run, 189 passed.
- m3-max-26212: the stage-bound test with its output shown passed with no SKIPPED line; the
negative control, the compiled bound's cap set past every module, fails it ("left: Emulated,
right: Direct" for CompilerMemoryGrowsWithStageSize).
SEMANTICS_VERSION 2095 -> 2096: on ANV a module of entry weight above 99,109 (and up to 786,432) is now
refused or re-planned with the widest pin kept, where it was handed to the driver.
The census at the pin-72 tip (m3-max-26176): 2369 cases over 21 profiles, 48670 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions, 348 uncovered cells as at pin 71. 1223 cells'
artifact hashes move with SEMANTICS 2092-2095, each still compiled. The slowest compile took
2.2 s and the largest case worker 389 MB (RSS), inside the 20 s and 500 MiB ceilings.
The golden tables at the pin-72 tip (m3-max-26175; inventory, golden and printout blesses each
exit 0): 363 golden hash rows move under unchanged keys, with SEMANTICS 2092 (NVIDIA computes
half on its 16-bit instructions under the float controls: the nvidia-rtx50-linux and
nvidia-rtx5080-laptop columns, 360 cells), 2093 (the rate-map fan-out probe's block bits), 2094
and 2095 (lockstep barriers that a simdgroup cannot meet across rows run only where one spans
rows). golden_hashes_match_the_table failed on development from SEMANTICS 2092 until this.
The inventory and the printouts are unchanged. Test data only.
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.
On ANV (TrimmedCommandBufferFailsResubmission) the free thread frees a spare pool's command
buffers without trimming it, and Mesa's common command pool keeps every freed one for that pool's
later allocations; only a trim or the pool's destruction destroys it. Each pool kept as many
command buffers as it ever held at once, for the device's life, summed over every pool and
invisible to HELD: a guest's compute load on the Iris Xe grew the process heap to gigabytes under
vkAllocateCommandBuffers (consumer ledger: growth, then a panic, after Geekbench's Fluid pass).
- A pool counts the command buffers freed from it untrimmed, less those made from it since. Once
the spares hold UNTRIMMED (4096), a trim round is due: as the scheduler next submits a batch,
while its group holds no batch, State::trim_round marks every kept barrier command buffer to be
recorded again before a batch takes it (KeptBarriers::invalidate; a begin clears what it names),
then trims the spare pools holding the most until TRIMMED_AT_ONCE (1024) at least are destroyed.
Where frees are trimmed at once, pools hold none untrimmed and nothing changes.
- A taker takes a spare holding command buffers before an empty one.
- Counted: WorkCounts::spare_command_pool_trim_rounds, spare_command_buffers_trimmed_in_rounds.
- spares.rs docs carry the measured effect, its walk figures scoped to their profiles.
Verified (perdraw5):
- Iris Xe (ANV) 25876, tests::spares_compute_in_flight, base -> with rounds: heap 410 -> 2936 MiB
vs 416 -> 534 MiB; anonymous 434 -> 2965 vs 439 -> 743 MiB; shed 129,361 vs 71,086; 17 trim
rounds destroying 64,714 command buffers. A negative control without the invalidate (e6e83e1e4b)
lost the device at round 2.
- Iris 26157, the kept test: the round destroyed 1214 (pool (3, 1214) -> (3, 0)), 0 of 59 command
buffers failed, 0 recoveries. Negative control 8db880af0a (no invalidate): the same round, then
1 of 59 failed and 1 device recovery: FAIL.
- msi 26150 at 9315937cbc: pure spares and kept-barriers tests 25/25, clippy, --cfg m2v_gpu,
rustdoc -D warnings, API signature/surface 15/15. msi 26162 at the rebased 2aef11f27d (on
86d362e2aa): the same lint green, lavapipe debug spares/kept_barriers/scheduler_held_wakes/
scheduler_wakes/unshared_hold 48/48.
- 780M walk: no churn (0 alloc/s, 0 frees, 0 trims).
Not shown: the fluid shape stayed flat on base and fix alike, so it doesn't reproduce the guest's
per-pass growth; the consumer's Iris Fluid pass is the proof.
RUNTIME_VERSION 2232 -> 2233.
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 guest's commitAndWaitUntilSubmitted could stay unanswered until the next commit (reims, XTX
RADV at pin 71, 2 of 77 runs under load: "A was never submitted"; the GPU idle; the scheduler
asleep with the batch held for 10 s; an empty commit on another queue released it at once).
Cause (reims's finding, /tmp/xqtest/m2v-finding.md): on a host whose one graphics VkQueue an
unshared queue also holds (RADV, ANV; WindowServer's queues are unshared), batch A behind H was
held by held_for_unshared() while H was in the Flight. QueueSlot::completed publishes `completed`
(fetch_max) before waits.completed takes H out of the Flight. When H completed between those two
steps, the hold read a stale Flight and gated on completed + 1, which nothing meets.
Fix:
- Unshared hold: QueueWaits::hold_ahead reads the published completed value under the waits lock;
Flight::ahead(ran, completed) counts batches at or below it as gone; Room::Hold { after, through }
carries the oldest still in flight; await_unshared_room gates on `through`, fences, and reads
again (completed >= through wakes it at once). No reorder of QueueSlot::completed.
- Kept group (submit_ready, Group::keeps read before gate_on): sets the gate, fences, then reads
again (Group::pending_through), the protocol gate_heads and check_heads use.
- A WAIT_SLICE that ends with a batch held makes a pass, as the module docs promise, counted in
WorkCounts::scheduler_slice_rescues (0 wherever every wake comes). api_signatures and host_ab
updated.
Verified (perdraw5, msi 26135, lavapipe, at 3bd14c83ac on a2ac4433ca): clippy all features and
--cfg m2v_gpu, rustdoc -D warnings, api_signatures/api_surface green; 36/36 of scheduler_held_wakes,
scheduler_wakes, completion_wakes, scheduler, unshared_hold. tests::scheduler_held_wakes forces
each interleaving with test-only hold points (completion::trace, cfg(test) + device cfgs; `Leave`
sits between QueueSlot::completed's fetch_max and waits.completed):
- unshared: H held at Leave while the next is committed; it goes with 0 slice rescues.
- kept group: both completions published between keeps and the gate; it goes in that pass, 0.
- lost wake: completion wakes dropped; the held group goes at the next slice (1 rescue, 99 ms).
Negative controls each fail only their own test: old gate (unshared held until the slice at
101 ms, and with development's code until the next commit, reims's symptom); kept recheck
removed (102.9 ms, 1 rescue); a slice making no pass (never completed within 5 s).
RUNTIME_VERSION 2231 -> 2232.
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.
Lockstep write-write ordering stays the default with no switch (owner, 10-29). What changes is the
proof of where it is needed. lower/simd/lockstep/facts.rs (Lanes) evaluates a place-only offset
at all 1024 places and compares every lane pair of each 32-lane block, modulo the index width:
exact for any stride, where the power-of-two lattice fell back to "may meet" (a 144-byte stride
against a 64-byte one, g = 16). The walk goes through constant GEP steps over a uniform base and
through single-incoming phis (what constant branches leave in the real kernel). A threadgroup
barrier that the rows analysis alone clears becomes Order::Rows, emitted under
(sy != 1 || sz != 1) && sx % 32 != 0 on the size spec constants, which the driver folds: no new
variant. air::Lockstep gains across_rows / orders_across_rows (api_signatures). Census name
barrier.lockstep.threadgroup.rows. A block one shift from the previous by the same shift for both
accesses reuses its answer, so an affine pair compares 1,024 lane pairs, not 32,768; the
comparisons are charged to the meter.
Why: the guest's generic MPS ndArrayConvolution2D, which NVIDIA's MPS picks for Super Resolution,
Background Blur and Face Tracking (3.7 s of SR's 5.5 s GPU on the 2080), carried 3 lockstep
write-write barriers per outer iteration that Metal's AIR doesn't have (stores at
4(t>>3)+144(t&7) / +64 bytes and 1152+4t / +512, t < 128): no two lanes of one simdgroup meet.
Verified (ftconv):
- Tests: 144/64 with single-incoming phis at 128x1x1 and 64x2x1 (3 row barriers, no plain one);
3t / 3t+9 at 32 (lanes 3 apart meet: one plain barrier kept, lockstep's answer); a row-word
kernel at 8x4, 16x2, 32x1.
- msi 26111 at 8cbb29cc67: metal2vulkan + air suites 4,121/4,122 (golden_hashes, pre-existing,
re-blessed at the next pin); api_surface passes; clippy plain, m2v_gpu, m2v_cpu_icd 0; rustdoc 0.
- The real AIR translated before/after with the CLI (constants from the walk's log): before, 5
barriers, 3 lockstep, unguarded; after, the 3 lockstep ones row-guarded, none runs at 128x1x1.
With the constants misread big-endian (tile C=128) the stores do meet and that barrier stays.
- RTX 2080 (620.70.06), the pin-69 module (8003 words), synthetic params, median of 21, two
rounds: 8,192 groups 0.8676 -> 0.8414 ms (-3.0%); 2,048 groups 0.2233 -> 0.2167 ms. Labelled
liberty: "after" is the dumped module with its 3 barriers removed (what the guard folds to at
128x1x1), not a re-translated module.
Expected: authored-compile census and stored strategies churn (.rows), re-blessed at the next pin.
Not yet: release-mode translation time of the largest row (the pin's census measures it).
SEMANTICS_VERSION 2094 -> 2095.
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.
reims's sink writes a runtime message's text alone, without its id, so a metal2vulkan-submit-failed
or metal2vulkan-recording-failed line could not be found by id in qemu.log. submit_failure::warn
now appends " [<id name>]" to the text, as degrade notices end in theirs, for both warnings.
The device test asserts the submit-failed line ends in " [metal2vulkan-submit-failed]".
docs/API.md says so. Log text only: no version bump.
Verified: expected, by the check job dispatched at this commit (clippy plain and m2v_cpu_icd on the
runtime, the submit_failure unit tests, the lavapipe device test).
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.
The lavapipe line read "0 keys of the runtime's own: buffer #1 ...", as if the stated
resources were the runtime's own. The summary now ends "and N keys of the runtime's own not
stated", and the stated resources follow after "; stated: ". The unit test's expected text
follows; run in the next Linux job.
API.md's diagnostics paragraph and CommandBufferError::Internal's doc name the two Warning lines
a device's sink now hears (metal2vulkan-submit-failed, metal2vulkan-recording-failed): which
submissions log one, what the line names, its bounds, and that a successful submission does none
of it. Checked against submit_failure.rs's constants and texts; rustdoc runs in the Linux job.
ash is built without its debug feature here, so vk::MemoryPropertyFlags has no
Debug: the line names each flag (and any bit without a name by its value).
Verified by the build job that failed on it (m3-max-26103) and the new unit
test memory_flags_are_named_and_an_unnamed_bit_is_given_by_its_value.
Twice on an RTX 3090 a command buffer failed with VkResult -13 and nothing said
what its submission held. Every vkQueueSubmit of the runtime's that fails now
logs one warning (id name metal2vulkan-submit-failed) through the device's sink,
else on stderr: the VkResult, the VkQueue and what submitted; each VkSubmitInfo's
waits, VkCommandBuffers and signals, each semaphore by its role with its value
and the timeline's value read after the failure (flagged where a signal is not
above it, VUID-VkSubmitInfo-pSignalSemaphores-03242, or a value lies past the
least maxTimelineSemaphoreValueDifference, -03243/-03244); each VkCommandBuffer
by its role (an encoder's, barriers, kept barriers submitted again, first work,
end); the Metal command buffers by id and label; and the resources their
encoders name, as what owns their memory, with size, storage mode, memory type
and flags, no-copy import kind and whether it is released now, detached or
gone, and age in the device's submissions since it was made. Bounded: 8 infos,
8 waits and 8 signals each, 32 VkCommandBuffers, 8 command buffers, 32
resources, each list counting the rest.
Nothing is read on the success path: the line is built only in each call's
error branch, and it reads under its submitter's locks without waiting for any
lock another thread may hold (try_lock), but the two resource registries a
batch's submission already locks.
A recording that fails also fails its command buffer with a raw VkResult
(VK_ERROR_UNKNOWN for the runtime's own error, which the command buffer's
error drops): recording_error now logs that error (id name
metal2vulkan-recording-failed), so a raw -13 says which of the two it was.
Tests: tests/submit_failure.rs (an info's lists read back from its chain; the
line's words, flags and bounds), tests/submit_failure_device.rs (a blit's batch
failed by the test hook as VK_ERROR_UNKNOWN: one warning naming the result, the
label, the encoder, the queue's timeline and the buffer with its age).
The test failed on both the RX 7900 XTX and lavapipe, with or without the narrow forget.
On the XTX it failed at "the reads through copies" (4, not 8). Its four draws of the second
target's texels read a color their draws write nothing of, at their own pixels. A device that
enabled attachmentFeedbackLoopLayout and fetches no color through input attachments reads that
color in place (render/snapshot.rs's in place), with no copy, and such a draw keeps nothing. The
test expected the copy on every device. The expectation now follows the device's read path,
decided from the device itself (the feature it enabled and framebuffer_fetch::through_inputs of
its profile), not its name:
- In place: 4 reads through copies and 4 in place (WorkCounts::reading_draws_in_place, now
counted with the copies). 4 draws unkept_shadowed in each frame. In the kept frame, 2 draws
again (1 with debug assertions), 1 rebound (0), and 1 stopped.
- Through copies: as before.
On lavapipe it failed at "the apart frame's keeps": 1 draw rebound, not 0. Both frames ran on one
queue. The first frame's last draw, kept, was carried along the queue into the second frame's
render encoder (render/carried.rs), and the second frame's first draw rebound it. Each frame now
runs on a queue of its own.
The pixel checks are unchanged.
A kernel planned again past the stage bound (stage_bound::emit, WidestPin::Kept) ran plan_one a
second time: decode, specialization, lockstep order, lowering inputs and memory analysis, all
charged to the meter again. And Device::compile_function_from_entries charged nothing for an entry
a creation had already specialized (StageEntries handed out an uncharged copy). So one input got
two answers under one budget: compiled alone, a large kernel past the bound on the Iris Xe was
refused LimitExceeded(WorkUnits); compiled from a creation's entries, Unsupported(StageSize).
- stage_bound::emit analyzes the entry once (analyze_one, the part of plan_one before selection,
kept as Analyzed) and only selects, emits and rolls again. What the dropped plan and module hold
of the ledger is released, measured from before the selection.
- Meter::measured runs work and states what it charged (Spent: work units, its ledger peak above
where it began, the bytes it still holds); Meter::spend charges that to another meter, work units
first, then the peak, keeping the held bytes.
- StageEntries keeps each entry's, decode's and plain answer's Spent and charges it to every ask
that finds them, so a found entry costs what making it cost. The object spares time, never
budget: compile_function_from_entries charges what compile_function charges, unit for unit.
For a consumer: Spent, Meter::measured and Meter::spend are new public items of
metal2vulkan-air's budget module (api_signatures.tsv blessed); nothing was removed. A creation
that shares a StageEntries is now charged its found entries' work units against each compile's
budget, as a compile that shares nothing always was.
Tests:
- budget: spent_work_charges_another_meter_as_the_work_did (work, ledger and peak equal to the
work itself; refused alike one unit under either cap).
- engine_simd_lockstep: a_kernel_past_the_stage_bound_gets_one_answer_through_either_path. The
pressured kernel under a bound its emulated module passes (planned again, Direct) and under one
its pinned module passes too (StageSize): alone, from entries that make the entry and from
entries that find it, the same answer and the same work units W; at exactly W both paths answer
the bound's way, at W - 1 both are refused WorkUnits; the negative control, a meter also charged
one more plan of the entry (what the plan made again used to charge), is refused WorkUnits at W.
- library_entries_decode_once, stage_input_siblings: the work units through a shared decode or
entry now equal the unshared compile's (they asserted fewer before); the decode counts still
show the sharing.
Also in this commit: crates/metal2vulkan-air/tests/api_surface.txt gains the four rate-map items
b31ce16c85 made public and left out of it (canon::rate_map_data BOUNDARY_MASK, GRANULE_SHIFT,
shader_physical_to_screen_integer, shader_screen_to_physical_integer): the_table_matches_the_source
failed on development without them, the same four lines at d5620581d5 (job m3-max-26042).
Verified, on msi, read from inside each job:
- m3-max-25972 (21ff252584, this change on d5620581d5 before the surface lines): cargo clippy
--workspace --all-targets --all-features -D warnings exit 0; cargo nextest -p metal2vulkan
-p metal2vulkan-air -p metal2vulkan-runtime --all-features: 5,645 run, 5,643 passed, 2 failed:
metal2vulkan-air::api_surface (the four rate-map lines above, failing alike at the base) and
golden_hashes_match_the_table.
- m3-max-26018: golden_hashes_match_the_table lists 360 changed cells at this change and 360 at
d5620581d5, the same cells line for line, 180 in each of the nvidia-rtx50-linux and
nvidia-rtx5080-laptop columns: development's own pending re-bless, none of this change's.
- m3-max-26001: budget::tests::spent_work_charges_another_meter_as_the_work_did passed.
Not landed beside it: the handle-table search as a loop (memory::handles::define_lookup), measured
and dropped. On the RX 7900 XTX (RADV, release, shader cache off), a synthetic kernel of 1,408
heap handle loads: the loop cut cold creation from 224.6 ms to 129.4 ms and the driver's code from
24,512 instructions (118,512 bytes, 28 spilled SGPRs) to 15,441 (78,004 bytes, 11), but a kernel
of 64 handle loads a thread over 2^20 threads took 33 to 38% more GPU time (median of 20 runs,
two rounds: 0.604 and 0.625 ms against 0.829 and 0.832 at 65 resident textures; 0.666 and 0.644
against 0.883 and 0.866 at 4,097). Creation is paid once and cached; the GPU time on every
lookup-heavy dispatch. The unrolled search stays.
Correction to c53ea4164e's message: its "reproduced ... with a synthetic 360k-FMA chain" was wrong.
That chain faults on another ANV defect, through a pipeline and through a shader object alike
(job m3-max-25842), so it is no reproduction of the serialized-index wrap.
SEMANTICS_VERSION 2093 -> 2094: an input near the work budget past the stage bound now gets the
bound's answer where it was refused at the work cap, so cached LimitExceeded(WorkUnits) refusals
must be recomputed. Landed before its own check (m3-max-26047) reported.
The known-gaps entry for the ANV stage bound said the kernel of entry weight 1,565,083, created as
a VK_EXT_shader_object compute shader, held more than 8 GiB within ten minutes: that was the cap
of the job that measured it, not the compile's end. Measured again with room (job m3-max-25881,
the Iris Xe of RPL-P, ANV Mesa 26.2.6, vkCreateShadersEXT alone in a process under a 20 GiB cap,
the child's VmHWM sampled every 60 s): 2.0 GiB at 60 s, 2.1 GiB from 120 s to 360 s, 5.3 GiB at
420 s, then past 20 GiB, where the job's cap stopped it at 435 s of wall time (434 s of CPU, one
core). It did not finish, so the shader-object route is no way around the bound on this driver,
and the refusal stays.
Docs only.
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.
On a device without unified memory, synchronizeResource: copied the whole Managed buffer (or a
texture's whole span over one) to its host copy every time. The runtime now keeps the GPU's
writes for each buffer that has been synchronized once (managed_sync.rs: GpuWrites, SyncCopy,
SyncOut), stamped in the scheduler's submission order across all queues. The copy-out is its own
segment (Deferred::SyncOut), decided when its batch is submitted, so it covers the writes of
earlier batches, of earlier encoders in its batch and of its own encoder, including a write
encoded after the synchronize but committed before it. Completion of the command buffer holding
the copy drops only the writes noted before the copy. It copies nothing when the GPU wrote
nothing since the last copy, and still copies the whole buffer where the writes cannot be known:
an untracked buffer; one whose VkBuffer was handed out or whose memory is exported; a buffer's
first synchronize; any batch since the last copy, not yet complete, that may write memory no use
names (State::writes_unnamed); and a synchronize recorded in place (a predicated loop's laying, or
no VkCommandBuffer could be made). Every barrier is still recorded. Pages no import maps copy back
only the regions copied. Textures over buffers take the same path (an image range counts as the
whole buffer). Touches command_buffer/submit.rs (record_syncs_out after record_scrubs) and
command_buffer/mod.rs (the footprint loop skips SyncOut segments), encoder.rs, tracker.rs,
deferred.rs, device/mod.rs. New WorkCounts: managed_synchronizes_unwritten,
managed_synchronizes_whole, managed_bytes_unwritten_skipped. FAST-PATHS managed bullet, API.md
managed section and the runtime README updated. No speed-for-accuracy choice.
Why: on the RTX 2080 the guest's Background Blur spent 0.90 s of GPU time copying out 3.5 GB
over 800 synchronizes (~176 MB a command buffer, the 2080's x4 link), whole resources each time.
Verified (mansync; step codes read inside the jobs):
- clippy --all-targets --all-features -D warnings, workspace: plain 25924, m2v_cpu_icd 25927,
m2v_gpu 25928, all 0; rustdoc -D warnings 25935 = 0 (at b72228629c).
- RTX 2080 (um790) at ac0887e7f5, 25942: 41/41 (managed_copy_device, detached_contents,
kept_padding, device_memory_overflow; hazard tests excluded). Counts (copied, skipped,
unwritten, whole), both Import and Pages: first synchronize (1048576, 0, 0, 1); after no write
(0, 1048576, 1, 0); after a fill in an earlier command buffer (16382, 1032194, 0, 0). Every
byte checked after each step, including a write committed before the synchronize's command
buffer but encoded after it, and a CPU write named by didModifyRange.
- Negative control (throwaway e1542d94c4, 26010): imports copy whole and pages drop kept writes;
both legs fail.
- Release, 2080, examples/managed_sync_out (40 no-copy Managed buffers of 4,399,104 B, 176 MB
synchronized a command buffer), median GPU ms over 20, base 010888b011 vs tip (25985):
40/40 written 95.62 -> 95.58; 4/40 written 95.10 -> 9.57; 0/40 written 95.05 -> 0.014.
Not measured: Background Blur itself (the counters say how much of its 0.90 s goes); lavapipe
(unified memory, the copy-out legs return early).
RUNTIME_VERSION 2230 -> 2231.
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 direct draw that reads its own attachment through snapshots (not the in-place form) used to keep
nothing and forget every kept draw, those set aside for other pipeline states included. When it
records into its instance as it stood, on the encoder's own layout (no stand-in), and none of its
uses writes except its snapshots, it now forgets only the set-aside kept draws that read its
colors: one that reads a color's texture through its copy (Kept::through_copies), one that reads
it at narrowed levels (reads_attached), and one whose uses meet a color's memory
(render_target::shares_attachment, against that state's last-draw uses, which are the kept draw's
own). No kept draw can read a snapshot: only a reader binds one, and a reader never keeps. The
surviving draws keep their epoch and are "between", so their next draw is rebound; the reader's
snapshot writes are images, so pass_start_reads.fragments_wrote() stays false. Every other unkept
draw still forgets everything. LiveBind::forget_kept_where, RenderLowering::forget_readers, and a
snapshots_alone flag set where the draw's instance is decided; draw_again.rs documents it.
Why: on the XTX Launchpad walk 53% of draws (280 a present) take every step and none is carried,
because nearly every encoder holds a snapshot-reading draw that forgot every kept draw. A rebind
costs about a fifth of every step (~9 us saved a draw). Expected: fewer draws_none_kept and more
draws_rebound on the walk (about 21.6k of 24,947 snapshotted readers per 8 s qualify); not yet
measured on a walk.
Verified (imgleak, at e1a6c07dd8 on d5620581d5):
- tests::snapshot_reader_keeps (1024^2 BGRA8; reader, fill, sampler reading the reader's color
through its copy, reader, fill, sampler, fill; a second frame forgets before each draw), XTX
job 26011: release kept frame {snapshotted 2, none_kept 5, rebound 2}, apart frame {2, 7, 0};
pixels equal Metal's answer in both. Debug (every rebound checked against every step): both
checks pass.
- Controls (26014): without the change {none_kept 6, rebound 1}, test fails; sabotage ignoring
reads through copies {none_kept 4, rebound 3}, test fails.
- XTX release wider set 41/42, debug 27/28; the one failure, kept_shadowed_draws, fails
identically at the base product files on the XTX (pre-existing, being fixed separately).
- msi 25991: clippy plain and --cfg m2v_gpu clean; runtime 1525/1525.
Not yet: lavapipe (26022), the 780M, a walk.
No accuracy trade, no FAST-PATHS row. RUNTIME_VERSION 2229 -> 2230.
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.
METAL2VULKAN_LOG_PIPELINES's compute lines (the making line before the driver's call and the
made line after it) now also name:
- the subgroup size the VkPipeline is created to require: `subgroup size required 32`, or
`subgroup size any` where it requires none (the ComputeStage's required_subgroup_size, the value
the runtime hands VkPipelineShaderStageRequiredSubgroupSizeCreateInfo);
- why the kernel emulates its simdgroups, where the runtime can tell: `simdgroups emulated (widest
pin)` where the translator's census holds simd.emulated.widest-pin (the emulation in place of
the pin to the device's widest mode), `simdgroups emulated (variant)` where the dispatch's
variant is the emulated-simdgroups one (VariantKey::emulated_simdgroups), else `simdgroups not
emulated for the widest pin or a variant`. The last is worded so because the runtime does not
see the translator's tier: the device's subgroup model and the lockstep order choose the
emulated tier too, and telling them apart would need a translator change.
Why: to read off a creation's own line whether a slow driver compile (a kernel that took 49 s on
ANV) was the widest pin's emulation, without a counter. Default-off, diagnostics only; the
translator is unchanged (env_vars.rs's description of the variable is the one line there).
WIDEST_PIN_STRATEGY in pipeline/sources.rs is shared with the log rather than spelled twice.
Docs: docs/API.md's paragraph on the log and the variable's description in env_vars.rs.
Verified (job m3-max-25986, msi, 60327894c6): cargo clippy -p metal2vulkan -p metal2vulkan-runtime
--all-targets --all-features -D warnings, exit 0; under --cfg m2v_cpu_icd, clippy of the runtime
exit 0 and tests::opencl_data::the_pipeline_creation_log_names_a_compute_pipeline_and_its_notes
on lavapipe passed, which now asserts both lines carry `], subgroup size ` and
`simdgroups not emulated for the widest pin or a variant` (vsh_round has no simdgroup
semantics), with the creation_log unit tests (6 run, 6 passed).