Commit Graph
190 Commits
Author SHA1 Message Date
Anees Iqbal 4e1f847978 🐛 Answer nil for a device texture of more bytes than maxBufferLength
The device's newTextureWithDescriptor: sent every texture its validation
passed to the host, posted, and answered a texture, however many bytes it took.
Metal answers nil for one too large to make: the Intel 630 past its
maxBufferLength, the AMD 5300M past 16 GiB (the previous commit's
measurement). A texture whose create the host's platform refused for its size
was then one the app held, and the draws of every command buffer naming it
were dropped (refused.rs), where Metal's app would have seen nil and taken
another path.

What the guest sees: the device's creator answers nil, sending nothing, for a
texture whose bytes, every level of every slice and sample in its format's
blocks (its allocatedSize), are more than the device's maxBufferLength, as the
Intel does and as the bundle answers a buffer and a heap past it. It is inside
both x86 GPUs' answers, and keeps a texture within three quarters of the host
GPU's working set, which our maxBufferLength is. A heap's, a buffer's and an
IOSurface's creators place a texture in memory of their own size, and are
unchanged. test_textures_past_max_buffer_length_are_nil expects it.

guest/prebuilt is rebuilt from the tree (make -C guest prebuilt, the macOS
26.7.1 KDK): RgfxGate, which carries the bundle, and the record.
2026-11-07 11:07:32 -08:00
Anees Iqbal 450661e889 🐛 Answer nil for a texture buffer past its buffer's bytes
Both x86 Macs make a texture buffer by the public form even when its texels
lie past the buffer's bytes (measured: macOS 26.7.1, 4 RGBA32Float texels at
offset 4064 of a 4096-byte buffer). metal2vulkan refuses such a texture
(TexelsPastLength), and the Vulkan host ends its process at a refusal by this
creator. So the bundle answers nil, logged once, and sends nothing, as it does
for the other textures over a buffer the host does not carry.
2026-11-07 09:11:16 -08:00
Anees Iqbal 55bbbd0f82 🆕 Make texture buffers over a buffer by the public form
A buffer's newTextureWithDescriptor:offset:bytesPerRow: answered nil for a
texture buffer, logged as a type the host does not carry. The GL renderer
makes each GL texture buffer this way: gl_cases' texbuffer case got nil, and
the renderer drew it in software (RTX 5080 host, m3-max-3947).

Both x86 Macs make one by this form (measured: macOS 26.7.1, RGBA32Float and
RGBA8Unorm):
- over a Shared or a Managed buffer, at any offset (0, 4, 16, 64, 100, 256);
- with rows of at least its texels' bytes (64 and 4096);
- and their kernels read the buffer's bytes from the offset.

The host's platform makes one by the same form, at any offset, so the create
now goes to the host as TEXTURE_FROM_BUFFER with its type. For rows of 0 bytes
both Macs end the process with the same words, and the bundle does too. For
fewer bytes than the texels need, the AMD answers nil where the Intel ends
the process; the bundle answers nil, as the AMD does.
2026-11-07 09:11:16 -08:00
Anees Iqbal 3564633f28 🐛 Make no buffer or texture with resource option bit 18
On macOS 26.7.1 the AMD 5300M and the Intel 630 answer nil to
newBufferWithLength:options:, newBufferWithBytes:length:options: and
newTextureWithDescriptor: when the options hold bit 18 (0x40000). That
holds in every storage mode; bits 17 and 19 make the resource as
usual. The bundle made every one of them.

