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.
Device::host_pages_texture_placement, a runtime extension, answers where a texture over a
no-copy buffer of host pages imported by pointer or as dma-bufs would lie, before any buffer,
import or image is made; another backing is refused (Problem::HostPagesBacking). The buffer's
own placement query and the image-making path now ask the same image-free answers first and
make no image where those answers refuse every plan. The answers are unchanged, but the work
the runtime does to reach them changes, so this bumps the runtime's version.
Verified by the change's own runs on lavapipe (24747): both new tests pass over 8 shapes with
shader-read and unknown usage, by pointer, under the Shadow policy and as dma-bufs, each
pre-import answer equal to the buffer's, refusals included, with no image made by a pre-import
ask; texture_placement_device 2/2; runtime suite 2461/2462, the one failure the guest-RAM test
that fails without the change. clippy plain and --cfg m2v_gpu (24748, 24749), --cfg m2v_cpu_icd
(24722), rustdoc (24748). Not run on a real GPU.
What: Buffer::texture_placement, TexturePlacement::InPlace, InPlaceRefusal and route.rs say
what the query answers before it makes images and what host_pages_texture_placement answers
before the buffer; docs/API.md, docs/HOWTO.md and the runtime README name the new query. The
test compares both calls' results, refusals included (a plane past the buffer's length is
refused as PastBuffer by both, not answered PastLength), and asks rows of 8 bytes too.
Why: lavapipe m3-max-24732: every shape both queries decide answered alike (CheckFailed by
pointer, Unchecked over dma-bufs, InPlace elsewhere), but the past-length shape is a refusal
of both calls, which the test unwrapped.
Verified: pending the lavapipe run.
What: tests/host_pages_placement.rs reads ObjectChurn::vk_images_made_this_thread (the
WorkCounts field it named does not exist); api_signatures.tsv blessed for
Device::host_pages_texture_placement and Problem::HostPagesBacking; docs/REFUSALS.md
regenerated.
Why: the test did not compile (m3-max-24729); the public surface changed.
Verified: pending the lavapipe run.
What: a runtime extension, Device::host_pages_texture_placement(backing, descriptor, plane,
start, length), answers where a texture new_texture_with_iosurface_plane makes would lie over a
no-copy buffer of length bytes from host address start whose pages the device imports by
pointer or as dma-bufs, before any such buffer, import or image is made. It shares the making's
steps rather than copying them:
- make_texture_over's checks that read the buffer only for its length, options and detached
state are shape_over (OverFacts, Shape, ShapeKind), which both the making and the new query
call;
- the route is host_route over a HostLie (route_over_pages beside route_over_buffer, with
levels_or_past shared), and placement_over takes the buffer's texels or the pages (Bytes);
- the image in place is decided by in_place_unmade, the same image-free answer the buffer's
query now asks first; where only an image or the import decides, the answer is InPlace;
- kept_in, past_kept and owns_padding are the rules Texels used inline, now shared.
Another backing is refused (Invalid, Problem::HostPagesBacking), and a length the no-copy
buffer refuses as it does (Nil, BufferLength).
A test (tests/host_pages_placement.rs) asks a spread of shapes before and after the buffer, by
pointer, under the Shadow policy, and as dma-bufs where udmabuf opens: equal where the answer
is not InPlace, an image- or import-decided answer after where it is, and no VkImage made by
the pre-import query.
Why: reims's verdicts lane asks the placement of guest pages before it maps them.
Verified: pending the lavapipe run.
The shape checks that read a buffer only for its length, options and detached state become
shape_over, which make_texture_over calls; the route is placement_over over the buffer's texels
or pages not yet imported (Bytes), in texture/route.rs. Problem::HostPagesBacking refuses a
placement asked of pages for a backing other than an import by pointer or as a dma-buf. This is
the groundwork the next commit's Device::host_pages_texture_placement uses; that commit carries
the description, the test and its evidence.
What: Buffer::texture_placement's answer for an image in place now asks first what the device
answers without making an image (Device::in_place_unmade): rows that share bytes, and for
every plan the making would try, the checks its image steps run before vkCreateImage (the
linear tiling's features and the host-allocation format query and limits, then the
DRM_FORMAT_MOD_LINEAR checks; over dma-bufs, dma_buf_unmade). Where those refuse every plan,
the answer is that refusal and no image is made; else the query makes and releases its images
as before. The making's image steps call the same check functions (external_linear,
pitched_unmade, dma_buf_unmade, neither), split out of external_linear_image, pitched_image
and dma_buf_image_unbound, so the rules have one copy. The wider plans take how the texels lie
(HostLie, Texels::host_lie) in place of the texels, and unplaced dispatches by one memory
function (in_place_memory).
Why: the coming host_pages_texture_placement answers before any import and must make no image;
it shares this decision.
Verified: pending a build and the placement tests.
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 last merge pass now writes a merged execution's first draw as 0 vertices x 0 instances when
the total holds no whole chunk, in place of a chunk's 2^31 - 2 vertices x 0 instances. The vertex
variant reads the chunk from the scratch's header, not from the draw, so no other answer changes.
The trail GPU-form tests now also print their command buffer's GPU time. Changing the draw a
merged execution records changes runtime behaviour.
Verified by the change's own runs: on the RTX 2080 (24755) the 4-command trail test's command
buffer takes 0.526 ms against 0.707 ms before; the indexed 8162-command test is unchanged at
18.6 ms, so the zero-instance draw was not the RTX 3090's slow frame. 50 bind::replay tests and
clippy pass (24757).
The last merge pass wrote the first draw as a chunk's 2^31 - 2 vertices in no instance whenever
the total was below a chunk. It now writes no vertex in no instance there. The vertex variant
reads the chunk from the header, not from the draw, so nothing else reads the change.
Measured on the 2080 (NVIDIA 620.70.06, m3-max-24755): the 4-command trail test's command buffer
went from 0.707 to 0.526 ms of GPU time. The 8162-command indexed one stayed at 18.6 ms, so a
zero-instance chunk is not what costs that one. The interpreter's merge tests (50 bind::replay
tests) and clippy pass (m3-max-24757). The trail tests' expected lines now read the first draw as
0 vertices x 0.
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 device recovery now carries every kind of object the runtime's API makes that holds state on the
lost generation:
- An indirect command buffer keeps its records where they lie in the runtime's own pages. In
pooled memory they are lost, so every command is reset. The programs its commands run are made
again.
- A visible function table keeps its entries, in place or written again from a host copy.
- An argument encoder follows its device (ArgumentEncoder::device now returns the generation by
value).
The lost generation's live-buffers table now closes at its rest (LiveBuffers::close in
keep_nothing), so the lost VkDevice no longer lives on after a recovery. Both change runtime
behaviour.
Verified by the change's own runs: lavapipe 42/42 recovery, indirect-command-buffer and
released-program tests (24660, rebased tip 24743); with close made a no-op both new tests fail at
the live-VkDevice count (24669); the every-kind test fails on the product before the carry
(24481). GPU: 780M 42/42 (24687), Iris Xe 42/42 (24686), RTX 3090 41/42 (24685), the one failure
an existing one development shares (24704, the DmaBuf re-export test). function_tables and
argument_buffers lanes 28/28 on all three. clippy clean in every configuration (24661).
What: a device's recovery now carries the three kinds a program makes that it left the lost
generation's, so each is the same object on the new VkDevice, as Metal keeps its objects:
- An indirect command buffer (`indirect_command_buffer/carry.rs`). Its records' storage and its
slots past them are buffers of the runtime's own whose `contents` pointer no program holds,
carried as such (`Buffer::carry_runtime`): in the runtime's own pages, the same pages and the
records as they are; in pooled host-visible memory, new memory, the records lost with the
VkDevice (vkspec 5.2.3), written again as a new buffer's: its header, every command reset.
The program each command's state runs is the state's program there (made by the state's
carry, after it), or a released state's made again there, as are the programs it keeps for
GPU-written records (`released_programs.rs`); its kept chunk recordings go; the new
generation's keepers list it where the GPU may write it. Its records ID, address,
gpuResourceID, uniqueIdentifier and label are the line's and stay.
- A visible function table (`function_table/carry.rs`), after its pipeline state: its words
buffer carried the same way; where it went to new memory, the words written again from a
host copy the table now keeps of what the CPU wrote (`TableShared::writes`), so its entries
call what they called; listed among the new generation's tables. A table whose state stays
the lost generation's stays with it.
- An argument encoder: it holds no Vulkan object, so its device becomes a `LineDevice`, the
handle carried; `ArgumentEncoder::device` answers the generation handle by value (it answered
a borrow).
The registry keeps both buffer kinds weakly (`Carry::indirect_command_buffer`,
`Carry::function_table`), the recovery carries them after the pipeline states, and its notice
counts them (`", and N indirect command buffers, M of them whose records were lost (every
command reset)"`, `", and N visible function tables with their entries"`). The docs of what a
recovery carries and leaves say so: `RuntimeGap::MadeBeforeRecovery`,
`Degradation::DeviceRecovered`, docs/API.md, the runtime's README, `device/carry.rs`.
Why: after a 3090 recovery, `resetCommandsInBuffer:withRange:` on an indirect command buffer
made before it was refused (`MadeBeforeRecovery`) thousands of times and every later command
buffer of the pass failed, where Metal's buffer goes on. The whole class at once: every kind a
program can make, each with its carry status, was listed for the change (none other was left
uncarried that holds only what the program could make again; sparse heaps and textures and
pooled `Shared` buffers stay left, as documented).
Test: `device_recovery_every_kind::every_kind_of_object_made_before_a_recovery_serves_after_it`
makes one of each kind (a queue, a `Private` buffer, a heap and a placed buffer, a texture, an
event, a shared event, a fence, a sampler state, a depth/stencil state, a library and function,
a compute and a drawing state, an address pool, a rasterization rate map, a binary archive, a
dynamic library, an indirect command buffer of dispatches executed before and one of draws, an
argument encoder, a visible function table called before), recovers, uses each on the next
generation by command buffers that complete (the indirect buffers reset by a blit and encoded
again, the table called and set, the encoder writing), and ends with the lost VkDevice gone
while all live. Helpers made `pub(super)` in the pipelines and states recovery tests.
Verified, at the change on a0b85d89d4: the every-kind test passes on lavapipe (msi, nextest, one process a
test, with the 41 other recovery, indirect-command-buffer and released-program tests), on the
Radeon 780M (RADV) and the Iris Xe (ANV), 42 of 42 each, and the RTX 3090 (41 of 42: the exportable test's
DmaBuf re-export inode, which development fails the same way there). Its negative control, the
product's sources at bfcd63c5e2 and the test kept, fails at the notice's count of the indirect
command buffers (lavapipe). The validation lanes `function_tables` and `argument_buffers`
(the argument encoder's device): 28 of 28 on the 780M, the Iris Xe and the 3090. Clippy of
the runtime, validation and conformance (all targets and features, --cfg m2v_gpu and
m2v_gpu_hazards): no message. The API signatures check passes (`ArgumentEncoder::device`
blessed); docs/REFUSALS.md is unchanged.
What: at a lost generation's rest (`DeviceShared::keep_nothing`), its table of the live buffers
and the table's spare go (`LiveBuffers::close`), before its recycler closes, so their buffers
park there and go with it. The table's lifetime rule says so (`live_buffers.rs`: its module docs
and `Inner::current`, `Inner::spare`), and `keep_nothing` lists it among the device-level objects
of work.
Why: the table's upload buffer (and the spare), buffers of the runtime's own on the generation,
hold it "only while a listed buffer lives, which holds it too". A recovery breaks that rule: it
carries the listed buffers on, and they stop holding the lost generation, but no command buffer
runs there again to make the next change that would drop the table. So once any command buffer
had made the table (an indirect command buffer's execution, which resolves its records'
addresses through it), the lost `DeviceShared` kept two strong holds (the upload buffer's handle
and its pages') for the life of the process, its `VkDevice` and driver memory with it, after the
program let go of everything. Development had it before this change (a diagnostic on lavapipe:
"1 tables made", live VkDevices 2 before and after the program's release of everything; the
generation came to rest).
Test: `device_recovery_live_table::a_lost_generation_s_live_buffers_table_goes_at_its_rest`.
An indirect execution makes the table (`WorkCounts::live_tables_uploaded` rises: the path ran),
the buffer and its state go, the three buffers live past a marked loss (not a parked
generation); the live VkDevices fall to 1 while they live, and stay 1 once they go. Its helpers
(the indirect state, buffer, command and execution) serve the every-kind test next.
Verified, at the change on a0b85d89d4 (with the carry after it): on lavapipe (msi, nextest, one process a
test) this test and the 41 other recovery, indirect-command-buffer and released-program tests
pass; its negative control (`close` made a no-op) fails it at the live count with the buffers
alive (after the test's 60 s wait), and the every-kind test at its end. On the GPUs, one
process a test: the Radeon 780M (RADV) and the Iris Xe (ANV) pass it with the 41 others; the RTX 3090
passes it, and fails one other, the exportable test, as development does there (its DmaBuf
re-export's inode). Clippy of the runtime, validation and conformance (all targets and
features, --cfg m2v_gpu and m2v_gpu_hazards): no message.
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.
With METAL2VULKAN_LOG_PIPELINES on, a compute VkPipeline's making now logs a line as it starts,
before vkCreateComputePipelines: the kernel, its SPIR-V hash and words and its specialization.
With METAL2VULKAN_DUMP_PIPELINES set, its module is written then, not after. A making that never
returns (a driver compile that runs for tens of minutes) is the start line without its made
line, and its module is on disk, where before neither the line nor the module appeared until the
driver returned. Default-off diagnostics; no product path changes.
The made line no longer writes the module (the start did). The compute log test checks that the
start line, with the same module hash, comes before the made line.
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 kernel whose base module holds COUNTED_WORDS (65,536) SPIR-V words or more now runs its whole
grids, uniform dispatchThreads and dispatchThreadgroups, on its partial-threadgroups variant with
every thread live, where its ragged grids of the same form run on that variant. A large kernel
then needs one VkPipeline per threadgroup size for all three kinds of dispatch, and its creation
no longer makes the predicted plain region no dispatch would take. Where the variant is refused,
the dispatch takes the plain pipeline. Smaller kernels are unchanged. The answers are the same
(words equal the split's and Metal's), so this is not a speed-for-accuracy choice and takes no
switch; the measured GPU cost of the variant on uniform grids (0.997-1.020 of the plain form, XTX
24567) is stated at compute::partial_direct and in docs/API.md.
The binder lays a whole grid on a partial plan out as the same regions without the NONUNIFORM
flag, and a dispatchThreadgroups's regions with MultiRegion 1 (SEMANTICS). The runtime picks the
variant (ComputePipelineState::whole_on_partial) and counts it in
WorkCounts::whole_dispatches_on_partial_variants (RUNTIME). Two public translator accessors,
CompiledFunction::observes_threadgroup_partition and observes_partition_through_simdgroups_alone,
expose facts the compile already decides.
Verified by the change's own runs: lints green in every configuration (24640, 24641); translator
tests 5/5 (24667), whole Threads and Threadgroups grids on the partial plan equal to the split's
and Metal's words with one specialization per threadgroup size on 5 profiles; lavapipe 3/3
(24642), a large kernel making 1 VkPipeline over 2 whole dispatchThreads, 1 dispatchThreadgroups
and 1 ragged grid (counter 3) and a small kernel the 2 it made before (counter 0). The XTX run
(24690) is pending.
A kernel that observes its threadgroup partition runs its ragged dispatchThreads grids on its
partial-threadgroups variant, one VkPipeline of the call's threadgroup size (MultiRegion 1),
while its whole grids took the plain pipeline (MultiRegion 0): two driver compiles of the same
module. On a guest's run on an RX 7900 XTX the plain one, for a kernel of 2,415,531 words, was
26.9 s of a 39.8 s warm pass.
Now a kernel whose base module holds compile_memory::COUNTED_WORDS (65,536) SPIR-V words or more
runs every direct dispatch of a threadgroup size on that variant, every thread live, where its
ragged grids of the same form run there (it observes its partition, and for a one-row grid in
one-row threadgroups otherwise than through its simdgroups alone, whose such grids run flat).
Where the variant is refused it falls back to the plain pipeline as before. Smaller kernels keep
the plain pipeline. Both forms give the same answers, so there is no switch and no FAST-PATHS
row.
- Binder: on a partial-threadgroups plan, a whole Threads grid takes the same L-sized regions
per group-count chunk, unflagged (no NONUNIFORM), and a Threadgroups dispatch's regions have
MultiRegion 1, so one specialization of a threadgroup size runs all of them.
- Translator API: CompiledFunction::observes_threadgroup_partition and
observes_partition_through_simdgroups_alone state the two partition facts the compile already
decides, so the runtime can decide at creation which form a kernel's ragged grids take.
- Runtime: compute::partial_direct takes whole grids and dispatchThreadgroups of such a kernel
(ComputePipelineState::whole_on_partial). WorkCounts::whole_dispatches_on_partial_variants
counts each such dispatch. A creation's predicted region is not made for such a kernel's
predicted dispatch, which would run on the variant, not the base.
- GPU cost, measured once on the XTX (RADV) with the probe on steelbrain/uniform-partial-probe:
1,048,576 threads in 64, partial/plain 0.997 to 1.020 over four straight-line kernels, words
equal. Stated at partial_direct and in docs/API.md's dispatch-regions paragraph.
Tests: engine_partial_threadgroups's whole_grids_run_on_the_partial_plan_with_every_thread_live
(whole Threads and Threadgroups dispatches on the partial plan give the split's and Metal's
words, and every grid of a threadgroup size takes one specialization, on the CPU interpreter);
the runtime's a_large_kernel_s_whole_grids_run_on_its_partial_variant (a large kernel makes one
VkPipeline over whole grids of both forms and a ragged one, counting 3 whole dispatches, with the
plain pipeline's words; a small kernel makes the plain pipeline's and the variant's, counting 0).
heap_trimmed makes its two large makings at two threadgroup sizes, since its whole and ragged
grids now share one.
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 GPU form of a merged render execution (bind/replay/merged.rs) now computes its counts as two
u32 words, low first, with the corners as an OpUMulExtended product and the sums carried by hand;
the only u64 values it computes are addresses. On an RTX 3090 a guest's merged first draw came
out at 2^33 above its true total and hung the GPU. The runtime's merge kernels' SPIR-V changes,
and so do the counts a merged draw reads on such a device. That changes runtime behaviour.
Verified by the change's own runs: the_merge_passes_compute_no_u64_but_addresses fails with
merged.rs from before the fix and passes with it (24675); clippy and rustdoc clean (24675); 50
bind::replay tests pass on um790, the interpreter merge tests among them (24638). Not yet
verified on the device that hung: that is reims's RTX 3090 rerun.
A guest's render executions merged on an RTX 3090 (NVIDIA 620.70.06) drew their first merged
draw over 4 chunks of 2^31 - 2 vertices, seconds of vertex work, and the GPU hung (Xid 109).
The encoder trail's GPU-form readback showed both executions' totals at exactly 2^33 above the
sum of their commands' corners (321039 and 2184 corners, with second draws of 321047 and 2192
vertices), and a total no sum of whole triangles makes. The arguments, ranges, status words and
second draws were otherwise right. So the u64 count itself came out wrong in the passes, as the
u64 division did before on an RTX 5080 laptop GPU (615.71.09).
The passes now hold every count as its two u32 words, low first, as the prefix and the block
sums already lay out a u64. A command's corners are the OpUMulExtended product of its whole
vertices and its instances. A sum adds the low words and carries into the high ones. The last
pass takes the total's words directly to the u32 division it already ran. A u64 the passes
compute is an address alone. The layout is unchanged, so the vertex variant reads the prefix as
before.
Tests:
- the_merge_passes_compute_no_u64_but_addresses (replacing the division-only check): a u64 in
either pass is built only by OpIAdd, OpIMul, OpUConvert of a u32, a constant or a push
constant load, and used only to build another or as a pointer. Before the change it fails, on
the u64 compare, select, shift, conversion, load and store.
- The interpreter's merge tests (saturation and the VERTICES fault among them) hold the same
answers.
- The trail's GPU-form test gains an indexed case of the guest's shape: 8162 commands, the first
86 through a range read from a buffer, 90 blocks of 91. Its first merged draw must hold no
instance.
Verified:
- On the 2080 and the 3090 (620.70.06), the indexed case's synthetic shape ran right before the
change too (total 22446 corners, no block sum with a high word; the 3090 run skipped the draw).
Its scratch sat below 4 GiB of device address there, so neither device reproduced the guest's
high word, and the hanging device's proof is the guest rerun.
The trail's GPU-form test gains an indexed case of the compositor's shape: 8162 commands, the
first 86 of them run through a range a buffer holds, merged over 90 blocks; its first merged draw
must hold no instance.
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 usage shadow of a depth or stencil texture made over a surface's plane, or of a view of one,
now copies only the aspect the plane holds, one aspect per region as Vulkan copies
(VUID-VkBufferImageCopy-aspectMask-00212, which the validation layer reported). The other aspect,
which no copy writes, starts at zero, as the texture's own shadow does. The X32_Stencil8 view's
shadow also took its aspect from the view's format (stencil), so it copied the plane's depth bytes
into the stencil. It now takes the unit of the texture made over the plane
(Texture::surface_plane_unit). Which bytes a shadow holds changes runtime behaviour.
Verified by the change's own runs on lavapipe (24672): one usage shadow, the depths are the
plane's, the stencil reads 0, and the validation layer reports nothing. With usage_shadow.rs
reverted, every second texel's depth is wrong and the test fails. A test-only hook
(sampled_costs_forced) makes if_free answer "not free" to force the shadow. clippy --cfg m2v_gpu
passes (24673); runtime suite 2454/2455, the one failure an intermittent guest-RAM test that also
fails without the change (24657).
What: a usage shadow of a view of a depth or stencil texture over a surface's plane copies the
aspect the plane holds, the unit of the texture made over the plane
(`Texture::surface_plane_unit`), not the unit of the view's own format.
Why: an `X32_Stencil8` view of a `Depth32Float_Stencil8` texture over a plane took the
stencil as its unit, so its usage shadow copied the plane's depth bytes into the stencil
(lavapipe, m3-max-24657: the view's stencil reads were not 0). The plane holds the depth.
Verified: pending the lavapipe run of
tests::surface_depth_usage_shadow at this commit.
What: the depths the kernel read are `seen`, not `read`, which shadowed the
helper the stencil read then called.
Why: the test did not compile (E0618).
Verified: the jobs that follow.
What: texture/usage_shadow.rs's shadow of a texture's bytes copies only the
aspect a surface's plane holds (copy_plan::surface_depth_unit) for a depth or
stencil texture over a plane, and starts the image ZeroUnpatterned so its
other aspect reads 0, as the texture's own shadow does
(Device::storage_over_buffer). Every other usage shadow is as before.
Why: it copied DEPTH|STENCIL in one region from the bytes, against
VUID-VkBufferImageCopy-aspectMask-00212, and the plane holds no stencil.
Verified: tests::surface_depth_usage_shadow on lavapipe (job in the report).
What: tests::surface_depth_usage_shadow makes a Private Depth32Float_Stencil8
texture over a surface plane without ShaderRead, on a device where a test
hook (DeviceShared::sampled_costs_forced, read by Device::if_free) makes
SAMPLED cost every image that lacks it, so the texture's shadow lacks it and a
kernel's depth read binds a usage shadow of the bytes. It asserts one usage
shadow was made, the depths read are the plane's, the X32_Stencil8 view reads
0, and the validation layer reports nothing.
Why: that usage shadow copies both aspects from the bytes in one region,
which VUID-VkBufferImageCopy-aspectMask-00212 forbids (one aspect a region),
and the plane holds the depth alone.
Verified: fails without the next commit's fix on lavapipe (job in the
report).
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.
By default (ManagedCopyInPolicy::AtSubmission), a Managed buffer's didModifyRange range is now
copied by the GPU from the import or the runtime's own mirror into the device copy as the
submission runs. There is no CPU copy and no staging. The old commit-time snapshot stays as
ManagedCopyInPolicy::AtCommit, selected by DevicePolicy::exact_answers(): the Macs disagree (the
5300M doesn't read a write made after the commit, the UHD 630 does), so the default takes the
cheaper answer (owner rule 11-07), with its bound in FAST-PATHS. Staging that remains (uncovered
pages, copied imports, AtCommit) is host-cached system memory, never BAR, sized so the recycler
reuses it. That changes runtime behaviour.
Verified by the change's own runs (managed_copy_in_bench, 32 MiB commits): RTX 3090 eGPU commit
190 ms -> 0.04 ms, completion 194 -> 17.5 ms, 0.17 -> 1.9 GB/s (24627); RX 7900 XTX commit 6.0 ->
0.03 ms (24636); unified memory copies nothing (lavapipe, 24602). managed_copy_device 28/28 and
device_copies 8/8 on both GPUs in both settings; clippy and rustdoc green (24603, 24577, 24578).
What: docs/FAST-PATHS.md's managed_copy_in row gives the copy-in bench's
medians on the RTX 3090 (eGPU) and the RX 7900 XTX: the commit call and the
wall time to completion of 32 MiB commits under both values.
Why: a ledger row states the cost of its accurate form.
Verified: jobs 24627 (3090) and 24636 (XTX), two rounds each, both values.
What: the named-rounds tests' readable() and the lane test's step-4 answers
test ManagedCopyInPolicy by equality instead of matching its variants.
Why: the enum is non_exhaustive, so a match outside its crate needs a
wildcard; the tests did not compile (E0004).
Verified: the jobs that follow.
What: DevicePolicy gains managed_copy_in (ManagedCopyInPolicy, a runtime
choice no profile carries). Under the default, AtSubmission, a commit that
takes a did_modify_range's range has the GPU copy it from the host copy (the
import of the caller's pages, or the runtime's own host-cached memory) into the
device copy as the submission runs (Buffer::upload), with no CPU copy and no
staging. Pages no import maps are still staged by the CPU at the commit. Under
AtCommit, which exact_answers() selects, the commit copies the range on the
CPU as the host copy holds it then (the RV2145 snapshot, Buffer::upload_now,
now upload_at_commit). Staging buffers of both directions are now Shared in
the default CPU cache mode, host-cached system memory, never the device-local
(BAR) memory a write-combined buffer prefers without unified memory, and of
power-of-two lengths (64 KiB at least), so a like-sized later copy takes a
buffer the recycler parked rather than new memory.
The ledger gets its row (the bound: a CPU write after the commit, before the
GPU runs the command buffer, may be read), and managed.rs, managed_copy.rs,
API.md's accepted difference, the runtime README, FAST-PATHS' costs bullet and
the conformance crate's Policy::Exact say so. tests::fast_paths names the
choice and checks it keys no profile and that exact_answers() takes AtCommit.
The named-rounds race tests take the policy: by default each round reads, in
each byte, its own byte or one the CPU wrote to its buffer after its commit
(0xee, a later round's), never an earlier round's; under AtCommit only its
own; three AtCommit tests join the three default ones. The lane test's step 4
reads either oracle's answer by default and the 5300M's under AtCommit
(exact_answers_take_a_did_modify_range_at_the_commit).
Why: a compute benchmark's commits spent most of their time in this copy on a
discrete GPU (a CPU memcpy into write-combined staging in BAR across an eGPU
link, fresh 32 MiB chunks each time). The oracles differ on the bytes after
the commit (5300M A,B,B,A,B; UHD 630 A,B,B,B,B), so the cheaper answer is the
default and the snapshot stays behind the switch (AGENTS.md rule 1).
Verified: jobs in the report (lint both cfgs, the translator's fast_paths, the
runtime suite on lavapipe, managed_copy_device and the lane test on the RTX
3090 and the RX 7900 XTX, and the copy-in bench there before and after).
What: managed_copy_in_bench sets options.policy.exact_answers(), a method of
the policy value, in place of a call of it without one.
Why: the bench did not compile.
Verified: built in the following change's jobs.
What: tests::managed_copy_device gains managed_copy_in_bench (ignored, run in
release): did_modify_range of 256 KiB, 4 MiB and 32 MiB, written by the CPU
before each of 40 commits of a command buffer that reads the range's last
bytes, over the runtime's own Managed buffer and one over the caller's pages
through their import, on the default device and on one of
DevicePolicy::exact_answers(). It prints (MANAGED-COPY-IN) the median and
largest commit call, the median wall time to completion, the range over it in
GB/s, and the bytes copied in and the buffers parked, taken again and evicted.
And a_did_modify_range_on_unified_memory_copies_nothing: on a device with
unified memory both kinds of Managed buffer copy and stage nothing at a
did_modify_range, and the next command buffer reads the CPU's write.
Why: the copy-in at commit is most of a measured compute workload's gap on a
discrete GPU; the bench measures it before and after its change at the same
code, and the check holds the no-copy answer on unified memory.
Verified: built and run in the jobs of the following change (it has no
behaviour of its own).
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 where an unstored DontCare load stays the driver's DONT_CARE (no UnstoredClearNoSlower
under the Driver policy), the runtime's own attachment images (depth/stencil scratch, stand-ins,
backings, fetch scratches, colour twins) now start zeroed, so such a load never reads a released
texture's texels. Devices that clear those loads pay nothing. That changes runtime behaviour.
Verified by the change's own runs: on lavapipe the new test fails without the fix and passes with
it, runtime suite 2454/2454 (24582); Iris 25/25 (24584); clippy and rustdoc 24552 and 24553. The
class's other routes were read and none can be read by a program.
What: Device::new_planned_texture, which makes the runtime's own images (the
scratch image of separate depth and stencil textures, stand-ins, backings,
colour twins), starts an image with color or depth/stencil attachment usage
that a clear writes at zero (Start::ZeroUnpatterned) on a device whose
unstored DontCare loads stay the driver's DONT_CARE
(clear_reach::UnstoredLoads::DontCare: UnstoredDontCarePolicy::Driver on a
driver without DriverFact::UnstoredClearNoSlower). Elsewhere it starts as its
memory lies, as before. FAST-PATHS' unstored DontCare row and API.md say so.
Why: such a load reads what the image holds (a depth or stencil test, a
blend, a fetch). A Private runtime image started as its memory lay, and a
recycled one may hold a released texture's texels, of another process of a
consumer whose processes share the device. Devices that clear such loads read
nothing of it, so they pay no clear.
Verified: tests::unwritten_parts on lavapipe and Iris Xe (jobs in the
report).
What: tests::unwritten_parts gains a leg: a pass of a Private Depth32Float
texture and a Private Stencil8 one (which renders through a scratch image of
the combined format) clears the stencil to 0xA5 and stores it; its textures
and scratch are released, and a pass of two new textures takes the three
parked images, loads its stencil DontCare, stores nothing and draws where the
stencil is 0xA5. It must draw nothing.
Why: the scratch image (Device::new_planned_texture) starts as its memory
lies, and on a driver that leaves an unstored DontCare load to DONT_CARE
(lavapipe) the stencil test reads a recycled image's texels, which may be a
released texture's of another process.
Verified: fails without the fix on lavapipe (next commit's job).
Under the 16-bit float controls, a half division is now the device's 16-bit OpFDiv, its divisor
scaled into Vulkan's 16-bit range first (bound 2.5 half ulp), and a half sqrt is the 16-bit Sqrt.
That's the device's native form (owner rule 1); the NativeDivision and NativeTranscendentals notes
state the 16-bit bounds. An undefined f32 that is not an exact half now stays f32. The translated
SPIR-V changes; the golden tables are re-blessed on development.
Verified by the change's own runs: hnq on the Iris profile goes from 68 to 8 OpFConvert, spirv-val
passes (24518, 24528); clippy, half engine tests 85/85 and rustdoc green (24551).
On a device whose float functions are not Metal's, a half sqrt is the
device's instruction for Metal's function and records
NativeTranscendentals (function_notes), not DeviceArithmetic. The 16-bit
Sqrt's bound moves to that note's doc and its catalogue entry; the
division test asserts NativeDivision and NativeTranscendentals, as the
Iris Xe profile records (job 24519: [NativeTranscendentals,
NativeDivision, NativeNanEncoding]).
A use of an undefined f32 value that is no exact half (a float2 built by
inserting coordinates into an undefined vector) read the widening of its
16-bit twin: hnq's fragment shader had six OpFConvert of an OpUndef.
The f32 undefined value is kept for those uses instead; the twin is the
16-bit undefined value as before.
Test: engine_half_hold's division kernel builds a float vector on an
undefined one and asserts an f32 OpUndef stays and no undefined value is
widened (Iris Xe, RADV).
Rule 1: where the module computes half in 16 bits under the 16-bit float
controls (QuantizeForm::Controlled), the device's native form of a half
division and square root is its 16-bit OpFDiv and Sqrt, so those are the
only form there; elsewhere the float instruction rounded to half stays.
- divide::native: a half quotient under the controls narrows its operands
(exact, they are halves), scales a divisor past 2^14 by 2^-2 and a
denormal one by 2^10 into Vulkan's range for the 16-bit OpFDiv
([2^-14, 2^14], 2.5 half ulp), divides at 16 bits and widens. The
scaling is exact but where the quotient rounds to zero or overflows
anyway.
- math::float_fn: a half sqrt under the controls is the 16-bit Sqrt
between exact conversions (Vulkan: inherited from 1 / InverseSqrt).
- narrow::computes_in_16_bits counts 16-bit FDiv and Sqrt, so the entry
declares the controls (denormals kept, IEEE zeros, infinities, NaNs).
- ops: float_ty and f16_splat, shared with f16_binary.
- NativeDivision and DeviceArithmetic state the 16-bit bounds; docs/API.md,
docs/FAST-PATHS.md, the narrow and half_hold module docs follow.
- Test: engine_half_hold's half_division_and_sqrt_are_16_bit_under_the_
float_controls (Iris Xe and RADV: 16-bit FDiv x2 and Sqrt, none at 32,
no exact narrowing, the exact answers on the interpreter, L3, the notes;
lavapipe: the float forms, the same answers).
Verification: in the following potluck runs (FConvert count on hnq,
the half engine tests, spirv-val, clippy, the suite).
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 run of spaces inside a string literal, where a line once ended in `\`, printed the next line's
indentation into the text. Swept every .rs file's string literals (non-raw) once for a run of
four or more spaces between two non-space characters, and for literals whose line ends without a
continuation; the latter were all intended multi-line text (LLVM IR, SQL, data tables, usage).
Restored (each run became ` \` and the next line's indentation, 28 runs):
- product messages: render_state.rs (SampleDepthClamp's text), degradation.rs
(YCbCrFilterNotExact's text), two_planes.rs (a blit's why-not), device/create.rs (the dropped
instance layers' line);
- tests and suites: render_sibling_work.rs, shadow_standing_device.rs, image_standing.rs (2),
conformance texture_views.rs (2) and rate_map_sweeps.rs (3), validation plan_resources.rs and
parallel_encodes.rs (2);
- conformance times.rs: a wrapped line after an explicit `\n`, its two-space indent kept;
- engine_refused_families.rs: one space in an LLVM IR line's `ptr addrspace(1)`.
The degradation texts change in whitespace alone; docs/API.md's catalogue names the kinds, not
these texts, and still matches. Left as written: aligned columns and indentation after `\n`
(kernel_textures.rs, renders.rs, argument_buffers.rs, degradation_catalogue.rs, the
conformance stability, verdict and cost reports, the tab table of dma_buf_leak_probe.rs, usage
texts). 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.
A new buffer's first-move zeros are now one vkCmdFillBuffer on unified-memory devices too,
instead of copies from the device's zero buffer, one region per 4 MiB. Nothing structural needed
the copy there any more. That changes runtime behaviour.
Verified by the change's own runs, zeroing 17,899,520 bytes (GPU timestamps, median of 20): 780M
fill 0.532 ms against copies 0.748 ms; Iris fill 0.517 against 0.527 ms (24390). The first-use lane
passes on the Iris (24379) and 780M (24380), "its zeros 1 fills"; clippy 24359.
What: `FirstFill::zeros` set a new buffer's word-aligned zeros with one
`vkCmdFillBuffer` only on a device without unified memory; a device that
shares the host's memory copied the device's zeros instead. It now fills on
every device (copies stay for a range whose ends are not multiples of 4).
The first-use lane's `a_new_private_buffer_reads_zero_through_its_first_fill`
asserts exactly one fill (`WorkCounts::new_buffer_zero_fills`) on every
device; it asserted none on unified memory. The docs of `zeros`,
`first_move.rs`, `word_fill.rs` and `new_buffer_zero_fills` say so.
Why: the copy read the zeros as well as it wrote the range, which costs on
unified memory too. Measured on one blit zeroing 17,899,520 bytes, GPU time
by timestamps, median of 20 (a diagnostic branch, not committed):
- Radeon 780M (RADV, Mesa 26.2.6): fill 0.532 ms, copies 0.748 ms; the
command buffer's wall time 1.556 vs 1.900 ms.
- Iris Xe (ANV, Mesa 26.2.6): fill 0.517 ms, copies 0.527 ms; wall time
0.948 vs 1.070 ms.
The discrete numbers already in the doc (RX 7900 XTX) are unchanged.
Verified (at the same change on bfcd63c5e2): the first-use lane on the Iris
Xe and the 780M (11 passed each, "its zeros 1 fills" on both); clippy over
the workspace, all targets and features, green. Not FAST-PATHS material: no
accuracy is traded.