Commit Graph
5264 Commits
Author SHA1 Message Date
Anees Iqbal dad0470c2e A flagged fan-out draw is drawn in parts: only its flagged range region by region
Under DevicePolicy's RateMapRegionPolicy::FanOut the probe flags a draw that has a triangle
crossing w = 0 or reaching more regions than the geometry stage's copies. The whole draw was then
recorded region by region, once per region of the map (2074 for a 61 by 34 map), however few of
its triangles were flagged.

The probe now also records each flagged draw's first and last flagged triangle. A flagged list of
triangles of one instance, whose pipeline reads no [[primitive_id]] and writes no memory (the
conditions under which a draw is already cut into index ranges), is drawn in up to three parts in
its place: the triangles before the first flagged one fanned out, those from it to the last
region by region, and those after fanned out. Each part is a range of the draw's vertices or
indices, so each triangle keeps its vertices, vertex_id and order. Parts of a 16-bit index list
begin at even triangles, so their ranges start 4-byte aligned as the draw does. Any other flagged
draw is drawn region by region whole, as before.

The probe words grow from 1 + 2*32 to 1 + 4*32 per draw (bind::fan_out::PROBE_DRAW_WORDS). For a
flagged triangle the probe raises one of 32 words to u32::MAX - PrimitiveId and one to
PrimitiveId + 1, picked by PrimitiveId as the counts are, so no single word takes every atomic.
The wide marks that choose the variant of four copies now come only from triangles the probe does
not flag, so the fanned-out parts can take that variant.

Also: WorkCounts::rate_map_probe_wait_nanos sums the host's wall time from each probe's
submission until it saw it complete, so a walk can split host_step_nanos into the probe's round
trip and the host's own recording. rate_map_parted_draws and rate_map_parted_region_triangles
count the draws in parts and their triangles drawn region by region.

An earlier attempt drew a flagged draw through a geometry stage of 32 invocations, each taking a
block of up to 16 regions, in 5 passes over the map. On the pieces lane's frame with wide
triangles it made no GPU gain on an RTX 2080 (41.0 against 42.9 ms warm). On a Radeon 780M (RADV)
it went from 182 to 1900 ms, with one piece of 1.1 s. That attempt is not in this change.

Tests: render::fan_out's unit tests check that the parts take each triangle once, in order, with
no flagged triangle in a fanned-out part, and that the probe's words decode to the first and last
flagged triangle. The link test checks the probe's two atomic raises. The runtime's
rate_mapped_fan_out test adds two commands that draw the grid with one triangle over half the
target, one indexed and one without indices, and a triangle across w = 0 over the whole target.
Under FanOut all four flagged draws are drawn in parts and the frame is compared pixel for pixel
with the encoder's region-by-region frame. The pieces lane's wide frame checks that every flagged
draw is drawn in parts.
2026-11-13 02:43:42 -08:00
Anees Iqbal 0eb9f73862 The pieces lane draws a frame with wide triangles among the grid's, fanned out and region by region
One triangle of every 8192 of the lane's grid becomes one 48 quads a side, about 1061 by 504
pixels over the 3648 by 1734 screen, which touches more regions than the fan-out's copies. The
probe flags every command whose indices reach one, about a third of the 64, as a guest's
rate-mapped frame on an RTX 3090 and a Radeon 780M had about a quarter of its probed draws
flagged (rate_map_flagged_draws 698.8/s against rate_map_fanned_draws 1972.9/s; 280.4/s against
788.7/s). rate_mapped_pieces_host_step_wide fans the frame out and rate_mapped_pieces_host_step_wide_exact
draws it region by region; the fanned-out frame asserts that the probe flagged a draw, and the
small frames that it flagged none.

Measurement only (ignored, run by name); no product change.
2026-11-13 02:43:41 -08:00
Anees Iqbal 99e00f9c6b Re-pin the runtime sources at the landing tip
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.
2026-11-13 02:42:10 -08:00
Anees Iqbal 663d75d808 WarmStatistics names the record a warm pass is making and how long its making has worked
What: two fields on WarmStatistics, which stays Copy + Eq + Default.
- record_in_making: the record's place among every record handed to the device's
  Device::warm calls, in the order handed (each call notes its first's place). While it is
  made, that is the six record counts' sum. None between records and while no pass runs.
- record_in_making_nanos: how long that making has worked.
How the time is kept (warm/pass.rs):
- Each record's making now has its own Pass. The Pass shares the call's byte count and holds
  a clock: the wall time while one thread or more works for it. That is the pass's thread
  inside `within`, or a piece of the record's that it handed the pool, which captures that
  record's Pass when handed.
- warm::waiting stops the clock around this thread's waits. It is wrapped around:
  - a thread's wait for its budget turn (thread_turn_in);
  - without_turn's lend and retake, which covers compile_memory's words wait and the flight
    and library waits;
  - making.rs's waits for a making in flight;
  - pool.rs's full join.
  A nested wait is the outer one's, and a thread works once for a pass it already works for.
- The warmer keeps the record in making (index and Pass) from just before its creation until
  just before its outcome is counted, so the index and the counts' sum agree whenever it is
  Some.
- A test-only gate (warm::gate) holds a chosen record's making, working, at its start.

Why: reims's warmbound lane needs to find a warm record whose making never ends (an ANV
making on ms01's Iris) and tombstone it once it has worked 60 s. A record starved by a
program's storm must never look like that.

Verified: not run at this commit. Tests added:
- pipeline::budget::tests::a_warm_making_s_time_holds_still_while_it_waits_for_a_turn
- pipeline::budget::tests::a_warm_making_s_time_holds_still_while_its_piece_waits_for_a_turn
- tests::warm::the_record_in_making_names_its_place_and_how_long_it_worked
Signatures blessed.
2026-11-13 02:40:59 -08:00
Anees Iqbal c693155856 Re-pin the runtime sources at the landing tip
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.
2026-11-13 01:57:55 -08:00
Anees Iqbal 003dc10fee RUNTIME_VERSION 2214: a Managed buffer over a guest RAM's chunks is copied in by the GPU from their imports
A Managed two-copy buffer whose host copy is its pages alone, where a guest RAM's chunk imports
hold every page of it (a buffer across a chunk end), now keeps pieces of those imports, and its
copies in are GPU copies from them: no CPU staging, no bound and no submission. Before, its named
ranges were staged by the CPU at each commit. AtCommit still stages a named range at the commit.
New WorkCounts name the path: managed_bytes_staged_in, managed_bytes_copied_in_from_ram,
managed_pages_alone_refused, managed_pages_alone_over_imports, managed_pages_alone_unwritable and
managed_pages_in_ram_chunks. That changes runtime behaviour.

Verified by the change's own runs on the RTX 2080: the equality tests (a 4 MiB buffer across a
chunk end, both policies) pass, checking the counts, the bytes the GPU reads after a CPU write
across the end and which path copied them; MANAGED-RAM-COPY-IN at 32 MiB across the end, commit
call 2.139 -> 0.035 ms and completion 19.41 -> 17.40 ms (0.257 -> 0.010 ms at 4 MiB);
host_ram_device 29/29, managed_copy_device 30 passed. lavapipe suite 2472/2472; clippy plain,
--cfg m2v_cpu_icd and --cfg m2v_gpu and rustdoc green.
2026-11-13 01:57:12 -08:00
Anees Iqbal 2d98657ca8 A Managed buffer's pages that a guest RAM's chunk imports hold are copied in by the GPU from them
What: a Managed no-copy buffer on a device without unified memory can have
a host copy that is its pages alone, because its own import would map pages
a live import holds or the device refused it. Where a guest RAM's chunk
imports hold all of those pages, it now keeps the pieces of those imports
(host_ram.rs RamOnDevice::pieces_of, ChunkPiece). The caller's resolver is
still asked once: its answer is kept for the pieces.
- Its copies in (as it is made, at a rebind, and each range
  did_modify_range names under AtSubmission) are GPU copies from those
  imports' VkBuffers, one per piece. They are held as a host copy
  (Keeps::HostCopy): nothing is staged, no bound applies, no submission is
  made. AtCommit still stages a named range on the CPU at the commit.