Both Macs agree, so it is the contract, and those creates now answer nil.
The Macs make a no-copy buffer and a heap's buffer with bit 18, and so
does the bundle. On a Private heap they diverge (the AMD's is nil, the
Intel's is made), and the bundle keeps making it. What the bit means
nothing states.
2026-11-07 07:00:29 -08:00
Anees Iqbal 11672a2a5f 🐛 Carry only the options the host takes on heap and buffer creates
The GL renderer makes its no-copy buffers with resource option bit 20
(0x100000), a hint for the device's driver. The bundle passed every bit
to the host, and the host's runtime refuses a buffer with a bit Metal
gives no meaning, so each such buffer was refused (measured: macOS 26.6.1
on the RTX 5080 host).

Heap and buffer creates now carry only the CPU cache, storage and hazard
tracking modes, and Metal's private bit 24, which the host takes as Metal
does.

A buffer outside a heap now answers resourceOptions with its three modes
alone. On macOS 26.7.1 the AMD 5300M and the Intel 630 drop each of bits
10 to 31 from the answer, for length and no-copy buffers alike: they give
0x200, 0x210 and 0x220 for Shared, Managed and Private.
2026-11-07 06:57:51 -08:00
Anees Iqbal 9027ae34bf 🐛 Answer the GL renderer's depth/stencil state queries
The system's GL renderer sends readsDepth, writesDepth, readsStencil and
writesStencil to every depth/stencil state it binds, without asking first
whether the state responds. Our state had none of them, so the first GL
draw with depth or stencil ended the process on an unrecognized selector
(measured: macOS 26.6.1 on the RTX 5080 host).

On macOS 26.7.1 the AMD 5300M's and the Intel 630's states answer YES to
all four for every descriptor asked, including one that tests and writes
nothing. The bundle's state now answers the same.
2026-11-07 06:57:51 -08:00
Anees Iqbal ab4ee7c149 ✅ Compare the GL SPI test's passes without their fences
test_gl_renderer_spi compares the ops of one pass encoded with and without
the renderer's cleared marks, and committed with commit and commitAndHold.
Each pass's encoder takes the queue's next barrier fence, so its
ENCODER_BEGIN_RENDER and its fence ops differ from the others' by that
fence's id alone, and the comparison failed on them. Those ops' bytes are
blanked before the comparison; their tags and sizes, and every other op,
are still compared whole, and the first op that differs is printed.

The pass's target is a stand-in handle, as other encoder tests' are.
2026-11-07 06:57:50 -08:00
Anees Iqbal f2c1b62ccc 🐛 Answer the texture, buffer and encoder SPI the GL renderer sends
On the reims-graphics device, the system's GL renderer ended the process at
its first glClear: -[RgfxTexture swizzleKey] was an unrecognized selector
(measured on macOS 26.6.1 with an RTX 5080 host). Comparing the renderer's
selectors with what Intel's x86 classes answer, on the oracle Mac, turned up
four that our classes lacked and that the renderer sends unguarded. Their
behaviour was measured on macOS 26.7.1 on an AMD 5300M and an Intel 630:
- swizzleKey: the texture's swizzle channels, one byte each, red lowest.
  The default swizzle gives 0x05040302 whatever the pixel format.
- commitAndHold: Metal commits the buffer and holds its submission until the
  queue's next commit. Ours commits it as commit does, so it runs in the
  same order, and never later than Metal's would.
- setDepthCleared and setStencilCleared on a render encoder: hints for the
  driver's own clear state. They leave the pass unchanged on both Macs, and
  post nothing here.
A shell test covers the keys of a texture and its views, and checks that the
marks and commitAndHold post the same ops as a plain pass and commit.
2026-11-07 06:57:50 -08:00
Anees Iqbal 03d0d1bb65 🆕 Make the device's GL shaders libraries of AIR it lowers
macOS's OpenGL renderer over Metal hands a device each shader as GL IR
and each variant as plugin data. Metal's own devices lower the two to
AIR in their compiler service; ours has none, so a variant is now
lowered in the renderer's process, through the GL code generator the
system ships beside the renderer, called in place. The AIR goes into a
.metallib of one function, which the device makes a library of, so it
reaches the host as any library does.

- RgfxGLFunction answers the six newFunctionWith{GL,GLCore,GLES}IR:
  members, with what Metal's own function of GL IR answers.
- RgfxMetallibWriter writes the .metallib, and unwraps the bitcode the
  system's LLVM writes, which Metal refuses wrapped twice.
- The generator's return data rides with the variant, and the render
  and compute reflections answer it as Metal's do.
- The register lists the device's GL members as implemented and the GL
  function's members.
2026-11-07 06:57:50 -08:00
Anees Iqbal 53964346f8 ✅ Give the other stitchable tests' rings room for two libraries
test_stitched_libraries_in_archives and test_library_members_as_metal each
make two libraries of the stitchable bytes before they drain the control
ring, which the 16 KiB metallib no longer lets a 32 KiB ring hold: the
second library was nil (an uncaught exception in the first, a wrong error
domain in the second). A 64 KiB ring holds them, as for the stitched-shadows
test.
2026-11-07 04:54:29 -08:00
Anees Iqbal 1932512d2f ✅ Give the stitched-shadows test's ring room for its libraries
stitchable.metal's second caller grew its metallib to 16 KiB, so the test's
two libraries of those bytes no longer fit the fixture's 32 KiB control
ring: the second create was never posted, its library was nil, and the
test's check that a library with no shadow logs its reflection as
unsupported failed. A 64 KiB ring holds them.
2026-11-07 04:54:29 -08:00
Anees Iqbal 8228bedd37 🐛 Give functions made with constant values a shadow to stitch
MPS stitches its uber shaders' visible functions after making them with
constant values and a specialized name (MPSLibrary::CreateUberShaderKey). Our
stitch runs over each function's shadow, Metal's own function over the same
bytes, and a function made with constant values had none, so the stitch was
refused ("link: function constant_0000000000000000_f has no function of Metal's
own library"), MPS inserted the nil it got into an array and threw: Geekbench
7's GPU benchmark aborted at its first MPSGraph convolution.

A function now keeps the constant values it was made with, and its shadow is
Metal's own function of a descriptor of the entry point, those values and its
specialized name. Metal's own library on this device makes such functions and
stitches them (measured in a macOS 26.6.1 guest on the RTX 5080 host,
tools/stitch_probe --metal). The same covers a function given a specialized
name alone, whose shadow answered the entry point's name, which a graph's node
naming the specialized one does not find.

The shell tests stitch functions specialised each way over Metal's own shadows
(tests/stitch_constants.metal); tools/stitch_probe runs the stitched function
on a guest's device.
2026-11-07 04:10:56 -08:00
Anees Iqbal 892a0eefb0 🐛 Make BC textures over a surface where they answered nil
Since c13-contract (ae37ce1c2) the bundle answered nil for a BC1 to BC7
texture over an IOSurface or one of its planes, before it took a view of the
surface. Metal on the x86 Macs makes these wherever the rows fit, over a
surface with planes or without, in Managed or Private storage
(oracle_surftex, Q20). The nil was the host's limit: pin 14's runtime made
no texture of one over a surface's rows (NotLinear). metal2vulkan's stack
34, at this branch's pin, makes them in the x86 Macs' form, row j of blocks
at the plane's row j (on MoltenVK as a shadow image), and the bundle's own
CPU access takes the same rows since 187d1ee33. Runtime gaps are
metal2vulkan's, and ours go at the pin that fixes them.

What changes for the guest: newTextureWithDescriptor:iosurface:plane: of a
BC format answers a texture and posts its create, where it answered nil and
logged "no texture (descriptor)". The shapes stack 34 still refuses (a BC
texture over a plane at an offset or rows off 16 bytes, or wider than the
plane's rows) are posted and refused as the host's other refused shapes are
(decode/refused.rs). On the Metal platform, whose buffer creator answers nil
for BC as Metal's IOSurface creator does (87b24e27e), the texture is a
refused create too.

Test: test_iosurface_block_compressed_textures_are_made fails at the base,
where the bundle answers nil.
2026-11-05 21:59:37 -08:00
Anees Iqbal 6813776e3c 🐛 Size a surface texture's CPU access in its own format's texels
A texture over an IOSurface read and wrote its rows on the CPU (getBytes,
replaceRegion) in the surface's elements, not the texture's texels. A
texture of a narrower format than the surface's element wrote past the
caller's rows: an R8Unorm texture over a 'BGRA' surface copied four bytes a
texel into a buffer of one a texel. A wider format copied too few bytes, and
a surface whose elements are not single pixels (a 4:2:2 one) gave none.
Metal reads and writes the texture's own texels, row j of them at the
plane's row j.

What changes for the guest: getBytes and replaceRegion of a texture over a
surface read and write the blocks of the texture's own format
(rgfxPixelFormatBlock) at the plane's rows, over a 4:2:2 surface too. A
texture of a format with no block there (depth or stencil, Private over a
surface) reads and writes nothing.

It is also the ground for block-compressed textures over a surface, whose
rows of blocks lie at the plane's rows.

Test: test_iosurface_cpu_access_in_the_texture_s_format fails at the base,
where the R8Unorm read writes past the caller's 256 bytes.
2026-11-05 21:59:37 -08:00
Anees Iqbal 9beab79d22 📝 Number texture-nil's oracle sections Q24 and Q25 after shared events
c14-shared-events and c14-texture-nil each added a Q23 to dgpu-oracle.md. The
car keeps shared events' Q23 and numbers texture-nil's two sections after it:
the texture descriptors each creator refuses are Q24, and what a command buffer
does with nil objects is Q25. The references in dgpu-oracle.md, design.md, the
decoder's refused.rs and the shell tests follow, and the report's probe list
names oracle_events, which shared events added to the oracle's README and
build.sh.
2026-11-05 21:59:37 -08:00
Anees Iqbal 31115cc8df 🐛 Answer nil for a block-compressed texture over a buffer
The bundle posted a BC1 to BC7 texture over a buffer's bytes, which the host's
platform makes none of (Metal's over a buffer, and metal2vulkan's linear
images), so the host refused it and every draw that named the texture was
dropped. The AMD 5300M answers nil for one over a Shared buffer, 64 x 64 and
62 x 64 (oracle_texdesc buffer bc1.*), where the Intel 630 makes it: the
envelope holds nil, and the bundle answers it, sending nothing.

For the guest: newTextureWithDescriptor:offset:bytesPerRow: of a
block-compressed format is nil. Both x86 Macs make a single block's (2 x 2),
which is now nil too.
2026-11-05 21:59:36 -08:00
Anees Iqbal 476bafaad7 🐛 End every texture creator at the x86 Macs' descriptor validation
A texture create is posted, not waited for, so a descriptor the host refused
left the app holding a texture whose every draw was dropped, where Metal on the
x86 Macs ends the process at its descriptor validation. The bundle copied a few
of its rules (three-channel formats, multisample compressed formats, depth in
CPU storage), and the IOSurface creator a subset of its own.

Every texture creator now runs one copy of
-[MTLTextureDescriptorInternal validateWithDevice:]: the device's, both of a
heap's, a buffer's public form and its linear and tiled SPI, and the creator
over an IOSurface. It follows the AMD 5300M and the Intel 630 under macOS
26.7.1 at the device, a Private heap and a Shared buffer (oracle_texdesc, 107
descriptors): every rule broken a line, in their order, in one assertion; the
sample counts the device makes; Depth24Unorm_Stencil8 and X24_Stencil8 lacked,
as on the Intel. A heap's creators then end the process at a descriptor of
another storage mode than the heap's, and a texture type past TextureBuffer
ends it with no words, as there.

For the guest: a process that sent the host a texture create Metal does not
make now ends at the create with Metal's words, and the host is sent nothing.
2026-11-05 21:59:36 -08:00
Anees Iqbal d4398c6465 🆕 Hand shared events to other processes, as Metal does
eventPort, newSharedEventHandle, newSharedEventWithHandle: and
newSharedEventWithMachPort: answered nil or raised unrecognized selectors. They
now answer as the AMD 5300M and the Intel 630 do under macOS 26.7.1
(oracle_events, identical on both), where the kext and the host carry ports:

- eventPort is the kext's port for the event, asked once and the same name at
  each ask, which the event holds one send reference of;
- the handle is Metal's own MTLSharedEventHandle over it, which takes its own
  reference, keeps the label, and crosses NSXPC as Metal's does;
- an event made of a port or a handle is the same host event at its value,
  holds one more reference, and is labelled as the handle (nil from a port);
  made of this process's own port it is the event's alias, which reads the
  other's sets at once, as Metal's two events do;
- MACH_PORT_NULL, a dead name, a port the process receives, a port that names
  no shared event, and a nil handle answer nil, the references as they were;
  the bundle asks its own connection whether a port is the kext's
  (IOConnectAddClient) before it calls on it, so another process's own port is
  answered nil, where an IOKit call on it would kill the process;
- the event adopts NSSecureCoding and codes only through an NSXPCCoder, raising
  NSInvalidArgumentException with Metal's words otherwise.

The values other processes give the event come on a queue of the device's own,
its listen queue. A value set in another process reaches this one as the host
posts it, where Metal's shared page is read at once: a read right after the
other's set may see the value before it.
2026-11-05 21:59:36 -08:00
Anees Iqbal 09eb85c73c ✅ Time the guest's buffer scheduling and completion
The car 12 probe put a lone buffer's commit-to-scheduled-handler at about
390 us p50 on the RTX 5080 host, against 198 on an AMD Mac. Part of that is the
guest's own hops: the completion thread's wake, then the queue's completion
queue for each record. shell_tests --queue-timing [rounds] times them on the
bundle's real queue, reader and completion thread, with the kext's wait stood
in for: how long after the host's post of a CB_SCHEDULED, then a CB_COMPLETE,
the handlers run and waitUntilScheduled and waitUntilCompleted return, for a
buffer with both handlers, one with a completed handler alone and one with
none. It is a measurement, run by hand, never in make test.
2026-11-05 21:59:36 -08:00
Anees Iqbal bf214206db ✅ Check specialised reflections against Metal's answers
The shell tests now make k_specialised and v_specialised under two sets
of constant values and expect what the 5300M and the 630 answer: an
index kIndex + 1 computes, an argument under kOn || kOff kept or left
out, and which arguments a switch, a select and an optional constant
leave used. air_arguments_test checks rgfxAirSpecialise directly (the
arguments used, the globals the initialisers leave, no values given),
and specialises 4000 spoilt copies of k_specialised's module without a
crash or a hang.
2026-11-05 21:59:36 -08:00
Anees Iqbal 0932f1cd0c 🐛 Reflect nested argument buffers, tables and colour reads
A pipeline's reflection answered nil where a function had an argument
buffer of a struct of members, a C array of members, an array of
samplers or a pointer to an argument buffer of its own, a function table
or an acceleration structure, a texture of 64-bit atomics, or a fragment
function that reads its colour attachments: the AIR reader refused the
fragment node, and the reflection had no answer measured for the others.

Each now answers what Metal answers on the x86 Macs (measured on the
5300M and the 630 with tools/pipeline_reflection_check, every getter and
instance variable alike):
- a struct of members is a struct of its own argument buffer members,
  at ids from its first, a C array of them an argument buffer array of
  the ids an element takes as its index stride;
- a C array of a member is an argument buffer array whose details are
  the element's binding, of a constant's size's stride;
- a metal::array of samplers is an array of index stride 1, as textures';
- a pointer to an argument buffer is a pointer member of its binding;
- function tables and acceleration structures are bindings of their
  own types, read only, as kernel and fragment arguments and as an
  argument buffer's members;
- a texture of ulong is of MTLDataTypeULong (the 630's answer; the 5300M
  makes no pipeline of one, nor of a fragment table);
- a fragment function's colour attachment reads are listed nowhere.

For the guest: those pipelines now answer a reflection where they
answered nil. An imageblock still answers nil: neither x86 Mac makes a
pipeline of one.
2026-11-05 21:59:36 -08:00
Anees Iqbal 3b05f264e2 🐛 Reflect pipelines as their function constants specialise them
A pipeline's reflection is built in the guest from its functions' AIR,
and answered nil where a binding index, a count or a predicate was an
expression of function constants, and isUsed came from the AIR alone,
which marks used an argument read only in code a constant removes.
Metal reflects the specialised function (measured on the 5300M, the 630
and the M3: an argument read only under a false constant is unused, and
[[buffer(kIndex)]] is at the index kIndex gives).

The AIR reader now decodes the function bodies of a module that declares
function constants. Under the function's constant values it runs the
module's initialisers (the stores that set the globals a computed index,
count or predicate is read from), propagates the values through the
entry point's branches, switches, selects and phis, and marks used the
arguments a live instruction of a reachable block reads.

For the guest: such a pipeline now answers a reflection, its arguments
at the indices and counts its constants compute, and an argument read
only in code its constants remove answers isUsed and isActive 0. Where
the reader does not follow the module's code, the answers are as before.

Car 14's stack: resolved over c14-air-cache's one read of a module (104f648f8).
The specialisation code sits before visibleOf in the anonymous namespace,
rgfxAirSpecialise after rgfxReadAirEntries outside it, and finishCode takes a
const Module. rgfxReadAirEntries and rgfxReadAirModule read with wantCode;
where the cache's read with code fails, the module is read again without it for
its functions and visible functions, so only its entry points go unread, as on
this lane. rgfxAirEntryNamed copies the module's code pointer beside its
constants. The header keeps both includes and both sections.
2026-11-05 21:59:36 -08:00
Anees Iqbal dff5d2d43a 🐎 Read each AIR module once a process, for every library
A library read a function's AIR module once for each kind it asked for (the
arguments, a visible function's signature, the nodes a pipeline's reflection
reads), and every library object over the same bytes read it again. The
c13-answers probe measured 20.6 us a read on average over macOS 27's
frameworks (m3-max-1379).

Now one read of a module gives all three answers (rgfxReadAirModule), and
the process keeps its reads by the module's bytes (RgfxAirModuleCache), so a
second library over equal bytes, or another kind of lookup, reads nothing
again. The cache's key is a copy of the bytes, compared whole, so equal
reads always come from equal bytes. It keeps the most recently looked-up
modules while their bytes total 16 MiB, and reads one it let go again.

A function's answers are a function of its module's bytes alone, so the
cache changes when a library's answers are produced, never the answers
themselves: the AIR test checks that one read answers what each reader
answers, for every module of its libraries. Libraries over equal bytes now
share one object per function's arguments and signature (the shell test).
2026-11-05 21:59:36 -08:00
Anees Iqbal 7defb7f533 🆕 Make mesh render pipelines and draw them, as an x86 Mac's Metal
For the guest: where the device takes MESH_PIPELINES, every
newRenderPipelineStateWithMeshDescriptor: form makes a mesh render pipeline. It
used to answer nil and an unsupported error. The render encoders send the object
and mesh stages' bindings and drawMeshThreadgroups:, drawMeshThreads: and the
indirect form, and the SPI's supportsMeshShaders answers YES. Without the
feature they answer as before. The state answers its object and mesh limits as
the host's platform answers them (maxTotalThreadgroupsPerMeshGrid NSUIntegerMax
past 32 bits) and the threadgroup sizes its descriptor required.

