A no-copy buffer or heap over memory with no dma-buf source, or whose source fails, on a device
that imports no host pointer, is now the copy a refused pointer takes on RADV instead of a
HostMemory refusal; the device's in-place check makes no pointer-pages buffer there.
a_copy_takes_its_chunks_as_an_object_does_and_the_window_ahead_moves_past_them
failed on lavapipe under load (job m3-max-14819, msi-laptop, five jobs
there): 'the device's thread went on past the window', 6 against 5.
The thread's import of a chunk counts host_ram_chunks_imported inside
import_chunk (host_ram.rs, Imported::Chunk) and host_ram_chunks_imported_ahead
only after the import ends. The scatter's settle waited for
by_copies + ahead == 2 + WINDOW, a sum that reaches its mark between the
two increments (by_copies 1, ahead 5), so it stopped there and the
thread's later ahead count read as the thread going past the window.
It now waits for ahead == 2 + WINDOW (and no run import live); the
assertion after it still checks by_copies is 0, so a copy that imported
its own chunk still fails it, after the wait.
On a device that imports no host pointer but imports dma-bufs (Honeykrisp
on Asahi lists no VK_EXT_external_memory_host), a no-copy buffer or heap
over memory with no source of dma-bufs was refused, naming the extension.
Metal makes such a buffer, and in place is impossible there, so it now
takes the copy a refused pointer with no source takes on RADV
(CopiedFor::DeviceRefused): announced as copied-host-pages, counted in
copied_host_buffers_device_refused, with every copy's coherence.
How: host_window marks such pages pointerless (the device imports no
pointer, the memory is not dma-buf-only). buffer_over_host_parts no
longer takes the no-route refusal for them, so they reach
import_by_pointer, whose not_importable answer is the device's refusal;
a source that fails counts as the device's refusal there too, as on
RADV. Rebinds to such memory, a guest RAM with no source, and every
no-copy object on a device with neither route stay refused, naming the
extension. The in-place check no longer makes its pointer-class buffer
on a device that imports no pointer (it would be an announced copy now);
its verdict there stays lasting, as before.
Docs: the copied-host-pages detail, CopiedFor, CopiedBecause and the
counter, copied.rs, host_memory.rs, the no-copy buffer and heap calls,
imports_shared_host_pointers, host_ram/copy.rs, the runtime README, the
API catalogue and HOWTO section 6. docs/REFUSALS.md regenerated:
unchanged, as the extension's refusal sites all remain.
Verified by the device test in the previous commit (lavapipe and the
780M, see the hand-off).
A device that imports no host pointer (made withholding the extension, as
a driver that lists none is) but imports dma-bufs refuses a no-copy buffer
or heap over memory with no source of dma-bufs today, naming the
extension. The decision is that such memory takes the copy a refused
pointer without a source takes on RADV.
copied_buffer_and_heap_are_made_on_a_device_that_imports_no_pointer makes,
on that device, a buffer over shared memory with no source, one with a
source that fails, and a heap with no source, and asserts each is a copy
(counted as the device's refusal, announced once, no pointer or dma-buf
imported, the source called once) with the RADV copy path's coherence: a
CPU write before a commit reaches the GPU, those bytes alone copied in,
and a fill reaches the pages at its completion, those bytes alone merged
back. The heap's placed-buffer checks move into placed_lies_in_a_copy,
which the gate-refused heap test now shares, gaining the CPU-write check.
The test that asserted the refusal goes.
Fails at de15678626: the buffer with no source is refused.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
A consumer keeps its imports of exportable buffers (CUDA's cuImportExternalMemory of each
buffer's descriptor) until a reaper thread lets go of them, a short while after the buffer's
release, never using them after it. That is sound: each descriptor vkGetMemoryFdKHR makes holds a
reference to the allocation's payload, and vkFreeMemory releases only the memory object's own
reference, so the payload stays until the import goes. The docs said the buffer must outlive
every import, a stricter rule than the one that holds; they now say every access through one.
Docs only.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
The runtime records a by-region self-dependency barrier between draws that fetch and write the
color, and at an instance's first fetch, on a device with neither raster-order access nor pixel
interlock; a draw that both fetches and writes a color is no longer kept for drawing again.
The hkfbfetch branch took 2025 from a base at 2024, and development's Core Image
change (521f778bf6) took 2025 too; translation changed in both, so this takes the next.
On RADV on the RX 550 (Polaris, neither ordered fetch form of its own; job m3-max-14807) the first
fetch of a render pass instance read a load-cleared RGBA32Uint attachment as 0: the lane's three
exf_fetch_count draws stored (k + 1) * 13 for c * 27 + (k + 1) * 13, and
fetched_attachments_clear_as_the_load_action_does counted 7, 200, 13, 255 beside the tag for
10, 206, 22, 267. Each read after a barrier between draws was right. Vulkan orders the load
operations before every access of the instance through the attachment, but this driver did not
make the clear visible to the input attachment read; the barrier between draws, inside the
subpass's own dependency, does. So an instance begins with InterlockedStorage::BEGUN, the
fetch-after-writes kind alone set: the first draw that reads input attachments ordered between
draws alone records the barrier too. No draw of another device reaches that kind, so nothing else
changes.
The lane test now counts one more barrier in each pass (4, 3, 1) and states what a first read of
0 leaves. API.md, the runtime's framebuffer_fetch and InterlockedStorage docs and
WorkCounts::fetch_draw_barriers say the load operations are among the writes a fetch records
after. To be verified on the RX 550.
On llvmpipe with both ordered forms withheld (job m3-max-14763) the lane's three draws of
exf_fetch_count, each reading its input attachment and writing the color, panicked in the draw
again check (render/draw_again.rs: "a draw again kept no draw"): the first draw, recorded
before any write, was kept, so the second, the same call, would have been drawn again with no
barrier after the first's write; in builds with debug assertions it took every step, recorded
the barrier and kept nothing. A draw whose input attachment reads are ordered between draws alone
and which writes a color of its pass meets its own writes (InterlockedStorage::meets_fetch), so it
is no longer plain: every draw of it takes every step and records after the barrier, as the
storage form's draws do (storage_colors). A draw that only reads, or only writes, is kept as
before: drawing it again needs no barrier, and a draw between that would need one keeps nothing
and forgets the kept draws.
On llvmpipe with both ordered forms withheld (job m3-max-14744) the draws in order read 0.25 at
every texel with three barriers, and the test then found no unordered-fetch-within-draw notice:
the runtime announces a stage's precision notes where its pipeline is made (degrade_stages), as
it does every such note, and the test had taken the notices after making the pipelines and
dropped them. The test now asserts the note once at the first fetching pipeline's making and none
after the draws; the runtime's framebuffer_fetch docs, API.md's catalogue entry and the test's
module docs said it was announced at the first draw that binds the pipeline, and now say so no
more.
engine_padded_blends' a_fetch_of_a_padded_attachment_reads_the_tile_value_of_its_codes expected
pfx_fetch's reads refused FramebufferFetch on the profiles with neither rasterization-order access
nor the pixel interlock (job m3-max-14695). They compile there as on a rasterization-order device,
color 0 an attachment of the raw format read as its input attachment, and only those note
UnorderedFetchWithinDraw; the test asserts both and still counts each kind of profile.
The core suite at 6bbdbdabc6 (job m3-max-14695, homelab-ms01-1) still expected the refusal on a
device with neither rasterization-order access nor the pixel interlock (vk12-floor,
lunarg-desktop-baseline-2023, roadmap-2022):
- engine_dead_fetch: a live read there reads color 0's input attachment, no storage form, and
notes UnorderedFetchWithinDraw (an ordered form notes nothing); the three forms partition the
profiles, so the refusal arm is gone.
- engine_fragment's framebuffer_fetch_reads_in_an_ordered_form_where_the_device_has_one: with
neither form each entry (fetch_ordered's raster order group included) compiles to one input
attachment a color with its FramebufferFetch fact, noted; the rasterization-order form notes
nothing.
- engine_function_constant_interface: the declared color input on vk12-floor compiles, its
FramebufferFetch fact and the note.
- the runtime's image_plan check: a color attachment is an input attachment exactly where
framebuffer_fetch::through_inputs holds (rasterization order, or between draws), as the image
plan decides.
On a device with neither rasterization-order color attachment access nor the pixel interlock, a
color input reads its input attachment ordered between draws by the runtime's barriers. A raster
order group on that input (fragment_fetch's fetch_ordered), or on a color output of an attachment
the function reads, asks for the order of that read, which is the read's own form there; it no
longer interlocks the function, so such a function is no longer refused RasterOrderGroups after the
fetch itself stopped being refused. Its overlapping fragments of one draw stay unordered,
PrecisionNote::UnorderedFetchWithinDraw, which the read records. A group on a buffer, texture or
imageblock member still needs the interlock. Devices with an ordered fetch form keep their path
(rog::declared is unchanged where fetch::fetch_unordered is false).
The conformance cases that fetch (fetch_ordered, srgb_fetch: one fullscreen triangle a draw, so
every byte still compares exactly) name unordered-fetch-within-draw among their notice allowances,
so a venue with neither form (RADV on the RX 550) replays them against the M3's recordings.
Tests: the compile test draws fetch_ordered on lavapipe's description without either ordered form
(input attachment, neither feature required, noted) and with the interlock (interlocked, as
before); engine_dead_reads' live dfr_output on vk12-floor now compiles without an interlock,
noted (before, refused RasterOrderGroups). Docs: API.md's fetch paragraph and catalogue entry,
rog.rs's module docs, the note's doc.
a_framebuffer_fetch_pipeline_is_ordered_exactly_where_the_device_orders_it asserted the refusal
naming both ordered forms on lavapipe's description with rasterization-order access and the pixel
interlock removed. That device now compiles the fetch as the input attachment without
rasterization-order access, neither feature required, its fragment stage recording
PrecisionNote::UnorderedFetchWithinDraw; the test asserts that, and that neither ordered form
(lavapipe's, the interlocked storage form) records the note.
Clippy's chunks_exact_to_as_chunks under --cfg m2v_cpu_icd (job m3-max-14696) refused the
constant-size chunks_exact the one-draw-over-itself check read the R32Float texels through.
docs/API.md's framebuffer-fetch paragraph says what a device with neither
ordered form does, and the degrade-notice catalogue gains
unordered-fetch-within-draw. docs/FAST-PATHS.md's device-gap table gains its
row. docs/REFUSALS.md regenerated (FramebufferFetch loses the
unsupported_features and family-row sites). api_signatures.tsv blessed: the
PrecisionNote and Degradation variants and WorkCounts::fetch_draw_barriers.
Verified: refusal_surface.py (0 without reach mark or basis), signatures.py
--bless (3 added).
A device with neither rasterization-order color attachment access nor the
fragment shader pixel interlock (Honeykrisp on Apple's M2 Pro, Mesa 25.3.6;
RADV on the RX 550) refused every fragment function that reads a color
attachment, Unsupported{FramebufferFetch, AnyOf[[ROAA],[interlock]]}. Metal
compiles those functions, so the device's own scope was narrower than the
refusal: Vulkan orders an earlier draw's color write before a later draw's
input attachment read of a subpass by a barrier of the subpass's dependency
on itself (core Vulkan, the Render Pass chapter's Common Render Pass Data
Races); only the overlapping fragments of one draw stay unordered.
Translator: on such a device a color input reads the input attachment, as on
lavapipe, without rasterization-order access, and the fragment stage records
the new PrecisionNote::UnorderedFetchWithinDraw (device gap). The device's
unsupported_features no longer lists FramebufferFetch. SEMANTICS_VERSION
2024 -> 2025.
Runtime: such a device fetches through input attachments
(framebuffer_fetch::through_inputs, inputs_between_draws); its subpasses and
pipelines take no rasterization-order flags; a draw that reads input
attachments after an earlier draw of its instance wrote a color, or writes a
color after one read them, records after the draws' subpass's whole
self-dependency barrier (InterlockedStorage's two new kinds,
render_target::DrawsBarrier), counted in the new
WorkCounts::fetch_draw_barriers. Devices with an ordered form keep their
paths: the new kinds are set only where inputs_between_draws holds.
Validation: the fetch lane's gate answers whether a device fetches in an
ordered form, and on one without checks the pipeline is made with the note;
framebuffer_fetch::between_draws is the device test of the new form on any
venue, ordered forms withheld.
Verified: cargo fmt only so far (builds and tests follow on potluck).
8bf3842923's cherry-pick on development: an exportable buffer takes a dedicated
allocation only where the device requires one (DEDICATED_ONLY or
requiresDedicatedAllocation), not where it prefers one, so on NVIDIA such
buffers lie in their handle type's shared block and textures over them lie in
place instead of as Shadow(Unchecked). A run of an unchanged artifact allocates
and places otherwise, so cached runtime results are stale. (The kept in-place
record moves with in_place::CHECK_VERSION 18, a separate key.)
Version only; cargo fmt.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
What: for each handle type the test makes two exportable buffers, of a 4K NV12 picture's bytes and
of the in-place check's (in_place_check::BUFFER_BYTES, now pub(crate)), asks the device's
dedication answers at each length, and gathers every failed hold (a dedicated allocation where the
device requires none, or the reverse; a texture over shared memory that is not in place or made a
shadow), so every buffer's allocation, placement and the check's notes print before it fails. The
texels' read still fails at once.
Why: on the RTX 3090 (NVIDIA 620.70.06, gem10, job m3-max-14662) the driver prefers no dedicated
allocation for an exportable buffer of the picture's 12,441,600 bytes either, so the test's
dedication hold could not fail there; it prefers one for the check's 40 MiB buffer, which is what
left the exported-fd class unchecked under the old rule. A buffer of that length makes the hold
bite where the driver's preference does.
Verified: the control (this tree with exported_memory.rs as of 789abcbd07) and the fix run on the
3090, the 780M and the 5080 in the jobs after this commit. cargo fmt --all.
What: the test's exportable buffer, and the buffer whose dedication it asks the device about, are
LENGTH bytes (3840 x 2160 x 3 / 2, the consumer's decoded frame) instead of 1 MiB; the texture
still lies over its first SIDE rows.
Why: the driver's preference follows the size. On the RTX 3090 (NVIDIA 620.70.06, gem10, job
m3-max-14627) the 1 MiB buffer was preferred no dedicated allocation, so at the pre-fix commit
789abcbd07 the test's own buffer lay in a shared block and only the in-place check's 40 MiB
buffer (dedicated, so the class unchecked and the texture Shadow(Unchecked { Reads, OnLines }))
failed it. The dedication assertion was vacuous there; at the consumer's size it is asked of the
buffer the consumer makes.
Verified: the control (this tree with exported_memory.rs as of 789abcbd07) and the fix run on the
3090 and the 5080 in the jobs after this commit. cargo fmt --all.
What: Dedication loses its derived Debug and prints through a Display impl that names each answer
(exportable, dedicated only, prefers dedicated, requires dedicated); the EXPORT-DEDICATION line
uses it.
Why: under --cfg m2v_cpu_icd (and m2v_gpu) the lib test build warned that `prefers` is never read
(dead_code ignores derived Debug impls; job m3-max-14523 on ms01), and warnings are errors in CI.
`prefers` is the answer the measurement is for (NVIDIA prefers a dedicated allocation where it
requires none), so it stays, read where it is printed.
Verified: the builds and clippy in the three configurations run in the jobs after this commit.
cargo fmt --all.
What: docs/HOWTO.md section 7 says how CUDA and another VkDevice import export_memory_fd's
descriptor: ExportedMemory's allocation_size as the import's size, the dedicated flag only where
`dedicated`, the buffer at `offset` for `length` bytes, and that a buffer outside a dedicated
allocation lies at an offset in a block other exportable buffers share, which the import reaches
whole.
Why: the previous commits keep an exportable buffer out of a dedicated allocation where the
driver only prefers one, so on NVIDIA its export now answers dedicated false, a non-zero offset and
the block's size where it answered dedicated true, offset 0 (or the aligned byte's lead) and the
buffer's own size. ExportedMemory and Buffer::export_memory_fd already carried those fields and
said so; the guide showed only the dma-buf import. No API change.
Verified: docs only. cargo fmt --all.
What: in_place::CHECK_VERSION goes from 17 to 18.
Why: the check's exported-fd class makes its buffer through exportable_buffer, as the product
does. Before the previous commit, on a driver that only prefers a dedicated allocation for an
exportable buffer (NVIDIA), that buffer was its own dedicated allocation, no image binds there
(VUID-vkBindImageMemory-memory-10926), and exported_pages answered Unmade::lasting: the class was
recorded unchecked for a cause that lasts for the driver's identity, in the record the shader
cache's directory keeps, named by the driver and CHECK_VERSION and not by RUNTIME_VERSION. A device
of the same driver reading that record runs no check of the class again, so every texture over an
exportable buffer would stay a ShadowCause::Unchecked shadow on a host that ran the old runtime
(the consumer's RTX 5080 Laptop, 615.71.09), whatever the fix. With the new version the old record
is never read (its name and the version it holds differ; tests::in_place's record tests hold
that), and the check measures the class over the buffer in its shared block.
Verified: the change is the constant alone; the record tests run with the runtime's touched tests
in the jobs after this commit. cargo fmt --all.
What: exportable_buffer's buffer is its own dedicated allocation where the device exports
such memory only so (DEDICATED_ONLY) or requires one (requiresDedicatedAllocation); a
driver's preference (prefersDedicatedAllocation) alone no longer makes one, so the buffer
lies in the block exportable buffers of its handle type share. Docs: exported_memory.rs
(module and Device::new_exportable_buffer), memory.rs (module, NoImage::Dedicated),
texture.rs, the runtime README and docs/HOWTO.md section 7 say the same.
Why: no image may be bound to a dedicated allocation (VUID-vkBindImageMemory-memory-10926)
and a texture over an exportable buffer is an image in its memory, so on NVIDIA (reims's
RTX 5080 Laptop, 615.71.09) every texture over the consumer's exportable caches was a
shadow, ShadowCause::Unchecked (2862 of 4112 IOSurface-plane shadows; 12.4 MB copied in per
plane use, 30 MB back per composite). The owner's rule: a texture over exported memory stays
in place even if slower; a shadow only where in place is impossible.
Verification pending (parked for the 780M regression): tests::export_dedication on the
3090 at c63787840b (the measurement and negative control) and at this commit; clippy and
the 5080 entry still to run. cargo fmt --all.
What: tests::export_dedication asks the device, apart from the runtime, what it answers of
exporting a buffer's memory of the runtime's usage (exportable, DEDICATED_ONLY,
prefersDedicatedAllocation, requiresDedicatedAllocation) and of a linear R8_UNORM image made
for the handle type, prints both (EXPORT-DEDICATION), then makes an exportable Shared buffer
of each handle type the device exports and a texture over it, and prints the allocation and
the texture's placement once the in-place check answered, with the check's notes. It holds
that the buffer is dedicated exactly where the device requires it, and that where its memory
is shared and the image needs no dedicated allocation the texture lies in place with no
shadow.
Why: reims's RTX 5080 (NVIDIA 615.71.09) makes every texture over an exportable buffer a
shadow (ShadowCause::Unchecked, 'the device's check made no image over the runtime's memory
exported as opaque file descriptors'): exported_memory.rs gives the buffer a dedicated
allocation where the driver only prefers one, and no image may be bound there
(VUID-vkBindImageMemory-memory-10926). This commit is the repro and measurement; the fix
follows. Runs on potluck after this commit. cargo fmt --all.
12a8a907bc..02a64274c5: on a device without VK_EXT_external_memory_host, a no-copy
buffer or guest RAM with a dma-buf source is imported as its dma-bufs instead of
refused; supportsResourceDetachBacking answers whether the device makes no-copy
buffers at all; Linux bit-24 memory is no longer refused for lack of an import
route. A run of an unchanged artifact can answer otherwise, so cached runtime
results are stale.
Version only; cargo fmt.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
On a device that imports no host pointer, an object over a guest RAM the device uses
(HostMemory::with_runs) with no dma-buf source of its own was refused by host_window before its
runs were routed to the RAM's chunk, so tests::host_ram_dma_buf::
without_pointer_imports_a_ram_s_chunks_are_its_dma_bufs failed on the Radeon 780M (RADV) and on
lavapipe (jobs m3-max-14705 and m3-max-14707): "HostMemory needs ExtExternalMemoryHost" at the
object, after the RAM was taken.
host_window no longer refuses; HostWindow::no_route is the refusal of pages with no route of their
own (not their pointer, no usable source, no copy), the same as before: naming
VK_EXT_external_memory_host on a device without it, not_importable elsewhere. A no-copy buffer,
heap or rebind with no runs is refused with it at once, as before; one with runs is refused with it
only where its pages lie in no chunk and an import of its own is needed. On a device that imports
pointers, by_pointer holds wherever the import alignment covers the range, so nothing changes
there; only where it does not (an alignment past the host page) may such an object now bind in a
chunk instead of being refused.
Docs: the no-copy buffer and heap refusals and HOWTO section 6 say a chunk-bound object needs no
source of its own.
tests::no_pointer_import makes the cfg's device with VK_EXT_external_memory_host withheld
(DeviceOptions::withheld_extensions), as a driver that lists none is, and checks, where the
physical device lists the dma-buf route (asked of the driver, not of the importer):
- a no-copy buffer over a sealed memfd mapped shared, 256 bytes into a page, whose memory has a
udmabuf source, is made over imports of its dma-bufs (HostBacking::ImportedAsDmaBuf,
WorkCounts::dma_buf_imports) with no pointer imported (host_pointer_imports_made) and the source
called once; the GPU reads the file's bytes, its fill lands in the file's pages (the bytes around
as they were), and it reads the CPU's later writes;
- a no-copy buffer and heap over memory with no source are refused, naming the extension, with no
copy made and no pointer imported (where no route is listed, so is the sourced buffer).
tests::host_ram_dma_buf::without_pointer_imports_a_ram_s_chunks_are_its_dma_bufs: on that device a
RAM with no source is refused, naming the extension; one with a source is taken, its chunk the
source's dma-buf (host_ram_dma_buf_imports), no pointer import tried
(host_ram_pointer_imports_failed), the object over it in the RAM (HostBacking::InHostRam), read and
filled by the GPU in the file's pages.
host_residency's udmabuf_openable and Ram::source become pub(super) for them.
At the base (the previous commit's parent) the sourced buffer and the sourced RAM are refused with
"HostMemory needs ExtExternalMemoryHost", so the first and third tests fail there; job ids in the
branch's report.
On a driver that lists no VK_EXT_external_memory_host but imports dma-bufs (Honeykrisp on Asahi, as
the consumer reported: a macOS guest's newBufferWithDescriptor answered nil, "HostMemory needs
ExtExternalMemoryHost", 704 times in one boot), every no-copy buffer, heap and guest RAM was
refused: Importer::new refused before the dma-buf route was looked at, and the importer held the
host-pointer extension's functions unconditionally.
The importer now holds the pointer import as an option (host_memory.rs's PointerImport: its
functions, page and minImportedHostPointerAlignment, and memory_types). Importer::new refuses only
where the device imports neither pointers nor dma-bufs (the pointer's refusal, naming the
extension, as before); a device with dma-bufs alone gets an importer whose pointer refusal stands
for every pointer (Importer::pointer_import). Every pointer-import site takes a PointerImport, so a
device without one never makes a host-allocation object: buffer_descriptor.rs (import_by_pointer,
import_pointer, import_pointer_again, import_backing), host_shared_pointers.rs (false there),
fresh_pages.rs and the page-buffer blocks (none there), the submission checks (unchecked there),
host_ram.rs's chunk import by pointer. The unit an import's pages round out to is
Importer::unit: the host page and the import alignment where the device imports pointers, the host
page alone where it imports dma-bufs. Every device that imports pointers keeps the same calls.
On a device that imports no pointer:
- a no-copy buffer, heap or rebind over memory with a source is bound in imports of its dma-bufs;
memory with none is refused, naming VK_EXT_external_memory_host (host_window), as it was;
- memory of Metal's private option bit 24 that the runtime copies anyway (no read-only view on
Linux) is no longer refused for lack of an import route, on any device;
- a guest RAM with a source is taken and listed (its chunks its dma-bufs, imported on demand), the
pointer never tried; one with no source is refused, naming the extension, as it was;
- supportsResourceDetachBacking answers whether the device makes no-copy buffers (it has an
importer), not whether it lists the extension.
Docs: the runtime README, HOWTO section 6 and the RAM copies' refusal, RUNTIME-PORTING, the
module docs of host_memory.rs, dma_buf.rs and host_ram.rs, HostBacking::ImportedAsDmaBuf, and the
refusal lists of the no-copy buffer, heap, RAM and RAM copy calls. docs/REFUSALS.md regenerated
(the HostMemory refusal's sites: PointerImport's and no_pointer_refusal).
Verified: the next commit's device tests (RADV on the Radeon 780M, lavapipe), which fail at the
base with the refusal; job ids in the branch's report.
Apple's compiler declares a by-value kernel argument it passes as a constant pointer as an
`air.buffer` with `air.read` and `air.address_space 1` (a one-byte `char`): a Core Image kernel of
macOS 13.7's frameworks (AIR 2.5) declares its parameter block so, and the ABI check refused the
library with RoleTypeMismatch (the buffer's declared space against its pointer's). Metal takes the
shape: on the M3 Max (macOS 27.0.1, job m3-max-14624) our own kernel over `constant Params *p`,
its node rewritten to `device` read (with and without the `char` description) and reassembled with
metal-as, made a compute pipeline and wrote the same 32 floats as the kernel as Metal's compiler
wrote it.
abi::check's role_type now also accepts an `air.buffer` declared read-only in `device` space on a
`constant` pointer (read_through_constant). The buffer keeps its declared space and access, so the
planner binds it as a read-only device buffer; the entry's loads are through its pointer. A
writable buffer, or a `constant` buffer on a `device` pointer, is still a mismatch.
Tests: the ABI unit test of both the accepted and the still-refused forms; an engine test that
compiles our kernel with either node on lavapipe, moltenvk-m3, the 780M's RADV and the Vulkan 1.2
floor and passes L3; and a runtime device test that runs both forms and compares them with the
M3 Max's 32 floats. SEMANTICS_VERSION 2025: a refused input now translates.
PR #15's a_flat_dispatch_switches_to_its_64_bit_count_at_the_workgroup_that_passes_2_32
timed out on lavapipe in round 6898863f3f (lvp 2/4, ms01, i9-13900H 20 threads,
job m3-max-14477): its command buffer passed the lane's 60 s WAIT beside the rest
of a parallel runtime lane. Each of the two such dispatches runs all 4.3 billion
threads, so a CPU device spends every thread on it: alone on lavapipe (llvmpipe,
LLVM 23.1.4) on a 16-thread Ryzen 7 7840HS they completed in 24.9 s and 23.7 s
(job m3-max-14623). A runner with fewer threads takes proportionally longer.
complete_within() takes the wait; edges_counted_once waits PAST_2_32_WAIT (600 s,
inside nextest's 20-minute terminate-after), and .config/nextest.toml runs both
tests alone (threads-required = num-test-threads), as the object-grid lane does.
A GPU completes them well inside a second; their assertions are unchanged.
Test only; the runtime-sources pin is unchanged. cargo fmt.
b39d22516f says heap-texture-refused, twin-decode-failed, late-reservation and
queue-limits-reached once per device and kind and counts each later one in
WorkCounts (the owner's rule, 11-11: a degradation, fallback or refusal is
logged once per kind, then counted). A run of an unchanged artifact now records
fewer messages, so cached runtime results are stale.
Version only; cargo fmt.
The landed packet changed a runtime-sources input, so the committed digest no
longer described the sources and `the_runtime_sources_are_the_committed_ones`
would fail. Recomputed over the same inputs and committed by land-pkt.sh.
The pixel format is PixelFormat::ETC2RGB8; and an assertion whose message
locked the sink's list again while its condition held the lock would wait
on itself where it failed: each reads the list once.
What: metal2vulkan-heap-texture-refused (Info, a placement heap's texture not
made at an offset inside it), metal2vulkan-twin-decode-failed (Error, a decoded
twin's failed CPU decode), metal2vulkan-late-reservation (Warning, an ignored
late reserve_resource_ids call) and metal2vulkan-queue-limits-reached (Info,
each placement or queue-sharing read the queue limits changed, at device
creation, per queue made and per report) were said at every occurrence. They
now go through the degradations' once-per-device record: Announced keeps a
bit per kind of a closed vocabulary of messages that are no degradation
(degradation::Told), and Device::tell says a kind's first message on the device
(through its sink, else stderr) and counts each later one, without making its
text, in the kind's new WorkCounts field: heap_texture_refused_withheld,
twin_decode_failed_withheld, late_reservation_withheld,
queue_limits_reached_withheld. Device::inform_once is the informational form.
Every refusal and answer is as before; only the messages' rate changes.
Why: the owner's rule (11-11): a degradation, fallback or refusal message is
logged once per kind and device, later occurrences counted, never logged per
call. reims's sweep at ef7af82fe4 found these four firing per occurrence.
Tests: tests::told_once (each kind said once and its later one counted on
one device, said again on another; a second late reservation counted, not
said); tests::heap_refused_notice (the second refusal on a device counted, not
named; another device names its own first); tests::queue_limits_device (the
first case met is sent, every later one counted; a second read of the sharing
counts one more). api_signatures.tsv takes the four fields; the docs of the
four messages (texture.rs, resource_ids.rs, DeviceOptions::queue_limits, the
runtime README, docs/API.md) say the rate.
Verified: see the branch's report.
runtime_lane::grouped_submissions expected grouped vkQueueSubmit calls wherever the
device's merge check held. The runtime holds batches in a group only where the check
held and the queue's failures are not relayed (command_buffer/group.rs `groups`: a
relayed batch takes a fence of its own, device/relay.rs). MoltenVK's queues are
relayed (DriverFact::QueueFailuresReportedByMessenger), so it never groups. On the
M3 Max lane, beside the lane's other tests, the merge check answered Holds (42.5 us
in one call of 4 against 87.9 us apart), and the checked run asserted a group that
the device cannot make: "0 grouped calls", 8 calls in all, "the driver merges: true".
Where the check answered Fails the same test took its plain branch and passed, so
the verdict alone decided pass or fail.
The tests now read the expectation from both facts (`groups`: `merges` and not
`commit_work::relays`); the printed line says whether the device groups. The tests
that assume the merge check (DeviceOptions::assume_submissions_merge) still assert
that the check held as assumed.
Verify: runtime_lane::grouped_submissions:: on lavapipe and PHOENIX (merges, no
relay: groups asserted) and on the M3 Max (relayed: the plain branch asserted).
What: checked_commits_during_submissions_are_taken_up_promptly settles the
device's submission checks (Device::settle_submit_checks) before its rounds,
records each round's submission-check calls (WorkCounts::submit_check_calls,
none expected), and prints the round of the most own time with its numbers.
Why: on the RTX 5080 beside the validation lane (b5080 entry
bugs-a-item4-queue-order-012550 at 60efb70925), 40 of 40 runs passed and the
old bound's quantity (the later kernel after the earlier one's end) passed
40 ms in 20 of them, the driver's vkQueueSubmit time reaching 292 ms; but one
run's own time reached 36.7 ms, near PROMPTLY's 40. A lane device has a fresh
shader cache, so its submission checks run as it is made, on its first VkQueue,
which the rounds' command queue shares under the lane's queue limits: they hold
that VkQueue's lock for their own calls (not counted in batch_submit_nanos), and
on NVIDIA their imports and releases hold back every other thread's submission
(submit_check.rs). The failing round of the round at 7d7085f9d0 was round 2,
early, as such an overlap would be. Waiting for the checks' answer leaves the
rounds the scheduler's thread alone.
Verified: see the branch's report (5080 through b5080, gem10).
What: checked_commits_during_submissions_are_taken_up_promptly times when the
scheduler's thread took each of the two command buffers committed while it
waited for the VkQueue by their submission handlers (which run on that thread
once it took the batch: after its vkQueueSubmit returned, or as it held it for
one call with later ones), noting the host time and WorkCounts::batch_submit_nanos
there. The thread's own time is that time after the VkQueue's release less the
driver's time in between, for both; the sleeps are read once the later one is
taken. The kernel starts, the later one's start after the earlier one's end,
and the submissions are printed, not bounded.
Why: the round at 7d7085f9d0 failed it on the RTX 5080 Laptop GPU beside the
validation lane (msi, m3-max-13901, partition 1/2): round 2's later command
buffer started its kernel 63.4 ms after the earlier one's kernel ended, over
PROMPTLY's 40 ms, while the batches' vkQueueSubmit calls spent 71.5 ms in the
driver from the earlier one's check until the round completed, and no sleep
ended at its limit. The later one's bound began at the earlier one's kernel
end and assumed the earlier one's vkQueueSubmit had returned by then; NVIDIA's
call can return long after the GPU ran the work (or the later call block before
it starts), so the driver's time was counted as the thread's. The handler's
time and the counter read there leave neither the GPU's nor the driver's time
in the bound, and a wait of the thread's own (a sleep to its limit after the
check) still counts.
Verified: see the branch's report (5080 through b5080, gem10).
tests::air_input::engine_fixtures_match_their_golden_printout compares every engine fixture with
its golden; the rounding fixture had none. Recorded by bless_engine_goldens on um790 (job
m3-max-14555) from the bitcode LLVM 21.1.8's llvm-as (Homebrew llvm@21) assembles from the
committed kernel_convert_rounding_modes.ll (sha256 bf1592327ce7...), fed to the test through
METAL2VULKAN_LLVM_AS by a scratch wrapper that answered only that file (one hit) and sent every
other fixture to the node's LLVM 23; only this fixture's file is kept.
corpus-metal qualified the case on the M3 Max (apple-m3-max-macos27.0.1, output 30dbaaab) and
corpus-moltenvk's candidate matched it (apple-m3-max-moltenvk), job m3-max-14441.
64 threads, an integer and a float word each, through the 13 suffixed forms the M3 Max compiles
and answers as the conversion their types name (the guest's two refused forms among them),
compared exactly. Installed by corpus-case-check (job m3-max-14432): case id 48fb69561824.
scripts/regen-air-fixtures/regen-air-fixtures.sh kernel_convert_rounding_modes on the M3 Max
(Apple metal 32023.922, macOS SDK 27.2, LLVM 21) in job m3-max-14415; TOOLCHAIN unchanged.
The exact emulation of the directed roundings, the integer .sat clamp, float-to-int pre-rounding,
the RoundingModeRTE plan and PrecisionNote::NativeConversionRounding are removed; they stay in
history at 540011dd49. The parser accepts the suffix and the lowering is the plain conversion:
Metal's compilers disagree on the suffixes, and the owner's 11-07 rule takes the cheapest answer
inside the envelope where real Macs disagree.
Measured per form, 64 threads of the fixture's edge values, one kernel per intrinsic (probes
m3-max-14380 Radeon Pro 5300M and m3-max-14381 UHD Graphics 630, macOS 26.7.1; m3-max-14382 M3
Max, macOS 27.0.1):
form M3 Max 5300M 630 now
float->int .rte nearest even truncates no pipeline truncates
float->half .rtz/.rtp/.rtn .rtz as named, nearest even as named nearest even
no pipeline rtp/rtn
float->int .sat unsigned keeps a 8-bit not no pipeline clamps
negative's wrap, long clamped, long
of inf is 0 clamped to int
int->float/half any mode .rte nearest even, nearest even nearest even nearest even
no pipeline directed
int->int .sat no pipeline wraps wraps wraps
float->int .rtp/.rtn no pipeline truncates no pipeline truncates
The last three rows are no difference: every Mac that creates the pipeline answers the plain
conversion. OpenCL on all three GPUs (not Metal) answers the exact IEEE roundings. The M3's
compiler service exits (XPC_ERROR_CONNECTION_INTERRUPTED) on the forms it does not compile.
- metal2vulkan-air: Convert::parse takes `.<rte|rtz|rtp|rtn>` and then `.sat` (to an integer
only), between numbers; the module doc carries the measurement. Test: every suffix parses to
its plain form.
- Engine test: 24 forms with every rounding (and .sat to an integer) compile on lavapipe and on
moltenvk-m3 without shaderInt64 to the plain conversion's module words and notes, and pass L3.
- Fixture: kernel_convert_rounding_apple_gpu now calls only the forms the M3 compiles and
answers plainly, for a case qualified there.
- docs/API.md accepted differences: the table above.
- SEMANTICS_VERSION 2024 (development is at 2023); ARTIFACT_FORMAT_VERSION back to 500, with no
codec change.
Verified: not yet run (dispatched next).
Apple's M3 Max (macOS 27.0.1) creates no pipeline for any of the fixture's four kernels: its
compiler service exits (XPC_ERROR_CONNECTION_INTERRUPTED) on every directed int-to-float and
int-to-half form, float to half by rtp and rtn, float to int by rtp and rtn, and every integer
.sat form, one kernel per intrinsic (probe m3-max-14296). A Radeon Pro 5300M under macOS 26.7.1
creates every one (m3-max-14293). So the four cases could never be qualified on the reference
Metal and are withdrawn; the kernels stay for the engine tests and translation.
kernel_convert_rounding_apple_gpu calls only the 22 forms the M3 compiles (the guest's two refused
forms among them), over integer and float inputs, for a case the M3 can qualify. The source
compiles without fast math (metal-fast-math: off), so NaN, infinity and signed-zero operands and
infinite half results are defined questions. Companions regenerated next.
clippy's approx_constant denies 3.14159 as an approximate PI.
Verified: job m3-max-14128 (homelab-um790-xtx-1) at 37e8650472: clippy failed on exactly these two
literals in all three configurations; the engine tests passed (6756 results of 106 conversions on
lavapipe and moltenvk-m3 without shaderInt64; RTE declared on 14 committed profiles, noted on 5),
and with Directed::of sabotaged to map rtz/rtp/rtn to nearest even the exactness test failed
(f.f32.s.i32.rtz of 0x1000003 gave 0x4b800002 for 0x4b800001).
Evidence that the path ran (llvm-as present, every conversion compiled and compared): the number
of results checked and of profiles that declared RoundingModeRTE or recorded the note.
Verified: the touched suites passed at e4bbaf5a37 (job m3-max-14108, homelab-um790-xtx-1):
metal2vulkan-air convert 3/3, metal2vulkan arith/rounding/engine 279/279, validation comparison
10/10.