Commit Graph
3096 Commits
Author SHA1 Message Date
Anees Iqbal 742e320bee REFUSALS.md for what a recovery carries; the carry test's notification sends plainly
REFUSALS.md is regenerated by scripts/refusal-surface/refusal_surface.py in job m3-max-11457, and its --check passes. MadeBeforeRecovery's row now says what the recovery does not carry and lists the exportable-event carry site. The carry test's notification no longer drops a Copy Result, which the CPU-ICD clippy rejected.

(cherry picked from commit ef076009e82d2bde7f29ff9a81608ec40e94cb6a)
2026-11-09 04:26:05 -08:00
Anees Iqbal d83c658475 carry: clippy's drain and append forms, and a plain flag in OwnedKernels::destroy
Clippy rejected collecting a full drain into a Vec and extending from one. The lost parts now move out one by one as they are marked, and the event's pending notifications move with Vec::append. OwnedKernels::destroy sets its flag plainly, with no mem::replace.

(cherry picked from commit d7cc6f4806e1f2948372fb274e619aedaadfe3d1)
2026-11-09 04:26:05 -08:00
Anees Iqbal 33675e87f1 Carry tests, and docs for what a recovery carries and leaves refused
New device tests (tests/device_recovery_carry.rs, under the CPU-ICD and GPU
cfgs):

- One recovery carries a Private buffer (same address, zero after) and a
  buffer in fresh pages. The fresh-page buffer keeps its contents pointer and
  bytes, and the host's writes through that pointer after the recovery reach
  the GPU's copy. It also carries a shared event: its value, its listener's
  notification and a GPU signal after the recovery.
- A pooled Shared buffer stays refused, and the notice counts it. It keeps the
  lost VkDevice, which then holds no empty block and less memory than before
  the loss. Dropping it takes the line back to one live VkDevice.
- Seven recoveries with a carried buffer and event in use between them end
  with one live VkDevice, and eight made.

The device_recovery helpers are shared with the new file.

Docs: RuntimeGap::MadeBeforeRecovery, the DeviceRecovered catalogue entry and
its consequence (runtime and API.md), the runtime README's lost-device
section, line.rs's module and recover_for_test docs, in_place.rs, the
validation lane's docs and the refusal surface's reach mark now say what is
carried and what stays refused. REFUSALS.md is regenerated in the next commit.

Not yet built.

(cherry picked from commit 68d68cdfbdbbac979e5097a8ad286416450790bf)
2026-11-09 04:26:04 -08:00
Anees Iqbal 17a35ba5c0 Lost generation goes once nothing records on it: device handles, semaphores and work objects
Following the orchestrator's decision for 1a, the lost generation of a
recovered device is let go of rather than kept alive by its carried objects.
Before this, every recovery left one more live VkDevice behind while carried
objects lived, and the 5080's driver refuses an 8th.

- Carried buffers, their pages and events hold their generation through
  MadeOn, a device handle let go of once the object's parts there went.
- A buffer names its generation by address for the RecordsOn compare, so
  nothing reads a handle that was let go of.
- Lost parts go in two phases: marked under the registry's lock, then
  released after it. Command buffers made after the mark meet none of them.
- Rest needs the line to serve past the generation. Once there, a lost
  generation refuses new command buffers (Recording::begin answers None and
  the queue refuses as on the lost device).
- At rest, the generation destroys its device-level work objects: internal
  submissions, the staging pool, owned kernels, the mipmap scratch and the GPU
  pools. It also closes its recyclers and frees its kept and made-ahead blocks.
  OwnedKernels::destroy now runs once.
- A carried event counts the host calls under way on its semaphore (counter
  reads, host-wait slices, reservations, the watcher). The last call, or the
  release when none is under way, destroys the semaphore. vkspec 7.4.4 bounds
  a wait on a lost device to finite time.

The lost VkDevice is still destroyed only through DeviceShared's drop. This
change adds no vkDestroyDevice site.

Work in progress: not yet built.

(cherry picked from commit f851e029dd4a4268d60e95bc936174c4ad2da715)
2026-11-09 04:26:04 -08:00
Anees Iqbal 4502a352af Device recovery carries events, Private buffers and fresh-page buffers to the next generation
A device's recovery now carries the program's events and the buffers whose
bytes no program pointer reaches, or whose pages the runtime owns, to the new
VkDevice before the line serves it. Each keeps its identity: ObjectId, hazard
key, Metal address (a share of its range), range token, label and purgeable
state. Until now they were refused afterwards (MadeBeforeRecovery), where
Metal's objects carry on.

- Events get a new timeline semaphore at the value the host saw. Its
  listeners' notifications move with it, and host waits go on with it.
- Private buffers get new memory at the same address, zero.
- Fresh-page buffers lie in the same runtime-owned pages, imported again on
  the new device: the same contents pointer and bytes.
- Pooled Shared/Managed buffers, no-copy buffers, heaps' buffers, the caller's
  VkBuffers, exportable memory and exportable events stay the lost
  generation's and are counted in the recovery's notice.

A command buffer of the lost generation that still records sees its own
generation's parts through a thread-local scope (RecordsOn). The scope is read
only for a buffer that was ever carried, so other buffers pay one load.

The lost generation's VkBuffers and memory go once none of its command buffers
can record (vkspec 5.2.3). After that the generation parks and keeps nothing.

Work in progress: not yet built. Tests, docs and REFUSALS follow.

(cherry picked from commit 962f9b61280c263f1a182ab0572ab28ce38fc9f6)
2026-11-09 04:26:04 -08:00
Anees Iqbal a543115fab RUNTIME_VERSION 1969 and the runtime-sources pin for NVIDIA's volume-plane resolve through the scratch
nvreds' 93795eaaa2: on the RTX 5080 Laptop (NVIDIA 615.71.09) a resolve into a 2D view of a 3D
image starting at depth plane 1 writes nothing (planes 0, 2 and 3 resolve correctly), the class of
RADV's RuntimeDriverDefect::VolumeResolveFirstPlane. NVIDIA's driver ID joins that defect's
affected table, so such a resolve goes into the scratch and is copied into its plane, announced
as resolve-scratch, as on RADV. No public variant added. The runtime changed, so RUNTIME_VERSION
1969.