Measured with guest/bundle/tools/oracle/oracle_mesh, plain Metal, on the AMD
Radeon Pro 5300M and the Intel UHD Graphics 630 (macOS 26.7.1, 25G241) and the
M3 Max (macOS 27.0.1, 26A434), the creators now end the process where the x86
Macs' Metal does, with their words:
- supportIndirectCommandBuffers YES, on the 5300M and the 630 (the M3 Max makes
  it): "validateWithDevice:1884: failed assertion `Mesh Render Pipeline
  Descriptor Validation\nUse of mesh shader pipelines in indirect command
  buffers is not supported by this device.\n'"
- no mesh function, on all three: "...\nmeshFunction must not be nil.\n'"
- no fragment function while rasterizing, on all three: "...\nfragmentFunction
  must not be nil.\n'"
So no mesh pipeline supports indirect command buffers, and indirect commands
carry no mesh draw. This matches the families: supportsFamily: answers no for
Apple7 to Apple9 on the x86 Macs and on the device, and the SPI's
supportsMeshShadersInICB answers NO on the x86 Macs and the device (YES on the
M3 Max).

They refuse before the host is asked, in the x86 Macs' compiler's domain
(CompilerError):
- a payload past 16384 bytes, code 2, "payloadMemoryLength property of
  MTLMeshRenderPipelineDescriptor (16385 bytes) exceeds maximum supported by
  this device (16384 bytes)";
