identity domains: a loaded or converted pointer is the device address it holds, no root table

rt answers MTLArgumentBuffersTier2 and refused the tier's basic buffer member: a kernel reading
two buffers through an argument buffer's pointer members, and one reading a buffer through a
gpuAddress the CPU wrote into a constant buffer, were both "Unsupported{IdentityDomains} (an
encoder value the function reads as RootTableAddress)". A pointer loaded from memory or made
from an integer is a wide pointer, which the resident-table domain resolves by searching the
root table's resident set; the identity domains push no root table, so the gate refused it.

Under the identity domains a pointer is the device address of the byte it names, so a wide
pointer there is (0, a, 0, 0) for address a, the form of a miss of an empty table: a loaded word
or an inttoptr operand is the pointer itself, with no search, a wide buffer parameter is its
slot's address (SlotGuestBase with the bias added back), its Metal address is `at`, and its
accesses are at host + at = a, unchecked and uncounted (a stored address is used as it is; there
is no resident set to miss). Nothing pushes RootTableAddress or ExecutionStatusAddress for it.
An escaping slot root stays static there, as on Profile F, which has no root entries either: a
slot pointer converted to an integer or stored through a static destination is SlotGuestBase
plus its displacement, and the slot's run-time accesses keep their SlotBounds check.

The same gate lifts the texture behind an argument buffer's pointer member (ab_tier2's
ab_indexed) and a kernel that converts a slot pointer to an integer. A slot pointer stored
through a loaded pointer or into an open pointer cell stays refused, as on Profile F
(Unsupported{Lowering(Access)}). Every branch is under the identity domains: the default
domains' modules are unchanged. SEMANTICS_VERSION 2202: these refusals become modules.

Tests: engine_identity_pointers (ab_sum, ab_address, ab_slot_address and ab_indexed on every
committed profile Device::from_queries derives under the identity domains: no RootTableAddress,
no ExecutionStatusAddress and no descriptor, L3, and on the CPU interpreter with buffers above
4 GiB and offset addresses, the words the addresses name, the slot's Metal address and the
increment, and the slot checked against its bounds); rt's argument_tier device tests sum through
two pointer members, read through a CPU-written gpuAddress, answer a converted slot pointer as
its gpuAddress plus its offsets, and read the textures behind a pointer member, each exactly. The
two translator tests and the device test that asserted these refusals go. Run by the lane's
compile gate (fmt, clippy plain, m2v_gpu and m2v_cpu_icd, workspace Rustdoc, the translator's
and rt's suites on lavapipe); job ids in the landing note.

Docs: rt's README says the condition in one sentence (the stored word must be a buffer's
gpu_address plus an offset inside it, and a buffer not placed at the address its guest asked
for has another gpu_address) and drops the three refusal bullets; docs/API.md sections 1 and 5
and PointerDomain::Identity say what the identity domains lower now. docs/REFUSALS.md
regenerates unchanged.
This commit is contained in:
Anees Iqbal committed 2026-11-20 08:35:00 -08:00
1 parent cb643e363b
commit 3cdca62567
12 files changed
+603 -181

No files matched your search

+14 -11
View File
@@ -211,17 +211,18 @@ compile does. `DevicePolicy::default()` is `DevicePolicy::UNTRUSTED`:
(`PushField::FetchedColor { color, texels }`, `texels` the read's numeric class), and a
read-only signed-integer attachment joins `signed_color_attachments`. Every precision note is
static there: no constant or binder decides one. So far they lower a kernel that reaches memory
through its buffer slots and reads, writes, sizes or tests for nil its texture slots and its
argument buffers' textures, and samples its texture slots through its runtime sampler slots
and its constexpr samplers. Any other function is refused as `Unsupported{IdentityDomains}`,
through its buffer slots and the device addresses it loads (an argument buffer's pointer
member, a stored `gpuAddress`) or makes from integers, and reads, writes, sizes or tests for nil
its texture slots and its argument buffers' textures, those of an argument buffer a pointer
member reaches included, and samples its texture slots through its runtime sampler slots and
its constexpr samplers. Any other function is refused as `Unsupported{IdentityDomains}`,
whose symbol names the first such form the function holds: one that samples through an
argument buffer's sampler or an array of samplers or samples an argument buffer's texture,
emulates a sampler's anisotropy, samples a 1D texture or at pixel coordinates through a bicubic
filter, uses a texture buffer, a slot's levels or swizzle, a two-plane, extended-range or
sRGB-twin form, reads an argument buffer's texture
through another numeric type or as raw texels, reads the texture of an argument buffer that a
pointer another argument buffer holds reaches (it reads the root table, `RootTableAddress`), or
uses any other state of a texture or sampler beyond its ID.
through another numeric type or as raw texels, or uses any other state of a texture or sampler
beyond its ID.
An argument buffer's texture reads the element at its ID's index masked to its low 16 bits,
so a bad ID reads an element of the arrays ([RESOURCE-ID.md](RESOURCE-ID.md)); the change that
first lowers an argument buffer's sampler masks its index the same way.
@@ -1611,11 +1612,13 @@ for dependency in &pipeline.dependencies {
`setBytes` copy, or of the consumer's nil buffer where nothing is bound), less 2^31, modulo
2^64. An access through the slot adds its 32-bit byte offset plus 2^31, modulo 2^32,
zero-extended, to that word; a pointer compare, a pulled vertex fetch and an access from the
word below it add the 2^31 back to read the address itself. A slot pointer converted to an
integer is a wide pointer, which reads the root table: the identity domains refuse it. The
binder (`BindingPlan::instantiate_*`) of a device that compiles under the identity domains
writes the word so. A pointer loaded from an argument buffer is the address the buffer holds,
unbiased. A texture's or sampler's `SlotGuestBase` is its `gpuResourceID`, unbiased.
word below it add the 2^31 back to read the address itself, and so does a slot pointer
converted to an integer or stored, which is the slot's address plus its offset. The binder
(`BindingPlan::instantiate_*`) of a device that compiles under the identity domains writes the
word so. A pointer loaded from memory (an argument buffer's pointer member, a `gpuAddress` the
program stored) and a pointer made from an integer are the device address the word holds,
unbiased and used directly, unchecked: there is no root table, no `PushField::RootTableAddress`
and no search. A texture's or sampler's `SlotGuestBase` is its `gpuResourceID`, unbiased.
- Under the identity domains with containment on, a buffer slot that an access may reach at a
byte offset that is not a translation-time constant (an index the memory plan does not prove
one value, a looping `memcpy` or `memset`, a pulled fetch) also reads