Verified (nvreds): 5080 b5080 entry volres5080-041003, the view_attachments tests 3x at the tip
(3/3 pass) and 3x at the base aeaa4844ee (3/3 fail, "t3d_resolve_plane1: byte 64 is 0x11,
Metal's 0x33"); gem10 11608 the runtime's driver_defects and degradation tests 27/27, plain
clippy -D warnings clean for metal2vulkan, -runtime and -validation. Here: the API-signature
check, REFUSALS.md and CONFORMANCE-COVERAGE.md regenerate unchanged, cargo fmt clean.
2026-11-09 04:16:19 -08:00
Anees Iqbal 2cbe8ce595 Volume resolves: NVIDIA's leaves plane 1 unwritten, so it resolves through the scratch copied into the planes too
On the RTX 5080 Laptop GPU (NVIDIA 615.71.09)
runtime_lane::view_attachments::a_resolve_writes_the_volume_plane_it_names failed at base and tip
alike, 3/3 each (t3d_resolve_plane1: byte 64 is 0x11, Metal's 0x33). Its VOLUME-RESOLVE lines and a
probe of resolve orders (scratch branch, never merged) show a 4x multisampled RGBA8Unorm attachment
resolved into the 2D view of a 4x4x4 or 4x4x8 volume that begins at depth plane 1 writes no plane:
the volume keeps every byte it had. Into the views at planes 0, 2 and 3 it writes that plane alone,
in every order tried (1023, 3210, 0123) and three times over into plane 1. A draw into plane 1
through the same kind of view writes it (a_volume_s_plane_is_an_attachment passes), and the
validation layer reports nothing, so the usage is the valid one RADV's defect row already cites.

Fix, the RADV fix's shape (c1a825d748): RuntimeDriverDefect::VolumeResolveFirstPlane gains an
NVIDIA_PROPRIETARY row, every NVIDIA GPU until a probe finds one clean. Its meaning is stated for
both drivers: the resolve is written where the view begins only at the image's first plane (RADV
writes plane 0 whatever plane the view begins at; NVIDIA's writes no plane from plane 1). There a
color resolve into a 3D texture's planes past its first, or into more than one, goes into the
scratch image of the pass's layers that is copied into the planes after the pass, announced as
resolve-scratch with the defect named. The variant, the table's doc, the resolve module's docs, the
notice's reason and docs/API.md's catalogue entry say so.

Tests: tests::driver_defects lists the defect for every committed NVIDIA profile (the RTX 5080
Laptop GPU's and the others'), so it fails without the row.

Verified: cargo fmt. The lane on the 5080 at this commit and at its base follows through potluck.
(cherry picked from commit 93795eaaa29dba62257ca9b4c569394e23c269da)
2026-11-09 04:15:29 -08:00
Anees Iqbal aeaa4844ee RUNTIME_VERSION 1968 and the runtime-sources pin for colour clears and fills taking either code by default
nvreds' 876cfd1402 (from 9a844f5c5f): a normalized channel a clear or fill leaves off a whole code
is in question on every device, as the spec allows either code, except where a measured row says
the device stores Metal's (ColorClearIsMetals, MoltenVK Apple9 load-op clears). This inverts the
old default. Removed from the public surface: DriverFact::ColorClearTakesEitherCode (both crates)
and its three device rows; the AMD_RX_550 constant goes with them. The runtime changed, so
RUNTIME_VERSION 1968.

Verified (nvreds), full runtime lanes, the stack 0bf26ce585 against its base 7b45bd4646: on the
780M (11477) and the XTX (11476), color_fills (188 plain fills), logic_ops (the 16 cleared
RGB10A2Unorm draws) and buffer_texture_blits::iosurface_planes go from red to green; Iris
(11544) 1922/1922 at both; RX 550 (11495) and M3 (11478) unchanged; 5080 tip 1406/1922 + 642/643,
the one red (view_attachments volume-plane resolve) red at the base too (3/3 each).
device-color-conversion notices rise about 16.2k on the XTX, the 780M and the M3 (plain fills
announced 17558 -> 33706 of 106680). Here: the API-signature check, REFUSALS.md and
CONFORMANCE-COVERAGE.md regenerate unchanged, cargo fmt clean.
2026-11-09 03:48:38 -08:00
Anees Iqbal 876cfd1402 Colour clears and fills take either code on every device but where a measured row says Metal's
The orchestrator's decision: Vulkan lets a clear of a normalized channel store either of the two
codes closest to its scaled value ("returns one of the two ... closest ... Implementations should
round to nearest"), so every device takes that rule, not only the three devices measured to take
the farther code (DriverFact::ColorClearTakesEitherCode's rows: NVIDIA's on the RTX 5080 Laptop
GPU, ANV on the Iris Xe of RPL-P, RADV on the Radeon RX 550). The one exception stays the measured
DriverFact::ColorClearIsMetals row: MoltenVK on the Apple9 GPUs, whose load operation of an
attachment the render area covers clears as Metal's.

Runtime: clear_value::rounds_apart and fill_value::device_apart lose their `either` argument; a
normalized channel's clear or plain fill is in question wherever its scaled `float` is off a whole
code (the rule the three rows took), which subsumes the old margin of 1/1024 around a midpoint
(and the packed 16-bit formats' wider one). render_pass.rs and blit_fill.rs read no fact for it;
the load operation's exception under ColorClearIsMetals is unchanged. The fresh pattern of a
signed normalized format (code -1) is written by copies of its bytes, not a clear: no `float`
scales onto it (-1/127 is -0.99999999627 codes), so its clear is in question under the rule
(texture/heap_tiled.rs fresh_pattern; the fresh-pattern test allows its 1-byte texel).

Translator: DriverFact::ColorClearTakesEitherCode, its three rows and AMD_RX_550 (only they used
it) are removed; the facts table test and api_signatures.tsv follow. ColorClearIsMetals' doc
and PrecisionNote::DeviceColorConversion's state the spec's rule.

Validation: buffer_texture_blits' IOSurface planes expect the clear's notice on every device but
where the load operation clears as Metal's (degrade_notices::clear_in_question, the former
tie_cleared, now stated for any value off a whole code). color_fills prints how many plain fills
announced device-color-conversion (COLOR-FILLS-ANNOUNCED).

Docs: docs/API.md's device-color-conversion entry is the spec's statement plus the measured
devices and the one exception.

Verified: cargo fmt. Runs follow through potluck.
(cherry picked from commit 9a844f5c5f5ce1499664f77eceb66fccf2dfd9f7)
2026-11-09 03:47:40 -08:00
Anees Iqbal 39773d40f2 type_nine lanes: a failure's time is measured from the command buffer's kernel end time
On lavapipe under load, two in_turn tests failed, a hang reading as failed
about 26-27 ms after Scheduled, under HANG (27.5 ms). The hang emulation counts
the hang from when it posts the Scheduled transition (the command buffer's
kernelEndTime), but the test measured from its scheduled handler, which runs
on the handler thread and, under load, late. The bound was right; the origin
was wrong.

The test now records both handlers' host times (metal2vulkan_runtime::host_time,
the clock kernelEndTime is read on) and measures a failure from the command
buffer's kernel end time, the mark Metal's contract states the hang from, to
its completed handler. The scheduled handler's lag behind the kernel end time
is printed.

Verified: not yet run. The base and this change, interleaved 20 times on
lavapipe beside a CPU hog on every core (the tests at nice 19), are queued as
potluck 11510.

(cherry picked from commit 6017e89451e805418c5e6083ea0fd8ccdbfbb661)
2026-11-09 03:34:37 -08:00
Anees Iqbal d928302b34 Depth lanes: the layer's GPU-assisted buffer-copy check off, after it crashed ANV's recording
runtime_lane::depth_upload_clamps::a_staged_blit_from_a_buffer_takes_no_depth_outside_0_1_into_a_depth_image
crashed with SIGSEGV on the Iris Xe of RPL-P (ANV, Mesa 26.2.6) under validation layer 1.4.363.
The crash is on the CPU, while the copy is recorded: in the core (coredumpctl, pid 633468) five
layer frames sit between our vkCmdCopyBufferToImage and four of the driver's, which fits the
commands the layer inserts for its buffer-copy check (a dispatch of its own, then a restore of
the command buffer's compute state), not the copy itself.

Measured at development 524cf28137 on ms01 (jobs 11255 and 11372), each run of the test alone:

- lane test, copy check on: 1 of 5 and 4 of 10 crashed;
- the probe of the same copy, copy check on: 2 of 5; core checks alone: 0 of 5; GPU-assisted
  validation without the copy check: 0 of 5; lane test, copy check off: 0 of 5;
- copy check on, rows of the staging copied by vkCmdCopyBuffer instead of their dispatch
  (DriverFact::RowCopiesDispatchFaster, ANV's): 0 of 10;
- copy check on, the staging's depth clamp dispatch left out: 0 of 10 crashed (the check then
  reports the 6 depths outside [0, 1], as it should).

So the crash needs the layer's copy check and both dispatches before the copy, each of which
pushes set 0 under its own layout (two bindings, then one). Our command stream is valid Vulkan
and the layer's core checks report nothing of it; the product stays as it is.

The lanes keep GPU-assisted validation on and turn off only its buffer-copy check
(depth_upload_clamps::gpu_assisted_device, renamed from gpu_assisted_copies, with the reason and
the layer version). Their evidence is the uploads clamped and the texels read back, as before;
the docs of the depth lanes and heap_textures' two depth lanes say the check is off.

(cherry picked from commit 13490a0b070c46dd735435fcf4381be9020310e5)
2026-11-09 03:30:43 -08:00
Anees Iqbal 380a9225f1 blend16 lanes: a device without a fetch form skips each refused draw, printed
On the RX 550 (RADV, GCN4) the six blend16 lane tests panicked at pipeline
creation. The device has neither form a framebuffer fetch takes
(rasterization-order color attachment access, the fragment shader pixel
interlock), and the runtime refuses each fetching pipeline, typed: Unsupported
of FramebufferFetch, needing either feature. That refusal is the device's
honest answer, not a failure of the lane.

framebuffer_fetch::fetch_unavailable takes a refusal as that answer only when
it is FramebufferFetch's and the device's profile has neither form. The
blend16 sweep (stores_metals_blend, behind the blend16, nans and zero tests)
and narrow print each such refusal and skip its draw, then print how many
were skipped. Any other refusal, or this one on a device with a form, still
fails the test.

Verified: the six tests on the RX 550 at 81cf64c16a failed at pipeline
creation with that refusal (potluck 11470). Not yet run at this commit.

(cherry picked from commit fd472b008435c945dcc197f07aa136e92a23bd94)
2026-11-09 03:24:18 -08:00
Anees Iqbal 97fd73c36b RUNTIME_VERSION 1967 and the runtime-sources pin for every pipeline making reporting what its driver found
ownpixel's f82a8a3b3f: DeviceShared::make_compute_pipeline and make_graphics_pipeline chain
VK_EXT_pipeline_creation_feedback and count it, and every former make_pipelines caller (owned
kernels, the split kernels, the resolve/copy/planes/interleave draws, the library parts, the
program compute making) uses them; the unreported make_pipelines is deleted. A making the driver
found in its loaded record reads nothing back and writes nothing, so a found record is never
rewritten on byte drift. The runtime changed, so RUNTIME_VERSION 1967.

Verified (ownpixel): um790 780M RADV PHOENIX, release, --cfg m2v_gpu (11523): the new
the_runtime_s_own_kernels_found_in_their_records_write_nothing failed 50/50 without the fix (0
reports; the negative proves the missing reports, those kernels' records were not drift-written in
50 runs), and with it x51 and the library test x51, warm x100, touched modules 34, runtime suite
x2 1965 each, pipeline_records and cache lanes 10; lavapipe (11524) both tests and 34; clippy plain
and m2v_gpu clean (11527). NVIDIA not run. Here: the API-signature check, REFUSALS.md and
CONFORMANCE-COVERAGE.md regenerate unchanged, cargo fmt clean.
2026-11-09 03:19:30 -08:00
Anees Iqbal c0f334eaff Every pipeline making reports what its driver found, so no found record is written again
What: the runtime's own pipelines were made through the shader cache with no
VK_EXT_pipeline_creation_feedback: its owned kernels, the depth, stencil and planes split
kernels, and the draws of its copies, resolves and planes steps. So each such making read the
driver's data back and compared its SHA-256 with what the cache was loaded with. Two functions of
DeviceShared now make every pipeline that goes through a record, each chaining the feedback:
make_compute_pipeline makes a program's compute pipelines and the runtime's kernels, and
make_graphics_pipeline makes the libraries of shaders a render pipeline is linked from and the
runtime's draws. A making the driver reports found in the cache its record loaded reads nothing
back and writes nothing (driver_data_found). Its report counts in driver_pipeline_hits and
misses. The unreported DeviceShared::make_pipelines, which nothing calls now, is gone. The
whole render pipeline's making keeps its own call, which already reported.

Why: RADV's data after a making from its record is now and then not the record's byte for byte
(Mesa 26.2.6 on a Radeon 780M: one byte of over a thousand, at the same length; the previous
commit fixed the libraries of shaders, the cause of the warm flake). The byte comparison took
that for new data and wrote the record again: needless SSD writes at a device's makings of its
helpers.

The negative: tests::driver_pipeline_compile::the_runtime_s_own_kernels_found_in_their_records_write_nothing.
A second device, over the directory where a first device made two of the runtime's kernels
(RowsCopy, VisibilityCombine), makes them again. It must count one report per kernel, with found
== hits, and where both are found it writes no record (driver_saves 0). Without the fix it reads
0 hits and 0 misses and fails.
That proves the missing reports, not drift writes on those two kernels: without the fix their
records were written 0 times in 50 runs on PHOENIX. The drift I measured was on the libraries.
With the fix, a kernel found in its record is neither read back nor written, whatever bytes the
driver returns.

Verified on um790's 780M (RADV PHOENIX via MESA_VK_DEVICE_SELECT=1002:15bf!, Mesa 26.2.6,
release, --cfg m2v_gpu), job 11523:
- The test alone (the negative) failed 50 of 50: 2 kernels made, 0 hits and 0 misses reported,
  0 written, 2 loaded.
- With the fix:
  - The own-kernel test passed x51: 2 hits, 2 found, 0 written.
  - a_library_of_shaders_reports_what_its_driver_found passed x51.
  - The warm own-directory test passed x100: 4 found, 0 written.
  - tests::warm, shader_cache, driver_pipeline_compile, owned_kernel_builds and owned_pushes:
    34 passed.
  - The runtime suite (the GPU-hazard filter, the GPU-time tests left out) passed in 2 runs,
    1965 tests each.
  - runtime_lane::pipeline_records and runtime_lane::cache: 10 passed. The second device read
    loads 2, saves 0, found 2, hits 2. The cache lane read 26 makings, each counted once by its
    report.
- lavapipe (--cfg m2v_cpu_icd, llvmpipe from Mesa 26.2.6), job 11524: both report tests passed
  (each 0 hits, 2 misses, 0 written) and the touched modules passed, 34 tests.
- cargo clippy -p metal2vulkan-runtime --all-targets --all-features -D warnings is clean, plain
  and with --cfg m2v_gpu (job 11527).
Not yet run: NVIDIA (the 5080).

(cherry picked from commit f82a8a3b3f192fef6bb7dc74c030797f0a2773eb)
2026-11-09 03:18:41 -08:00
Anees Iqbal 1dcb4eb4a6 Re-bless the golden tables at a773acbc5f
Translation changed at a773acbc5f (SEMANTICS_VERSION 2001). Blessed on the M3
(s37-pl.sh bless, dv-golden).

(cherry picked from commit 9bb30a92456aab0803ce79e53e30f66fbc5b0bdf)
2026-11-09 03:16:46 -08:00
Anees Iqbal 71129978d4 host_memory lane: the past-completion deallocator runs on one VkQueue and on two
a_deallocator_returns_whatever_thread_submits_past_its_completion ran its two
command queues wherever the round robin put them: on two VkQueues where the
device has two (MoltenVK), on one elsewhere, so no device ran both
arrangements. Its hang came back on a device where the queues shared one
VkQueue. The causes are fixed on development: Exact completion by 4ef6cbad82
(the owed completion turn of a command buffer taken with no submission is made
before the submission handlers run) and Grouped by ad451a5334.

The test now makes each arrangement where the device has it: two queues on
one VkQueue on every device, and two queues on two VkQueues where the device
has another (queue_where, from the round robin through
CommandQueue::vk_queue_sharing). A failure names the arrangement, the queues'
VkQueues, both command buffers' statuses, the thread the deallocator began on
and the submissions since. The doc says why the owed turn must come before
the handler.

Verified, with this test body at earlier commits (edb9854f3b, 81cf64c16a):
- M3, MoltenVK (two VkQueues; both arrangements): 100/100 alone and 100/100
  beside lane-module loops (potluck 11460).
- Iris (one VkQueue): 100/100 alone and 100/100 under load (potluck 11459).
- RX 550, RADV (one VkQueue): 50/50 (potluck 11470).
Not yet run: the XTX and 780M (11468), lavapipe (11469), and the negative on
lavapipe with 4ef6cbad82's scheduler hunk reverted (11472).

(cherry picked from commit 25d8962fa5735ed3f1eb69f23f9ff3ec04e1a222)
2026-11-09 03:14:42 -08:00
Anees Iqbal a773acbc5f RUNTIME_VERSION 1966 and the runtime-sources pin for nvreds' resolve, half and logic fixes
- resolve_rounding (db251d505e, 66c344998a, 541c5afec6): a cleared sRGB resolve takes either code
  nearest the clear where the passes announce the conversion; closes the XTX's cleared-sRGB red.
- RADV's fused half conversion (7ed49fd04d, e68eea5a2a, c8d166727f): DriverWorkaround
  HalfConversionFusedWithArithmetic, keyed on the RADV driver ID; a pipeline whose half comes from
  an f32 add, subtract, multiply or fma records NativeHalfConversion. PHOENIX and NAVI31 measured
  fusing (4542 of 253958 lanes the device's), POLARIS12 noted anyway. The RADV profiles' hash
  moves, so their golden keys move (re-blessed next); no artifact format change.
- logic_ops (30501351a4): a channel the device converts its own way takes either code nearest its
  value; the XTX's 24/189 red becomes 16/189, all of it clears, which the clear-code change closes.
e68eea5a2a's conflict in device/tests/profile.rs (development had added
PerspectiveReadsExtrapolated to the same list) resolved to both variants in declaration order.
Translator and runtime sources changed, so RUNTIME_VERSION 1966.

Verified (nvreds): full runtime lanes on the XTX 11476 (RADV NAVI31), the 780M 11477 (RADV
PHOENIX), the RX 550 11495 (POLARIS12) and the M3 11478, hazard and timing filters on; lavapipe
and m2v_cpu_icd clippy 11373; the half fix's unit tests and clippy 11374 (41/41). Here: the
API-signature check, REFUSALS.md and CONFORMANCE-COVERAGE.md regenerate unchanged, cargo fmt
clean. The merged tree's own build runs next with development's checks.
2026-11-09 03:13:21 -08:00
Anees Iqbal 30501351a4 logic_ops: a channel the device converts its own way takes either code nearest its value
On the Radeon 780M (RADV PHOENIX) the_logic_operation_stores_metal_s_codes failed 24 of 189
draws, all RGB10A2Unorm (radvruns job 11026, 2 of 2 runs; operation 2: [00,c9,f8,af] against
Metal's [00,cd,f8,af]). A probe on that device (job 11147) found the cause in the conversions,
not the operation: the plain draw and the copy draw both store green 562 for 562.65 (Metal 563),
and the clear alone stores blue 613 for 613.8 (Metal 614). Every RGB10A2Unorm pipeline that
writes the color records PrecisionNote::DeviceColorConversion there (plain and copy: notes
[DeviceColorConversion]; no-op: none), and the clear is announced as device-color-conversion.
That is the device's conversion, noted and announced (rule 1); the lane did not follow either.

Now a draw whose texel is not Metal's is checked against the device's codes: each channel the
operation of either code nearest the drawn value, where the pipeline's fragment stage records
DeviceColorConversion (compiled through the device's compile layer), and either code nearest the
cleared value, where the device announced device-color-conversion over a pass of each normalized
format's clear alone, made before any pipeline (a device announces each kind once). Elsewhere the
draw must be Metal's texel, as before. The test prints how many draws took the device's codes and
under which key.

(cherry picked from commit bc4b5197202d9508bea0fd718a439675e79dee2d)
2026-11-09 03:12:21 -08:00
Anees Iqbal c8d166727f HalfConversionFusedWithArithmetic names the generations measured: PHOENIX and NAVI31 fuse, POLARIS12 notes every narrowing
The orchestrator asked that a fact of RADV's compiler, keyed on the driver, name the generations it
was measured on. The full runtime lanes at 0bf26ce585's base (7b45bd4646, this branch among the
stack) printed, for runtime_lane::half_conversions' product kernel:

- Radeon 780M (RADV PHOENIX, GFX11, '1002:15bf!', job 11477): 4,542 of 253,958 lanes the device's,
  note true (the v_fma_mixlo_f16 fusion seen in the 11121 disassembly);
- Radeon RX 7900 XTX (RADV NAVI31, GFX11, '1002:744c!', job 11476): 4,542 of 253,958, note true;
- Radeon RX 550 (RADV POLARIS12, GFX8, '1002:699f!', job 11495): 8,180 of 253,958 for the product,
  sum and fma kernels and 8,185 for a plain load, every kernel noted, so the narrowing itself is
  the device's there and no fusion can be told apart.

The workaround stays keyed on VK_DRIVER_ID_MESA_RADV on every GPU; the doc says so and names the
three. Doc only.

Verified: cargo fmt.
(cherry picked from commit fd13169d87b9d81921ff304929d3af3f54587a89)
2026-11-09 03:12:21 -08:00
Anees Iqbal e68eea5a2a Unit tests that list RADV's workarounds and set aside a half kernel's own rounding note
Job 11253 (gem10, the whole metal2vulkan suite at 799d39233c) failed three tests:

- moltenvk_on_apple_carries_the_early_tests_image_write_defect lists the workarounds of a
  description under RADV's driver id: it now carries HalfConversionFusedWithArithmetic too, which
  holds on any vendor as RADV's interpolation defect does.
- exported_float_notes_are_the_ones_a_compile_records sets aside the note of a half kernel's own
  rounding (narrow::native_rounding); on a RADV profile the rounding of a half function computed
  in float arithmetic (log10_f16_flagless on amd-rdna2-apu-radv) now records
  NativeHalfConversion through the fused conversion (narrow::rounds_arithmetic), which is the
  module's rounding, not the function's, so the test sets it aside as well where the exported
  notes do not name it.
- golden_hashes_match_the_table: 6480 cells under the RADV profiles, whose profile key changed
  with the new workaround ("no SEMANTICS_VERSION bump is needed"); re-blessed on development.

(cherry picked from commit bd1796334a0cd8150484d2e8d4a9bccfb3d56898)
2026-11-09 03:12:21 -08:00
Anees Iqbal 7ed49fd04d RADV fuses float arithmetic into a half conversion: the pipeline records NativeHalfConversion
On the Radeon 780M (RADV PHOENIX) runtime_lane::half_conversions failed its product kernel:
2.6822087e-7 * 1.0000001 answered half 0x0005 where Metal's half of the float product is
0x0004, with notes only [NativeNanEncoding] (radvruns job 11026, 2 of 2 runs). The module
rounds under the float controls (QuantizeForm::Controlled), which make the conversion Metal's,
so it recorded no conversion note. RADV_DEBUG=shaders on the 780M (job 11121) shows why: ACO
compiles the product's OpFMul and the narrowing, both decorated NoContraction, as one
v_fma_mixlo_f16 v2, v1, v0, neg(0), rounding the exact product to half once where Metal rounds
the float product; the sum kernel's narrowing is one v_fma_mixlo_f16 1.0, a, b too.

That is the device's own rounding (rule 1), so the fix is the note, not Metal's bits:

- DriverWorkaround::HalfConversionFusedWithArithmetic, keyed on RADV on every GPU (the others
  unmeasured), as NVIDIA's HalfConversionPairFolded is keyed on its driver.
- narrow::rounds_arithmetic: whether a module rounds to half, through a conversion pair, the
  result of an f32 OpFAdd, OpFSub, OpFMul, OpFmaKHR or GLSL Fma.
- compile_kept records PrecisionNote::NativeHalfConversion where the module takes the
  controlled conversion, the profile carries the workaround and rounds_arithmetic holds. The
  controlled form itself stays: a loaded float's conversion is exact there and records nothing.
- Tests: radv_carries_the_fused_half_conversion (every committed RADV profile carries it, no
  other does, and RADV keeps the controlled form) and
  a_controlled_rounding_of_arithmetic_is_noted_where_the_driver_fuses_it (a float sum, product
  and fused multiply-add rounded to half record the note on every RADV profile and not on ANV;
  a loaded float narrowed alone records it on neither). Both fail with compile.rs and derive.rs
  at the base.
- The note's doc, the API guide's catalogue entry, HOWTO, the narrow module doc, the lane's doc
  and the signature table name the new variant.

(cherry picked from commit 799d39233c4e0ae2a18a716e794db8f67405ff00)
2026-11-09 03:12:03 -08:00
Anees Iqbal 541c5afec6 resolve_rounding: the clear's channels are f64 already (clippy useless_conversion under --cfg m2v_cpu_icd, job 11250)
(cherry picked from commit 7329c2d0476abcc4d6badabaf2e4d84182d99b31)
2026-11-09 03:12:03 -08:00
Anees Iqbal 66c344998a resolve_rounding: the cleared resolve reads the device's announcement of the conversion once a device
um870 job m3-max-11101 (780M, 2 runs) passed RGBA8Unorm_sRGB under 9e985f4bb4: its passes announced
DeviceColorConversion, and every resolved texel ([bc, 7f, 0a, ff]) lies on the codes nearest the
clear. BGRA8Unorm_sRGB still failed: its 1x clear stores [0a, 80, bc, 80], its 4x clear resolves
to [0a, 7f, bc, 80], and its passes announced nothing. A device announces each kind once
(Device::degrade, AnnouncedKinds::now), and the RGBA format's passes had already announced it.
The lane now reads the kinds the device has announced so far (Messages::taken_kinds), not only
these passes' notices.

(cherry picked from commit c4ad2a0905acba67636dac3e908005f1a380e07c)
2026-11-09 03:12:03 -08:00
Anees Iqbal db251d505e resolve_rounding: a cleared sRGB resolve takes either code nearest the clear where the passes announce the conversion
On the Radeon 780M under RADV (development 1c7a75be62, job m3-max-11026, 2 runs of 2), the 1x
clear of RGBA8Unorm_sRGB [0.5, 0.214, 0.0031308, 1.0] stores [bc, 80, 0a, ff]; Metal's is
[bc, 7f, 0a, ff]. The 4x clear of the same pass shape resolves to texels other than the 1x
clear's, all 4096 of them, the first [bc, 7f, 0a, ff]. 0.214 encodes to 127.47 codes. The
device converts a clear its own way, and its 1x and 4x images take different routes to the same
value: a code apart, either nearest code, both the device's native conversion. The runtime
announces device-color-conversion for such a clear, and rule 1 makes the device's answer the
answer.

The lane held the 4x resolve to the 1x clear's bytes. It now holds each resolved texel to those
bytes, or, where the two passes announced device-color-conversion, to the two codes nearest the
clear's value in each channel: the sRGB curve's for a colour channel, alpha as it is. It prints
how many texels differ from the 1x clear, the first, how many fall off the nearest codes, and
the notices.

(cherry picked from commit 9e985f4bb450ebf3f60d32511b9386bd9856950b)
2026-11-09 03:12:03 -08:00
Anees Iqbal ec3ccb6868 Re-bless the golden tables at 37e4bb644b
Translation changed at 37e4bb644b (SEMANTICS_VERSION 2001). Blessed on the M3
(s37-pl.sh bless, dv-golden).

(cherry picked from commit f3d4d4c40315066496ec70f31bcb0ed9639cd886)
2026-11-09 03:09:42 -08:00
Anees Iqbal 37e4bb644b Re-record the conformance cost records at 557652bd4a
The runtime's counts moved across RUNTIME_VERSION 1939-1964 and the records were not re-recorded
since: the opaque-fd split's new plain_buffer_blocks_made count (1133 lines), carried kept draws
(kept_draws_carried, kept_draws_carry_dropped_between), attached read slots, and small shifts in
the scheduler's passes, sleeps and wakes and in recycler evictions (about 185 records each way).
cost --runs 8 --write over the whole set, then cost --runs 8 --alone --write over every record it
changed (all 568), so each carries its contrast.

Verified: potluck job m3-max-11506 on the M3 Max (MoltenVK 1.4.2), exit 0: 568 cases measured,
none the venue could not measure.

(cherry picked from commit cfdb1560ab0911a40bd0f47b6ceecf86a63617f7)
2026-11-09 03:07:01 -08:00
Anees Iqbal 0891975532 RUNTIME_VERSION 1965 and the runtime-sources pin for RADV's Metal-rounded half storage writes
sweep's 5020ce9454 + be57c385dd: one RADV-wide DriverDeviation::MetalHalfStorageWrites row (driver
MESA_RADV, any vendor and device) replaces the 780M's, so the XTX and every other RADV device stop
announcing DeviceColorConversion for float outputs stored or blended into 16-bit float targets
under the interlock, where every texel is Metal's. Measured on RDNA3 x2 (780M, XTX) and GCN4
(RX 550): 0 non-NaN channels of 1.78M differ on each. driver_facts.rs is a pinned translator
source and the runtime's notes change on those devices, so RUNTIME_VERSION 1965. The golden tables'
amd-rdna3-radv and amd-rdna2-apu-radv keys move (3242 cells); re-blessed on development next.

Verified (sweep): XTX blend16 6/6 and half_storage_writes 2/2 (11408, 11467); 780M the same
(11467); RX 550 half_storage_writes 2/2 taking the row (11470); plain clippy clean; metal2vulkan
driver/profile/derive/half/fetch tests 272/273, the one failure golden_hashes (re-bless).
Here: the API-signature check, REFUSALS.md and CONFORMANCE-COVERAGE.md regenerate unchanged,
cargo fmt clean.
2026-11-09 02:55:43 -08:00
Anees Iqbal 14cb8334da Driver facts: RADV's half-float storage writes are Metal's on every GPU, one driver-wide row
What. DriverDeviation::MetalHalfStorageWrites is RADV's on every GPU: one row keyed by the
driver (MESA_RADV, no vendor or device) replaces the Radeon 780M's and the RX 7900 XTX's rows.
The doc names what was measured: RDNA3 on two GPUs (the 780M, the XTX) and GCN4 on one (the
RX 550). The committed RADV profiles no row named (amd-rdna3-radv, amd-rdna2-apu-radv) now take
it; the_profile_takes_the_deviations_its_driver_is_measured_with says so.

Why. runtime_lane::half_storage_writes on the RX 550 (Polaris 12, RADV, Mesa 26.2.6, at
5020ce945) stores every non-NaN channel as Metal does through access::write, access::read_write,
a texture buffer and an argument buffer's texture, into R16Float (0 of 253,979 differ),
RG16Float (0 of 507,958) and RGBA16Float (0 of 1,015,916), its NaNs as the 780M and the XTX
store them (device-nan-encoding announced): the third RADV GPU, of a second generation, that
answers as the others do. So the fact is the driver's, not a list of device IDs.

Golden cells of the RADV profiles that now take the property may move; they are re-blessed on
development.

(cherry picked from commit be57c385dd8f7b57ceee81db276d7cd1686cef86)
2026-11-09 02:54:56 -08:00
Anees Iqbal 4759876a47 Driver facts: RADV's half-float storage writes on the RX 7900 XTX are Metal's
What. The RX 7900 XTX (Navi 31, 0x744c) under RADV takes
DriverDeviation::MetalHalfStorageWrites, as the Radeon 780M does: a float
stored to a 16-bit float storage image rounds as Metal's write does.

Why. Without the row, a fragment function that blends a float output into a
16-bit float attachment in the interlocked storage form recorded
PrecisionNote::DeviceColorConversion on the XTX, so six
runtime_lane::framebuffer_fetch::blend16 tests (a_blended_sixteen_bit_float_
fetch_stores_metals_blend, a_fetched_blend_constant_difference_stores_metals_
blend, nans x2, narrow, zero) failed there on the note while every texel was
Metal's (4096 of 4096). The 780M, which has the row, passes them.

Measured. runtime_lane::half_storage_writes on the XTX (RADV, Mesa 26.2.6,
at 92202c5ea): every non-NaN channel Metal's through access::write,
access::read_write, a texture buffer and an argument buffer's texture, into
R16Float (0 of 253,979 differ), RG16Float (0 of 507,958) and RGBA16Float
(0 of 1,015,916); NaNs stored as on the 780M (device-nan-encoding announced).

(cherry picked from commit 5020ce9454a249490495410d5add76f10747ccf7)
2026-11-09 02:54:56 -08:00
Anees Iqbal 557652bd4a RUNTIME_VERSION 1964 and the runtime-sources pin for libraries of shaders reporting what their driver found
ownpixel's 037983e7a0: the pre-rasterization and fragment-shader libraries chain
VK_EXT_pipeline_creation_feedback and go through make_pipelines_reported, so a library the driver
found in its loaded record reads nothing back and writes nothing. RADV's data for such a library
could come back the same length with a byte changed, so the read-back compare saw a new hash and
wrote the record again (tests::warm's 'counts only what it writes' red, 2 in 20 on the 780M). The
runtime changed, so RUNTIME_VERSION 1964.

Verified (ownpixel), 780M RADV PHOENIX ('1002:15bf!'), Mesa 26.2.6, release, --cfg m2v_gpu, job
11466: without the fix the warm test failed 1 of 100 and the new
a_library_of_shaders_reports_what_its_driver_found reads 0 reports; with it, the new test x21 (2
hits, 0 written), the warm test x101, warm/shader_cache/driver_pipeline_compile 31, the runtime
suite x3 1964 each, pipeline_records and cache lanes 10; clippy plain and m2v_gpu clean (msi
11471). Pending: lavapipe 11484, the 5080 entry. Here: the API-signature check, REFUSALS.md and
CONFORMANCE-COVERAGE.md regenerate unchanged, cargo fmt clean.
2026-11-09 02:52:48 -08:00
Anees Iqbal 5cd5f93c9e Libraries of shaders report what their driver found, so a found one's record is not written again
What: where the device links its render pipelines from graphics pipeline libraries, the
pre-rasterization and fragment shader libraries were made through the shader cache with no
VK_EXT_pipeline_creation_feedback, so every such making read the driver's data back and compared
its SHA-256 with what the cache was loaded with. They now chain the feedback as a whole
pipeline's making does (VariantObjects::library_of_shaders). A library that the driver reports
found in the cache its record loaded reads nothing back and writes nothing (driver_data_found).
The reports count in driver_pipeline_hits and misses, as the pipeline_records and cache lanes
already count a linked device's makings.

Why: tests::warm::a_pass_over_its_records_own_directory_counts_only_what_it_writes failed in 1 of
3 full runtime suites on PHOENIX. The cause is the device, not another test or the load. I probed
the driver's data before and after each making on gem10's Radeon 780M (RADV PHOENIX, Mesa
26.2.6, release, --cfg m2v_gpu): the test failed in 2 of 20 runs alone. In both, the state's two
libraries were found in their loaded records, and each left data of the record's length with
one byte different (of 1352 and 1092 bytes, at offsets 708 and 796). keep() took the new
SHA-256 for new data and wrote both records again, while counting no growth: "2 records' data
written, pipeline_bytes 0". Whole pipelines report found and read nothing back, so the same drift
on them wrote nothing. The data's format is the driver's own, so no comparison here reads its
entries; the driver's report decides.

The negative: tests::driver_pipeline_compile::a_library_of_shaders_reports_what_its_driver_found.
A second device, over the directory where a first device's creation of a state wrote, must count
one report per library of shaders (2), with found == hits, and where both are found it writes no
record. Without the fix it reads 0 hits and 0 misses and fails.

Verified on gem10's 780M (RADV PHOENIX via MESA_VK_DEVICE_SELECT=1002:15bf!, Mesa 26.2.6,
release, --cfg m2v_gpu), in one job over the test alone and then the fix:
- The test alone (the negative) fails: 0 reports, 2 records loaded. The warm test x100 without
  the fix: 99 passed and 1 failed (2 records' data written, 2 found, 0 unchanged).
- With the fix:
  - The new test passed x21: 2 hits, 0 misses, 2 found, 0 written.
  - The warm test passed x101: 0 bytes, 0 written, 4 found.
  - tests::warm, shader_cache and driver_pipeline_compile: 31 passed.
  - The runtime suite (the GPU-hazard filter, the GPU-time tests left out) passed in 3 runs,
    1964 tests each.
  - runtime_lane::pipeline_records and runtime_lane::cache: 10 passed. Their second device
    read loads 2, saves 0, found 2, hits 2.
- cargo clippy -p metal2vulkan-runtime --all-targets --all-features -D warnings is clean, plain
  and with --cfg m2v_gpu.

(cherry picked from commit 037983e7a04af9346bcad1e4d4b61af864627fe0)
2026-11-09 02:51:59 -08:00
Anees Iqbal afe01b6093 in_place_textures lane: FdBlocks reads Unchecked where the device makes no exportable block, not as a failed check
The VERDICTS doc said a class the device cannot check reads Unchecked; it now says why FdBlocks
does on discrete devices: they have no unified memory, so memory.rs's fd_buffer_types refuses
and the device makes no block of its buffers exportable for the check to cover. Doc only.

(cherry picked from commit 3920fc9b0877dbb66d986c51c7dfa6fa4ff5a35e)
2026-11-09 02:36:12 -08:00
Anees Iqbal 1cf6d5b246 in_place_textures lane: the check's verdicts count the opaque-fd blocks class
runtime_lane::in_place_textures::a_failed_check_keeps_the_shadow_and_no_record failed on the
RX 7900 XTX at 92202c5eaf: 98 verdicts where it held the report to 84. The opaque-fd block
split added PagesClass::FdBlocks, and the check's report gives every class of PagesClass::ALL
on every device (in_place.rs's VERDICTS: row ends x classes x accesses), a class the device
cannot check reading Unchecked, as FdBlocks does where the device allocates no block of its
buffers exportable (every discrete device). So the lane counts seven classes: 98.

Verification: the in_place_textures lane on the XTX and the 780M follows.
(cherry picked from commit e55bd8200c5ecbd44878e5cab96d93eefe844c51)
2026-11-09 02:36:12 -08:00
Anees Iqbal 3cec9c05e6 Re-pin the runtime sources for completion_order's held pauses
d34f25a74b changes contexts/mod.rs, a pinned runtime source, in test-cfg code only (the pause
after a queue context's items held until the test lets it go), so the pin moves while the
runtime's behavior does not: no RUNTIME_VERSION change.

Verified (radvruns): um790 RADV PHOENIX release gpucfg: beside a full runtime suite the old test
failed 1 of 90 with "7 pauses" (completion_order.rs:313) and the fixed one passed 105 of 105;
20 full suites at d34f25a74b passed the test 20/20 (18 fully green, the other two only the
known warm red); M3 clippy plain/m2v_gpu/m2v_cpu_icd and rustdoc clean, runtime 1368/1368.
2026-11-09 02:32:41 -08:00
Anees Iqbal 4011032f3a completion_order: a paused handler thread stays away until the round after its own ended
a_handler_thread_held_off_the_cpu_after_a_wait_returned_keeps_the_order failed 1 in 5 full
runtime suites on RADV PHOENIX ("7 pauses", completion_order.rs:313) and passed 20 of 20 alone.
Its stand-in for a thread the host takes the CPU from was a 100 ms sleep counted after the
thread let go of the transition's hold, and the hold's going is what lets A's waiters return:
the test read the count as its last round's wait returned, before a thread the host had not
yet run again counted that round's pause. The 100 ms also made "the thread is still away as the
next round begins" a matter of time.

Contexts::pause_after_items now pauses a thread until the test lets the pause go
(Contexts::release_pauses; the pool's stop lets every pause go), and Contexts::await_pauses
waits for pauses to begin. Each round waits until one pause a round at least began, then lets
the round before's pauses go, so each round runs with the round before's thread away, and the
count is read once every round's pause began.

Verification: the old and the new test under a CPU hog pinned to the test's cores, and full
runtime suites, on RADV PHOENIX follow.

(cherry picked from commit d34f25a74b53d5495aded8055979fda7b1cdeff4)
2026-11-09 02:32:23 -08:00
Anees Iqbal b3c5a7d169 draw_again: warm returns once the device's own checks ended
A device's queue-switch check (queue_switch_check.rs, started by its first command queue) and
its submission checks (submit_check.rs, started as it is made) record command buffers on threads
of their own, which WorkCounts::commands_recorded counts as it counts a test run's. Under twelve
processes' load on the RTX 5080, draws_after_a_state_set_or_a_barrier_set_what_every_step_sets
read 32 cmd_reset_query_pool, 64 cmd_write_timestamp and 32 end_command_buffer more in one run
than in the other: the queue-switch check recorded inside that run's window.

warm(), which every test comparing runs' counts calls before its windows (draw_again,
command_counts, carried_draws, set_zero_at_offsets, shared_draw_locks), now also waits until
both checks settled (Device::settle_queue_switch_check, Device::settle_submit_checks), as
merge_scratch::settled waits for the in-place check.

warm_returns_once_the_device_s_own_checks_ended holds the queue-switch check between two of its
rounds (QueueSwitch::held) and lets it go only once a call waits for its verdict: without the
wait in warm, warm returns with the verdict pending and the test fails; a device that runs no
such check is skipped.

(cherry picked from commit ed93063389d03e930ba674d6100f31c8913cd2fc)
2026-11-09 02:11:18 -08:00
Anees Iqbal 92202c5eaf RUNTIME_VERSION 1963, the runtime-sources pin and REFUSALS.md for the opaque-fd block split
radvruns' split (43 commits, its fd-blocks-2 branch at dd5e698bff): on a unified device's system
heap, runtime buffers lie in blocks exportable as opaque fds once the device's in-place check
takes them, and buffers that declare their padding unobserved stay in plain blocks. On the 780M
this removes the submit stall behind the kernel's lock (0 turnarounds of 8 ms or more against
11-12; the lock wait 305 -> 2.6 ms). A buffer's making no longer starts the in-place check
(289b04fae4); kept room serves the runtime's own pools first (916073fc37); blocks made ahead stop
at the allocation margin left to the objects (dd5e698bff). REFUSALS.md: BufferLength gains the
pooled_check_buffer site. The runtime changed, so RUNTIME_VERSION 1963.

Verified (radvruns) at dd5e698bff: PHOENIX (um790, release, gpucfg) host_ram_device 22/22, the
seven earlier-red modules 47/47, the full runtime suite 1963/1963 and 1962/1963 (completion_order's
timing test once; base comparison 11395 against tip 11394 running); M3 clippy plain/m2v_gpu/
m2v_cpu_icd and rustdoc clean, runtime 1367/1367, m2v_gpu set 168/168. Open: Iris
in_place_check::the_in_place_check_takes_no_range_of_the_metal_space failed at dccbb9d3d7 (base
vs tip 11363/11364 pending). Here: the API-signature check, REFUSALS.md and
CONFORMANCE-COVERAGE.md regenerated, cargo fmt clean.
2026-11-09 01:45:34 -08:00
Anees Iqbal fc60379c1f Blocks made ahead stop at the allocation margin the runtime's work ahead leaves to the objects
With the runtime's buffers in exportable blocks, keep_room on the 780M kept a pool of the
program's Private buffers and one of its Shared ones; on a device held to a small
maxMemoryAllocationCount those two blocks and the host copies' block made ahead took every
allocation left, and the zero source a new Private buffer's first clear places (first_move.rs's
Zeros, a plain Shared buffer) was refused: the_ahead_thread_leaves_the_allocation_limit_to_the_objects
made no buffer (probe at dccbb9d3d7: three takes to the limit of 5, then Zeros::new refused).

allocations.rs already says the allocations the runtime makes ahead of any object stop while
fewer than a quarter of the limit are left, so the objects have those; only host_ram.rs's
import thread held to it. keep_room's own makings and memory/ready.rs's makings that no call
waits for now ask allocations::room_ahead before they allocate. A call that waits for a
making still has it made.

Verification: the failing test, the host_ram_device module and the runtime gpucfg suite on
RADV PHOENIX follow.

(cherry picked from commit dd5e698bff9bad8b780e6b1b2ff68e4d12cd617e)
2026-11-09 01:44:42 -08:00
Anees Iqbal 97afeae593 Kept room: the runtime's own buffers' pools first, the exportable ones only while they lie there
keep_room kept room in every kept pool in the order Buffers, FdBuffers, Images, whatever kind
of block the runtime's own buffers took. On a device near its count of allocations the plain
Buffers pool's block spent the last allocation the program's buffer, placed in the FdBuffers
pool once the device's in-place verdicts were known, then needed:
tests::host_ram_device::the_ahead_thread_leaves_the_allocation_limit_to_the_objects made no
buffer (Vulkan -10) on RADV PHOENIX at 97f92139dd, where the base made one.

Device::keep_room now asks which kind the runtime's own buffers take (Memory::own_buffers of
Device::fd_blocks_taken, the verdicts as fd_blocks_checked reads them, counting nothing and
starting no check), and keep_room keeps that kind's pools first and the FdBuffers pools only
when that kind is FdBuffers. The FAST-PATHS row on exportable blocks says so.

Verification: the failing test and the runtime gpucfg suite on RADV PHOENIX follow.
(cherry picked from commit 916073fc374888e44f203e7f1c00abbf55497af5)
2026-11-09 01:44:42 -08:00
Anees Iqbal 33f1fecac1 fd blocks: a buffer's making starts no in-place check
The full runtime gpucfg suite on PHOENIX at e03275c440 (job 11224, release) had 16 failures in
completion_here, draw_again, host_residency, teardown_threads, waiter_submits and
pointer_residency. The fd set itself passed 3/3. The failing tests count device-wide state
(recorded commands, host-import residency, threads at teardown, completions).

With this branch the first buffer a device made asked fd_blocks_checked, which went through
in_place_verdict and started the in-place check in the background wherever its verdicts were
pending: on every program's first run on a driver, and in every test with a fresh shader cache.
The check's own buffers, imports and command buffers then ran among the program's, as
tests::recycle showed exactly (472 vs 490-505 recycled under load).

fd_blocks_checked now reads the verdicts without starting the check. The runtime's own buffers
lie in exportable blocks once the verdicts are known: from the check's record as the device is
made, or once a check that a texture over host pages or Device::settle_in_place_checks started
has answered. Until then they lie in plain blocks, counted fd_blocks_awaited, as before.

The recycle tests' settle (3297613ce2's) is removed: it would now start a check the tests have
no use for.

Docs:
- in_place.rs, memory.rs, WorkCounts::fd_blocks_awaited and the bench's arm doc say who starts
  the check.
- The FAST-PATHS Private row drops the unsettled-runtime numbers (taken while a buffer started
  the check): until the verdicts are known the blocks are plain, as the base's. The settled
  numbers stand.

Verification is pending: the full suite at this tip and at development, side by side on
PHOENIX.

(cherry picked from commit 289b04fae4ce20bed3b2ebe92e6b693e7d4a8e0b)
2026-11-09 01:44:42 -08:00
Anees Iqbal 23be585d37 exported_textures: one bullet list in the module doc after the rebase
The rebase onto development put development's dma-buf bullets and this branch's own-blocks
bullet on either side of a blank doc line, which splits the list in two. Doc only.

(cherry picked from commit bea33f59a3855e62b8fefbcf1814a46837b31fde)
2026-11-09 01:44:42 -08:00
Anees Iqbal db278a5170 recycle tests: the device's in-place check settled before a test counts
tests::recycle::each_frames_buffers_take_parked_buffers failed on the 780M (RADV PHOENIX,
Mesa 26.2.6) whenever it ran beside the rest of the suite, and passed when run alone. Under the
suite it recycled 490, 492 and 505 buffers (expected 472) and parked 500, 502 and 523 (480).

The cause: with this branch, the first buffer a device makes asks fd_blocks_checked. Where the
verdicts are pending (a fresh shader cache directory, as each test has), that starts the
device's in-place check in the background. The check makes kernel buffers each round
(new_buffer_placed, shared, outside the address space), releases them, and they park and are
recycled like any buffer. The test counts the device's churn exactly. A per-frame probe
(11184) showed the counts exact through frame 44 and growing from frame 45 on, the check still
running (in_place_check_took None, fd_blocks_awaited 8 per frame).

The recycle tests' device now settles the check (settle_in_place_checks, up to WAIT) before a
test counts. The runtime's behaviour is unchanged.

(cherry picked from commit e47851ed18923489af978bc0350f0580ff2f72b9)
2026-11-09 01:44:41 -08:00
Anees Iqbal 617729cb62 buffer.rs: the recycler's fallback makings asked with bool::then_some, as clippy asks
clippy::unnecessary_filter... (Some(x).filter(|_| predicate)) on the fallback's two makings, under
plain and --cfg m2v_gpu (gem10, job 11041 at 8960f31a93).

(cherry picked from commit 78d0d8592a977123cb45eef1b55b26e8720477d7)
2026-11-09 01:44:41 -08:00
Anees Iqbal cd3676b4f3 FAST-PATHS: the Private row's runtime numbers at the split
From the bench at 73312dc63e on gem10 (RADV PHOENIX, '1002:15bf!', job 10985), two runs of
each runtime arm against the base binary: base 13/12 turnarounds of 8 ms or more quiet and
103/17 fragmented (slowest 40.4/49.0 ms, 350/311 ms of kernel-lock wait); tip fresh 1/1 quiet
(3 plain blocks made while the first check was pending) and 0/0 fragmented (21/24 ms waited);
tip settled 0/0 in both phases (4/10 ms waited).

Verified: docs only.
(cherry picked from commit e5816df55531a25ec0730d82e962f87e9cc17f52)
2026-11-09 01:44:41 -08:00
Anees Iqbal 2d71da75b5 fd blocks: a buffer bound for an exportable block takes a parked plain one
The device's buffers lie in plain blocks until its check answers, so a program's first
frames park plain buffers; with the block kind in the recycler's key, every later frame's
buffers made new ones in exportable blocks instead of taking them (gem10, RADV PHOENIX at
73312dc63e: tests::recycle::each_frames_buffers_take_parked_buffers failed). Any buffer may
lie in a plain block, so a making for an exportable block now asks for a parked plain buffer
of the same size and class where none of its own kind is parked, as a making that found no
fresh pages asks for a parked buffer of the device's memory. A buffer that declares its
padding unobserved still takes only plain ones.

Verified: cargo fmt only; the 780M rerun of the touched tests is dispatched next.
(cherry picked from commit af3bd029acebc54541688f10bf2cad5c502dcce0)
2026-11-09 01:44:41 -08:00
Anees Iqbal 829a68129b FAST-PATHS: the Private row names the split by padding, the first turnaround and what stays plain
The heading and body say buffers that declare their padding unobserved keep plain blocks
and why (a DRM_FORMAT_MOD_LINEAR image over exportable memory needs a dedicated allocation
on RADV); the made-before arm's 57.0 ms first turnaround against 2.4 to 8.1 ms with 64
exportable blocks held (reclaim-10514/10615); what still makes plain blocks
(WorkCounts::plain_buffer_blocks_made) and the second pool's held block; the planes over an
unobserved buffer take the conversion image as before. The RUNTIME_ARMS placeholder is gone;
the runtime arms' numbers follow once the bench at the split has run.

Verified: docs only.
(cherry picked from commit 3619d8e8783039e8568afc4c0e75fb9b943bfd76)
2026-11-09 01:44:41 -08:00
Anees Iqbal 5e020e43bd fd blocks: buffers that declare their padding unobserved stay in plain blocks
A texture over a buffer whose rows lie apart is in place only where the buffer declares
its padding unobserved, and there, over a plain block, it may take a DRM_FORMAT_MOD_LINEAR
image at Metal's pitch, which RADV makes for exportable memory only as a dedicated
allocation. The placement test at b48d8fae41 counted 15276 such textures lost over
exportable blocks for padding-unobserved buffers and 0 for padding-kept ones. So the split:

- BufferDescriptor's padding_unobserved reaches the placement (Made, buffer_of_length,
  NewBufferOf::Unobserved): such a buffer lies in a plain block (Holds::Buffers) wherever;
  every other buffer of the runtime's buffer path lies where the device's own buffers do.