- a stage maximum past the device's 1024 threads, code 2, the 5300M's
  "maxThreadsPerThreadgroup pipeline descriptor value (2048) exceeds maximum
  supported (1024)\n" (the 630 makes it, the M3 Max refuses it);
- a vertex function as the mesh function, code 2, "RasterizationEnabled is
  false but the vertex shader's return type is not void";
- any other function of another stage, code 1. The x86 Macs answer the
  crashed compiler's XPC words; ours are the validation layer's;
- a mesh function as the object function, code 1, which the x86 Macs make
  and the M3 Max refuses;
- an archive miss under MTLPipelineOptionFailOnBinaryArchiveMiss, code 2,
  "Unable to find function \"f_col\" in binary archives. \n ". It names the
  fragment function, else the mesh function. An x86 archive holds no mesh
  pipeline, so every create naming an archive misses.

The creators with a reflection answer RgfxMeshPipelineReflectionOf's, the
reflection of the pipeline's functions, as the render pipeline creators answer
theirs.
2026-11-05 21:59:35 -08:00
Anees Iqbal 320b9e5314 🐛 Answer pipelines' reflection as an x86 Mac's Metal
Every pipeline creator answered a nil reflection, whatever its options. An
app that asks for MTLPipelineOptionBindingInfo or BufferTypeInfo to find its
buffers' indices, sizes or struct layouts found none.

What changes for the guest: a render, mesh or compute pipeline made with
either option now answers Metal's own reflection (its private reflection
classes), in the synchronous creators and in the completion handlers alike.
It is built in the guest from the AIR of the pipeline's functions and its
vertex or stage input descriptor: each stage's bindings, built-in arguments,
types and struct members, and the private postVertexDumpStride. Options of
neither still answer nil. A pipeline the bundle cannot answer exactly (an
index function constants compute, a kind no x86 Mac was measured for, a
function of no library of ours) still answers nil, logged once per reason.
An argument read only in code its function constants remove is answered
used, where Metal answers it unused; Intel's postVertexDumpStride is 4 less
than ours, which is AMD's. Nothing changes on the wire.