- New public WorkCounts, so a pass can tell the paths apart:
  - managed_bytes_staged_in, the bytes the CPU staged for copies in;
  - managed_bytes_copied_in_from_ram;
  - managed_pages_alone_refused, managed_pages_alone_over_imports and
    managed_pages_alone_unwritable, why a host copy is its pages alone;
  - managed_pages_in_ram_chunks.
- Tests: tests/host_ram_managed.rs, a buffer across a chunk's end with
  both chunks imported, under both policies. It checks the counts (pages
  alone over imports, held by the chunks, nothing imported, gate unasked),
  the bytes the GPU reads as the buffer is made and after a named CPU
  write across the end, and which path copied them.
- Docs: managed_copy.rs, managed.rs, buffer.rs, HostMemory::with_runs,
  docs/API.md, and FAST-PATHS row 51. Signatures blessed.

Why: such pages were staged by the CPU at every commit that took a named
range. That is a CPU copy and staging memory, on the commit's thread, for
bytes the device already maps through the chunk imports. Zero copy first.

Verified: not run at this commit. The 2080 equality tests and the bench
(before at the bench commit, after here) and lint follow on the rebased
branch.
2026-11-13 01:56:44 -08:00
Anees Iqbal 0ab26709c9 A bench of a Managed buffer's copies in across a guest RAM's chunk end
What: tests/host_ram_managed.rs, a new device-test module for Managed
no-copy buffers over a guest RAM, with one ignored release bench,
MANAGED-RAM-COPY-IN. Its buffer is 32 MiB centred on the end of the RAM's
first chunk, and both chunks are imported. Ranges of 256 KiB, 4 MiB and
32 MiB across the chunk end are written and named before each of 20
commits. Each commit reads the range's first and last bytes, and they are
checked. It reports the commit-call and to-completion medians and the
bytes copied in, on the default device and on one of exact_answers().
host_ram_device.rs exposes its RAM helpers and gains held_device(policy).

Why: such a buffer's host copy is its pages alone, because its own import
would be over pages the chunks' imports hold. Its copies in are staged
by the CPU at the commit today. This bench measures that before the GPU
copies them from the chunks' imports.

Verified: not run at this commit. It is run on the 2080 before and after
the change.
2026-11-13 01:56:44 -08:00
Anees Iqbal bb728adca5 RUNTIME_VERSION 2213: a commit's take of the named Managed ranges looks only at buffers it may use
A commit's take of the ranges did_modify_range named now asks its encoder records only about the
owners that have noted ranges (CommandBuffer::may_use, State::named_among), stopping once all are
found, and walks only those owners' keys: no scan of every noted range and no Weak upgrade of
unused ones. Noted ranges are indexed by buffer key and owner; those of buffers that are gone are
replaced on note and swept when the set doubles. Before, every split part of a commit scanned
every noted range: reims's Launchpad walk spent 14% of commit_and_submit there. That changes
runtime work.

Verified by the change's own runs on the RX 7900 XTX (MANAGED-STALE-TAKE, 200 commits of 24 blit
encoders and one Managed range each, bytes checked every commit), median commit call before ->
after: 0.0061 -> 0.0066 ms with no stale buffers, 0.874 -> 0.0070 ms with 1,000, 9.16 -> 0.0062 ms
with 10,000. managed_copy_device 30 passed on the XTX; lavapipe suite 2470/2470; clippy plain,
--cfg m2v_cpu_icd and --cfg m2v_gpu and rustdoc green.
2026-11-13 01:56:44 -08:00
Anees Iqbal c86689bf19 A commit's take of the named Managed ranges reads its uses once and looks at no other buffer's
What: managed.rs's Noted keeps each buffer's ranges by its key and indexes them by what owns
its memory (used_resources::owner_of, asked as the range is noted). Modified::take_at_commit
asks the committing command buffer once which of the noted owners it may use
(CommandBuffer::may_use, State::named_among: every encoder record's keys read once, under one
lock of each registry, until every noted owner is found; all where a command reaches memory no
use names or the last encoder's end is not lowered), then takes those owners' buffers' ranges
and those no owner holds, in the order each buffer was first noted. used_resources::names_of
and HeapKeys::names_of answer for a set of owners where names_any answered for one. A note
drops buffers gone once the buffers noted pass twice their count at the last sweep, and a key
noted again whose buffer went starts anew, so ranges of buffers no commit uses do not pile up.
A note looks at its own buffer's ranges alone (it compared every noted range's buffer).

Why: a consumer's compositor frame commits in 27 parts; the take was 14.9% of
commit_and_submit (Noted::take 14.1%, the uses closure 8.1%, HeapKeys::names_any ~5%): every
commit upgraded every noted range's buffer and asked every encoder record of each, and ranges of
buffers no commit uses stayed noted, scanned at every part. Now a commit costs one read of its
own uses where an owner's ranges are noted, and nothing where none are. Which ranges a commit
takes, and so which bytes each command buffer reads, is unchanged.

