Commit Graph
4936 Commits
Author SHA1 Message Date
Anees Iqbal 4ee6172a10 Test that a binary archive and a dynamic library go on past a recovery
What: a device test (device_recovery_states.rs). Before a recovery it makes a binary archive
with one compute add and a labelled dynamic library: a metallib of file type 2, one exported
function, built with devtools' metallib writer. After the recovery the archive must take
another add and be listed by a creation that makes its state on the new generation. The
dynamic library must keep its label, and the lost `VkDevice` must go while both live.

Why: both hold only compile-layer artifacts, but each keeps a handle of the generation it was
made on. So an archive's adds and every creation that lists it are refused after a recovery
(`binary_archive::check` compares devices), and each keeps the lost `VkDevice` alive. A
pipeline state's carry remakes it on the new generation, which needs the archives it may list
to serve there.

Verified: expected to fail at this commit (the add after the recovery is refused); the fix
follows.
2026-11-12 16:35:28 -08:00
Anees Iqbal 70c666b243 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-12 16:30:46 -08:00
Anees Iqbal 1fefc3d956 SEMANTICS_VERSION 2065, ARTIFACT_FORMAT_VERSION 510, RUNTIME_VERSION 2167: a one-row ragged dispatch of a simdgroup-only kernel runs flat in the call's threadgroups
The four commits before this one. A ragged dispatch of a kernel that uses simdgroups was split into a body and an edge
variant, a second full compile of the same kernel (Blender's Cycles kernels on RADV: concurrent ~11 GiB compiles).
The kernel partition now has three classes, decided from structure alone (barrier execution scope, fence and atomic
scope, simd_/quad_ functions, is_uniform, the simdgroup size, the lane builtins): Oblivious, Simdgroups and Observed;
air.all/any of a bool vector now counts as the thread's own (a BoolReduce false positive). New:
KernelFacts::partition_simdgroups, LoweringInputs and VariantKey::call_threadgroups, RuntimeFact::CallThreadgroups
(Variant mechanism, fact id 97). Under flat_grid + call_threadgroups invocations count by subgroup lane order in the
flattened tiers, so workgroup w is Metal's threadgroup w with its simdgroups; the lane builtins are derived; lanes past
the grid return before the body. The compile refuses the bit without flat_grid, with replay_bindings, or for a module
that would hold a workgroup barrier. The runtime's flat_direct tries the plain flat variant first and, for a one-row
grid in one-row threadgroups, then the call variant (its own refusal flag; None, unremembered, when the threadgroup
size asks for emulated simdgroups). Indirect and replay paths still need an oblivious kernel; a kernel with a
threadgroup barrier keeps the split.

Verified (on the branch): m3-max-23184 (gem10, at 4c5d46f8d9) workspace clippy all features, clippy m2v_gpu on runtime
and validation, rustdoc, 136/137 translator tests (the one a test's use of flat_rmw, fixed after), lavapipe 7/7
(FLAT-SIMDGROUPS VkPipelines [1, 2, 2, 2]; lavapipe's 8-lane subgroups emulate the sum, so it splits); m3-max-23193
(8a46347092) 10/10, a_flat_grid_of_the_call_s_threadgroups_admits_a_kernel_of_simdgroups over every committed
profile; 780M RADV (m3-max-23200) 4/4, VkPipelines [1, 2, 2, 1]: the simdgroup barrier + simd_sum kernel runs flat in
one VkPipeline, every thread's word matching Metal's partition, the partial last simdgroup's sum included;
m3-max-23202 workspace and m2v_gpu runtime clippy clean. No guest kernel was dispatched through this path.
2026-11-12 16:29:57 -08:00
Anees Iqbal 59d7e9d86a Test the call's flat variant on a simdgroup barrier and sum, not the lockstep kernel
flat_rmw's inserted lockstep barrier makes its partition observed, not the simdgroups' alone,
so it has no flat variant of the call's threadgroups either (m3-max-23192: NotRepresentable on
amd-780m-hawkpoint-radv where the test asked for NotImplemented). The simdgroup barrier with
simd_sum is the case the device test runs.
2026-11-12 16:29:20 -08:00
Anees Iqbal fb41ed11d9 Name the simdgroup kernels' one-row flat dispatch in the split-dispatch notice's entry 2026-11-12 16:29:20 -08:00
Anees Iqbal 69ef9c2ba8 Describe the exact-waits test device as the held makings now stand
Its doc still said a Bounded recording past its bound drops the draw or dispatch, which the hold
change removed: a command buffer waits for its makings under either wait. Doc only.
2026-11-12 16:29:20 -08:00
Anees Iqbal 979efab2f1 A one-row ragged dispatch of a simdgroup-only kernel runs flat in the call's threadgroups
A direct dispatchThreads: whose grid is not a whole number of threadgroups split into an
interior and an edge region, each its own VkPipeline, for every kernel that observes its
threadgroup partition. A kernel that observes it only through its simdgroups (simdgroup
barriers, simdgroup and quad functions, lane builtins) computes the same in any partition that
keeps its threadgroups, so for a one-row grid in threadgroups of one row it can run Metal's own
single dispatch: the flat grid, in the call's threadgroups, with the last simdgroup's lanes past
the grid returned before the body, as Metal's partial simdgroup lacks them. A guest's 4.5 M-word
kernel that observes its partition only through simdgroup barriers took 116 s per VkPipeline on
the RX 7900 XTX; its edge no longer compiles a second one.

Translator:
- partition.rs classifies a kernel as oblivious, simdgroups-only or observed. The decision uses
  structure only: barrier and fence/atomic scopes, simd_/quad_ functions, is_uniform, the
  simdgroup size, and the builtins thread_index_in_simdgroup, thread_index_in_quadgroup and
  threads_per_simdgroup. air.all/air.any of a boolean vector (BoolReduce) no longer counts as an
  observation: it is a thread's own vector reduction.
- New KernelFacts::partition_simdgroups.
- LoweringInputs, VariantKey::call_threadgroups and RuntimeFact::CallThreadgroups (Variant
  mechanism): with flat_grid, the invocations count their threads by lin (the flattened tiers'
  subgroup order), so workgroup w is Metal's threadgroup w with its simdgroups, and the lane
  builtins are derived.
- The compile admits a simdgroups-only kernel under it. It refuses the input without flat_grid
  or with replay_bindings, and refuses a module that would hold a workgroup barrier (emulated
  tier, or a simdgroup barrier at workgroup scope where the subgroup is not the simdgroup).

Runtime: flat_direct tries the flat variant of any threadgroups first. For a one-row grid in
threadgroups of one row, it then tries the call's variant (settle_flat(.., call)), which keeps its
own refusal flag and skips a threadgroup size that asks for emulated simdgroups. Indirect and
replay paths still need an oblivious kernel.

Tests:
- partition classes: each builtin and feature, mixed cases, boolean reductions;
- the artifact's two facts;
- the input's key;
- a_flat_grid_of_the_call_s_threadgroups_admits_a_kernel_of_simdgroups over every committed
  profile;
- the device test flat_simdgroups. It covers: lanes in one row (1 VkPipeline); two rows and a
  threadgroup barrier (2, the split); a simdgroup barrier with simd_sum (1 where the tier asks for
  full subgroups, else 2). Every thread's word is checked against Metal's partition, including
  the partial simdgroup's sum.

ARTIFACT_FORMAT_VERSION bump (KernelFacts gains a field) is main's.
2026-11-12 16:29:19 -08:00
Anees Iqbal 19e8c1a09b 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-12 16:28:50 -08:00
Anees Iqbal 1e51d7a4ba RUNTIME_VERSION 2166: a recovery carries textures, their views and those over carried buffers
The six commits before this one. After a device recovery every texture made before it was refused
(MadeBeforeRecovery). A recovery now carries them: a texture made by new_texture (any storage mode) is made again as
a new texture, its contents lost (its only copy is an optimal image in driver memory; Vulkan leaves device memory's
contents undefined after a loss); a texture over a buffer the recovery carried (no-copy and guest-RAM buffers, fresh
pages, Shared buffers in the runtime's page blocks) is made again over the same re-imported pages, keeping what the
buffer keeps; a texture buffer of new_texture is made again over its carried texels buffer; views follow their
textures. Left and refused as before: heap textures, textures over the caller's VkImage, sparse and shareable
textures, textures over a buffer the recovery left, and their views. The notice counts textures whose contents were
lost by storage mode ("a `Shared`, b `Managed`, c `Private` or memoryless") beside those over carried buffers.
carry.rs says imported memory's content is undefined after a loss: the hung work's writes may land partially; once
the lost import is dropped, the pages are only our memory. FAST-PATHS known gap: a recovery loses new_texture's
contents in every storage mode.

Verified (on the branch, lavapipe, m3-max-23179, CONTROL_OK): both texture tests fail before the change on the notice
and pass after; all recovery tests pass single-threaded; a Shared texture over fresh pages reads back through the GPU
the bytes the host wrote before the recovery; a Shared texture buffer's texels in a runtime page block are the same
buffer object after it, same bytes; the notice counts 1 Shared, 1 Managed, 1 Private lost and 2 over carried buffers;
texture, view, in_place, shadow, heap and faces filters pass. Clippy plain plus rustdoc, m2v_gpu, m2v_cpu_icd
(m3-max-23180..23182).
2026-11-12 16:28:10 -08:00
Anees Iqbal 9b308145e9 A texture buffer goes on over its carried texels; the notice counts lost textures by storage mode
What: Texture::carry makes a texture buffer of new_texture again over its texels' buffer where the
recovery carried that buffer (texture_buffer_over, the runtime's own ID use), so a Shared one
reads the bytes the buffer carry kept; where the buffer was left it is made new as before.
Remade splits the textures whose contents were lost by storage mode (Shared, Managed, Private or
memoryless), and the recovery's notice says those three counts. carry.rs says how kept bytes are
read: Vulkan makes the content of external memory imported to a lost device undefined (vkspec
5.2.3), read as the hung work's writes possibly landing in part; once the lost import goes, the
pages are only our or the caller's memory. Docs: texture/carry.rs, carry.rs, the
DeviceRecovered cost (degradation.rs, docs/API.md, equal), the runtime README, and a known gap in
docs/FAST-PATHS.md: a recovery loses the contents of textures whose only copy is device memory
(new_texture of any storage mode), textures over carried pages keeping what their buffer keeps.

Why: the consumer asked for Shared textures' contents kept across a reset. A texture of
new_texture of any storage mode has no copy outside its image in the lost VkDevice's memory, so
keeping it would need a CPU copy at a cost to every frame; decided against for now, and recorded
as the known gap. Textures over carried pages already keep their bytes; texture buffers did not.

Verified: see the lane run reported with this sha (the test commit before it fails, this one
passes).
2026-11-12 16:27:36 -08:00
Anees Iqbal 7983fb57b7 Test that a recovery keeps the bytes of textures over carried pages and counts those it lost
What: a device test (device_recovery_textures.rs). A Shared texture over a buffer in fresh pages
reads, through the GPU, the bytes the host wrote before the recovery. A Shared texture buffer of
new_texture is made over its texels' buffer where the recovery carried that buffer with its bytes
(a block of the runtime's own pages; logged as CARRY-TEXTURE-BUFFER), and reads them. Textures of
new_texture of each storage mode, whose only copy was their image, are counted lost by storage
mode in the recovery's notice. The first texture test now expects that count's wording too.

Why: a texture buffer of new_texture was made again over a new buffer, its carried texels lost
even where the buffer carry kept them; and the notice did not say which storage modes' contents
a recovery lost, which a consumer logs once per recovery.

Verified: fails at this commit (the notice's wording, the texture buffer over a new buffer), passes
with the change after it; see the lane run reported with these shas.
2026-11-12 16:27:36 -08:00
Anees Iqbal 291fadc532 Pass the recorded call's name to the texture carry's makings as it is
What: `Texture::carry` passed `*call` where the call's name is a `&&'static str` that
auto-deref makes the `&'static str` the makings take.

Why: clippy's `explicit_auto_deref` refused it (jobs m3-max-23061 to 23063, all three
configurations).

Verified: the lint run that follows covers this tree.
2026-11-12 16:27:36 -08:00
Anees Iqbal d3c8e27229 Fix the recovery tests' build: a shadowed heap name and a needless mut
What: device_recovery_carry's main test named its `Shared` heap `left`, which a later
`(kept, left)` binding shadows. The heap is now `shared_heap`. device_recovery_textures'
`clear` held its render encoder in a `mut` binding it never mutates.

Why: the texture carry commit's lavapipe build failed on them (job m3-max-23060: E0689 at
device_recovery_carry.rs:282 and 284, and an unused-mut warning).

Verified: the lane run that follows builds this tree.
2026-11-12 16:27:36 -08:00
Anees Iqbal b564fb7a91 A recovery carries textures, their views and those over carried buffers
What: a device's recovery now carries the program's textures made by a call it can make
again (texture/carry.rs). That covers a texture of `Device::new_texture`, a texture over a
buffer the recovery carried (`Buffer::new_texture` and its kin), and a view of either.

- The call is made again on the new generation as the runtime's own texture, which takes no
  ID. That texture holds the program texture's parts there: `TextureShared::next`, with a
  `carried` flag.
- `Texture::s` picks the parts the work at hand reaches. Inside a command buffer's work it
  answers that generation's parts (`NoticesFor::generation`); elsewhere, those of the
  generation the texture was carried to last. The buffer carry picks its parts the same way.
- Every read of a per-generation field goes through it: `storage()` (the hub), facts, faces,
  usage shadows, storage forms, render shadows, snapshots, memoryless backings and planes in
  place.
- The texture object keeps its `ObjectId`, resource ID, label, parent and handles, and its
  purgeable state is copied across. Its ID's slot in the new generation's texture table and
  heap sets names its parts there (`heap_sets::place`), and leaving the slot walks every
  generation's parts.
- Each program texture is kept by its generation's carry registry as it is made
  (`Carry::texture`). The call that made it sets how to make it again (`Remake`) and carries
  it itself where the take came first (`Device::kept_texture`, `Carry::late_texture`).
- The carry runs inside a `NoticesFor::of_generation` scope for the new generation, so the
  buffer it remakes a texture over and a view's parent answer their parts there.
- Left refused, and counted by kind in the notice: a heap's texture or one over a heap's
  buffer, a texture over the caller's `VkImage`, a sparse or shareable texture, a texture over
  a buffer left, and their views.
- The notice adds ", and N textures whose contents were lost too (they read as new ones), M
  textures over the buffers carried and V texture views".

Known gap, documented in API.md, the README and device/carry.rs: a carried texture's images
on the lost generation, and so the lost `VkDevice`, stay until the texture goes. Letting them
go at the lost generation's rest needs a hold of the parts by each call outside command
buffers' work, as `Buffer::held_parts` does for buffers.

Why: render targets and display textures made before a recovery were refused
(`MadeBeforeRecovery`) where they met the new `VkDevice`, while Metal's go on.

Tests: device_recovery_carry's main test now leaves a `Shared` heap instead of a texture as the
object that keeps the lost `VkDevice`. Its held-parts test now expects the texture made by a
call that completed on the lost generation to be carried by its maker. Docs updated:
`MadeBeforeRecovery`, the device-recovered cost (degradation.rs and docs/API.md, kept equal),
the runtime README and the heap docs. docs/REFUSALS.md regenerated (`view` became `view_as`).

Verified: the lane run of the test commit before and this one after is reported with its sha.
2026-11-12 16:27:35 -08:00
Anees Iqbal 0fdfa9414e Test that a recovery carries textures, their views and those over carried buffers
What: a device test (device_recovery_textures.rs). Before a recovery it makes a `Private`
render target with `new_texture` (labelled), a view of it, and a texture over a `Private`
buffer. After the recovery the notice must count one texture made again, one over a carried
buffer and one view. Each must be the same texture object on the next generation (its
`ObjectId`, resource ID and label). The texture over the buffer must read the buffer's bytes
there (zero, then what a GPU fill writes). The render target must render in a pass, read back
through itself, its old view and a view made after the recovery. Its parts on the lost
generation keep the lost `VkDevice` until the textures go.

Why: no recovery carries a texture today, so every render target and display texture made
before a recovery is refused (`MadeBeforeRecovery`) where it meets the new `VkDevice`, while
Metal's go on.

Verified: expected to fail at this commit (the notice counts no textures); the carry follows.
2026-11-12 16:27:35 -08:00
Anees Iqbal 0c0cdf0b12 Re-bless the golden tables at cb8e82cf84
109 golden-hash rows move: the modules that resolve loaded pointers through the resident-set search no longer carry
its 16 unrolled steps before the loop (SEMANTICS_VERSION 2064). That change's own run (m3-max-23010) showed
golden_hashes failing for those rows (852 cells). No engine golden, printout or inventory row moves.

Verified: bless on the M3 at cb8e82cf84 (m3-max-23199): golden hashes blessed, engine goldens pass; merged check at
the same sha on msi (m3-max-23198): clippy every crate with --cfg m2v_gpu, api_signatures, api_surface, fast_paths
43/43, rustdoc -D warnings.
2026-11-12 16:26:54 -08:00
Anees Iqbal cb8e82cf84 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-12 16:21:18 -08:00
Anees Iqbal 378b5b9ef1 RUNTIME_VERSION 2165: an IOSurface plane over a buffer that declares its padding unobserved takes the declaration
The two commits before this one. Texels::padding_owned() answered false for every IOSurface plane, so Padding::of gave
Kept and BufferDescriptor::padding_unobserved never upgraded it: a plane whose texels share a line of memory with its
rows' padding (a consumer's Safari tiles on an Iris, 10472-byte rows in 64-byte lines written back whole) took a
shadow at any pitch (411 tile shadows in one walk, about 1.2 MB a frame). Surfaces were left out because Metal keeps
an IOSurface plane's padding even under kernels; where the buffer's maker declares the bytes between rows unobserved,
keeping and changing them cannot be told apart, so a plane over such a buffer, holding its last row to its pitch with
its rows on lines, now answers Free and so Unobserved. Without the declaration it stays Kept.

Verified (on the branch): lavapipe (m3-max-23145) the new test fails at 5c63c7b696 (the declared plane "a shadow")
and passes at abea616629 (the declared plane "a DRM_FORMAT_MOD_LINEAR image at the pitch", the undeclared one still a
shadow), padding_unobserved 6/6; clippy three ways, rustdoc, api tables (m3-max-23146). Of the walk's 413 tile shadows
184 qualify (10480 pitch); the other 207 (1104 pitch over 61440-byte buffers) end their last row inside a line with
bytes past it.
2026-11-12 16:20:38 -08:00
Anees Iqbal 36316325da An IOSurface plane over a buffer that declares padding unobserved takes the declaration
What: Texels::padding_owned is true for an IOSurface plane's rows where the buffer declares the
bytes between a texture's rows unobserved (BufferDescriptor::padding_unobserved), as for a
buffer's rows: such a plane whose rows, each to its pitch, share no line with bytes past them has
Padding::Unobserved, so a render asks the check of renders over unobserved padding
(Access::UnobservedRenders) and a shader's writes the check that lets the padding change. Without
the declaration a plane's padding stays Kept. The docs of Padding, Padding::of, padding_owned,
Texels::padding, in_place.rs's module docs and BufferDescriptor::padding_unobserved say so.

Why: Metal keeps an IOSurface plane's padding under every command, but bytes the buffer's maker
declares nothing reads cannot tell keeping from changing. A guest's WebGL page on the Iris Xe made
431 surface tiles over padding-unobserved Private buffers shadows (each 'an image whose texels share
a line of memory with bytes beside them'), as the plane's padding asked the check of renders that
keeps every byte, which the Iris fails for rows ending inside a 64-byte line.

Verified: the parent commit's test, lavapipe before and after; clippy three ways and rustdoc (job
ids in the report).
2026-11-12 16:20:08 -08:00
Anees Iqbal 4f97690fc0 Test: a surface plane over declared padding takes the check of renders over unobserved padding
What: an IOSurface plane's texture that renders, 101x48 BGRA8Unorm at 416 bytes a row (rows ending
inside the device's lines) over a buffer of the runtime's memory, with the device's pooled verdicts
set so that renders keeping every byte beside the texels fail and renders over padding declared
unobserved pass: over a buffer declaring padding_unobserved it must be a DRM_FORMAT_MOD_LINEAR image
at the pitch, read right through a blit; over one that does not, a shadow. Printed where the device
makes no modifier image.

Why: a guest's surface tiles over padding-unobserved Private buffers were shadows on the Iris Xe,
as a plane's padding never took the declaration (Texels::padding_owned). Fails before the fix that
follows.

Verified: lavapipe before and after (job ids in the report).
2026-11-12 16:20:08 -08:00
Anees Iqbal 8ec3e284a9 Print the regions of the pieces lane's map, and its measured times
The lane's docs named a region count from a model and a forecast time; they
now state what the lane measured on an Iris Xe (504 ms in 20 pieces of at
most 31 ms) and a Radeon 780M (307 ms in 20 pieces of at most 36 ms), Mesa
26.2.6, and its line prints the plan's regions.
2026-11-12 16:18:44 -08:00
Anees Iqbal e99dea4f0f 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-12 16:18:24 -08:00
Anees Iqbal 183ed0cf57 RUNTIME_VERSION 2164: an object's device() answers its generation again, not the line's serving one
The three commits before this one. Since RUNTIME_VERSION 2155 Fence::device() (and at 2156/2159 a depth/stencil
state's, a library's, a function's and an address pool's) returned the device's root handle, whose raw() answers
whichever VkDevice serves now. A consumer took `new_fence().device()` as the serving generation's handle; after a
recovery its objects made on the lost VkDevice were destroyed through the new VkDevice's handles and crashed in
vkDestroyCommandPool (a consumer's Iris recovery tests, SIGSEGV; they pass at 1125fb62d2). Those five objects now hold
a LineDevice (device/carry.rs): a root handle for their own checks plus a chain of generation handles each
generation's carry registry keeps. device() again answers a generation handle, the one the object was made on or a
recovery last carried it to, as a buffer's does: a handle a caller took keeps meaning its generation and keeps that
VkDevice alive while held. The objects themselves hold nothing of a lost generation (its link let go at its rest), so
the lost VkDevice still goes while they live. The internal checks take root_device() (encoders' fence and
depth/stencil checks, sparse fences, dynamic libraries, function handles, pipeline additions, compute creation from
a function, pool slots): 2155-2159's carries are unchanged.

Verified (on the branch, lavapipe, msi m3-max-23170): the new test fails at the test commit (the fence's device a
root: generation_serves) and passes with the fix: a VkCommandPool made through fence.device().raw() inside
with_loader_word, a recovery, the handle still answering the lost VkDevice while the root answers the new one, the
pool destroyed through the same handle, the lost VkDevice gone once the taken handles drop; all 21 recovery tests
pass single-threaded. Clippy plain and rustdoc (m3-max-23171).
2026-11-12 16:17:44 -08:00
Anees Iqbal 449657f3b9 Import LineDevice where the depth/stencil state holds it
What: depth_stencil.rs names device::carry::LineDevice, which the previous commit used there
without importing it.

Why: the runtime did not build (E0425/E0433 in depth_stencil.rs, job 23141).

Verified: see the lane run reported with this sha.
2026-11-12 16:17:14 -08:00
Anees Iqbal 4ae4f9b5d4 An object's device stays a generation handle across a recovery
What: a fence, a depth/stencil state, a library and its functions and an address pool hold
their device as a LineDevice (device/carry.rs): a root handle, which their own checks match by
the line as before, and a chain of generation handles, kept by the generation's carry registry.
device() answers the generation handle of the generation the object was made on, else of the one
a recovery carried it to last, as a carried buffer's or texture's device does. The recovery
links the next generation's handle after the lost one and lets the lost one go at the lost
generation's rest (MadeOn, a LostParts entry), so the object still holds nothing of the lost
generation once it rests; a handle a caller took keeps meaning its generation and keeps it
alive while held. A library's functions share the library's chain. The internal checks
(encoders' fence and depth/stencil checks, sparse fences, dynamic libraries, function handles,
pipeline additions, compute creation from a function, a pool slot's placement) use the new
root_device() accessors. Docs: the four modules, carry.rs, MadeBeforeRecovery, the runtime
README. REFUSALS.md regenerated: unchanged.

Why: RV 2155-2159 made those device() accessors answer a root handle, an API break: a root's
raw() answers whichever VkDevice serves and lets go of the one it answered before, so a consumer
that takes `new_fence().device()` as the serving generation's handle destroyed objects made on
the lost VkDevice through the new one's handles (SIGSEGV in vkDestroyCommandPool on ANV).

Verified: see the lane run reported with this sha (the test commit before it fails, this one
passes).
2026-11-12 16:17:14 -08:00
Anees Iqbal e5e0747961 Test that an object's device keeps meaning its generation past a recovery
What: a device test (device_recovery_states.rs) taking the device of a fence, a depth/stencil
state, a library, a function and an address pool before a recovery. Each must be a generation
handle of the serving generation; a command pool made through the fence's device's raw handles
before the recovery is destroyed through that same handle's raw handles after it, inside its
with_loader_word, the handles still answering the lost VkDevice, which the handle keeps alive.
After the recovery the objects' devices are the next generation's, and the lost VkDevice goes
with the handles taken of it.

Why: since the recovery carries these objects (RV 2155-2159), their device() answers a root
handle, whose raw() answers whatever VkDevice serves at the call and lets go of the one it
answered before. A consumer that takes `new_fence().device()` as the generation that serves
made its objects on the old VkDevice and destroyed them through the new one's handles after a
recovery: a SIGSEGV in vkDestroyCommandPool on ANV.

Verified: fails at this commit (the fence's device is a root handle), passes with the fix
after it; see the lane run reported with these shas.
2026-11-12 16:17:14 -08:00
Anees Iqbal e4205ac15f 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-12 16:16:34 -08:00
Anees Iqbal dc859fee56 Residency: host_imports_resident counts releasable imports alone; host_imports_held_for_good the rest
What: an import a read other than a blit's keeps for good (Residency::held_for_good) leaves the
host_imports_resident gauge and joins a new gauge, host_imports_held_for_good, as it already left
the device's count against its most (Shared::resident). Every move of an import's memory (a
release, an import again, let_go, the drop) now goes through one place, Residency::holds_memory,
which counts it as releasable or as kept for good, by the flag under the state lock, as the most
was counted. WorkCounts docs, host_residency.rs's Counted list and HOWTO.md say so; the API table
and host_ab's list name the new field.

Why: host_imports_resident's doc said 'the imports the device may release', but it went down only
at a release, a let_go or a drop, so it also counted every import kept for good. A guest walk on the
RX 7900 XTX showed about 1,040 'resident' beside a cap of 64 releasable imports, which read as the
cap failing. The two gauges show both numbers without subtracting.

Verified: the dma-buf and pointer residency tests now check the exposure step moves the import from
one gauge to the other, and that a gone import leaves both (job ids in the report).
2026-11-12 16:15:25 -08:00
Anees Iqbal 618b495e39 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-12 16:13:40 -08:00
Anees Iqbal 4a95901a38 SEMANTICS_VERSION 2064: the resident-set search is its loop alone
The commit before this one: the resolve of a loaded pointer no longer emits 16 unrolled binary-search steps before
its loop, so translated SPIR-V changes for every module that resolves loaded pointers. Answers are unchanged.
Measured on the 780M (m3-max-23016): a curve-shading kernel's creation 92.9 -> 62.6 s and 8.4 -> 5.8 GiB peak; GPU
time per dispatch -28% at 16 entries, +15-17% for uniform addresses over 1,024+ entries (the commit's table).

Verified at the identical patch db2689c589: lint three ways and rustdoc (m3-max-23010); translator suite 3500/3501,
the one failure golden_hashes (852 cells, re-blessed on development); census of the 2,266 rows that load or make a
device pointer (m3-max-23015): 1,233 translated, 0 failed, 0 defects, slowest 459 ms, peak RSS 193 MiB; 780M
(m3-max-23083) runtime 76/76, validation 348/350; lavapipe (m3-max-23158) runtime 77/77, validation 349/350. The
validation failures (render_merged_indexed residency listing on the 780M, replayed_frames holds) fail the same at
1125fb62d2 (m3-max-23124) and are being fixed separately.
2026-11-12 16:13:00 -08:00
Anees Iqbal b1d963289e The resident-set search is its loop alone, without 16 unrolled steps
Each resolve of a loaded pointer emitted 16 unrolled binary-search steps before the loop that
finished sets of more than 2^16 entries. RADV inlines every call of the search, so a module with
many loaded pointers paid the 16 steps at every site: on a curve-shading kernel with 1,065
searches, its creation on the 780M took 92.9 s and 8.4 GiB of compile memory.

The search now starts the loop from all N entries. A step halves the candidates whatever its
compare gives, so the trip count, ceil(log2 N), depends on N alone: every invocation that
searches one table takes the same branches, and a set below 2^16 entries does fewer entry loads
than the 16 steps did (they kept loading after one candidate was left). search_step is the loop's
step; search_rest is now bisect, from (0, N). SEARCH_STEPS is gone, SEARCH_WORDS charges one step
plus the loop, and the docs (roots.rs, API.md) and the tests that named the unrolled reach say
what is true now. The handle-table search keeps its own unrolled steps. Answers are unchanged.

Measured on the 780M (RADV PHOENIX), before (1125fb62d2) and after, one job (m3-max-23016), one
run each:

The curve-shading kernel's creation (pipeline cache off, RADV_DEBUG=shaderstats):
  time in the driver   92.9 s -> 62.6 s
  peak RSS             8,462 -> 5,846 MiB
  ACO instructions     1,741,690 -> 1,000,747
  spilled VGPRs        179,037 -> 105,970
  spilled SGPRs        95,824 -> 46,562

GPU time of a dispatch whose 262,144 threads each resolve 64 loaded pointers, over M buffers made
resident, every lane's address the same (uniform) or its own (divergent); median of 15 commits,
every thread's sum checked (0 wrong in every row):
  M        form       before      after
  16       uniform    5.56 ms     4.02 ms   -28%
  16       divergent  4.61 ms     4.03 ms   -13%
  1,024    uniform    5.58 ms     6.52 ms   +17%
  1,024    divergent  8.37 ms     7.84 ms    -6%
  66,048   uniform    7.86 ms     9.04 ms   +15%
  66,048   divergent  92.4 ms     95.8 ms    +4% (ranges overlap)
Uniform addresses over sets of 1,024 entries or more cost 15-17% more GPU time: the loop's exit
test and back branch at each step cost more there than the unrolled chain's extra steps.
2026-11-12 16:12:29 -08:00
Anees Iqbal 15f900118c 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-12 16:04:51 -08:00
Anees Iqbal 882827ee6c RUNTIME_VERSION 2163: a rate-mapped pass's work is submitted in bounded pieces, big draws as index ranges
The three commits before this one. A rate-mapped pass draws each command once per region it touches, so one ICB
execution of a consumer's sample (8,162 commands, up to 161,820 indices each, ~2,074 regions) made one kernel job
that ran past amdgpu's 2 s job timeout on a 780M (gfx ring resets) and NVIDIA's context-switch timeout on an RTX 2080
(Xid 109). Each executed command's region draws now count their work, (indices or vertices x instances + 512) per
region draw; when the work since the last cut reaches 2^26 the next draw starts a new piece: the segment's
VkCommandBuffer ends there and, in the batch's own vkQueueSubmit, every piece but the last is its own VkSubmitInfo
signalling a per-VkQueue timeline nothing waits on (Vulkan orders the submissions as before; Mesa's common queue
merges a submission into the next only when it signals nothing, so on Mesa each piece is its own kernel job; the
measured piece times, not this, are the evidence). Pieces stay inside the batch's own submission, so its event waits,
fills, first work, staging waits and tracker barriers are kept; pieced batches never join a group. A draw over 2^26 on
its own is drawn as consecutive index ranges cut at primitive ends, with a cut allowed between ranges: only indexed
point, line and triangle lists with instance_count 1 whose pipeline reads no [[primitive_id]] and writes no memory
(lists never restart; vertex_id, base_vertex and instance values are unchanged). Ranges are sized from the most
region draws measured so far in the execution, else the plan's maximum of 16,384. A piece of such draws holds under
2^27 (about 56 ms of Iris at a trivial vertex function); the budget is a forecast in vertex invocations. New
WorkCounts: rate_map_pieces, rate_map_pieces_timed, rate_map_piece_gpu_nanos, rate_map_piece_gpu_nanos_most,
rate_map_index_ranges. FAST-PATHS known gaps: what rides whole in one piece however big (strips, instanced draws,
draws without indices, mesh and patch draws, pipelines reading [[primitive_id]] or writing memory, draws the encoder
records itself in the pass), any one of which can pass amdgpu's 2 s or NVIDIA's context-switch timeout.

Verified (on the branch): clippy all targets and features, --cfg m2v_gpu, runtime (m3-max-23107) and validation
(m3-max-23119); lavapipe (m3-max-23128) tests::rate_mapped_pieces: 8 ICB commands of a twice-drawn blended triangle
grid over a falling map, 32-bit and offset 16-bit indices, cut into 13 pieces and 17 ranges under a small piece work,
all 13 timed, the cut execution's bytes equal to the uncut one's and to the encoder's own draws'; the runtime's 7 ICB
tests; lavapipe (m3-max-23129) 23 validation lanes (rate_mapped_passes, rate_mapped_layers, rate_maps, ICB fetch and
amplified). Iris and 780M runs of the ignored lane runtime_lane::rate_mapped_pieces (64 commands at the sample's
index counts, fails if a piece runs 1 s or more) were not in when this landed.
2026-11-12 16:04:11 -08:00
Anees Iqbal f25ba99528 Measure a rate-mapped execution's pieces at a guest frame's density
A validation lane, ignored by default, runs one execution of 64 commands
of a guest's executed commands' index counts (768 to 161,820) over the
3648x1734 falling map, and prints the command buffer's GPU time, the pieces
and index ranges it was cut into, and the pieces' GPU times, checking that
it was cut and no piece ran past 1 s. The runtime test's small piece work
rises to 2^18 so its ranges hold hundreds of indices.

Unverified at this commit.
2026-11-12 16:03:38 -08:00
Anees Iqbal f5d97f8e95 Cut a rate-mapped execution's big draws into ranges of their indices
A piece bound by command count, or by whole commands, still lets one command
hold unbounded work: the sample's largest executed command draws 161,820
indices, times its 2,074 regions about 2.5 times the old piece work in one
draw. Where an executed command's draw in a rate-mapped pass would alone hold
more than the piece work, it is now drawn as consecutive ranges of its indices,
each a draw of its own that a piece may begin before. That draws what Metal's
one draw does only for an indexed list (points, lines, triangles: Metal never
restarts a list) cut at primitive ends, of one instance, whose pipeline reads no
[[primitive_id]] and writes no memory; every command of the sample is such a
draw. Ranges are sized by the most region draws a draw of the execution made so
far (the most a plan holds before any), an even count of primitives so 16-bit
ranges keep 4-byte offsets. Any other draw rides whole: FAST-PATHS' known gaps
now name them, with the encoder's own draws, as able to pass amdgpu's job
timeout and NVIDIA's context-switch timeout.

PIECE_WORK halves to 2^26, so a piece of cut draws holds under 2^27: about
56 ms of Iris Xe at a trivial vertex function, 35x under 2 s.

WorkCounts::rate_map_index_ranges counts the ranges past the first; the
signature table gains it and the four piece counters. A runtime device test
draws eight commands of a twice-drawn blended triangle grid through 32-bit and
offset 16-bit indices over a falling map, and checks the execution cut under a
small piece work against the uncut execution and the encoder's own draws, byte
for byte, with pieces and ranges counted.

Unverified at this commit: the compile check and device runs are next.
2026-11-12 16:03:38 -08:00
Anees Iqbal 409c95ce23 Record a rate-mapped pass's executed commands in bounded pieces
A rate-mapped pass drawn region by region can hold more GPU work in one execution
than amdgpu lets a kernel submission run (2 s by default); the sample's
8,162-command executions at 2,074 regions hang the 780M. Where an execution's
commands record inline, each command's region draws now count their work
(vertices or indices times instances per region draw, plus a per-draw term);
once it reaches the piece bound the next command begins a new run, and that run
begins a piece: the pass's recording ends its VkCommandBuffer there, and the
batch's submission submits each piece but the last as a VkSubmitInfo of its own
that signals the VkQueue's new timeline of pieces, so Mesa's queue does not merge
it into the next kernel submission. Pieces are timed where the device writes
timestamps, and counted (WorkCounts::rate_map_pieces, rate_map_piece_gpu_nanos*).

Unverified at this commit: a compile check is next.
2026-11-12 16:03:38 -08:00
Anees Iqbal ee333a8d8e 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-12 16:02:33 -08:00
Anees Iqbal 09dd211c0a RUNTIME_VERSION 2162: a replayed draw whose pipeline is still being made is held, never dropped
The commit before this one. The last drop for a making's time: at commit, an execution's replay of CPU-written
records whose draw's own making was still unmade at the bound dropped that draw (DrawDroppedStillMaking). The replay
now stops there and leaves the making to the command buffer (leave_unmade); the pass takes it into its settled makings
(DeferredPass::left_for_makings), the commit returns with pipelines: true as for other unfinished settled makings, and
the host step records the pass once the making lands. Inside a host step the replay waits on the step thread until
made; record_on_gpu hands the pass to the host step the same way. Removed: DrawDroppedStillMaking,
draws_dropped_still_making, drop_late_draw, drop_late_replayed_draw, and the open-gap text in FAST-PATHS, API.md
(bullet and catalogue), the runtime README and the policy docs (api_signatures.tsv -2). The IndirectCommandCheck and
executed-commands docs name the case: an execution read at commit is checked and reported again in its step. With
this, no draw or dispatch is dropped for its making's time.

Verified (on the branch, msi): m3-max-23116 workspace clippy -D warnings all targets and features, clippy --cfg
m2v_gpu on runtime and validation, rustdoc -D warnings on metal2vulkan and the runtime, fast_paths, api_signatures,
api_surface, degradation, degrade_notices and refusal_surface 47/47; lavapipe m3-max-23117 71/71 held-pool device
tests, among them a_replayed_draw_whose_pipeline_is_still_being_made_at_its_bound_renders_once_made: the commit
returns after its 3 s bound and before 10 s; one second past the bound the command buffer is not complete while
another queue fills a buffer and completes; once the hold goes it completes with the rectangle drawn, nothing
dropped, no notice.
2026-11-12 16:01:54 -08:00
Anees Iqbal a610b58b8a A replayed draw whose making outlasts the commit's bound leaves its pass to the host step
The last draw dropped for its making's time: a draw of an execution's replay at commit (render
commands the CPU writes) whose pipeline the replay began itself and that was still being made at
the command buffer's bound recorded nothing. Metal cannot encode a draw before its pipeline
exists, so every encoded draw runs.

Now the replay at commit stops there, keeps the making on the command buffer
(CommandBuffer::leave_unmade), and the pass takes it into the makings its host step waits for
(DeferredPass::left_for_makings): the commit leaves the pass to the host step with its
pipelines pending, as it already did for a pass whose settled makings were still being made, and
the step records it from the records as they stand then once the making lands. A replay inside
a host step waits for its making until made, on the step's thread. record_on_gpu declines to
the host step the same way. The commit still returns at its bound at most.

Removed: DrawDroppedStillMaking, WorkCounts::draws_dropped_still_making,
CommandBuffer::drop_late_draw, RenderLowering::drop_late_replayed_draw, the execution's encoder
place that only named the dropped draw, and the open-gap text in FAST-PATHS row 43, API.md (the
bullet and the catalogue entry), the runtime README and the PipelineWaitPolicy docs
(api_signatures.tsv -2). The IndirectCommandCheck and executed-commands docs name the new case
in which an execution read at commit is read and checked again in its host step.

The gap's test flips: a_replayed_draw_whose_pipeline_is_still_being_made_at_its_bound_renders_once_made
(commit returns after the bound and before the 10 s watchdog; the command buffer is not complete
a second past its bound while another queue completes; once the hold goes it completes with the
rectangle drawn and nothing dropped). Checked by the lint and lavapipe jobs reported with it.
2026-11-12 16:01:25 -08:00
Anees Iqbal 6447de22ad 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-12 15:43:14 -08:00
Anees Iqbal 2d98a4570a RUNTIME_VERSION 2161: draws and dispatches whose pipeline is still being made are held, never dropped
The two commits before this one. A draw or compute dispatch whose pipeline was still being made at the Bounded
wait's 4.5 s was dropped and announced (Blender's Cycles rendered a wrong image after 45 dropped dispatches at pin
60). Metal cannot encode a draw or dispatch before its pipeline exists, so every encoded one runs, and a valid program
sees a dropped one for good (a texture rendered once and reused, a buffer read back). Under the rule that no
fast path may break Metal's API contract, the drop is removed, not kept behind a switch. A batch's host step now
waits for every making its segments record, past the bound too: draws, compute and tile dispatches, and replay
makings the settle registered (StepWaits loses `until`; Segment::holds is gone). The pending draw, dispatch and tile
recordings wait until made; the scheduler thread never blocks, and held batches still give way to other queues.
`commit` waits for no making, except a pass of CPU-written render commands, which it waits for up to its bound and
then leaves to the step. Removed: DispatchDroppedStillMaking, WorkCounts::dispatches_dropped_still_making,
drop_late_dispatch and its catalogue entry (api_signatures.tsv -2).
The one remaining drop is an open gap, not a choice: a draw of an execution's replay whose making the replay waits
for itself, because the settle left the step nothing to wait for (a commit-time replay of CPU-written records whose
state's making is still in flight). DrawDroppedStillMaking, its counter, the FAST-PATHS row and the catalogue name
only that case; a_replayed_draw_whose_pipeline_is_still_being_made_at_its_bound_runs_nothing is the gap's test.
Docs: FAST-PATHS (the row rewritten), API.md (bullet and catalogue), the runtime README, PipelineWaitPolicy and
pipeline_commit_wait, the module docs.

Verified (on the branch, msi): at 5cebae8b98 (m3-max-23045) workspace clippy -D warnings all targets and features,
clippy --cfg m2v_gpu on runtime and validation, rustdoc -D warnings on metal2vulkan and runtime, fast_paths,
api_signatures, api_surface, degradation, degrade_notices and refusal_surface 47/47; lavapipe (m3-max-23046) 66/67
held-pool device tests (the one failure the first attempt to flip the replay test, which showed the gap case); at
7e81e8a700 (m3-max-23054) deferred_calls plus degradation 40/40: a draw past its bound renders once made, a dispatch
past its bound runs once made, another queue's command buffer completes meanwhile while the held one is not complete
one second past its bound, and the gap test.
2026-11-12 15:42:35 -08:00
Anees Iqbal b4eaf4caa7 Keep the replayed draw's test as the open gap's, and name the gap by the replay's own wait
The lavapipe run (m3-max-23046) showed a draw of a commit-time replay of
CPU-written records dropped at the bound: the replay waits for that
making itself, which the settle did not leave to the host step. That is
the open gap this change keeps; its test asserts the drop, and the docs
name the gap by the replay's own wait.
2026-11-12 15:41:59 -08:00
Anees Iqbal 91dbc91bbc Hold a command buffer for its draws' and dispatches' makings instead of dropping them
A dispatch whose pipeline was still being made 4.5 s after its command
buffer's commit recorded nothing, and so did such a draw. Metal makes a
state's pipelines inside its creation, so every draw and dispatch it
encodes runs: a dropped dispatch leaves wrong results (a guest's path
tracer dropped 45 dispatches behind a 116 s compile on the RX 7900 XTX),
and a dropped draw leaves content drawn once (a cached shadow map, a
glyph atlas) without it. The owner's rule: no switch may break Metal's
contract, so the dropping form is removed, not kept behind a switch.

A batch's host step now waits for every making its segments record,
past the bound too (Segment::steps_after_pipelines; the scheduler's
StepWaits loses its `until`, and Segment::holds goes): the batch stays
in its queue's line on the scheduler's thread, which no call waits for,
and records the draws and dispatches once made. Held batches still give
way to other queues' later commits that share no fence. `commit` waits
for no making but a pass that executes render commands the CPU writes,
until its bound, and leaves that pass to the host step past it. The
pending dispatch, tile dispatch and pending draw recordings wait until
made. DispatchDroppedStillMaking, its counter and catalogue entry, and
CommandBuffer::drop_late_dispatch are removed.

One drop remains, an open gap named in FAST-PATHS and the notice: a draw
of an execution's replay whose pipeline the replay itself began making,
of a key the commit's settle did not foresee, still being made at the
bound (DrawDroppedStillMaking, now that case alone). That case is the
next change.

Tests (device, rewritten): a draw, a replayed draw and a dispatch whose
makings are held past the bound each complete once the making lands,
drawn or written, nothing dropped, while another queue's command buffer
completes meanwhile and the held one is still not complete a second past
its bound.
2026-11-12 15:41:59 -08:00
Anees Iqbal 5fd725fbf0 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-12 15:38:28 -08:00
Anees Iqbal fd23616d17 RUNTIME_VERSION 2160: large pipeline makings hold a process limit of SPIR-V words around their driver call
The three commits before this one. Blender's kernels on RADV made several large pipelines at once, and the driver's
compile memory (a curve kernel alone peaks at several GiB) added up past the host. A making whose stages hold 65,536
SPIR-V words or more now holds its words of a process limit around its driver call (pipeline/compile_memory.rs):
counted makings in flight hold at most 4,194,304 words, a larger one runs alone, and one that does not fit waits for
those in flight, lending its turn while it waits (budget::without_turn); waiters go in turn-rank order, none
overtaking. Applied to compute makings, whole render pipelines (their stages' words) and pipeline library parts (their
own stages). ShaderModule carries its word count. New counters WorkCounts::makings_held_for_compile_memory and
compile_memory_held_nanos (the conformance cost half classifies the count with the other making counts; host_ab lists
both; api_signatures.tsv +2 fields).

Verified (on the branch, msi): clippy -D warnings, runtime and conformance, all targets and features (m3-max-23004);
runtime budget/pool/flight tests 79 passed, conformance cost tests 17 (23004); the 4 compile_memory tests (m3-max-23041):
a making below the floor is not held, two large ones never hold at once, nothing overtakes a waiter and waiters go in
rank order, a waiter lends its turn and takes it again. Not run: clippy under m2v_gpu, a GPU run of the limit.
2026-11-12 15:37:50 -08:00
Anees Iqbal b1acd04588 Fix the lending test's channel ends 2026-11-12 15:37:20 -08:00
Anees Iqbal 8000da32a3 Bless the signature table for the compile memory counters 2026-11-12 15:37:20 -08:00
Anees Iqbal c6fa636665 Hold large pipeline makings to one large compile at a time
A guest's run on RADV made kernels of up to 4.5 M SPIR-V words several at
once; on the Radeon 780M one such making alone peaks at 3.6 to 10.3 GiB
resident (1.9 to 4.5 M words). Nothing bounded how many large modules the
driver compiled at once beside the budget's turns, which count makings and
not their size.

The process now keeps a limit of SPIR-V words in flight
(pipeline/compile_memory.rs): a making whose stages hold 65,536 words or
more holds its words around its driver call, the counted makings in
flight holding at most 4,194,304 words, a larger one alone. One that does
not fit waits for those in flight, lending its turn (budget::without_turn)
and taking one again after; the waiters go in their turns' rank order and
none passes one waiting before it, so a large making never starves. The
compute making (objects.rs) holds its kernel's words, a whole render
pipeline its stages', a pipeline library its own part's. Each module
carries its words. WorkCounts counts the makings that waited
(makings_held_for_compile_memory) and their wait
(compile_memory_held_nanos); the conformance cost half reads the count
with the other making counts.

Unit tests: a making below the floor is not held; two that do not fit
never hold at once; no counted making passes a waiting one, waiters going
in rank order; a waiter lends its turn and takes it again.
2026-11-12 15:37:20 -08:00
Anees Iqbal ade1e8cb15 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-12 15:34:15 -08:00
Anees Iqbal 8bead88369 RUNTIME_VERSION 2159: an address pool reserved before a recovery takes new buffers after it
The two commits before this one. After a device recovery every new buffer in a slot of an AddressPool reserved before
it was refused (MadeBeforeRecovery): newBufferWithLength:options: under a page answered nil for Shared, Managed and
Private buffers (a consumer's Iris recovery, m3-max-22983). A pool is only a span of the line's address space: it
holds no Vulkan object, memory block or mapping; a slot's buffer takes its own memory and only its Metal address from
the slot. The refusal's one cause was the pool's handle of the generation it was reserved on, compared at
new_buffer_with_descriptor_now with the serving generation; the same handle kept the lost VkDevice alive while the
pool lived. The pool now holds the device's root handle and the line's address space: Device::same takes a root and
any generation of its line as one device, so a slot buffer made on the next generation passes; a pool of another
device is still refused (ForeignObject); the pool's drop gives its span back to the shared space directly.
Pooled Shared and Managed buffers made before the recovery outside page blocks stay refused: their contents pointer
is a mapping on the lost VkDevice. Docs: AddressPool, MadeBeforeRecovery, the device-recovered cost (degradation.rs,
API.md), the runtime README, carry.rs.

Verified (on the branch; lavapipe, m2v_cpu_icd, m3-max-23017): an_address_pool_takes_buffers_past_a_recovery fails at
the test commit (the first Shared slot buffer after the recovery refused, MadeBeforeRecovery) and passes with the fix:
Shared, Managed and Private buffers in slots 1-3 are made on the new generation at the pool's address plus their
offsets, filled by the GPU and read back; the Private buffer placed in slot 0 before is carried (same address, zero);
the lost VkDevice goes while the pool lives. All 20 device_recovery* tests and passing_holds' pool-slot test pass.
Clippy plain, m2v_gpu, m2v_cpu_icd (m3-max-23018..23020).
2026-11-12 15:33:36 -08:00