The values are an x86 Mac's (macOS 26.7.1, AMD Radeon Pro 5300M and Intel
UHD Graphics 630), measured with the oracle_reflection probe and recorded in
docs/graphics-kext/dgpu-oracle.md, Q20. tools/pipeline_reflection_check.mm
makes the same pipelines on a device and compares its reflection with ours,
getter by getter and instance variable by instance variable: over 80 cases it
finds no difference on the AMD GPU, and on the Intel GPU only that stride.
The shell test checks ours over the probe's library. RgfxMeshPipelineReflectionOf is the
mesh creators' to answer once they make mesh pipelines.

Car 13's stack: resolved docs/graphics-kext/dgpu-oracle.md, where c13-contract
added Q20 (textures over an IOSurface) first: this commit's section is Q21, and
the probe list names oracle_surftex and oracle_reflection;
guest/bundle/Makefile's shell tests take both RGFX_AIR_REFLECTED
(c13-wire-gaps) and RGFX_ORACLE_REFLECTION.
2026-11-05 21:59:34 -08:00
Anees Iqbal 9a9077389c 🐛 End the process at every two-plane texture over a surface
The bundle made two-plane Y'CbCr textures over a surface as the M3 Max does
(dgpu-oracle.md Q13, read as class 2). The lane imitates the x86 dGPU Macs,
and both end the process there: oracle_surftex's third round measured
"MTLTextureDescriptor has invalid pixelFormat (N)." on the AMD 5300M and the
Intel 630 under macOS 26.7.1 at every two-plane Y'CbCr format (500, 502, 503,
505 to 510, 520, 522, 523, 525 to 530, 540 to 545) and at the extended-range
RGB10A8_2P_XR10 and its sRGB twin (550, 551), over either plane of a 420v
surface, a one-plane surface and a surface without planes. Where both agree,
their answer is the lane's contract; the M3, which makes them all, is outside
its envelope. Q13 records the reversal.

What changes for the guest: newTextureWithDescriptor:iosurface:plane: ends
the process at a texture of any of these formats, at any size, with the x86
Macs' words, sending the host nothing. The odd-extent render target rule
folds into it. No code of the bundle makes such a texture: the video decoder
lands pictures through R8, RG8, R16 and RG16 textures over the planes. The
one-plane 4:2:2 formats (GBGR422, BGRG422) are made as before.

Test: test_invalid_surface_textures_end_the_process holds a death per format
over the luma plane, 500 over the chroma plane and over a surface without
planes, and passes for the planes' own formats and the 4:2:2 ones; it fails
at surface-ycbcr-flat with the rule stubbed out.
2026-11-05 21:59:34 -08:00
Anees Iqbal 2cfd44fb18 🐎 Lay a one-level Managed 2D array over its CPU copy
On a GPU that shares the CPU's memory the host laid a Managed texture over
its CPU copy only where it was a one-level 2D texture: every 2D array kept two
copies there, the guest's CPU copy and the platform's own texture, so it took
its size twice in memory, each replaceRegion: was copied again on the host,
and the guest's getBytes: of it waited for a device copy. The platform makes a
one-level 2D array over a buffer too, by the linear SPI, which lays each slice
at its rows' bytes rounded up to 128 (measured on the M3 Max; the Vulkan
platform's runtime alike, array_over_host_memory_is_metals), and a CPU copy's
rows are multiples of 256 bytes, so its slices lie where the copy's layout
puts them.

For the host: on unified memory MANAGED_TEXTURE_CREATE of a one-level 2D
array of a linear format is newLinearTextureWithDescriptor: over the CPU
copy's buffer, its rows and slices the layout's, in place of a
newTextureWithDescriptor: beside it; TEXTURE_REPLACE_REGION and
synchronizeTexture: of it copy nothing. A texture of the one-copy shape whose
texture over its buffer the platform refuses is logged once. On a GPU of its
own memory nothing changes but where it has no memory for the GPU's copy,
where such an array now takes the one-copy form too.

For the guest: where the device answers hasUnifiedMemory yes, getBytes: of such
an array reads its CPU copy, as a one-level 2D texture's does, with no device
copy (rgfxManagedLiesOverCopy). A mipmapped texture, a cube, a 3D texture and a
block-compressed one stay two copies: no texture over a buffer has their shape,
and without the CPU copy an upload would be a staging blit the call waits for,
340 to 420 us a call where a Managed one's is 2 to 4 (dgpu-oracle.md Q17).

An older bundle on this host reads such an array through a device copy, which
reads the one copy: correct. This bundle on an older host would read a CPU
copy the host keeps apart: the two ship together.

Car 13's stack: resolved a comment in shell_tests.mm over
test_managed_texture_reads_on_unified_memory against c13-answers (16c2a86ad):
kept this commit's 2D-array wording and c13-answers' virtualAddress sentence.
2026-11-05 21:59:34 -08:00
Anees Iqbal efbf359c2b 🐛 Answer a function's encoder at a plain buffer, and end at none
newArgumentEncoderWithBufferIndex: asked the host's layout at every index. Both
x86 Macs (AMD 5300M and Intel 630, macOS 26.7.1, oracle_bundle argbuf.index.1
and .5) make an encoder of no arguments, 0 bytes long, at a plain buffer's
index, and end the process at an index of no buffer, with "bufferIndex N does
not identify an argument buffer".

