canon::static_values, which validation's case checker uses to resolve the
globals the ABI states (metadata integers and predicates), read every global
through Values::int, which takes no float. So the predicate of a float or
half function constant (267d3163a6's shape) never evaluated there, and the
checker recorded every such case as partial ('the predicate of entry
parameter 1 does not evaluate (unsupported: StaticInitializer)'), as lane
fcfloat found installing its fc_float_gate cases. A half or float global now
answers its truth as 1 or 0 by the rule specialize's interface uses
(Values::present: bits not all zero is on, Metal's answer from job
m3-max-75714), and anything else is still the integer it holds.
Test: static_values over the float and half predicate shapes answers 1.5 1,
0.0 0, -0.0 1, NaN 1 and unsupplied 0. Validation-facing only; the
translator's output is unchanged, so no SEMANTICS_VERSION bump.
Ten authored cases over engine/fc_float_gate, one constant set each: s = 1.5, 0.0, -0.0
(0x80000000), a quiet NaN (0x7fc00000), and s unsupplied, for each of its two entries.
They were installed with corpus-case-check and qualified on Metal on the Apple M3 Max (jobs
m3-max-75712, m3-max-75714 and m3-max-75716, three executions each).
| s | fcf_gated_argument (out) | fcf_gated_sample_mask (target) |
|---|---|---|
| 1.5 | 1.25, 2.5, 3.75, 5.0 | the 0xAB fill: the mask is an output |
| 0.0 | -7.0 | the colour: the mask is not |
| -0.0 | -7.0 | the 0xAB fill: the mask is an output |
| NaN | 1.25, 2.5, 3.75, 5.0 | the 0xAB fill: the mask is an output |
| unsupplied | -7.0 | the colour: the mask is not |
So Metal keeps what the constant gates where the supplied value's bits are non-zero, -0.0 and a
NaN included, and drops it at +0.0 and where the constant is unsupplied. The kernel reads the
argument where C reads the float as true, a NaN included, and Metal binds it there.
Buffer 1 is bound in every kernel variant: the slot is declared and not required, so the cases do
not encode a presence rule. The three sample-mask variants whose answer is the target's fill
declare no_effect (outside the identity), which Metal qualification requires of an answer equal
to the initial bytes. The checker records every case as partial: its AIR layer evaluates no float
predicate (canon::static_values reads integer globals), so the argument is optional and the
output not required, which binds every variant alike.
fc_float_gate is MSL of ours compiled by scripts/regen-air-fixtures (Metal 32023.922, SDK 27.2,
precise maths). Its AIR has the shape commit 267d3163a6 reads: the internal float global
@__metal_implicit_fc_pred_0, written by the static initializer from
air.normalize_function_constant_predicate.f32 of the constant `s`, which is declared as
`float (float)`, and one predicate metadata node naming it for two uses:
- fcf_gated_argument: buffer(1) gated by `s`. The body reads gated[i] exactly where `s` is
defined and true as C reads a float (`is_function_constant_defined(s) && s`, so a NaN is true
and -0.0 false) and writes -7.0 elsewhere, so an argument dropped where the body reads it shows
as a wrong value. The definedness guard keeps the unsupplied variant a defined question: a
plain `if (s)` leaves a value use of an omitted constant, which Metal leaves undefined and the
case checker refuses.
- fcf_gated_sample_mask: the [[sample_mask]] member of a fragment's output struct gated by the
same `s`. The function writes colour and a mask of 0 whatever `s` is, so the render target
shows the presence itself (uncovered where the mask is an output, the colour where it is not),
including for the values where the kernel's body reads nothing. Neither executor records
pipeline reflection, so a kernel argument's presence alone is not observable; an output's is.
Precise maths (`// metal-fast-math: off`) so that a NaN compared with 0 is defined, not poison.
No `.air` beside the text: engine/ commits one only where a test reads Apple bitcode, and the
Metal oracle assembles the `.air.ll`.
The engine inventory gets the fixture's four rows, written as `ok` on every profile: a kernel
with no constants writes the sentinel, and a fragment whose mask is absent writes its colour.
The golden hashes and tests/air_input are left to the bless on development.
Metal's answer, from lane fcfloat's authored case (our MSL fixture
fc_float_gate: a fragment output's [[sample_mask]] gated by a float
function constant, so whether the output is present shows in the target;
Apple M3 Max, job m3-max-75714, three runs each):
s = 1.5 present, +0.0 absent, -0.0 (0x80000000) PRESENT,
quiet NaN (0x7fc00000) present, unsupplied absent.
So Metal keeps what a float predicate gates wherever the supplied value's
bits are not all zero. 267d3163a6's fold compared values (v != 0.0) and so
dropped -0.0's argument; 8f84a9c4fd then made float_nonzero compare values
too. Both now compare bits: normalize_predicate_float gives 1.0 for any
float constant with a bit set (-0.0 and NaN included) and 0.0 for +0.0,
null or undefined; float_nonzero is true for any bit set. A body that reads
the constant itself (if (s)) still reads -0.0 as false: Metal's kernel
variant wrote its sentinel there, and the body's compare is not this path.
SEMANTICS_VERSION 2307: the outcome for a -0.0 float or half predicate
moved again under 2306 (never published).
Tests: the specialization tests' -0.0 rows (float and half, normalized and
unnormalized) now expect the argument kept.
a_specialization_computes_the_entry_dominator_tree_once read a process-wide
counter of dominator trees, so under cargo test, which runs a crate's tests
as threads of one process, another test's trees landed in its count. The
contributor of 267d3163a6 reported it failing in parallel and passing alone.
It was failing before that change: cargo test -p metal2vulkan-air --lib at
fc9c99916d failed it in 2 of 3 runs (4 and 6 trees for one body; job
m3-max-75710 on a CPU-only Linux host), while nextest, a process a test,
never shares the counter. The counter is now thread-local: the crate builds
every tree on its caller's thread (it spawns none), so a test counts its own
trees only. Test-only code; the product build has no counter.
267d3163a6 changed the translator's output under an unchanged key: a
function whose argument is gated by a float (or half) function constant
was refused (Abi(BadValue) at air.function_constant, then
StaticInitializer) and now translates, keeping or dropping the argument by
the constant's value. 8f84a9c4fd moved the outcome again for a double
predicate global (now refused at the ABI check) and for a float predicate
global holding -0.0 (now absent). A consumer's cache keyed on 2305 would
keep the old refusals. The golden table's recorded version is re-blessed on
development.
267d3163a6 parses and folds air.normalize_function_constant_predicate.f16 but
no test reached it. The shading language compiler writes that form for a
half constant named by an argument's function_constant attribute (main
compiled 'constant half s [[function_constant(0)]]' gating a buffer argument
with xcrun metal on the M3: @__metal_implicit_fc_pred_0 is a half global,
stored from the .f16 call), so the specialization test's shape now takes
half or float, and a half test runs it with 1.5, 0.0, -0.0, NaN and
unsupplied, normalized and unnormalized.
Test-only.
Two follow-ups to 267d3163a6 (a float function constant gates an argument):
- The ABI check took a double predicate global too, but
air.normalize_function_constant_predicate parses only .f16 and .f32 and
the fold normalizes only half and float. A double predicate is now
refused at the check (AbiError::BadValue at air.function_constant), as
any other unhandled type is: unknown stays unknown.
- float_nonzero compared the global's bits with 0, so a predicate global
holding -0.0 kept its argument, where the fold compares values and gives
-0.0 the zero predicate. It now compares by value for the global's type
(the sign bit masked: -0.0 is zero, a NaN is not), and a float predicate
of any other type is not evaluable (a typed refusal) instead of absent.
Values carries the type table for it.
Tests: the ABI test refuses a double predicate; the specialization test
runs the normalized shape and a shape that stores the constant unnormalized,
each with 1.5, 0.0, -0.0, NaN and unsupplied. Without the fixes the double
case and the unnormalized -0.0 case fail.
cargo fmt over 267d3163a6's four files (check.rs, fold.rs, interface.rs,
stage.rs): lines past the width limit wrapped. No change in behaviour.
Verified: cargo fmt --all --check is clean after it.
The tests of upload, import, spill, sites, gpu_span and resolve that read a Managed buffer's form
(Device::has_unified_memory, or a Managed buffer they make) ran each device in its own form only,
so lavapipe and the integrated cards never took their two-copy arm. Each now runs through
tests::command::on_device::each_device_in_both_forms, which runs a one-copy device once more
through the two-copy view:
- upload: every_device_counts_and_times_its_own_command_buffers
- import: every_device_releases_an_import_under_a_managed_buffer_dropped_before_any_commit
- spill: every_device_spills_private_memory_out_of_device_memory
- gpu_span: every_device_leaves_a_copy_in_out_of_the_gpu_span_it_goes_ahead_of
- resolve: every_device_resolves_a_loaded_pass_into_a_shader_read_texture_over_a_buffer
- sites: every_device_counts_each_allocation_site_apart, through the new
each_device_in_both_forms_with, which opens both runs with the test's own options
(MakerTest::Fail here); each_device_in_both_forms is it with the default options.
docs/VALIDATION.md names the six modules among those that run both forms. Test-only: no product
source changes. Verification (lavapipe two-copy runs counted per test, lint) is in the landing
line.
No device in CI kept a device copy of a Managed buffer: lavapipe is a CPU device, so
Core::unified_memory() (rule 2's unified-memory form, decided by Vulkan's device type alone) is
true there, and every device test of the two-copy form returned at its unified-memory check or
took the one-copy arm. every_device_synchronizes_a_texture_over_a_managed_buffer passed vacuously
on lavapipe while the runtime recorded nothing for that synchronize on discrete cards (fixed in
d0f117f2a8). The integrated lab cards take the same one-copy arm.
DeviceOptions gains a test-only field beside `memory`, under the same
cfg(all(test, any(m2v_gpu, m2v_cpu_icd))): `two_copies`. Device::open reads it, under that gate
alone, where it decides `unified_memory`: where true the device keeps a device copy of every
Managed buffer whatever its device type, and Device::has_unified_memory answers false, as on a
discrete GPU; its Vulkan device, memory types and every other answer are its own. No product
build carries the field or its read, and tests/one_path.rs is untouched.
tests::command::on_device::each_device_in_both_forms runs `body` on each device in its own form
and, where the device keeps one copy, once more through the view (the run's name ends in
", two copies"). The tests a Managed buffer's form decides take it: those of tests::managed that
make a Managed buffer (not the two Managed-texture tests, nor the Shared variant of the
two-queue read), the three of tests::copy_over that read the form, two of tests::blit
(buffer-to-buffer, synchronize of a Managed buffer) and tests::over's texture held in place. So
the plain m2v_cpu_icd and m2v_gpu suites run the two-copy form on lavapipe and on the integrated
cards; a discrete card runs as before. docs/VALIDATION.md says so.
Verification: the jobs on lavapipe (the synchronize test failing with blit.rs and texture.rs at
e9f09c9a92 and passing here, and the device suite), the RTX 5080 and the Radeon 780M follow in the
lane's report.
Apple's OpenGL front end gates a vertex function's point_size output on a
function constant of type float (MTL_global_pointsize). The static
initializer stores air.normalize_function_constant_predicate.f32 of it into
a float predicate global, which the ABI check and the specializer refused:
every pipeline of such a vertex function was refused, first as
Abi(BadValue) at air.function_constant, then as StaticInitializer.
- air.normalize_function_constant_predicate parses .f16 and .f32 and folds
to 1.0 where its operand is a known non-zero and to 0.0 where it is zero
or undefined, as the integer forms do.
- A predicate global may be of floating-point type; its argument is present
where the global holds a non-zero float (an unsupplied constant's is 0).
Tests: the float predicate's ABI check, the intrinsic's signature, and a
specialization that keeps and drops the gated parameter by the constant's
value (non-zero, zero, unsupplied).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HL11F898zP6tAUb9Phkfsv
every_device_synchronizes_a_texture_over_a_managed_buffer now writes the texture with a blit
(the synchronize in the same encoder) or with a kernel (the synchronize in the next command
buffer, as a program that writes and then reads back does), and synchronizes the texture or its
buffer, in place and in an image of its own. The buffer's synchronize takes the image's owed copy
back ahead of its copy to the host; the texture's copies its own bytes alone, the host's
unannounced bytes past the texture written after the kernel staying as written.
The kernel is an owned synthetic AIR text (a texture write of a constant). No guest bytes.
Verification: the discrete-card runs (one per vendor) with and without the fix follow; the
device suite takes the two-copy arm only on a discrete card.
On a device that keeps a device copy of each Managed buffer (a discrete card: rule 2's unified
memory form, decided by Vulkan's device type), a texture over a Managed buffer
(Buffer::new_texture) lies on the device copy, in place or in an image of its own that goes back to
it. Metal's texture over a buffer shares the buffer's storage, so a program that writes such a
texture with a kernel and then calls synchronizeResource: of the texture reads the texels in the
buffer's contents once the command buffer completes. The runtime recorded nothing for that call:
BlitCommandEncoder::read_back_texture (blit.rs) returned at Texture::named_bytes() (texture.rs),
which answers only a texture made by Device::new_managed_texture (Form::Managed), never a texture
over a buffer (Form::InPlace or Form::Copied). The consumer's bytes kept what the host had left
there, and the program read them.
Now read_back_texture first asks Texture::over_device_copy (new, crate-private): for a texture over
a buffer whose buffer keeps a device copy, the buffer and the bytes its texels lie in (from the
texture's offset through the last texel of its last row, within the buffer). The synchronize is
then the buffer's own, over that range: read_back is read_back_range over the whole buffer, and
read_back_range takes the copies back owed by textures in images of their own first
(managed_reach, managed_backs), then records one vkCmdCopyBuffer of the range of the device copy
into the consumer's bytes between the buffer synchronize's two barriers, marking the range written
for the host's coherence. This is the copy Metal itself makes at the program's synchronize; no new
query and no new form: the two-copy arm only, and a device with unified memory records nothing, as
before (its texture lies in the bytes the host reads).
Found by a recording of a guest compute benchmark whose Gaussian blur failed validation on the RX
7900 XTX and the RTX 3090 and passed on the Iris Xe: whole plays at 1db5cfb2b0 on the XTX (jobs
m3-max-75524 and m3-max-75526, R and R2 dumps equal) left the last stage's RGBA8 output, a texture
over a Managed no-copy buffer, all zero after the program's synchronizeResource: of it (job
m3-max-75541, a probe player that dumps a synchronized texture), with the five earlier stages
plausible.
Test: every_device_synchronizes_a_texture_over_a_managed_buffer (copy_over.rs, the commit before),
which runs on devices that keep a device copy; a device with unified memory prints its skip. The
runtime README's synchronize_resource line says what it records for such a texture.
every_device_synchronizes_a_texture_over_a_managed_buffer: on a device that keeps a device copy
of each Managed buffer, a texture over such a buffer (RGBA8Unorm, shader read and write), in place
at the device's own pitch and in an image of its own one alignment past it, is written by a blit
and synchronized in the same blit encoder (synchronizeResource: of the texture, not the buffer).
The consumer's bytes must then hold the texels at the texture's rows, and the host's unannounced
bytes past the texture's last texel must stay as the host wrote them. A device with unified memory
keeps no device copy and prints that it skips.
This fails at this commit on a discrete card: synchronize_resource of a texture over a buffer
records nothing (read_back_texture returns at texture.named_bytes(), which only a texture made by
Device::new_managed_texture has), so the consumer's bytes keep what the host left. The fix follows.
Under the refused device's memory view (each_device_under_the_view), the coherence tests asserted
flush bytes only for the zero source, a Shared fill, replace_region and get_bytes. Shared's
host-coherence form is a device-shaped path whose only evidence on our cards is a counter, so
eight more sites now assert the deltas of shared_flushes, shared_flushed_bytes,
shared_invalidates and shared_invalidated_bytes, each range widened to the device's atom inside
its allocation, shared_coherence_failures at 0, and the bytes read after the calls:
- a texture over a Shared buffer and a view of it, in place and in an image of its own, read by
a blit after a host write: the submission flushes the texture's buffer and the destination;
the completion settles the destination, and the texture's buffer where it is copied;
- a Shared buffer ab_address reaches only by an address the host wrote, declared with
use_resource (a read, then a read and a write): flushed with the bound buffers, settled where
the declaration writes;
- a Shared heap's block whose buffer ab_address reaches by address, named by use_heap: flushed
and settled whole;
- a blit's Shared source: flushed before the submission, nothing settled;
- a visible function table's words the host rewrote before the commit: flushed with the bound
buffer, not settled;
- a shared event's GPU-raised value, seen through signaledValue and through a wait while its
command buffer is still in flight: what that command buffer may write is flushed and
invalidated before the value shows, and the host reads the fill's bytes;
- the glyph and tile upload route (copyFromBuffer:toTexture:): a sub-range of a 4 KiB Shared
source at offset 64 of a pool block, rows 100 bytes apart, into an R8 texture over a Shared
buffer that is also a render attachment; the flush before the submission counts the source's
bytes and the texture's buffer, the completion settles the texture's buffer, which holds the
source's rows; a source in host memory's import takes no call;
- a range a submission only writes: a new Shared buffer the host zeroed, written by the GPU alone
in the first submission that reaches it, as a blit's destination and as an attachment's buffer:
the flush before that submission counts its bytes, and the host reads the GPU's bytes.
Test-only: no product code changes.
Verified at this tree (run as the scratch commit 4f4c4cd6cf, the same tree):
- the RTX 5080 Laptop GPU (NVIDIA 615.71.09), --cfg m2v_gpu, build job m3-max-75352, run job
m3-max-75357: the 10 coherence tests pass. Deltas [flushes, flushed bytes, invalidates,
invalidated bytes, failures], atom 64: texture in place and its view [2, 3072, 1, 1024, 0], in
an image of its own and its view [2, 5120, 1, 2560, 0]; use_resource read [2, 832, 1, 256, 0],
read and write [2, 1088, 1, 512, 0]; use_heap [2, 131648, 1, 65792, 0] (the 64 KiB block
whole); blit source into Private [1, 1024, 0, 0, 0], back into Shared [2, 2048, 1, 1024, 0];
function table [2, 192, 1, 64, 0]; shared event, to the value seen, both ways
[2, 128, 1, 64, 0]; upload from the Shared source [2, 12288, 1, 4096, 0] (8192 bytes before
the submission: source 4096, texture's buffer 4096), from the import [2, 8192, 1, 4096, 0];
a range only written, the blit's destination and the attachment's buffer, each
[2, 2048, 1, 1024, 0] (1024 bytes before the submission). On this card both render-target
textures over a Shared buffer are an image of its own; the in-place attachment did not run.
- lavapipe (Mesa 26.2.4), --cfg m2v_cpu_icd, job m3-max-75355: the 10 pass; the view is refused
there (its one memory type also holds the parameter ring), so the new bodies do not run on it.
- fmt --check, and clippy -D warnings of metal2vulkan-runtime plain, under m2v_gpu and under
m2v_cpu_icd: job m3-max-75358.
The rule's proof is the GPU-free unit test over Meteor Lake's i915 types
(a_dma_buf_is_refused_where_the_shared_type_is_not_host_coherent): offered
0b11, listed 0b11, coherent 0b01, Shared in type 1 without coherence. The rule
without the state answers Ok(0), which is what the base rule answered: at
c241bf280b, crates/metal2vulkan-runtime/src/import.rs:419-422 (dma_buf_type),
first = 0b11.trailing_zeros() = 0 and (0b11 & 0b01) & 1 != 0, so Some(0). Keyed
by the state it refuses with Limit::ImportCoherence, for one dma-buf and for
several.
The device test under the forced view cannot fail on the base by an accepted
import on any lab card: on the Radeon 780M (RADV) the type the fd's query
offers first is its cached type, which the view reads as not coherent, and on
the Iris Xe and the RTX 3090 it is not host-visible, so the base rule refused
there too, with Limit::ImportType. Its doc comment now says what it shows: the
refusal's kind and its path through both calls, nothing imported.
README and the refusal's doc: the rule is verified by its unit test; on a
device of that shape the refusal is expected, and no device of ours has that
shape. Verified: cargo fmt, refusal_surface.py (no change), signatures.py
--check; the build and the device run in the lane's next jobs.
The view test asserted that host memory is imported under the refused device's
view; on the Radeon 780M (RADV, Mesa 26.2.6, job m3-max-75341) the pointer's
query offers type 5 alone, the cached type the view reads as not coherent, so
the host-memory rule refuses it with Limit::ImportType, as it did before this
lane. The test now asserts that the pointer import answers its own rule, which
the coherence state does not key (taken into a host-coherent type, or
ImportType where host_type takes nothing it offers), and prints the dma-buf
evidence before that step. The dma-buf refusals passed in that job (the panic
came after them). Verified: the next device job of this lane.
The step timing in tests/import_time.rs called dma_buf_type with its old
arguments, and the view test formatted vk::MemoryPropertyFlags with Debug,
which this ash build does not derive; the runtime's lib test under
--cfg m2v_gpu did not compile at f6aa8dbdf1 (job m3-max-75336). Verified: the
next build job of this lane.
What: the dma-buf rule (import.rs, dma_buf_type) now takes the device's Shared
coherence, keyed by the query that already decides it (the Shared type's
HOST_COHERENT flag; the device holds a coherence state exactly where it lacks
it). On a device that holds one, every dma-buf is refused with the new
Limit::ImportCoherence { handle }, whatever the fd's query offers, before any
allocation: Device::import_dma_buf and Device::import_dma_bufs (each fd's rule;
the sparse buffer is destroyed, as for Limit::ImportType). Basis: device. The
pointer import (import_host_memory) is unchanged, so the consumer's fallback
imports those pages by pointer. No new route: the refusal sits inside the
existing rule.
Why: on a Meteor Lake GPU under Mesa's Intel driver and the i915 kernel driver
(no LLC), the fd's query offers type 0 (device-local, host-visible,
host-coherent, write-combined) first, so the rule took the import, and the
runtime never flushes an import because its type is host-coherent. That flag
speaks only for mappings Vulkan makes; the consumer writes the pages through
its own cached mapping. In Linux v7.3, i915_gem_prime_import
(drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:281-337) makes the object with
i915_gem_object_alloc (kmem_cache_zalloc, gem/i915_gem_object.c) and never calls
i915_gem_object_set_cache_coherency, so pat_index 0 and cache_coherent 0; the
only CPU-cache work is one wbinvd_on_all_cpus at get_pages where !HAS_LLC &&
!IS_DG1 (i915_gem_dmabuf.c:249-261, whose comment says only DG1 "still snoops
transactions even with CACHE_NONE"); on MTL PAT 0 is WB with no coherency. So
the GPU reads DRAM without the guest's lines still in the CPU cache: text and
images missing. The pointer import (userptr, I915_CACHE_LLC, PAT 3) snoops.
No Vulkan query says whether a driver's GPU mapping of a foreign dma-buf sees
the CPU's caches, so the Shared type's flag is a proxy that errs to the safe
side: where it refuses, the pointer route is coherent by its type's flag.
Docs: import.rs's header and both dma-buf calls' doc comments; coherence.rs on
imports; the runtime README's Shared memory's coherence ("Imported blocks take
no call"), Imported blocks (the rule, the proxy and its limit) and its known
gaps; docs/VALIDATION.md on the shared view; docs/REFUSALS.md regenerated; the
api_signatures table blessed (one variant added).
Tests: a_dma_buf_is_refused_where_the_shared_type_is_not_host_coherent (pure,
over Meteor Lake's i915 type list and the Iris Xe's);
every_device_under_the_view_refuses_a_dma_buf_and_imports_host_memory (device,
through the refused device's view); the existing dma-buf device tests take the
new refusal. Verified at this commit: cargo fmt only; the build, the pure
tests and the device run are in the jobs the lane reports.
The known gap's image_filter bullet now also says that a plain Vulkan program of that filter,
holding none of the runtime's code and with no robustness enabled, takes 1.07x with its buffers
bound against the same program reaching them by address on the Iris Xe: 1,168.9 against 1,092.3
us a dispatch (+7.01%) and 1,169.6 against 1,092.5 (+7.06%) at p50, two alternated pairs in one
job (m3-max-75320, Mesa 26.2.6). The line on the split of the recorded stream's loss stays as it
was: it is still not measured.
Docs only.
The bound-buffer form (rule 2's twelfth form) changes what every compute kernel's module holds
on a device that binds kernel buffers, and SEMANTICS_VERSION moved to 2305, so the golden hash
table's keys and the census's artifact hashes went stale. The gate at 29c40fa526 failed only
golden_hashes_match_the_table, class "bless due (stale cells only, keys changed)".
Re-blessed on the M3 Max at da7cfda87c: the engine inventory, the golden hashes and the air_input
printouts (m3-max-75238, all three exit 0; only golden_hashes.tsv changed, 1,546 rows), and the
authored compile census (m3-max-75239, exit 0). In the census, 2,357 rows before and after,
none added or removed, and no row's verdict changed: only artifact hashes and the artifacts_at
product line moved.
The gap da7577de03 recorded said buffers are not bound. With the bound form landed, it is two
items in Known gaps of pipeline states:
- On a device that binds a kernel's buffers, the form's cost, in both shares: the descriptor
sets, in the harness's rows of many small dispatches (burst_2000, burst_2000x5,
dispatch_chain), and a kernel's slower access through a bound storage buffer, in its row of one
large dispatch (image_filter), each by card; and a recorded stream on the Iris Xe, +7.98% GPU
time a frame (m3-max-75206), whose split between the two is not measured. The rows are at the
landing's code with no cuts: Iris Xe m3-max-75203, Radeon 780M m3-max-75095, RX 7900 XTX
m3-max-75094, RTX 3090 m3-max-75237. Each table runs tip harness 48adfb958e against base
c6518caf3b. From 48adfb958e to 8e76a2a5e1 only two runtime test files change, and from
8e76a2a5e1 to the landing's 365097105f only the runtime README.
- On a device without the form, on the slots that keep their addresses by structure, and on
every render stage, the address form's checked access, with da7577de03's native comparison
rows kept as they were.
The Bound kernel buffers section's devices without the form now name their sources: lavapipe's
128 MiB maxStorageBufferRange (its committed profile; no dispatch bound in m3-max-75211),
MoltenVK's robustBufferAccess2 false (the validation crate's moltenvk-m3 profile) and the UHD
630 Windows driver 101.2145's missing VK_EXT_pipeline_robustness (its vulkaninfo).
The set pools' leak lines (AGENTS.md):
- zero at device drop and a fill past capacity:
set_pools::every_device_shares_its_set_pools_and_keeps_at_most_seventeen;
- flat between iterations 100 and 200:
set_pools::every_device_s_set_pools_hold_flat_across_an_encode_and_retire_loop (29c40fa526).
It passed 771/771 in the device suites on the RTX 3090 (m3-max-75212), Radeon 780M RADV (75213),
RX 7900 XTX (75214), Iris Xe (75222) and the 780M under AMDVLK (75215, address form), whose
bound counts rose by its 25,800 dispatches, and on lavapipe (75211: pools [0, 0]).
Docs only: no test or generated table changes.
AGENTS.md's leak lines for the set pools, a bounded store the bound form adds: zero at the
device's drop and a fill past capacity were shown by
every_device_shares_its_set_pools_and_keeps_at_most_seventeen; flat between loop iterations 100
and 200 was not. The new test encodes 200 command buffers of half a pool's sets and one more, each
retired before the next, so the pool the device hands out from runs out every other iteration
and a pool's sets come back while another serves, and asserts the buffer_set_pools gauge equal
after iterations 100 and 200, at most the kept pools, and zero at the device's drop; a device in
the address form holds none. Test only; it runs in the device suites at the landing tip.
The planner's amendment of the bound-buffers clause: the known gap now records two things, the
descriptor set's CPU and GPU cost, and a kernel's slower run on a device whose bound access costs
more than its address access. Why: how the Iris Xe streams' loss splits between the set and the
kernels' own accesses is not measured, and one filter kernel's loss there is measured as not the
set's (only its message kind differs), so the rule records the loss the owner accepted without
naming an unmeasured cause. The rest of the clause is unchanged; the clause's last lines are
re-wrapped.
Docs only.
The bound-buffers clause gains what the owner accepted with the form, in the style of the other
eleven and with no figures: a dispatch whose buffers differ from those its command buffer bound
last writes and binds a descriptor set, and that set's CPU and GPU cost on a device that takes the
form is recorded as a known gap. The figures belong in the runtime README's known gap. Also joins
a line the clause's earlier edit left short.
Docs only.
The bound-form expectations named the form flag bound, which the test's buffers shadowed, and the
test did not compile (job m3-max-75099, clippy in m3-max-75100). The flag is binds.
Verified: fmt only; the archive and clippy rerun in the next job.
Both device tests asserted the address form on every device and failed on the Iris Xe (ANV) and
the RX 7900 XTX (RADV) in the device suite at b717e99909 (jobs m3-max-75089, 75088; the panics in
m3-max-75096): the push-window test found no address and no check field in the block of the
kernel of 24 buffers where it wanted 2 and 25, and the variant-lowering test found no buffer whose
accesses are checked where it wanted buffer 1.
On a device whose translator binds a kernel's buffers, the push-window test now wants each buffer
a view, no address and no check field anywhere, no block and one push for three dispatches where
the bind offsets fit the window and one block and a push a dispatch where they do not, and one set
written and held twice; the variant-lowering test wants no buffer checked. The address form's
expectations are unchanged.
Verified: fmt only; the device suite reruns on each card.
A command buffer took a whole pool of 256 sets for its first bound dispatch, and a pool past the
16 kept free was destroyed as it came back. Under bursts of small command buffers pools were made
and destroyed all the time: on the Radeon 780M (RADV) the set-pool gauge's sampler saw at least
15 pools made and destroyed a run of burst_160 and 55 a run of burst_2000, and none in
dispatch_chain (job m3-max-75078). Instructions a run grew by 4.87M in burst_2000 against the base
(job m3-max-75070), 0.96M of them the 2,000 set writes at dispatch_chain's price.
Now the device's pools are shared. A command buffer takes its sets in runs from the pool the
device hands out from, the first of one set and each next as long as all it took before, at most
32, so it holds no more sets unused than it wrote and at most 31. A pool whose every set is handed
out gives way to a free one or a new one; it is free again once every set taken from it is back.
The device keeps at most 16 free pools besides the one it hands out from and destroys the rest.
The bound is in the runtime README in sets, descriptors and RADV's bytes of device and host
memory.
One lock, the device's over its pools, orders what Vulkan synchronizes on a pool (its making, its
sets' allocation and its destruction) and the takes and give-backs. A set's write is synchronized
on the set alone, and its command buffer writes it.
The test set_pools: 200 command buffers of a set each, held at once, take one pool;
(16 + 2) x 256 dispatches in one command buffer hold 18 pools, 17 stay as it retires, and
17 x 256 more make none; none is left once the device drops. set_pools_threads: two threads
encode 600 dispatches each at once, under the validation layer, and their sets come from at most
5 pools. Both check every output.
Verified: fmt only; the build, the tests and the burst rows' table follow in jobs.
The test that reads and writes before and past a buffer between two neighbours of one block ran on
the M3 Max under KosmicKrisp 26.3.1 in the bound form and found zero and no write (job
m3-max-75048, under the validation layer, 20 dispatches bound and none at their addresses).
Verified: the job's output; docs only.
A landing that names which suites ran the bound form on a card reads it from the run: each device
test prints its device's bound and address dispatch counts at its teardown (M2V-FORM), and each
conformance replay pass prints the pass's (buffer forms on DEVICE). Nothing in a verdict reads them.
Verified: fmt; built and run in the next device-suite jobs.
rustdoc -D warnings refused OPTIONAL_EXTENSIONS's and pipeline_robustness's links to the crate-private
PIPELINE_ROBUSTNESS, and clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd refused pool_reach's
dispatch table type as too complex (job m3-max-75057). The links go; the table's thread reaches are
a type of their own.
Verified: fmt; clippy and rustdoc rerun in the next gate job.
The granule (robustStorageBufferAccessSizeAlignment) reads 0 where VK_EXT_robustness2 is not
exposed, so the plain minimum rule named the runtime floor's 0 as beyond every device that has the
extension (job m3-max-75044: three profile tests, the Iris capture among them). The rule subgroup
size control's minimum takes, 0 states none and a value needs the device's and at least it, is now
one variant for both members (OptionalMinimum), and the direction test holds the granule's three
cases on the committed lavapipe.
Verified: fmt; the suites run in the next gate job.
Rule 2's bound-buffers item now reads 'a device with' the pipeline-robustness feature (the
runtime enables the feature, a device does not), names 'a compute function's' buffer arguments in
place of 'a kernel's', and drops the commas around 'by structure'. Rule 3's clause says which
replaces which: for a compute function's buffer arguments, bound buffers where rule 2's query
takes them. The text is the planner's fourth round, wrapped to the file's width.
Verified: docs only; no line of the edited paragraphs passes 100 columns.
The owner's authorization of 11-26 (brief 'bound'): rule 2 counts twelve forms, the twelfth bound
buffers, stated as its query (the pipeline-robustness feature, robustBufferAccess2 and
robustBufferAccessUpdateAfterBind, then the limits its layout reaches) with the address form and
the check that stays by structure as known gaps; rule 3's direct addresses take a kernel's bound
buffers in their place where that query takes them. Worded by bound buffers, not by descriptor
type.
Every committed profile's context chains VkPhysicalDevicePipelineRobustnessFeaturesEXT where it
lists the extension, so each of the 28 contexts' pinned chain moved (bless_opened_chains, job
m3-max-75043).
docs/API.md: section 1's bound kernel buffers (the query's features and every limit set 0's
layout reaches, the four kinds of slot that keep their address by structure), section 5's
SlotBindOffset view, and the accepted difference of a bound buffer's out-of-bounds reach: up to
15 bytes before a buffer off 16 and up to 3 past a length off 4 where
robustStorageBufferAccessSizeAlignment is 4 (none on NVIDIA), reads and writes landing in the
same process's memory, its own or shared with it by name, and past a buffer the consumer placed
by heap_buffer_size_and_align the block's padding (zero or the same device's earlier bytes,
never another device's). The runtime README: the extension row, the Bound kernel buffers floor
entry with its feature table (pool_reach's runs: Iris Xe, 780M, XTX and RTX 3090 bound, jobs
m3-max-75037..75040; the 780M under AMDVLK, which lists no VK_EXT_pipeline_robustness at the
runtime's Vulkan 1.3, in the address form, m3-max-75041/75042), the counters, and the check's
known gap. The placement comments at encoder::view and HEAP_BUFFER_ALIGNMENT.
Suite pins (m3-max-75036): the stage helper's version 3 for its robust compute chain; the
validation runtime-sources pin (RUNTIME_VERSION is already bumped in this change); the profile
subset rules for robust_buffer_access2, robust_buffer_access_update_after_bind (implications)
and robust_storage_buffer_access_size_alignment (a minimum); the enable test's device with room
for set 0's 31 storage buffers; the README floor test's pipeline-robustness feature table.
pool_reach places its target between two 256-byte neighbours of one Shared block and reads and
writes word indices inside it, before its first byte and past its end (beyond any slack), at bind
offsets 0 and 16: every read outside reads zero, every write outside lands nowhere, the
neighbours keep their fills, and the dispatch counts in the form the device takes
(bound_dispatches where the translator binds a kernel's buffers, address_dispatches elsewhere).
The fixture's companions are regen-air-fixtures' (job m3-max-75033). Built only; the device runs
follow.
The runtime's containment test places its target between two neighbours of one block and gives
it indices inside, before and past the buffer. Its companions come from regen-air-fixtures next.
engine_bound_buffers compared a descriptor's type with ash's DescriptorType; the interface holds
the crate's own (crate::vk). Found by the translator suite's build (m3-max-75017).
A module that reaches its buffers through storage views of set 0 now requires the
pipeline-robustness feature (VkFeature::PipelineRobustness), which a pipeline needs to state its
own robustness. The out-of-bounds contract reads that requirement (ModuleFacts::robust_views):
such a kernel's views are contained by robustBufferAccess2 (Check::Robust2), their atomics by
the shader's check, both reading zero, as before for the read rule. Built only; the suites and
the authored out-of-bounds cases on a bound card follow.
The harness's matrix counts gain bound_dispatches and address_dispatches, and the replay player's
executed counters gain those two with buffer_sets_written and buffer_sets_held, so a run shows
which form its dispatches took. Built only; the harness run is the Iris read that follows.
The identity profiles the word-phase tests share keep the address form by stripping the
pipeline-robustness feature; bound_identity_profiles keeps it, and engine_bound_buffers checks
the bound form on every committed profile that answers the query (lavapipe does not): two
storage views of set 0 at pushed bind offsets, no device-address access, the slot alignments
stated, and a word-bound slot keeping its address held to 4.
identity_refusal refused any descriptor, so the bound form's storage views were
Unsupported{IdentityDomains} (copy_words on the Iris Xe, job m3-max-75013). Under
AccessPlan::robust_views it admits one storage buffer for each storage-view slot and no other
descriptor.
Verified: the rerun follows.
identity_refusal refused every pushed SlotBindOffset and every non-device-address slot, so each
kernel on a profile that binds its buffers was Unsupported{IdentityDomains} (the harness's
copy_words on the Iris Xe, job m3-max-75010; 22 identity tests on the committed profiles, job
m3-max-75008). Under AccessPlan::robust_views it admits both.
Verified: the rerun follows.
The validation contexts' enable table (Structure::PipelineRobustness, promoted in 1.4), the
fake device of the ash query's tests, the runtime's extension name for the translator (its
description refused 'enables PipelineRobustness without exposing it' on the Iris Xe, job
m3-max-75007), the api_surface table's two constants and the signature table
(scripts/api-signatures/signatures.py --bless).
Verified: the translator suite's member-table and surface failures (job m3-max-75004) are
these; a rerun follows.
The bound form's query states the features, then the limits its layout reaches: the
translator's binds_kernel_buffers adds maxPerStageDescriptorUpdateAfterBindStorageBuffers,
maxDescriptorSetStorageBuffers, maxDescriptorSetUpdateAfterBindStorageBuffers and
maxPerStageResources (each holding the 31 storage buffers) beside maxPerStageDescriptorStorageBuffers
and maxStorageBufferRange; Limits gains the two update-after-bind storage-buffer limits. The last
limit the layout reaches, maxPerStageUpdateAfterBindResources, counts the runtime's set 1 beside
the 31, which the translator does not size: the runtime enables pipelineRobustness only where it
holds the compute stage's set-1 descriptors and the 31 (floor::kernel_buffers_fit).
Verified: nothing yet; builds follow.