Verified: tests::managed's take-rule test rewritten for the new rule (stale gone buffers swept);
the bench before and after follows on the RX 7900 XTX.
2026-11-13 01:56:44 -08:00
Anees Iqbal 2496a6a7e1 A bench of a commit's take with ranges noted of buffers no commit uses
What: tests::managed_copy_device::stale_ranges_take_bench (ignored, MANAGED-STALE-TAKE):
the median commit call of 200 command buffers of 25 blit encoders, one reading a Managed
buffer whose range each commit takes (its bytes checked at each), beside 0, 1,000 and
10,000 Managed buffers whose ranges are named and that no commit uses.

Why: a consumer's compositor frame commits in 27 parts; Modified::take_at_commit was 14.9%
of commit_and_submit there (Noted::take 14.1%, the uses closure 8.1%): every commit scans every
noted range and asks each encoder record of each, and ranges of buffers no commit uses stay
noted. This bench measures that per-commit cost before and after the next commit.

Verified: run with the next commit's change, before and after, on the RX 7900 XTX.
2026-11-13 01:56:44 -08:00
Anees Iqbal 37769d1c7c Re-pin the runtime sources at the landing tip
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.
2026-11-13 01:53:55 -08:00
Anees Iqbal 066ab820bf RUNTIME_VERSION 2212: an idle device hands glibc's free heap back
Each device's idle sweep thread now looks at glibc's heap every 5 s (HEAP_EVERY), whether or not
a sweep is due, and trims (malloc_trim, counted in WorkCounts::heap_trims) when free heap stands
more than 256 MiB (FREE_FLOOR) above the least free it read since its last trim, on two looks in
a row. Before, the free heap went back only after a large pipeline making: an Iris Xe guest boot
held 3-4 GiB of free arena untrimmed (reims 24852). On hosts without glibc the thread makes no
look. That changes runtime behaviour.

Verified by the change's own runs on lavapipe (24983): 11/11, among them idle_heap_trim, which
frees 768 MiB of 64 KiB chunks but one in 16 and reads resident 941 MiB fall to 223 MiB after
9.8 s idle with 1 trim; with the heap look removed (24994) 946 MiB stays for 30.1 s with 0 trims
and the test fails. Lints green (24957, 24958).
2026-11-13 01:53:11 -08:00
Anees Iqbal 4f0b31f4da The process's trim count is glibc's alone
compile_memory's TRIMS counter and its atomic imports are read and written only by the glibc
forms of trim() and heap(). On a host whose allocator is not glibc's (macOS), the static was never
used and Ordering never imported, warnings that -D warnings makes errors. Both now carry the
same cfg as the code that uses them. No behaviour changes on any host.