The guest's function now reads its AIR arguments for the index: a plain
buffer answers an encoder of no arguments (length 0, alignment 1, the AMD
5300M's) with nothing sent to the host; no buffer ends the process with
Metal's words; an argument buffer, or a function whose AIR was not read or
whose buffer index is a function constant's, asks the host as before.
2026-11-05 21:59:34 -08:00
Anees Iqbal 938f3e7e74 🐛 Hold the functions given in a function array's library
newLibraryWithFunctionArray:error: went through Metal's own library of the
functions' shadows (46b5a4d66), but Metal's function-array library holds no
bytes to make ours over, so the guest got nil. Both x86 Macs (AMD 5300M and
Intel 630, macOS 26.7.1, oracle_bundle libforms2 and libforms3) make a library
that holds the given functions themselves, which a guest now gets:

- each function by its name, the very object given, whatever constants or
  descriptor ask for it; nil, or MTLLibraryErrorDomain 5 "Function NAME was
  not found in the library", for a name it lacks;
- its functionNames in the reverse of the order given;
- type Executable, no install name, label, reflection or extern functions,
  and serializeToURL:error: refused with "MTLLibrary is not formatted as a
  MetalLib file.";
- two functions of one name: nil and code 1 "function names must be unique";
- an empty array ends the process with Metal's assertion words.

Nothing goes to the host. The test of the old route is replaced by one of
these answers, with the empty array's death.
2026-11-05 21:59:34 -08:00
Anees Iqbal 0ae3bc5cbd 🐛 Make libraries of function arrays and packages as x86 Metal does
Guest-visible: an app's newLibraryWithFunctionArray:error: now answers a
library of the visible and stitchable functions given, where the bundle
answered nil and MTLLibraryErrorUnsupported. Both x86 Macs make one (AMD 5300M
and Intel 630, macOS 26.7.1: oracle_bundle libforms). It is Metal's own library
over the functions' shadows, made ours over its bytes, as the bundle's links
and stitches are.

newLibraryWithMetalPackageURL:error: and newLibraryWithMPSGraphPackageURL:
name:error: now run Metal's own reading of the package, the base class's, and
make a library it answers ours over its bytes, as a source compile is. So a
refusal is Metal's own: both x86 Macs answer MTLLibraryErrorDomain 1 "Invalid
metal package" for a missing path and a .metallib, where the bundle answered
code 1 in its own words, and MTLLibraryErrorDomain 6 "failed to open MPSGraph
package", logging "Error: did not find file at url", where the bundle
answered code 1.
2026-11-05 21:59:34 -08:00
Anees Iqbal dba9e9ce00 🐛 Give a queue its process's slot where a surface's record is full
Each surface's shared block holds four writer slots and four reader slots,
shared by every process's queues. A queue that found none free left its
access unnamed (logged once): a later write of another queue did not wait
for its reads, nor a later read or a present for its writes.

Where a record has no slot left for a queue, the bundle now gives it a slot
of its own process's that names a buffer of another of its queues which the
buffer runs after on the GPU, its post's SURFACE_ORDER having named that
buffer at the slot's seqno or later: whatever names the slot from then on
runs after both, as it ran after each. A read that finds no reader slot is
named among the writers instead (its queue's writer slot, a free one, or
one taken so), which every later buffer that uses the surface names. Only a
slot of this process's is written, and one raised past what the post named
is kept.

What the guest observes: an access to a surface whose record is full of
slots of this process's other queues is ordered against later accesses of
other queues as one with a slot is, where it was not ordered before; a read
named among the writers is also waited for by a later read of another queue
and by a present of the surface, which is later than a Mac would and never
sooner. An access whose records hold every slot for other processes' queues
is still not named.

Tests: test_iosurface_full_records_take_this_process_s_slots fails before;
test_iosurface_slots_free_at_completion's fifth queue's read is now named
among the writers until it finishes.
2026-11-05 21:59:34 -08:00
Anees Iqbal df0a868146 🐎 Read binding counts constants set, and patch inputs, from AIR
Of the 29,273 entry points of macOS 27's frameworks' .metallibs on the M3 Max,
the AIR reader followed all but 710, and a function it does not follow takes
every texture whose usage has ShaderWrite as written. 709 bind an array_ref
of textures or buffers whose length is an expression of function constants (a
global variable in place of the count's integer, as for an index; Metal
Performance Shaders' kernels among them), and one is a post-tessellation
vertex function with a patch input (air.patch_input), a stage input of no
texture.

Such a count now reads as an argument of every index from its first
(anyCount), and a patch input as a binding of no texture: the reader follows
all 29,273. The guest sees no other answer: textures those kernels only read
or sample are no longer taken as written, which spares their surfaces'
write-backs.
2026-11-05 21:59:34 -08:00
Anees Iqbal 917f5e86db 🐛 Take a function's constants from its AIR where its metadata has none
A function of a library whose function list reads, but whose metadata names
no constants (no CNST tag, or one that does not read), resolved the values a
process set against no constants: every value set by name or by index was
dropped, and the host specialised the function with none, where Metal
resolves them against the constants the function's module declares.

What the guest sees now, for such a function: functionConstantsDictionary
answers the constants its AIR module declares (name, type, index, required),
values set by name and by index reach them, and a value of another type than
its constant's fails with MTLLibraryErrorCompileFailure, as for a function
with the tag. A function whose module declares none is unchanged, and so is
every function with a CNST tag. Apple's compiler writes the tag for every
function with constants (measured, previous commit), so this reaches only
metadata of other writers. The module is the one the library already reads
for the function's arguments, so no function costs a second read.
2026-11-05 21:59:34 -08:00
Anees Iqbal 29dd60bfb9 🆕 Read each module's function constants from its AIR
A .metallib names a function's constants in its public metadata (the CNST
tag), and the bundle had nothing else to read them from: a function whose
metadata names none took every value set for it as set for nothing.

Each module lists its constants in the named metadata air.function_constants:
the global the value is read from, the type's name, the constant's name and
its index. The AIR reader now reads them beside the arguments and signatures,
into RgfxAirFunction and RgfxAirVisible. A constant is required where its
global is unnamed_addr; one the function tests with
is_function_constant_defined has its address taken and is not. Measured over
the 46,563 functions of macOS 27's frameworks' .metallibs on the M3 Max: each
of the 6,615 with constants lists the same names, indices and types in its
module as in its CNST tag, the 25,275 unnamed_addr ones required and none of
the 7,108 others, and no function without a CNST tag declares any.

The reader's test compares every function of its library with its CNST tag,
over a new kernel of five constants (vectors, and one tested for) and a
visible function of one.
2026-11-05 21:59:34 -08:00
Anees Iqbal 378f0f6eb7 🐛 Answer a Managed texture's CPU copy as its virtualAddress
A Managed texture in no heap answered virtualAddress NULL. Both x86 Macs'
Managed and Shared textures answer a CPU address, the memory getBytes: reads, in
their GPU's tiled layout: a CPU write there is what getBytes: answers next
(oracle_bundle texmem: AMD 5300M and Intel 630, macOS 26.7.1).

What the guest sees now: a Managed texture answers its CPU copy's address, laid
out as RgfxManagedLayout lays it, where replaceRegion: writes and getBytes:
reads, so a CPU write there is what getBytes: answers next, as on both x86
Macs. Such a write reaches the GPU's copy only where the host's texture lies
over the copy itself (a one-level 2D texture of a linear format on a GPU that
shares the CPU's memory: one copy, the Intel's rule); elsewhere it does not, as
nothing tells the host (the AMD's two copies), and the GPU sees it at no later
call but a replaceRegion: of those texels, which overwrites them. A Managed
texture the host keeps in two copies on a GPU that shares the CPU's memory reads
getBytes: from its GPU copy, so it still answers NULL, as do Shared textures,
whose memory the device keeps nowhere the CPU reaches.
2026-11-05 21:59:34 -08:00
Anees Iqbal 814c527080 🐛 End the linear alignment query at every format x86 Metal ends it
minimumLinearTextureAlignmentForPixelFormat: answered 256 for every raw format
but the 105 of the SDK's that 3274b39d1 ended the process at. Both x86 Macs'
Metal (AMD 5300M and Intel 630, macOS 26.7.1, no validation layer; oracle_bundle
linalign over every raw value from 0 to 799 and 1000, 1023, 4096 and 65535)
answer 256 for 64 values alike, the SDK's 46 and 18 it has no name for (84, 85,
300 to 304, 313 to 315, 323 to 325, 556, 586, 587, 628, 629), and end the
process at all the others, with the compressed or depth words for those
formats and MTLPixelFormatInvalid for the rest.

What the guest sees now: the query answers 256 for those 64 values only, and
ends the process with Metal's words at every other: MTLPixelFormatInvalid (0),
the Y'CbCr formats, and values no format has among them, which answered 256
before. The bundle's own callers still ask the internal query, which ends
nothing.

Car 13's stack: resolved RgfxTexture.mm's rgfxEndAtUnalignableLinearFormat,
where c13-contract had moved the same lacked-format list into rgfxDeviceLacks
(kept for its other use): took this commit's answered-format list, which ends
at every lacked format too.
2026-11-05 21:59:33 -08:00
Anees Iqbal e828db91bc 🐎 Lay no-copy Managed buffers over the app's pages in place
A no-copy Managed buffer over writable app memory took a shadow: a range of
a slab as its CPU copy, synced with the app's memory at every commit that used
it and written back at every completion that might write it, and on a discrete
host a third copy, the platform's own Managed buffer, beside it.

Where the region has pages blocks it now lies over the app's own pages, as a
writable Shared one has since 2c09b2196: a BUFFER_OVER_PAGES whose buffer the
host makes Shared, so the memory is one copy on every host, as the Intel 630's
no-copy Managed buffer is (dgpu-oracle.md Q3; the AMD 5300M keeps two, and
Metal's contract for the mode allows either). The buffer still answers the
Managed options it was asked. Its didModifyRange:, and a blit's
synchronizeResource: or synchronizeTexture: of it or of a texture over it,
send the host nothing, as one copy has nothing to bring over.

What the guest sees: a GPU write to such a buffer shows in the app's memory as
the GPU makes it, not at its command buffer's completion, and a CPU write is
seen by the GPU's next read with no didModifyRange:, as on the Intel 630.
Read-only memory, and memory the kext or host makes no pages block of, keep
the shadow.
2026-11-05 21:59:33 -08:00
Anees Iqbal ff57919a66 🐛 Answer nil at block-compressed textures over a surface
A block-compressed format over a surface was sent to the host and answered
a texture. The host's runtime makes no texture of one over a surface's rows
(metal2vulkan's NotLinear), so every command buffer naming it failed.

The AMD 5300M and the Intel 630 make BC1 and BC7 textures there wherever
the rows fit, over a surface with planes or without, in Managed or Private
storage (oracle_surftex). The nil is the host's limit, not Metal's, and is
outside the x86 envelope; it is the better answer while the host makes
none, since the guest's frameworks can take a nil and go another way, where
a refused texture fails their work later. The host's gap is on the ledger.

What changes for the guest: the bundle answers nil at the call, before it
takes a view of the surface, and logs it once ("no texture (descriptor)").

Test: test_iosurface_nil_is_logged fails at the base, where nothing is logged
for the descriptor.
2026-11-05 21:59:33 -08:00
Anees Iqbal 9a6bbc65c1 🐛 End the process at surface textures the x86 Macs end it at
newTextureWithDescriptor:iosurface:plane: sent every descriptor to the host,
posted and not waited for, and answered a texture. The host's runtime refuses
most of what Metal's validation stops, so the guest held a texture whose every
command buffer failed later.

oracle_surftex measured what Metal does instead on the AMD 5300M and the
Intel 630 under macOS 26.7.1: it ends the process, alike on both, in three
steps. The descriptor's validation, over every surface, stops a zero width or
height, a format the device lacks, a depth, array length or sample count
above 1 that the type does not allow, a multisample texture of one sample or
in Shared or Managed storage, Memoryless storage, and a 4:2:2 format of an
odd width. Over a surface without planes it then stops a type other than 2D
or TextureBuffer, a depth other than 1, more than one level, rows of a format
of one texel a block wider than the surface's, and depth or stencil formats;
then a plane past 0, a compressed format's rows in blocks wider than the
surface's, and more rows than the surface has. A plane of a planar surface
takes everything past the first step.

The x86 Macs also end at every two-plane Y'CbCr texture ("invalid
pixelFormat (500)."), which the lane makes as the M3 Max does (Q13). A render
target of one of 4:2:0 or 4:2:2 chroma at an odd width or height is the
exception: neither the M3 (which answers nil) nor the host makes it, so it
takes the x86 Macs' answer.

What changes for the guest: the device's creator now ends the process at
each of these with the x86 Macs' words, sending nothing, as the bundle's
other texture creators do. A plane past a planar surface's planes stays nil,
as on both.

Test: test_invalid_surface_textures_end_the_process (65 cases, each death in
a process of its own) fails at the base, where surface-width-0 goes on.
2026-11-05 21:59:33 -08:00
Anees Iqbal 0f9108bdfa 🐛 End the process at Shared heaps and CPU depth textures, as x86 Macs
Guest-visible: an app's newHeapWithDescriptor: with Shared storage now ends
the process with Metal's words ("Heap Descriptor Validation\nShared storage
mode disallowed"), where the bundle made a heap over host memory; and a depth,
stencil or depth-stencil texture in Shared or Managed storage, from the
device's, a heap's or a buffer's texture creators, ends it with Metal's
"Depth, Stencil, DepthStencil textures cannot be allocated with
MTLStorageModeShared or MTLStorageModeManaged on this device.", where the
bundle made one. Neither sends the host anything.

The x86 lane imitates an x86 Mac's GPU, and both oracles, the AMD 5300M and
the Intel 630 under macOS 26.7.1, end the process there: at a Shared heap
(oracle_bundle heapbuffers), at a Depth32Float texture in Shared storage over
a buffer (buftex.depth), and at the device's Depth32Float in Shared or Managed
storage and Stencil8 in Managed (devtex.*), making the Private one. The M3 Max
makes the heap and the texture over a buffer, but is no oracle of this lane.
The heap's region argument is now unused.
2026-11-05 21:59:33 -08:00
Anees Iqbal e98027224c ✅ Fit the library type test's five libraries in its ring
test_library_type_and_install_name posts five libraries, two of the stitchable
test library's 12 KiB and three of the compiled dynamic library, through the
fixture's default 32 KiB control ring, which nothing drains in the test: the
last create answered nil. Its fixture now takes a 256 KiB ring.
2026-11-05 21:59:33 -08:00
Anees Iqbal 52a4648bfb ✅ Die at an exported function of a library the reader reads
The exported-function death test compiled a dynamic library on the Mac and
named its first function, which needs the bundle's reader to read that
library's function list. It now makes its library in metallibOf's layout,
one function of TYPE 3, so the death it checks does not hang on what the Mac's
compiler writes. The type and install-name checks keep the compiled library.
2026-11-05 21:59:33 -08:00
Anees Iqbal f6dcf1f8f2 ✅ Fit the shadow and patch tests' libraries in their rings
test_unread_function_list_answers_from_shadow posts the AIR test library
(228 KiB) and test_function_patch_answers the patch library, 44 KiB since
74e5868b8 added a mesh, an object and an intersection function, through a
control ring of the fixture's default 32 KiB, which a library create must fit:
each create answered nil. Their fixtures now take rings their libraries fit.
2026-11-05 21:59:33 -08:00
Anees Iqbal a21d0d7f46 ✅ Give the linked-function test's visible entry TYPE 4
test_linked_function_specialised_on_the_wire wrote its visible function's
metallib entry as TYPE 3, which the bundle read as Visible until 47a241699. TYPE
3 is a dynamic library's exported function, which the bundle now ends the
process at as both x86 Macs do; Apple's compiler writes a visible function as
TYPE 4 (oracle_bundle functypes).
2026-11-05 21:59:33 -08:00
Anees Iqbal edf0d5e4b8 ✅ Keep the events with options alive in their test
test_event_routing let each event made with options go before the next was
made, so its destroy came between the creates the test reads. The register now
lists newEventWithOptions: and newSharedEventWithOptions: as implemented, as
83b9a8031 answers every options value Metal's x86 Macs answer, and
protocol_members_tests fails a 'partial' member with no RGFX_UNSUPPORTED.
2026-11-05 21:59:33 -08:00
Anees Iqbal 61e1316eac 🐛 End the process at a dynamic library's exported function
A guest app that makes a function of a dynamic library's exported function
(TYPE 3 in the metallib's function list, which no MTLFunctionType names) now
dies there with Metal's words, "validateMTLFunctionType: failed assertion
`type is not a valid MTLFunctionType.'", where the bundle answered a function
of type Visible. Both x86 Macs' Metal ends the process at newFunctionWithName:
for it (AMD 5300M and Intel 630, macOS 26.7.1; oracle_bundle functypes.dyn).
2026-11-05 21:59:33 -08:00
Anees Iqbal daa32a7533 🐛 Fail a function's archive miss as x86 Metal does
A guest app's newFunctionWithDescriptor: with
MTLFunctionOptionFailOnBinaryArchiveMiss and binary archives named now answers
nil and Metal's error where both x86 Macs do (AMD 5300M and Intel 630, macOS
26.7.1; oracle_bundle failmiss and failmiss2), where the bundle made every
function before:
- a kernel no named archive holds by its name and constants' values, added
  either way: MTLLibraryErrorFunctionNotFound, "Failed to find specialized
  function "NAME" in binary archive";
- a visible function asked with MTLFunctionOptionCompileToBinary too that was
  not added with it: MTLLibraryErrorCompileFailure, "Compilation failed:
  \n\nFailed to find compiled function in binary archives.".
Every other function is made, as on both Macs: one asked without failing on a
miss or naming no archive, a visible function asked without
CompileToBinary, and vertex and fragment functions.

An archive keeps a visible function added with CompileToBinary under a key of
its own, so a function added either way keeps its earlier key, and the add
makes the function without looking it up in the archives its descriptor names.
2026-11-05 21:59:33 -08:00
Anees Iqbal 2f40b261fd 🐛 Answer a library's type and install name as x86 Metal does
A guest app now sees a dynamic library's metallib (header file type 2),
loaded as a plain library from a URL or from data, answer MTLLibraryType
Dynamic and the install name its bytes hold, where the bundle answered
Executable and nil for every library. An executable library now answers the
last part of the URL it was made from as its install name, or
default.metallib for one made from data or source, where it answered nil.

Both x86 Macs answer so (AMD 5300M and Intel 630, macOS 26.7.1; oracle_bundle
libtype and functypes). The dynamic library's install name comes from its
shadow, Metal's own library over the same bytes.
2026-11-05 21:59:33 -08:00
Anees Iqbal b5fb12efe9 🐛 Answer Private and no-copy buffers' allocatedSize in whole pages
A guest app now sees allocatedSize in whole 4 KiB pages for a Private buffer
(its length rounded up, 4096 for 1 byte) and for a no-copy buffer (the pages
its bytes meet, 0x15000 for 0x14000 bytes 0x123 into a page), where the
bundle answered their length before. Both x86 Macs answer so (AMD 5300M and
Intel 630, macOS 26.7.1; oracle_bundle buffers in every storage mode, and
nocopy.* with 8192 for 4096 bytes 16 into a page), as the bundle's Shared and
Managed device buffers already did through their slab ranges.
2026-11-05 21:59:33 -08:00
Anees Iqbal fbed614c20 🐛 End the process at the texture views x86 Metal ends it at
A guest app now dies, with Metal's words, at a texture view Metal's own
validation ends the process at on both x86 Macs (AMD 5300M and Intel 630,
macOS 26.7.1, no validation layer; oracle_bundle view.*), where the bundle
answered nil before: a view in no format (MTLPixelFormatInvalid), in a format
of one texel a block of other bytes than the texture's (RGBA16Float in
RGBA8Unorm), at levels or slices past the texture's, of a type of another
family (a 2D texture as 3D), and as a cube of a slice count not a multiple of
six. The words are _mtlValidateArgumentsForTextureViewOnDevice's "Texture
Creation" lines, measured alike on both GPUs.

The M3 Max under macOS 27.0.1 ends the process at the same views but answers
nil for one in no format; the x86 lane follows the x86 Macs. Views no oracle
measured (empty ranges, a 2D view of two slices, compressed formats) keep their
nil answer. The type rule follows rgfxViewFamily's families, measured on the
M3, so a 3D texture viewed as 2D dies as the 2D texture viewed as 3D does.
2026-11-05 21:59:32 -08:00