- The recycler's BufferMaking keys on the block kind, so a parked buffer in an exportable
  block is never handed to a padding-unobserved one.
- fd_blocks_cover's second guard asks what a padding-kept texture can take: rows one after
  another at a multiple of 16 bytes where the device's own linear image lies otherwise, at
  every width of linear_alignment::WIDTHS, every backed format and usage; any
  DRM_FORMAT_MOD_LINEAR image of its own memory made there refuses the blocks. The linear
  layout comparison runs at every width too.
- WorkCounts::plain_buffer_blocks_made counts plain blocks of buffers, beside
  fd_buffer_blocks_made, so a lane can read the share of block makes on each side; the bench
  prints it.
- The placement test tries rows rounded to 16 too, makes the program's buffer through
  new_buffer_with_descriptor for each padding, asserts where it lies, and asserts 0 lost for
  both kinds. The nv12 test checks a padding-unobserved picture lies in a plain block while a
  parked exportable one of its making exists.
- Docs: memory.rs, in_place_check.rs, the FAST-PATHS in-place row, the descriptor field and
  the runtime README.

Verified: cargo fmt only; builds and device tests are dispatched next.
(cherry picked from commit 6e5c80ac3caaa2ad26c0456ecfc0801bca4ccd42)
2026-11-09 01:44:41 -08:00
Anees Iqbal ced7920e3a exported_textures: wrap the placement test's lines
(cherry picked from commit b0711c9c1d00438cfdcc2d5fbca000d8fc407a32)
2026-11-09 01:44:41 -08:00
Anees Iqbal 5c1f2295ac exported_textures: the placement test over buffers that declare their padding unobserved too
(cherry picked from commit f0068b7ce6e13108f6368a5f18c4f5d05999e44a)
2026-11-09 01:44:41 -08:00
Anees Iqbal a40b22160f exported_textures: the placement test tries four-row textures and prints why pitched ones are shadows over a plain block
(cherry picked from commit 80229ccbd2eef15134504e43c7d33291d2fee0d7)
2026-11-09 01:44:41 -08:00