Verified by reading: every use of TRIMS, AtomicU64 and Ordering in the file is under
cfg(all(target_os = "linux", target_env = "gnu")). Not compiled on macOS here; the macOS lint
is CI's.
2026-11-13 01:52:43 -08:00
Anees Iqbal 3b3739ce45 The idle sweep hands glibc's free heap back, not only a large making
glibc keeps what the process's threads free as free heap, its pages resident, until
malloc_trim hands it back, and only a large pipeline making's return called it. The memory
log of one Iris Xe cold boot at pin 66 (reims's 24852) shows the cost: 1.4 GiB of glibc's 4.0
GiB of arenas free at its end, after 3 trims in all, all from large makings.

Now each device's idle sweep thread also looks at glibc's heap every 5 s (HEAP_EVERY), whether
or not a sweep is due, and trims once the heap holds more than the floor (FREE_FLOOR, 256 MiB)
free above the least free a look read since the last trim, at two looks in a row
(idle_sweep::HeapLook). The least-free rule, not the bytes free alone, because glibc still
counts a trimmed chunk free: a plain fordblks rule would trim again at every look. A trim
counts in WorkCounts::heap_trims, as a large making's does. compile_memory gains heap_bytes()
and trim(), which return_free_heap now uses. Only on Linux with glibc; elsewhere the thread
makes no look and waits as before.

Docs: idle_sweep.rs and compile_memory.rs module docs, WorkCounts::heap_trims, the memory
log's paragraph in docs/API.md.

Tests: tests::idle_heap_look (the look's rule: trimmed at the second look, not again for what
a trim left, again for what was freed after it); tests::idle_heap_trim (device test, m2v_gpu
or m2v_cpu_icd, Linux gnu): 768 MiB of written 64 KiB chunks, all but one in 16 and the last
freed, then idle; the device's thread trims and the resident set falls by 512 MiB or more. The
lavapipe run and its negative control (no heap look: the test must fail) follow this commit.
2026-11-13 01:51:23 -08:00
Anees Iqbal f0ceab6a30 Re-pin the runtime sources at the landing tip
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.
2026-11-13 01:31:42 -08:00
Anees Iqbal 0772e7d3d0 RUNTIME_VERSION 2211: a commit's copies in from a host copy ride its batch, with no forced submission
Only copies in from real staging now count against the staged-copy bound (STAGED_BYTES,
STAGED_COPIES). A copy in from a host copy (the runtime's own mirror, or an import of the
caller's pages) holds no staging memory, counts toward no bound and makes no submission of its
own: Buffer::upload no longer calls submit_internal, and a commit's uploads go with its own
batch. Before, a commit naming more than 256 MiB of Managed ranges crossed the bound, submitted
internally and waited on the GPU inside the commit call: Geekbench's Photo Filter, Video Filter
and Path Tracer paid about 137 ms once an iteration on an RTX 3090 (internal_submissions +23,
about 137 ms outside the commit phases each). AtCommit's staging keeps the bound. When a commit
submits changes, so this changes runtime behaviour.

Verified by the change's own runs on the RTX 2080: ranges_past_the_bound_go_with_the_commit_s_batch
(528 MiB of ranges over the runtime's own buffer and an import) fails before the change with 2
internal submissions and a 280.7 ms commit, and passes after with 0, no bytes staged and a 28 us
commit, the GPU reading the right bytes; the AtCommit leg keeps its 2. Bench at 265 MiB a commit:
the commit call 140.2 ms -> 0.028 ms, completion unchanged at 140.5 ms. managed_copy_device 30
passed on the 2080 and on lavapipe; clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd and
rustdoc green.
2026-11-13 01:30:59 -08:00
Anees Iqbal 69e257b1a3 The first-move tests register staged copies as staging
What: tests/first_moves.rs passes Keeps::Staging to register_bytes, whose keeps the previous
commit typed.

Why: the lib test target did not compile at 9637bb69f9 (E0308 at first_moves.rs:56 and :113).

Verified: clippy --cfg m2v_gpu and --cfg m2v_cpu_icd failed there with exactly these two
errors (jobs 24857, 24858); the rebuild follows.
2026-11-13 01:30:31 -08:00
Anees Iqbal 7ea30d60e8 Copies from a host copy stage nothing: they count toward no staged bound and make no submission
What: texture/first_move.rs's FirstFill marks whether its source is a staging buffer of its
own (Keeps::Staging) or a host copy the buffer holds anyway (Keeps::HostCopy: a Managed
buffer's mirror, an import of the caller's pages). past_bound counts only staged fills toward
STAGED_BYTES and STAGED_COPIES, and a registration answers past the bound only where it staged.
Buffer::upload (the runtime's own mirror) and CallerCopy::copy_in from an import register
HostCopy and never call submit_internal; stage_in (pages no import maps, and AtCommit) and
Buffer::fill_first_from register Staging and keep the bound. Docs: first_move.rs's Bounded
bullet, managed_copy.rs's Copies in, Buffer::upload and copy_in_from.

Why: a commit's copies in of the ranges did_modify_range named counted toward the 256 MiB bound
of staged memory though they hold no staging memory; past it, Buffer::copy_in_from made an
internal submission on VkQueue 0 behind the GPU's queued work and waited for it inside the
commit call. A workload naming ~265 MiB of Managed ranges an iteration spent ~137 ms of each
iteration's commit there on the RTX 3090 (internal_submissions +23 a run, the commit phases
7-14 ms of 2.88-3.00 s). The copies now go with the commit's own batch, which the call does not
wait for; real staging keeps its bound. Which bytes a command buffer reads is unchanged.

Verified: see the evidence sent with the branch (the 2080 run of the previous commit's tests
before and after, the unit test, lint).
2026-11-13 01:30:31 -08:00
Anees Iqbal 40a45bcfd9 A commit naming ranges past the staged bound over host copies: its test and bench range
What: tests::managed_copy_device gains ranges_past_the_bound_go_with_the_commit_s_batch
(the default AtSubmission: a commit of a command buffer that reads ranges did_modify_range
named, 2 x 264 MiB over the runtime's own Managed buffer and an import of the caller's pages,
makes no internal submission and stages nothing, and the GPU reads the CPU's bytes) and
ranges_past_the_bound_at_the_commit_are_staged_within_it (AtCommit: the commit stages them,
the bound holding for that staging, and the GPU reads them). The copy-in bench gains a 265 MiB
range a commit.

Why: on the RTX 3090, three compute workloads spent 21 x ~137 ms a run in commit calls
outside every commit phase (perfscout2, w-3090 24751 at e5876e36b1: internal_submissions +23
each, the six phases summing to 7-14 ms of 2.88-3.00 s). Each iteration named ~265 MiB of
Managed ranges; the commit's copies in from the host copies counted toward the 256 MiB bound of
staged bytes though they stage nothing, so the copy that passed it made an internal submission
behind the GPU's queued work and waited for it inside the commit call. This commit is the
failing test; the next makes it pass.

Verified: not run yet at this commit (it fails without the next commit by design; the run on
the RTX 2080 follows with the fix).
2026-11-13 01:30:30 -08:00
Anees Iqbal 5f44928823 Re-pin the runtime sources at the landing tip
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.
2026-11-13 01:12:41 -08:00
Anees Iqbal 1b6ee76aae SEMANTICS_VERSION 2082, ARTIFACT_FORMAT_VERSION 516, RUNTIME_VERSION 2210: 8-bit floats widen natively where the device has them
On a device with VK_EXT_shader_float8 (shaderFloat8), 8-bit floats now widen through the
device's own Float8E4M3EXT and Float8E5M2EXT types: air.convert's f8e4m3fn and f8e5m2 sources,
simdgroup-matrix fp8 cells and matmul2d's fp8 elements all go through one decode, which bitcasts
each lane to fp8 and converts it with OpFConvert. That's the device's native form (owner rule 1).
IEEE-like f8e4m3 has no device encoding and keeps the integer decode, as do devices without
shaderFloat8. A tensor format widened natively records PrecisionNote::NativeFloat8
(native-float8): the device's e4m3 reads 0x7F and 0xFF as NaN where Metal reads a number, and
its e5m2 NaNs carry other bits. The float8 products refusal is removed.

The translator's output changes (SEMANTICS), the precision-note codec gains NativeFloat8
(ARTIFACT_FORMAT), and the runtime enables shaderFloat8 (RUNTIME). The golden tables and the
compile census are re-blessed at the next pin.

Verified by the change's own runs: 993 of 994 touched tests (24812), the one failure fixed and
rerun 59/59 (24835); matmul2d fp8 on nvidia-rtx50-linux declares Float8EXT and records the note,
and on MoltenVK, RADV and lavapipe gives exact words with neither; lints green (24813, 24814).
RTX 5080 against the M3 Max rows (24815, 18 fp8 cases): 4 equal, 14 differ only in NaN words,
each row carrying NativeNanEncoding and NativeFloat8 and the runtime announcing
metal2vulkan-degrade-native-float8.
2026-11-13 01:11:58 -08:00
Anees Iqbal d50b8de95b The every-extension device lists VK_EXT_shader_float8; the opened chains re-blessed
ash_interop::tests::every_feature_has_a_source reads every VkFeature from a fake device that
lists every extension; it lacked VK_EXT_shader_float8, so ShaderFloat8 had no source (24812). The
RTX 50 profiles' 8 opened validation contexts now chain VkPhysicalDeviceShaderFloat8FeaturesEXT
(one member more each), blessed by bless_opened_chains on msi (24812).
2026-11-13 01:11:23 -08:00
Anees Iqbal 42a13d17a9 The validation context's extension structures count shaderFloat8's
Verified by the lint A job that follows (24785 failed on the stale length 44).
2026-11-13 01:11:23 -08:00
Anees Iqbal 10f2539a71 8-bit floats widen through the device's own type where it has one
Owner rule 1: where a device has a native 8-bit float type, its conversion is the only form.
VK_EXT_shader_float8's shaderFloat8 (the SPIR-V capability Float8EXT, SPV_EXT_float8) is now a
VkFeature the device enables and the profile reads (leaf.float8); the SPIR-V IR has
Type::Float8 { encoding } (OpTypeFloat 8 with its FPEncoding, from the regenerated grammar items),
and the interpreter reads OCP's E4M3 and E5M2.

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

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

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

Tests: matmul2d's fp8 fused sums on the RTX 50 profile (Float8EXT declared, the note recorded,
e4m3 NaN sums) beside MoltenVK, RADV and lavapipe (neither); air.convert widenings on the RTX 50
profile and lavapipe; simdgroup-matrix fp8 cells on the RTX 50 profile too. Not yet built here:
the build and these tests run next on the cluster.
2026-11-13 01:11:22 -08:00
Anees Iqbal 705de13297 Re-pin the runtime sources at the landing tip
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.
2026-11-13 01:10:31 -08:00
Anees Iqbal 01a6271455 RUNTIME_VERSION 2209: an allocation at the limit takes back the blocks made ahead
A memory block the runtime makes ahead of need no longer takes the device's last allocation
slots from a caller's allocation. An allocation made ahead is admitted only where one more still
leaves the margin, checked in the same step as the count; it never waits at the limit and never
counts as refused. A making counts as work ahead unless a placement waits for it, and the
give-back thread now also frees blocks made ahead and not yet added that no call waits for
(Memory::give_back_ahead), counted in blocks_ahead_unused and memory_frees.kept_for_room. Before,
a speculative make-ahead could pass the margin check while live allocations were low, take the
last slot, and leave a caller's buffer refused at the limit with no block ever given back. That
changes runtime behaviour.

Verified by the change's own runs on lavapipe: the new forced test
blocks_ahead::an_allocation_at_the_limit_takes_back_the_blocks_made_ahead passes (24845, 1 buffer
of a room of 1, 1 block given back) and fails without the fix every time (24844, 0 of 1); the
guest-RAM test that failed 4 of 4 passes (24825, 3 of 3); clippy default and --cfg m2v_gpu,
runtime lib 1514/1514 and rustdoc green (24826).
2026-11-13 01:09:46 -08:00
Anees Iqbal 3f146f974b An allocation at the limit takes back the blocks made ahead
A guest's buffer at the device's allocation limit was refused while blocks the runtime had
made ahead of any object held allocations: on lavapipe,
tests::host_ram_device::an_allocation_at_the_limit_waits_for_the_untaken_chunks_to_go_back
failed 4 of 4 (2 buffers made of a room of 3, then TOO_MANY_OBJECTS at 5 of 5). A probe of every
vkAllocateMemory by site and thread showed the cause. After the give-back of the untaken
chunks left 2 live, the speculative making of the images' pool passed the margin check at 3
live, and its zero-initialized allocation was still under way when the guest's third buffer was
refused. keep_room's making for the encodings' pool took the other slot: a creation call's wait
counted as "wanted", so it bypassed the margin. The pooled blocks made ahead were never given
back at the limit; only the host-RAM chunks were.

- allocations.rs: an Ahead mark on the thread admits an allocation only where one more leaves
  the margin, in one step with the count (no check-then-allocate), and it never waits at the
  limit or counts as refused. It marks the give-back due.
- memory/ready.rs: a making is the runtime's work ahead unless a placement waits for it
  (Waits::Placement against Waits::Room). keep_pool_room's own making is marked ahead too.
- The give-back's thread also frees the blocks made ahead and not yet added that no call waits
  for (Memory::give_back_ahead). Their makings are stopped and joined; a making under way is
  ahead, so it never waits at the limit and takes no memory lock. The frees count as
  blocks_ahead_unused and memory_frees.kept_for_room.
- Tests: allocations::tests::an_allocation_ahead_takes_the_room_past_the_margin_alone_and_is_given_back,
  and blocks_ahead::an_allocation_at_the_limit_takes_back_the_blocks_made_ahead. The second forces
  the order: blocks made ahead are held, and the limit leaves no room ahead even once they go.
  Without the fix it fails every time.

Verified on lavapipe (msi):
- blocks_ahead's forced test passes: 1 buffer of a room of 1, with 1 block made ahead given
  back. On development without the fix (negative control) it fails every time: 0 of 1.
- The test that failed 4 of 4, host_ram_device's
  an_allocation_at_the_limit_waits_for_the_untaken_chunks_to_go_back, passes: 3 buffers of a
  room of 3, with 2 waits for the give-back.
- So do the rest of host_ram_device, blocks_ahead, posted_frees and allocations' unit tests
  (46 of 47; the 47th is the forced test, since fixed).
- Clippy (default and m2v_gpu), the runtime lib suite (1514 of 1514) and rustdoc are green.
2026-11-13 01:09:17 -08:00
Anees Iqbal a0fbffd078 The exportable recovery test checks that an import from before the recovery still writes the carried buffer
device_recovery_exportable compared the inode of a dma-buf export taken before a recovery with
one taken after it. On an RTX 3090 the two inodes differ. The recovery exports the block again
from the lost VkDevice, and NVIDIA's driver answers a new dma-buf to each export. Vulkan does not
say that two exports of one memory answer one file, so the inode check relied on undocumented
behaviour.

What the runtime documents is that the other API's imports still reach the carried buffer's
memory. The test now checks that instead. For each handle type, a second VkDevice imports the
export taken before the recovery. After the recovery it fills the memory and releases it to the
family the runtime acquires from (VK_QUEUE_FAMILY_EXTERNAL for an opaque descriptor,
VK_QUEUE_FAMILY_FOREIGN_EXT for a dma-buf). After Buffer::external_write_done, a copy of the
buffer and a copy of the texture over it both read the import's bytes. The allocation size,
offset and memory type are still compared; the inode is not.

The test does not check the other direction, the import reading what the runtime wrote. The
runtime releases nothing to the other API, and Vulkan leaves the contents undefined for an
entity that takes ownership without a release (External Resource Sharing). The module docs say
the same.

tests/exported_memory.rs's Writer now takes the handle type. For a dma-buf it enables
VK_EXT_external_memory_dma_buf and VK_EXT_queue_family_foreign. It imports as a memory type that
vkGetMemoryFdPropertiesKHR answers, preferring the exported one. The import is dedicated where
the allocation is, where the device imports only so, or where the buffer requires it; a
dedicated buffer spans the allocation (VUID-VkMemoryDedicatedAllocateInfo-buffer-02965).

Verified: the lib test binary under --cfg m2v_gpu at this change, each test in its own process,
passed device_recovery_exportable (OpaqueFd and DmaBuf both printing "the import before the
recovery wrote the carried buffer", allocation (67108864, 0, type) the same before and after) and
both exported_memory tests on an RTX 3090 and an RTX 2080 (NVIDIA 620.70.06) and a Radeon 780M
(RADV, Mesa 26.2.6).
2026-11-13 01:07:56 -08:00
Anees Iqbal 3620bb9dde Re-bless the authored compile census at 3bca3ce246
The census at the pin-66 tip (m3-max-24777): 2369 cases over 21 profiles, 48614 compiled, 1135
refused, 0 failed, 18 differences, 0 regressions. The slowest compile took 3.0 s and the largest
worker 232 MiB, inside the 20 s and 500 MiB ceilings.
2026-11-13 00:53:11 -08:00
Anees Iqbal 30cb6f1fc1 Re-bless the golden tables at 3bca3ce246
The golden tables at the pin-66 tip (m3-max-24776): 73 golden hash rows move under unchanged
keys and 4 are new, from the translator changes since pin 65 (half division and square root at
16 bits, SEMANTICS_VERSION 2080; whole grids on the partial-threadgroups variant, 2081; the fp8
matmul fixtures). The engine fixture expectations gain the tns_mm_fp8 and tns_coop_fp8 rows, and
tns_mm_fp8 gains its printout. Test data only.
2026-11-13 00:53:11 -08:00
Anees Iqbal 0224675e05 detach_lost: the no-copy bytes go only after the command buffer that writes them completed
The intermittent SIGSEGV (lavapipe, a full runtime suite, m3-max-24602)
was the test's own: its spinning kernel stores its count into the no-copy
buffer's bytes once it sees the raised word, and the test freed those
bytes (a heap allocation) right after it dropped the device's handle,
which does not wait for work in flight. The command buffer still held the
buffer, so the bytes had to stay mapped until it completed
(HostMemory::new's contract). The core (systemd-coredump on msi, gdb):
the process faulted in exit's frees at glibc's unlink check, the free
chunk at the test's 64 KiB-aligned allocation holding 0x0010fb16 in its
link, the kernel's count (1,112,854 loads).

The test now waits for the command buffer before the bytes go. Its
host bytes are pages of their own, unmapped at drop, and the word is
raised 200 ms late on a thread of its own, so a test that let the bytes
go first faults at the kernel's store every time rather than corrupting
the heap now and then.
2026-11-13 00:47:28 -08:00
Anees Iqbal 3bca3ce246 Re-pin the runtime sources at the landing tip
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.
2026-11-13 00:44:33 -08:00
Anees Iqbal 570f7a394a RUNTIME_VERSION 2208: a texture's placement over host pages is answered before their import
Device::host_pages_texture_placement, a runtime extension, answers where a texture over a
no-copy buffer of host pages imported by pointer or as dma-bufs would lie, before any buffer,
import or image is made; another backing is refused (Problem::HostPagesBacking). The buffer's
own placement query and the image-making path now ask the same image-free answers first and
make no image where those answers refuse every plan. The answers are unchanged, but the work
the runtime does to reach them changes, so this bumps the runtime's version.

Verified by the change's own runs on lavapipe (24747): both new tests pass over 8 shapes with
shader-read and unknown usage, by pointer, under the Shadow policy and as dma-bufs, each
pre-import answer equal to the buffer's, refusals included, with no image made by a pre-import
ask; texture_placement_device 2/2; runtime suite 2461/2462, the one failure the guest-RAM test
that fails without the change. clippy plain and --cfg m2v_gpu (24748, 24749), --cfg m2v_cpu_icd
(24722), rustdoc (24748). Not run on a real GPU.
2026-11-13 00:43:50 -08:00
Anees Iqbal 72562e193a The pre-import placement's docs, and its test compares refusals too
What: Buffer::texture_placement, TexturePlacement::InPlace, InPlaceRefusal and route.rs say
what the query answers before it makes images and what host_pages_texture_placement answers
before the buffer; docs/API.md, docs/HOWTO.md and the runtime README name the new query. The
test compares both calls' results, refusals included (a plane past the buffer's length is
refused as PastBuffer by both, not answered PastLength), and asks rows of 8 bytes too.

Why: lavapipe m3-max-24732: every shape both queries decide answered alike (CheckFailed by
pointer, Unchecked over dma-bufs, InPlace elsewhere), but the past-length shape is a refusal
of both calls, which the test unwrapped.

Verified: pending the lavapipe run.
2026-11-13 00:43:10 -08:00
Anees Iqbal 1ace4b5c46 The pre-import placement test counts the asking thread's images; signatures and refusals
What: tests/host_pages_placement.rs reads ObjectChurn::vk_images_made_this_thread (the
WorkCounts field it named does not exist); api_signatures.tsv blessed for
Device::host_pages_texture_placement and Problem::HostPagesBacking; docs/REFUSALS.md
regenerated.

Why: the test did not compile (m3-max-24729); the public surface changed.

Verified: pending the lavapipe run.
2026-11-13 00:43:10 -08:00
Anees Iqbal cee38fc83b Device::host_pages_texture_placement answers a texture's placement before any buffer of the pages
What: a runtime extension, Device::host_pages_texture_placement(backing, descriptor, plane,
start, length), answers where a texture new_texture_with_iosurface_plane makes would lie over a
no-copy buffer of length bytes from host address start whose pages the device imports by
pointer or as dma-bufs, before any such buffer, import or image is made. It shares the making's
steps rather than copying them:
- make_texture_over's checks that read the buffer only for its length, options and detached
  state are shape_over (OverFacts, Shape, ShapeKind), which both the making and the new query
  call;
- the route is host_route over a HostLie (route_over_pages beside route_over_buffer, with
  levels_or_past shared), and placement_over takes the buffer's texels or the pages (Bytes);
- the image in place is decided by in_place_unmade, the same image-free answer the buffer's
  query now asks first; where only an image or the import decides, the answer is InPlace;
- kept_in, past_kept and owns_padding are the rules Texels used inline, now shared.
Another backing is refused (Invalid, Problem::HostPagesBacking), and a length the no-copy
buffer refuses as it does (Nil, BufferLength).

A test (tests/host_pages_placement.rs) asks a spread of shapes before and after the buffer, by
pointer, under the Shadow policy, and as dma-bufs where udmabuf opens: equal where the answer
is not InPlace, an image- or import-decided answer after where it is, and no VkImage made by
the pre-import query.

Why: reims's verdicts lane asks the placement of guest pages before it maps them.

Verified: pending the lavapipe run.
2026-11-13 00:43:10 -08:00
Anees Iqbal c26c2b142b A texture's placement over a buffer and over pages not yet imported share one decision
The shape checks that read a buffer only for its length, options and detached state become
shape_over, which make_texture_over calls; the route is placement_over over the buffer's texels
or pages not yet imported (Bytes), in texture/route.rs. Problem::HostPagesBacking refuses a
placement asked of pages for a backing other than an import by pointer or as a dma-buf. This is
the groundwork the next commit's Device::host_pages_texture_placement uses; that commit carries
the description, the test and its evidence.
2026-11-13 00:43:10 -08:00
Anees Iqbal 12a18ecc4b The placement query asks the device's image-free answers before it makes images
What: Buffer::texture_placement's answer for an image in place now asks first what the device
answers without making an image (Device::in_place_unmade): rows that share bytes, and for
every plan the making would try, the checks its image steps run before vkCreateImage (the
linear tiling's features and the host-allocation format query and limits, then the
DRM_FORMAT_MOD_LINEAR checks; over dma-bufs, dma_buf_unmade). Where those refuse every plan,
the answer is that refusal and no image is made; else the query makes and releases its images
as before. The making's image steps call the same check functions (external_linear,
pitched_unmade, dma_buf_unmade, neither), split out of external_linear_image, pitched_image
and dma_buf_image_unbound, so the rules have one copy. The wider plans take how the texels lie
(HostLie, Texels::host_lie) in place of the texels, and unplaced dispatches by one memory
function (in_place_memory).

Why: the coming host_pages_texture_placement answers before any import and must make no image;
it shares this decision.

Verified: pending a build and the placement tests.
2026-11-13 00:43:10 -08:00
Anees Iqbal e4f7cc81c8 Re-pin the runtime sources at the landing tip
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.
2026-11-13 00:42:40 -08:00
Anees Iqbal b0663eabc1 RUNTIME_VERSION 2207: a merged execution with no whole chunk draws an empty first draw
The last merge pass now writes a merged execution's first draw as 0 vertices x 0 instances when
the total holds no whole chunk, in place of a chunk's 2^31 - 2 vertices x 0 instances. The vertex
variant reads the chunk from the scratch's header, not from the draw, so no other answer changes.
The trail GPU-form tests now also print their command buffer's GPU time. Changing the draw a
merged execution records changes runtime behaviour.

Verified by the change's own runs: on the RTX 2080 (24755) the 4-command trail test's command
buffer takes 0.526 ms against 0.707 ms before; the indexed 8162-command test is unchanged at
18.6 ms, so the zero-instance draw was not the RTX 3090's slow frame. 50 bind::replay tests and
clippy pass (24757).
2026-11-13 00:41:57 -08:00
Anees Iqbal f57e036303 The trail GPU-form tests print their command buffer's GPU time 2026-11-13 00:41:29 -08:00
Anees Iqbal d3c3d502f3 The merged form's first draw is empty where the total holds no whole chunk
The last merge pass wrote the first draw as a chunk's 2^31 - 2 vertices in no instance whenever
the total was below a chunk. It now writes no vertex in no instance there. The vertex variant
reads the chunk from the header, not from the draw, so nothing else reads the change.

Measured on the 2080 (NVIDIA 620.70.06, m3-max-24755): the 4-command trail test's command buffer
went from 0.707 to 0.526 ms of GPU time. The 8162-command indexed one stayed at 18.6 ms, so a
zero-instance chunk is not what costs that one. The interpreter's merge tests (50 bind::replay
tests) and clippy pass (m3-max-24757). The trail tests' expected lines now read the first draw as
0 vertices x 0.
2026-11-13 00:41:29 -08:00
Anees Iqbal 0fb220805f Re-pin the runtime sources at the landing tip
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.
2026-11-13 00:38:19 -08:00
Anees Iqbal 507f40e387 RUNTIME_VERSION 2206: a recovery carries indirect command buffers, function tables and argument encoders
A device recovery now carries every kind of object the runtime's API makes that holds state on the
lost generation:
- An indirect command buffer keeps its records where they lie in the runtime's own pages. In
  pooled memory they are lost, so every command is reset. The programs its commands run are made
  again.
- A visible function table keeps its entries, in place or written again from a host copy.
- An argument encoder follows its device (ArgumentEncoder::device now returns the generation by
  value).
The lost generation's live-buffers table now closes at its rest (LiveBuffers::close in
keep_nothing), so the lost VkDevice no longer lives on after a recovery. Both change runtime
behaviour.

Verified by the change's own runs: lavapipe 42/42 recovery, indirect-command-buffer and
released-program tests (24660, rebased tip 24743); with close made a no-op both new tests fail at
the live-VkDevice count (24669); the every-kind test fails on the product before the carry
(24481). GPU: 780M 42/42 (24687), Iris Xe 42/42 (24686), RTX 3090 41/42 (24685), the one failure
an existing one development shares (24704, the DmaBuf re-export test). function_tables and
argument_buffers lanes 28/28 on all three. clippy clean in every configuration (24661).
2026-11-13 00:37:35 -08:00
Anees Iqbal 2c21b3e6f1 A recovery carries indirect command buffers, visible function tables and argument encoders; one test over every kind
What: a device's recovery now carries the three kinds a program makes that it left the lost
generation's, so each is the same object on the new VkDevice, as Metal keeps its objects:
- An indirect command buffer (`indirect_command_buffer/carry.rs`). Its records' storage and its
  slots past them are buffers of the runtime's own whose `contents` pointer no program holds,
  carried as such (`Buffer::carry_runtime`): in the runtime's own pages, the same pages and the
  records as they are; in pooled host-visible memory, new memory, the records lost with the
  VkDevice (vkspec 5.2.3), written again as a new buffer's: its header, every command reset.
  The program each command's state runs is the state's program there (made by the state's
  carry, after it), or a released state's made again there, as are the programs it keeps for
  GPU-written records (`released_programs.rs`); its kept chunk recordings go; the new
  generation's keepers list it where the GPU may write it. Its records ID, address,
  gpuResourceID, uniqueIdentifier and label are the line's and stay.
- A visible function table (`function_table/carry.rs`), after its pipeline state: its words
  buffer carried the same way; where it went to new memory, the words written again from a
  host copy the table now keeps of what the CPU wrote (`TableShared::writes`), so its entries
  call what they called; listed among the new generation's tables. A table whose state stays
  the lost generation's stays with it.
- An argument encoder: it holds no Vulkan object, so its device becomes a `LineDevice`, the
  handle carried; `ArgumentEncoder::device` answers the generation handle by value (it answered
  a borrow).
The registry keeps both buffer kinds weakly (`Carry::indirect_command_buffer`,
`Carry::function_table`), the recovery carries them after the pipeline states, and its notice
counts them (`", and N indirect command buffers, M of them whose records were lost (every
command reset)"`, `", and N visible function tables with their entries"`). The docs of what a
recovery carries and leaves say so: `RuntimeGap::MadeBeforeRecovery`,
`Degradation::DeviceRecovered`, docs/API.md, the runtime's README, `device/carry.rs`.

Why: after a 3090 recovery, `resetCommandsInBuffer:withRange:` on an indirect command buffer
made before it was refused (`MadeBeforeRecovery`) thousands of times and every later command
buffer of the pass failed, where Metal's buffer goes on. The whole class at once: every kind a
program can make, each with its carry status, was listed for the change (none other was left
uncarried that holds only what the program could make again; sparse heaps and textures and
pooled `Shared` buffers stay left, as documented).

Test: `device_recovery_every_kind::every_kind_of_object_made_before_a_recovery_serves_after_it`
makes one of each kind (a queue, a `Private` buffer, a heap and a placed buffer, a texture, an
event, a shared event, a fence, a sampler state, a depth/stencil state, a library and function,
a compute and a drawing state, an address pool, a rasterization rate map, a binary archive, a
dynamic library, an indirect command buffer of dispatches executed before and one of draws, an
argument encoder, a visible function table called before), recovers, uses each on the next
generation by command buffers that complete (the indirect buffers reset by a blit and encoded
again, the table called and set, the encoder writing), and ends with the lost VkDevice gone
while all live. Helpers made `pub(super)` in the pipelines and states recovery tests.

Verified, at the change on a0b85d89d4: the every-kind test passes on lavapipe (msi, nextest, one process a
test, with the 41 other recovery, indirect-command-buffer and released-program tests), on the
Radeon 780M (RADV) and the Iris Xe (ANV), 42 of 42 each, and the RTX 3090 (41 of 42: the exportable test's
DmaBuf re-export inode, which development fails the same way there). Its negative control, the
product's sources at bfcd63c5e2 and the test kept, fails at the notice's count of the indirect
command buffers (lavapipe). The validation lanes `function_tables` and `argument_buffers`
(the argument encoder's device): 28 of 28 on the 780M, the Iris Xe and the 3090. Clippy of
the runtime, validation and conformance (all targets and features, --cfg m2v_gpu and
m2v_gpu_hazards): no message. The API signatures check passes (`ArgumentEncoder::device`
blessed); docs/REFUSALS.md is unchanged.
2026-11-13 00:37:07 -08:00
Anees Iqbal ce6bc460cf A lost generation's live buffers' table goes at its rest: the lost VkDevice no longer lives on
What: at a lost generation's rest (`DeviceShared::keep_nothing`), its table of the live buffers
and the table's spare go (`LiveBuffers::close`), before its recycler closes, so their buffers
park there and go with it. The table's lifetime rule says so (`live_buffers.rs`: its module docs
and `Inner::current`, `Inner::spare`), and `keep_nothing` lists it among the device-level objects
of work.

Why: the table's upload buffer (and the spare), buffers of the runtime's own on the generation,
hold it "only while a listed buffer lives, which holds it too". A recovery breaks that rule: it
carries the listed buffers on, and they stop holding the lost generation, but no command buffer
runs there again to make the next change that would drop the table. So once any command buffer
had made the table (an indirect command buffer's execution, which resolves its records'
addresses through it), the lost `DeviceShared` kept two strong holds (the upload buffer's handle
and its pages') for the life of the process, its `VkDevice` and driver memory with it, after the
program let go of everything. Development had it before this change (a diagnostic on lavapipe:
"1 tables made", live VkDevices 2 before and after the program's release of everything; the
generation came to rest).

Test: `device_recovery_live_table::a_lost_generation_s_live_buffers_table_goes_at_its_rest`.
An indirect execution makes the table (`WorkCounts::live_tables_uploaded` rises: the path ran),
the buffer and its state go, the three buffers live past a marked loss (not a parked
generation); the live VkDevices fall to 1 while they live, and stay 1 once they go. Its helpers
(the indirect state, buffer, command and execution) serve the every-kind test next.

Verified, at the change on a0b85d89d4 (with the carry after it): on lavapipe (msi, nextest, one process a
test) this test and the 41 other recovery, indirect-command-buffer and released-program tests
pass; its negative control (`close` made a no-op) fails it at the live count with the buffers
alive (after the test's 60 s wait), and the every-kind test at its end. On the GPUs, one
process a test: the Radeon 780M (RADV) and the Iris Xe (ANV) pass it with the 41 others; the RTX 3090
passes it, and fails one other, the exportable test, as development does there (its DmaBuf
re-export's inode). Clippy of the runtime, validation and conformance (all targets and
features, --cfg m2v_gpu and m2v_gpu_hazards): no message.
2026-11-13 00:37:07 -08:00
Anees Iqbal 9906832ceb Re-pin the runtime sources at the landing tip
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.
2026-11-13 00:23:01 -08:00
Anees Iqbal b6131002df A compute pipeline's making names itself and dumps its module before the driver's call
With METAL2VULKAN_LOG_PIPELINES on, a compute VkPipeline's making now logs a line as it starts,
before vkCreateComputePipelines: the kernel, its SPIR-V hash and words and its specialization.
With METAL2VULKAN_DUMP_PIPELINES set, its module is written then, not after. A making that never
returns (a driver compile that runs for tens of minutes) is the start line without its made
line, and its module is on disk, where before neither the line nor the module appeared until the
driver returned. Default-off diagnostics; no product path changes.

The made line no longer writes the module (the start did). The compute log test checks that the
start line, with the same module hash, comes before the made line.
2026-11-13 00:21:49 -08:00
Anees Iqbal e47cfad71f Re-pin the runtime sources at the landing tip
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.
2026-11-13 00:19:23 -08:00