What the guest observes changes. Before, where the host's video landing found
no blit encoder for its copy of a picture's staged planes into the output's
device caches, the copy was skipped and the picture counted as landed: its
value was signalled and the command buffer waiting for it completed as for any
landed picture, so a reader was handed the caches' earlier bytes, a new
output's zeros, as the picture, with no error to the guest. 7ca9d53fa4 made
that skip; this puts back the failure it replaced.
Now the copy answers an error, as an encode's copy out of the caches already
does: the landing fails through the path of any picture that did not land.
The planes owed zeros are cleared, the command buffer that waits for the
picture completes failed (Metal's internal error, which the guest's video
driver answers as a decode error), and it counts as a failure to land. The
warn line now says the picture does not land; the library's logger keeps it to
the process's first, the rest at debug, counted, as the docs say.
On metal2vulkan-runtime the case is not reached today: it refuses a blit
encoder only on a committed command buffer or one with another encoder open,
and this one is made the line before. The test changes with the behaviour:
a_copy_into_caches_the_platform_makes_no_blit_encoder_for_fails_the_landing
replaces ..._is_skipped.
A device loss's lines called a command buffer of the host's own just that,
with its encoders' kinds: no blit operand was recorded and no host image named,
so a report (issue 173, an RX 6600 XT whose lost command buffer was a host blit
or render at the display's start, its fault address in no rt range) could not
tell a window swapchain's image from an image of rt's own.
Objects now carry a role beside their guest id: the platform names a window
swapchain's image, and the host names the scanout's import, a presented
surface's texture and the display's view of it, the display colour's table and
ramps, the cursor's glyph, the overlay's image and a host read's target. In a
command buffer of the host's own, each encoder names its operands: a blit what
its copies read and what its copies, fills and mipmap generations write; a
render encoder the textures it binds. The list of command buffers in flight
says, for each of the host's own, what each encoder renders into, binds, reads
and writes, by role or guest id ("render into colour 0 a window's swapchain
image, blit from the scanout's import into a window's swapchain image"); the
oldest's attachments and lists name roles where there is no guest id; and the
line of a host command buffer lost in flight names its encoders the same way.
A window swapchain's clear at its retire, committed on rt outside the
platform's command buffers, is now on that list from before its commit until
its wait returns, named as such. It holds no index given back: the commit order
the platform's own indices wait on passes over it, as before it was listed.
Diagnostics only: nothing the guest or the C API sees changes, and nothing is
committed differently or at another time.
The boot diagnostics' gaps and refusals lines count rt's refusals by kind
alone, and each kind's first line names one function, so a log of 500
PartialThreadgroups refusals named one kernel of them and left the rest
unnamed. A fix built on that kernel's cause could leave others refused,
and the next log would again name one kernel a kind.
The refusal-keys line, written at exit beside those two, counts each
refusal they count by its kind, the functions its site names (each by its
role, its library's hash and its index, never its name), and, of a
PartialThreadgroups, its grid and threadgroup, of a StorageElement, its
slot, pixel format, case and backing. It names the 64 keys of the most
refusals and the rest in one tail, keeps at most 4096 keys, is counted on
the refusal's path alone, and is not written without a refusal. A
diagnostic: nothing the guest observes changes.
A compute encoder's setImageblockWidth:height: now reaches rt
(ComputeCommandEncoder::set_imageblock_size). A kernel with an explicit
imageblock runs each dispatch, direct or indirect, at the size the guest set
last on its encoder, and at 1 by 1 before the encoder sets one, as Metal does.
Before this the encoder dropped the size, and every such dispatch ran at 1 by 1
whatever the guest set: the kernel's get_width and get_height answered 1, and
its threads past the first cell reached past the imageblock.
A size rt refuses, a width or a height that is not a power of two (0 included)
or more than 1024 cells (Refusal::ImageblockSize), is counted as Metal's
refusal, rt-refused-metal, by the basis rt declares for it: Metal's validation
layer stops each such size at the call (measured on the M3 Max by
metal2vulkan's probe). The encoder's later dispatches run at the size set
before it. What Metal runs after such a size without its validation layer is
not measured. A size past 32 bits is Metal's refusal too, as the encoder's
other values past rt's 32 bits are.
The dispatch pre-pass reads the encoder's size beside its threadgroup memory
lengths and hands it to the compute state's make ahead and key: the platform's
ComputePipeline::prepare_dispatch and dispatch_variant take it now, and pass it
to rt's in place of the [1, 1] the pin commit passed. So the first dispatch at
a new size finds its pipeline made, as at a new threadgroup memory length.
Indirect command buffers run no kernel on rt (their records are draws, and a
compute encoder's execution of one is Metal's refusal), so no such path takes
a size.
Tests: mutdec_imageblock's extent at sizes set, refused and unset, direct and
indirect, on the GPU; rt's keys of an imageblock kernel's dispatches by size,
and one key whatever the size for a kernel with none; and the pre-pass's makes
ahead at each encoder's size. The kernel's metallib is in tests/shaders.
Moves the runtime to metal2vulkan development f8181e2a6c. SEMANTICS moves from
2280 to 2286, so every host translates its guests' shaders again once;
ARTIFACT stays 592 and RUNTIME 2550.
What changes for the guest at this pin:
- A sampler bound with LOD clamps of its own (setSamplerState:lodMinClamp:
lodMaxClamp:atIndex: and its vertex, fragment and range forms) samples with
the bind's clamps, as Metal does, where rt refused the bind (Gap::LodClamps).
Past 4,000 live clamp variants a bind is rt's Limit::LodClampVariants.
- A vertex function's slice and viewport index are stored as it writes them,
and as 0 where it never writes them; rt refused such a function where it
could not show the index the same at a primitive's vertices, or where the
function never wrote it.
- A storage cube or cube array written or read by face translates.
- MSL 3.2 program-scope buffer bindings translate; other program-scope shapes
are refused under their own features (Feature::ProgramScopeBinding is gone).
- A thread's array of buffer pointers indexed at run time translates in two
more shapes.
- An argument buffer's command-buffer word is plain data, and a render state
whose functions may reach indirect command buffers is made.
- A kernel with an explicit imageblock dispatches, where rt refused the
dispatch; it runs at 1 by 1 for now, since the compute encoder still gives rt
no setImageblockWidth:height: size. The next commit passes the guest's size.
For the host: a kernel keeps its first 8 pipeline variants and the 56 last
dispatched, so rt's memory for one kernel's variants is bounded, and
threadgroup memory lengths round up to 16 bytes in its keys.
The two calls into rt that changed take the imageblock size as a fourth
argument: the compute state's make ahead (prepare_dispatch) and key
(dispatch_variant), each passed [1, 1], Metal's size for an encoder that sets
none. The accuracy ledger's imageblock row and the compute encoder's docs say
what the guest sees at this pin.
The Vulkan platform made no function handle or visible function table
(rt-unbuilt-function-table): each create answered nil. rt now makes them, so
the platform carries them on rt:
- a compute pipeline state's handle of each function its kernel links (rt's
function_handle), and none, Metal's nil, of any other function;
- visible function tables (rt's new_visible_function_table): gpuResourceID is
rt's device address of the table's words, which the guest writes into an
argument buffer itself; allocatedSize is those words in 4 KiB pages, as the
Macs answer for small tables; resourceOptions is Shared, tracked (512);
- sets of one entry or many, a nil entry calling nothing; a set past the table
is rt's refusal (Refusal::FunctionTableIndex, counted rt-refused-ours), and
sets none of the entries;
- the compute encoder's bind of a table at a buffer index or a range of them,
a nil table unbinding its slot.
A kernel that reads a table through an argument buffer stays rt's translation
refusal (rt-refused-translation), and render stages take no tables.
The device still answers supportsFunctionPointers NO, so the guest makes
none of these yet; the next commit takes rt's answer. Unbuilt::FunctionTable
and its code go. The rt platform's tests make tables, set and bind them, run
a kernel calling through them (nil entries, an unbinding, a set after the
encode) and refuse sets past the table; the decoder's test makes the guest's
handles and tables.
rt makes no texture over a buffer but a 2D texture of one level, sample and
slice, or a texture buffer, and refuses any other shape there as its gap
(TextureOverBuffer). The Vulkan platform's linear entry
(newLinearTextureWithDescriptor:offset:bytesPerRow:bytesPerImage:) still asked
rt for those shapes, so each one-level Managed 2D array on unified memory
counted an rt-refused-gap before the decoder fell back to a texture of its
own: four in an x86 guest's browser WebGL page, one in the GL cases on RADV
and on ANV.
The platform now answers nil for those shapes without asking rt, and counts
nothing. The guest sees nothing new: the answer is the nil rt's refusal gave,
the decoder falls back to the same texture of its own beside the CPU copy
(logged once, as before), and a guest's LINEAR_TEXTURE_FROM_BUFFER of such a
shape is refused as before. The walks' counts lose the TextureOverBuffer
refusal.
on_vulkan_a_managed_2d_array_shows_its_cpu_copy now holds that the array is a
copy of its own and that no rt-refused-gap is counted, and a new Vulkan-crate
test holds the platform's answers: a 2D texture of one level made, a 2D array
and a 2D texture of two levels nil, with no refusal counted.
Moves the runtime pin from 75c3e49bd6 to a8c1acc9a1, on metal2vulkan's
development, in a commit of its own: 25 commits. The translator's semantics
version moves 2276 -> 2277 and its artifact format 591 -> 592, so each host
makes its cached translations again once.
For the guest:
- An upload into a Depth32Float texture, or into Depth32Float_Stencil8's depth
(replaceRegion:, a Managed texture's upload, a blit copy from a buffer), is
now the device's copy into the depth aspect, where it was refused before. A
GL shadow-map compare over such a texture read 0 where 0.5 was uploaded, on
every card, since the move to the runtime. Within [0, 1] a value is kept
exactly, except that a device may store a denormal or -0.0 as +0.0. Outside
[0, 1] it is the device's: RADV and ANV clamp it, NVIDIA keeps it, and Metal
keeps it. The accuracy ledger has the row.
- A threadgroup load, store or atomic at a constant offset outside the arena
(undefined in Metal too) is a zero load, no store, or an atomic that writes
nothing and returns zero. 18 functions in 4 libraries that failed to
translate now translate.
- Compute function pointers are built in the runtime. The device does not
answer them yet, so no guest reaches that path.
For the host: the runtime's Gap::FloatDepthUpload is gone. Nothing of ours
named it except the blit module's doc, which now says what the copy does.
A compute pipeline whose kernel reads its imageblock's size is refused by
the runtime at its create (KernelInput, ImageblockSize), where Metal makes
the state. arm64 guests on macOS 15, 26 and 27 meet it once at login, and
the ledger of what rt refuses did not list it.
rt at 2953064a1c has setStageInRegionWithIndirectBuffer:indirectBufferOffset:
as a call of its own, set_stage_in_region_with_indirect_buffer, which refuses
it as Gap::StageIn of kind IndirectRegion. The compute encoder sent the
command nowhere and counted it under rt-unbuilt-compute-command, as a form rt
had none of. It now makes rt's call and counts rt's refusal as every rt
refusal is counted: rt-refused-gap on the counts line, and
StageIn-IndirectRegion as a key of its own on the boot diagnostics' gaps line
(reims-vgpu: rt-diag gaps:, written beside every counts line), the name its
first refusal's line carries too. diag's refusal_name now names each
stage-in form StageIn-<kind>, so the two forms rt refuses as a compute state
is made, DynamicStride and IndexedStepRate, show by their form as well, where
before all three showed as StageIn.
For the guest: nothing changes. The command encoded nothing before and
encodes nothing now, and the encoder's stage-in region stays the one set
before it, or none. For the host: each such call counts one
rt-refused-gap in place of one rt-unbuilt-compute-command, and the stage-in
gaps show by their form on the rt-diag gaps line.
The compute encoder's test held the old count: it now expects
rt-unbuilt-compute-command at +1 (the indirect dispatchThreads alone),
rt-refused-gap at +1 and StageIn-IndirectRegion at +1. refusals_count_by_kind
checks each form's name and that each counts apart.
The compute module's doc of attribute strides said a kernel's [[stage_in]]
read through a layout of MTLBufferLayoutStrideDynamic takes the encoder's
stride and is refused. rt at 2953064a1c refuses only an attribute the kernel
reads with a thread-position step through such a layout (a constant step
reads no stride, and its state is made), and the doc now says so. The
ledger's rt-unbuilt-compute-command row drops the stage-in region, and its
gaps paragraph lists the three stage-in forms by their names.
The rt platform's state finishes, ComputePipeline::finish and
RenderPipeline::finish, now call rt's finish_pipeline: the driver's create of
the state's main pipelines, which rt's creators leave out since 951285e7a7, runs
on the device's compile thread after the create's reply and before its store.
For the guest: a pipeline create's reply no longer waits for the driver's
create of its main pipeline, as it did before the pin move; the store, and the
command buffers, indirect command buffer writes and function handle and table
creates that name the pipeline, still do, so its first draw or dispatch no
longer makes that pipeline on its queue's lane, as it did with the pin move
alone. Every answer the reply carries is made before the driver's create, so
nothing the guest reads changes beside timing. A finish rt fails is the create's
late failure, pipeline-finish-failed, as before: the pipeline is stored as made,
and a draw or dispatch that needs it makes it again, refused at its encode where
that make fails too; the accuracy ledger lists it.
A create whose destroy, context close or reset came before its finish began is
no longer finished: its pipeline is never stored, so the driver's create would
be wasted. A finish already running still ends. A keyed create skipped so keeps
its answer as its make answered it.
The counts line gains rt's new metrics: rt-finished-pipelines and
rt-finished-pipeline-ns, rt-first-use-unfinished-waits and
rt-first-use-unfinished-wait-ns, and rt-first-use-unfinished-wait-max-ns at its
highest over the process's devices. The ten-second rt summary says the finishes
and the unfinished waits, and the trace's rtmetrics event ends with the five
values. rt's failed_finishes is not folded: the device's pipeline-finish-failed
counts each failure at the platform's seam, where every platform's finish
answers (a raise or death in the platform's refusal scope too, which rt never
sees) and where the failure's guest-visible effect is decided, so the line
carries each failure once.
docs/conventions.md's stall rule names the reply ahead of the driver's create as
its second exception, and compile.rs's Order, the design doc and the rt
platform's pipeline docs say what the finish now does.
rt's pass keeps no sample positions and renders at Vulkan's standard
locations, which are Metal's default positions of 1, 2 and 4 samples
(measured on the M3 Max, macOS 27, guest/bundle/tools/samplepos_probe.m).
setSamplePositions:count: still counted any non-empty set under
rt-unbuilt-render-pass, so a set equal to Metal's defaults, which renders as
Metal's does, counted as a degradation, and the first line said neither the
count nor the positions: two arm64 GL walks met it four times each with no way
to tell whether any picture was wrong.
Now a set equal to Metal's defaults of its count counts and writes nothing.
A set that differs, and a set of any other count (8 or more), whose defaults
nothing measured, is counted as before, and the piece's first line, where such
a set writes it, ends with the set's count and each (x, y), each coordinate in
the shortest form that reads back as its f32. The unbuilt module's refuse
gains refuse_with, whose first line takes the same ": what" tail as rt's
refusal detail lines, rather than a second line format.
Diagnostics only: no answer, result or value the guest sees changes. Docs:
descriptor.rs's module and set_sample_positions docs, the unbuilt module's,
and the accuracy ledger's rt-unbuilt-render-pass row.
rt at d7bf09eb05 resolves into a texture in place over a buffer whose linear
image takes no attachment usage through a resolve image and one copy a pass,
so the ledger now names the resolves that stay refused (Gap::RenderPass,
ResolveUsage), the pass skipped whole: a depth or stencil texture, a colour
texture of another type or of a format the optimal image does not render, a
texture over a dma-buf's import, and a view of another pixel format of a
texture in place whose linear image takes no attachment usage. The resolve
image's copy goes beside it as a static note, with its counts: a copy Metal
does not make, not a value difference.
The device answered Metal's M3 Max values for vertex amplification:
maxVertexAmplificationCount 2, and supportsVertexAmplificationCount: YES for
2. rt draws one view. It refuses a render pipeline whose maximum amplification
count is above one (rt-refused-gap), and it encodes nothing for an encoder's
amplification count of more than one view mapping. So a guest that asked
first was told yes and then got a nil pipeline with an NSError.
What changes for the guest: maxVertexAmplificationCount answers 1, and
supportsVertexAmplificationCount: answers NO above 1 (YES for 0 and 1). The
bundle takes both from the host's answers (the device info's
max_vertex_amplification_count, and the identity's
largest_vertex_amplification_count, which follows it), so only the host's
constant changes. A guest that asks before it makes an amplified pipeline now
takes its single-view path, as on a device that amplifies nothing. No test held
the old answer; a new one pins this answer, and the accuracy ledger notes it
beside rt's gaps.
Moves the runtime pin from 8ca94bca19 to 03a7e267ff, on metal2vulkan's
development, for heavy kernels that need less driver memory to compile and
the indirect offset refusal split by its basis.
For the guest:
- A variable a loop carries that no later trip reads is ended at each trip's
top, so the driver carries nothing for it: heavy kernels compile in less
memory and time (metal2vulkan's clean cold creates: a heavy kernel on a
Radeon 780M 10,269 -> 7,773 MiB and 73.5 -> 56.0 s, one on an RTX 3090
1,770 -> 1,376 MiB, one on an Iris Xe 444 -> 411 MiB). What they compute
is unchanged.
- An indirect draw or dispatch at an offset off a multiple of 4 is Metal's
documented refusal (Refusal::IndirectOffset), counted as Metal's; one that
leaves the buffer fewer bytes than its arguments is rt's own
(Refusal::IndirectArgumentsPastEnd), counted rt-refused-ours. Each still
draws or dispatches nothing; indirect_draws_on_vulkan's counts move one
from ours to Metal's for each pair.
- rt's floor takes maintenance4 (core in Vulkan 1.3): a device without it is
refused at creation.
For the host: the translator's SEMANTICS goes 2263 -> 2264, so a first boot
translates its kernels again; the pipeline cache's blob is kept.
The basis commit's list of the counts that move from rt-refused-metal to
rt-refused-ours missed one test, which its GPU run on a Radeon 780M failed:
- states_on_vulkan: a sampler state the guest places at an index it did not
reserve (Refusal::IndicesNotGranted, whose basis metal2vulkan-runtime's
error/basis.rs marks Ours), 1; its Metal's refusals go from 2 to 1, the
address mode rt has no value of.
The test now checks each count after its own refusal, and the module doc and
the accuracy ledger name the refusal among rt's own. Nothing changes for the
guest: the kind feeds only the host's counts and log.
metal2vulkan-runtime now declares where each refusal's rule comes from
(Error::basis): Metal's, documented or measured, or rt's own. The degradation
counts put every Error::Refused under rt-refused-metal but one,
TextureBufferNotOverBuffer, under rt-refused-ours, so a walk's counts mixed
Metal's refusals with rt's own rules.
RtRefusal::of now takes the kind from the refusal's basis (of_basis): rt's own
under rt-refused-ours, Metal's under rt-refused-metal. The device's basis,
which no refusal declares at the pin, and any later one stay under
rt-refused-metal, where they counted before. A heap texture's place that
Metal's own rule refuses too stays Metal's; one Metal places keeps its own
code, its kind now rt's own. rt's limits and gaps, and the loader and
below-floor codes, keep their own codes. A test pins each basis arm.
What moves from rt-refused-metal to rt-refused-ours, by the tests that held
it as Metal's:
- indirect_draws_on_vulkan: an indirect argument offset off a multiple of 4,
or without the arguments' bytes after it (Refusal::IndirectOffset), 2.
- a_layered_pass_renders_each_slice_on_vulkan: a layered pass's slices past
its texture's last (Refusal::AttachmentPlace), 1.
- compute_encoders_on_vulkan: a buffer offset set on an empty slot
(Refusal::NoBufferAtIndex), 1; its Metal's refusals go from 8 to 7.
- command_buffers_on_vulkan: waitUntilCompleted in a scheduled handler
(Refusal::InScheduledHandler), 1.
- shared_events_on_vulkan: waitUntilSignaledValue: in a notification on rt's
thread (Refusal::WaitOnOwnThread), 1.
- buffers_on_vulkan: a Managed buffer's didModifyRange: past its end
(Refusal::ModifiedRange), 1; its Metal's refusals go from 4 to 3.
Every other refusal of rt's whose basis is its own moves too (the variants
metal2vulkan-runtime's error/basis.rs marks Ours).
Nothing changes for the guest: the kind feeds only the counts, the stderr
lines, and the text of an NSError or a raise's detail, which reach the host's
log alone.
The accuracy ledger said rt-unbuilt-icb counts indirect command buffers
themselves, answered nil. Since 16eee4db90 rt makes them, of GPU-encoded indexed
draws, and executes and resets them on the GPU. The code now counts only the
pieces rt has no form of at 0429ff1bd4: commands the CPU encodes, a CPU
resetWithRange:, a blit copy between buffers, a descriptor of a resource index,
and the type-5 index reservation (rt_platform/icb.rs, device.rs). The row now
names those.
Re-read at 0429ff1bd4 by lane unbuiltsweep: every other Unbuilt piece is one
rt still lacks, so nothing else moves to rt.
rt makes a texture buffer (a VkBufferView) only over a buffer its consumer
places, through Buffer::new_texture, and refuses one its device places
(Refusal::TextureBufferNotOverBuffer, a rule of rt's own), so a guest's
newTextureWithDescriptor: of MTLTextureTypeTextureBuffer was nil, counted
under rt-refused-ours.
The device now composes Metal's call from two of rt's: a buffer of the
texture's bytes, its row of width texels rounded up to rt's texture-buffer
alignment of the format, of the descriptor's resource options and so its
storage mode; then the texture over it from offset 0, rows that rounded row
apart, at the index the device's make would give it (the guest's, where it
places one). The texture holds the buffer, which goes with the texture and
its views. The buffer takes no object ID, GPU address or resource index the
guest sees and shifts no numbering: the decoder names only the texture, rt
gives a buffer no resource index, and the buffer lies at rt's own address. A
recording keeps the device's call, which plays back through the same make.
What the guest sees: such a texture buffer is made, of the descriptor's
storage mode, where it was nil. One of a format rt makes no texture buffer of
is still nil, now counted under that format's code. A heap's texture buffer
is still rt's own refusal, nil, which rt-refused-ours keeps counting.
The five decoder tests that started from the refused texture buffer now
start from the made one, the guest's texture ids kept as a graphics device
keeps them; what they pin about the host's ranges covers its buffer. A test
on the GPU checks the composition, Shared and Private, and a refused format.
The pin moves from 5a04298008 to 5ccd158e6d, metal2vulkan's development.
For the guest:
- Every compute pipeline a command buffer binds now goes through one bind
that binds rt's descriptor set 1 first (rt 70dfe08320). The guest's
dispatches after rt's own count kernel of an
executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: over a
range the GPU writes found that set unbound, which lost the device in
the rendering sample's indirect path on the RTX 3090 and the RX 7900 XTX.
- Texture buffers are made: a texture buffer over a buffer
(newTextureWithDescriptor:offset:bytesPerRow: of a buffer) reads and
writes the buffer's bytes through a Vulkan buffer view (rt 817463704e).
Before, it was rt's gap (rt-refused-gap). rt refuses an offset off the
device's texture-buffer alignment (TextureBufferAlignment) and rows or
texels that do not fit the buffer (BufferTextureLayout), counted under
rt-refused-metal. A blit copy to or from a texture buffer is rt's gap
(Gap::TextureCopy).
- A texture buffer the device places (newTextureWithDescriptor: of
MTLTextureTypeTextureBuffer on the device) is rt's own refusal, not
Metal's (TextureBufferNotOverBuffer: rt makes a texture buffer only over
a buffer its consumer places, and the host places none for it yet): nil,
counted under a new code for rt's own refusals, rt-refused-ours, apart
from rt-refused-metal.
- A copy between textures whose bytes share memory is cut into ordered
slabs; where rt cannot cut it so, it is rt's gap (Gap::OverlappingCopy),
and nothing is encoded.
- rt's floor adds six texel-buffer features of Vulkan 1.2 (uniform and
storage texel buffers: update-after-bind, dynamic and non-uniform array
indexing) and counts texel-buffer arrays against the descriptor limits.
- SEMANTICS_VERSION 2257 -> 2258: the translation caches are made again,
so the first boot after this pin is cold.
The pin-range tests' texture buffer, a device-placed one, was rt's gap and
is now rt's TextureBufferNotOverBuffer, counted under rt-refused-ours
(RtRefusal::Ours); decoder_with_a_texture_buffer checks that, and
docs/accuracy-ledger.md names the code, the refusal and the two gaps. No
lock change: metal2vulkan's manifests did not change.
setVisibilityResultMode:offset: of Boolean or Counting and
setAlphaTestReferenceValue: were counted rt-unbuilt-render-command, though rt
has both calls at the pinned 8a36a49453. They now reach rt: Boolean and
Counting are rt's gap (Draw-VisibilityResults), counted rt-refused-gap, and the
reference is kept for rt's private alpha test, which no state of ours has.
Nothing the guest observes changes: the draws after an enabled mode still
write no result, and no draw reads the reference. Only the counts move. A
mode no Metal enumeration has is now Metal's refusal.
A line width other than 1 stays unbuilt, and the docs now say why: rt keeps
the width but refuses every draw of lines under it, which would draw lines
not at all where they draw 1 pixel wide now.
render_encoders_on_vulkan and the sub-encoders' counting-mode test count
rt-refused-gap where they counted rt-unbuilt-render-command.
Copies between a buffer and a texture with a blit option were counted
rt-unbuilt-blit and copied nothing. rt copies one aspect of a depth and
stencil format at the pinned 8a36a49453 (copy_from_buffer_with_options,
copy_from_texture_to_buffer_with_options), so the two plane options go there.
For the guest: a copy of MTLBlitOptionDepthFromDepthStencil or
MTLBlitOptionStencilFromDepthStencil now moves that plane, 4 bytes a texel of
Depth32Float_Stencil8's depth and 1 of a stencil. rt refuses a copy into a
32-bit float depth, and a plane option of a format without the plane, each
counted rt-refused-gap. PVRTC rows, more than one option, and copies between
textures with options stay unbuilt.
plane_copies_on_vulkan clears both planes in a pass and reads each back,
then writes a stencil and reads it back.
A render pass of renderTargetArrayLength 2 or more was counted
rt-unbuilt-render-pass and rendered its attachments' own slice alone: its load
and store actions reached no other slice. rt's pass takes the length at the
pinned 8a36a49453 (render_target_array_length), so the descriptor now keeps it
and hands it to rt.
For the guest: such a pass loads, stores and resolves that many slices of each
attachment from its own slice, and, as rt documents, a vertex function's
[[render_target_array_index]] picks the slice it draws into. An attachment
with fewer slices than the length is rt's refusal, the encoder nil and counted
rt-refused-metal; a length past the device's layers is rt's gap.
a_layered_pass_renders_each_slice_on_vulkan checks both slices' texels; the
descriptor test no longer counts the length unbuilt.
The Vulkan platform answered drawPrimitives:indirectBuffer:, the indexed
indirect draw and the indirect patch draw as unbuilt: each encoded nothing and
counted rt-unbuilt-render-command, so the guest's indirect draws drew nothing.
metal2vulkan's runtime builds them at the pinned 8a36a49453 (aed460e0da): each
is one vkCmdDraw*Indirect that reads the guest's MTLDraw*IndirectArguments
from its buffer as the draw runs.
For the guest: indirect draws of primitives, indexed primitives and patches
now draw what their arguments say. An offset rt refuses (off a multiple of 4,
or without the arguments' bytes after it) is counted rt-refused-metal, and a
patch index buffer rt-refused-gap, as the direct patch draw's is. Indexed
patch draws stay unbuilt: rt refuses every state of a control point index
type.
indirect_draws_on_vulkan fills the arguments buffer and checks the pixels;
render_encoders_on_vulkan no longer counts an indirect draw unbuilt.
A lost device's line named the Vulkan call that met the loss and nothing of
the fault behind it, so a loss on the host left no trace of what the GPU read
or ran when it faulted. rt reads the driver's report (VK_EXT_device_fault) at
the loss and places none of its addresses: that is the platform's to do, as it
holds the guest's objects and the blocks they lie in.
On the host, a lost device's line is now followed by the fault's lines on
stderr: the driver's description and vendor records; each access it names,
rounded to its precision and placed among the decoders' live objects (buffers,
heaps, textures over a buffer, Managed textures' CPU-copy buffers) and the
mapped blocks the host sees (rt's pool allocations, the device's known blocks
and dma-buf imports, the blocks of live objects), with the offset in each that
holds it; where none does, the nearest live object and the nearest mapped
block below and above the address, each with its id or class and its distance
in bytes; each instruction pointer, placed the same way, with the note that no
range the host sees holds shader code; and what the placement saw and did not.
A loss that rt read no report for says so on one line.
The device gives rt a BlockMappings that maps nothing and refuses nothing, to
keep its pool allocations' ranges, and each import's range is kept beside the
record of where it was imported. The decoders' tables are walked only at the
loss, each walk waiting 500 ms in all for its locks, as the lines are written
on rt's completion thread. Nothing the guest sees changes.
rt makes no rasterization rate map: its newRasterizationRateMapWithDescriptor:
refuses (Unbuilt::RateMap, rt-unbuilt-rate-map), yet the Vulkan platform
answered the M3's layer count, 2, and every host offered RATE_MAPS. A guest
asked supportsRasterizationRateMapWithLayerCount:1, heard yes, and its map's
create was refused at the host.
The Vulkan platform now answers max_rasterization_rate_layer_count 0, and so
the identity's largest_rasterization_rate_map_layer_count 0, and the device
offers RATE_MAPS only where that count is one or more (makes_rate_maps). What
the guest sees on rt: supportsRasterizationRateMapWithLayerCount: answers NO
for every count, the device info's largest rate map layer count is 0, and
newRasterizationRateMapWithDescriptor: returns nil in the bundle with no
message to the host. A platform that makes rate maps (the testkit's fake)
offers them as before. No GPU family's answer moves: Mac2 stands, and no
Apple family stood before or after.
The tests that held rt's answer of 2 now hold 0, and a new test pins the
feature bit to the platform's layer count.
The pin's range refuses a render pipeline state that fetches or blends an
extended-range colour attachment on every device (Translation-Format), and makes
a fragment function whose SIMD-group operations read other lanes where the
device reports shaderQuadControl, refusing it elsewhere
(Translation-SubgroupOperations). The ledger's list of the translator's
refusals names both. It named no argument buffer sampling refusal, which the
range translates, so no row goes.
The 3090's fault at job 60124 left no named cause: at a loss, the rt
platform wrote one line naming the GPU, the Vulkan call and its result,
and nothing of the work that was on the GPU.
Each command buffer rt ends as in flight at its device's loss now writes a
line after the device's, naming the guest's command buffer by its object
id and the object ids of the first compute and the first render pipeline
state its encoders set, or none; a command buffer of the host's own says
so. A command buffer cut in parts writes one line however many of its parts
are lost. The first 8 write theirs, the next one that the rest are counted
only, and each is counted, rt-device-lost-in-flight.
The record is the cheapest that holds them. The decoder makes the guest's
names for a command buffer's work once, at its begin, and hands them to the
platform before any encoder (CommandBuffer::names_work, a no-op by default
that makes no Metal call), which keeps them on the command buffer and each
part cut from it. A walk keeps its first pipeline state of each kind in a
cell, read at each set, and notes them in the names with relaxed stores
before each commit of what it walked: a cut, a dealt chunk's commit, which
notes its chunks' firsts in their order, and the last commit. Nothing per
draw, and nothing reaches the guest: the line is a diagnostic.
The bundle now names read-only anonymous memory unchanging where its maximum
protection has no write, the kernel answers it SM_PRIVATE at a shadow depth of
0, and mach_vm_page_info's VM_PAGE_INFO_BASIC answers its object's count as 1
at depth 0 with the region's object id (kRgfxAnonymousPrivate). The kext takes
such a block (kRgfxPagesSoleHolder, 1 << 3, where it sets
kRgfxKextFeatureSoleHolderPages, 1 << 20) and marks its SURFACE_PAGES
RGFX_SURFACE_PAGES_UNCHANGING without COPY_ON_WRITE, so the host reads its
pages once, as the view is imported. On P2's guest (macOS 26.7.2, the Windows
mini) the 4K block over such memory was copied whole at each commit that used
it.
A wire holds no reference, so the count leaves out wires for writing taken
while the memory was writable. The kext knows its own: it refuses the block
(kIOReturnNotPermitted) where, once its pages are wired, a writable block of
its own in the table or an in-place surface block covers a page of them, or a
block of writable memory is being made (writableMakes), and the bundle then
asks a read-only block, why RGFX_PAGES_WHY_REFUSED. The check sorts the
block's runs and walks every writable wire's segments under contextLock, once
per such make. What is left is a write another driver started before the app
removed write for good, still landing after the make.
The clause is on for every guest kernel, with no release gate. The facts it
rests on, read in xnu's published source at each tag from macOS 11.0.1 to
26.5, osfmk/vm/ lines:
xnu- cnt pid rid fake prot upl clamp iopl walk id
7195.50.7.100.1 19154 19264 14459 19126 6172 6459 17037 9030 14915 1209
7195.60.75 19074 19184 14406 19046 6156 6459 16984 9030 14862 1209
7195.81.3 19074 19184 14413 19046 6157 6459 16984 9030 14869 1209
7195.101.1 19119 19229 14290 19091 5915 6457 17020 9010 14749 1190
7195.121.3 19158 19268 14329 19130 5916 6457 17059 9010 14788 1190
7195.141.2 19158 19268 14329 19130 5916 6517 17059 9070 14788 1190
8019.41.5 19330 19440 14493 19302 6007 6551 17227 9137 14952 1190
8019.61.5 19330 19440 14493 19302 6007 6551 17227 9137 14952 1190
8019.80.24 19330 19440 14493 19302 6007 6551 17227 9137 14952 1190
8020.101.4 19330 19440 14501 19302 6003 6543 17247 9143 14960 1188
8020.121.3 18885 18995 14245 18857 5918 6541 16960 9131 14704 1168
8020.140.41 18945 19055 14305 18917 5909 6542 17019 9135 14771 1168
8792.41.9 19527 19637 14780 19499 5939 6701 17519 9294 15246 1166
8792.61.2 19538 19648 14791 19510 5939 6753 17530 9346 15257 1167
8792.81.2 19538 19648 14791 19510 5939 6753 17530 9346 15257 1167
8796.101.5 19669 19779 14872 19641 5926 6750 17650 9273 15338 1164
8796.121.2 19669 19779 14872 19641 5926 6750 17650 9273 15338 1164
8796.141.3 19738 19848 14911 19710 5940 6774 17695 9297 15377 1164
10002.1.13 19897 20007 15074 19869 6032 6791 17854 9316 15540 1163
10002.41.9 19910 20020 15087 19882 6032 6771 17867 9296 15553 1165
10002.61.3 19910 20020 15087 19882 6032 6771 17867 9296 15553 1167
10002.81.5 20023 20133 15121 19995 6041 6771 17980 9296 15587 1167
10063.101.15 20254 20364 15180 20226 6098 6774 18210 9299 15646 1355
10063.121.3 20357 20467 15247 20329 6123 6774 18308 9299 15714 1355
10063.141.1 20359 20469 15249 20331 6125 6774 18310 9299 15716 1355
11215.1.10 20139 20249 14984 20111 5692 6843 18096 8188 15442 771i
11215.41.3 20139 20249 14984 20111 5692 6843 18096 8188 15442 771i
11215.61.5 20501 20611 15230 20472 5759 6817 18384 8162 15693 765i
11215.81.4 20507 20617 15236 20478 5765 6817 18390 8162 15699 765i
11417.101.15 20646 20756 15393 20617 5804 6766 18487 8111 15856 765i
11417.121.6 20694 20804 15441 20665 5843 6781 18535 8129 15904 766i
11417.140.69 20703 20813 15449 20674 5841 6777 18546 8124 15913 766i
12377.1.9 20960 21070 15518 20931 5974 6988 18734 8331 16004 776i
12377.41.6 22004 22114 16433 21975 6174 7198 19709 8562 16933 807i
12377.61.12 22037 22147 16463 22008 6204 7203 19742 8567 16963 808i
12377.81.4 22109 22219 16534 22080 6275 7209 19813 8573 17034 808i
12377.101.15 18688 18805 13571 18677 5743 7659 16128 8765 14068 824i
12377.121.6 18686 18803 13569 18675 5722 7659 16126 8765 14066 824i
cnt vm_map.c, vm_map_page_range_info_internal: the top object's count,
less the query's own reference to 12377.81.4, read before it after
pid there: the id, VM_KERNEL_ADDRPERM to 10063.101.15, ADDRHASH after
rid vm_map.c, vm_map_region_recurse_64: the region's id, VM_OBJECT_ID
id vm_object.h (i: vm_object_internal.h): VM_OBJECT_ID, the low 32 bits
of pid's macro in each tag
fake vm_map_page_range_info_internal: a footprint query's count of 1 and
an id of no object (task_self_region_footprint)
prot vm_map.c, vm_map_protect (its preflight from 12377.101.15): no
protection the maximum lacks
upl vm_pageout.c, vm_map_create_upl: no write UPL where the entry's
protection lacks write; from 12377.1.9 through vme_allows_upl_write,
whose test is at 6786, 6986, 6991, 6997, 7413 and 7413
clamp vm_map.c, vm_map_remap_extract: a share's maximum is the source's at
most, which memory entries take through vm_map_copy_extract
iopl vm_pageout.c, vm_object_iopl_request: the UPL keeps the object with
no reference of its own
walk vm_map.c, vm_map_region_walk: the count less one while paging, so
the share mode alone leaves it in doubt
Later releases are checked by test: guest/bundle/tools/sole_holder_probe.c,
which the lane gate's info phase (item sole-holder) and Ambrosia's
check-boot.sh (check sole-holder) run on each guest they boot, reads the count
as 2 with a memory entry or a second mapping holding the memory and 1 once it
goes, sees a footprint query answered otherwise, the kext's writable wire of
memory whose maximum lacks write refused, a sole holder's block made, and
refused while a writable block of the kext's covers it. A release where it
fails is a red leg. The kext's tests cover the wiring and the runs' sort and
search, and the bundle's a sole holder's block named and refused.
What the guest observes changes. Before, where the host's video landing found
no blit encoder for its copy of a picture's staged planes into the output's
device caches (on the rt platform, an encoder metal2vulkan-runtime refuses),
the landing failed: the decode's value was signalled, and the command buffer
that waits for it completed failed, with Metal's internal error, which the
guest's video driver answers as a decode error (HEVC:
kVTVideoDecoderMalfunctionErr).
Now the copy is skipped, as the decoder skips whole a pass the platform makes
no encoder of (4b7975b882, decode::cmdbuf's unmade): the caches keep their
bytes, the picture lands with them, its value is signalled and its command
buffer completes as any landed picture's, not counted as a failure to land. rt
counts the refusal under rt-refused-<kind>, as before; the process's first
skip has a line. No new degradation code.
An encode's copy of its source out of the caches keeps its answer: no blit
encoder fails the frame (RGFX_VIDEO_ENCODE_FAILED), since a skipped copy would
hand the encoder the staging buffer's earlier bytes, another frame's or what
the buffer held when it was made.
No test held the old failure. The new tests:
a_copy_into_caches_the_platform_makes_no_blit_encoder_for_is_skipped (no copy,
signalled, completes as landed, the next picture copied as any) and
a_source_whose_copy_out_has_no_blit_encoder_fails_its_frame, which pins the
encode's answer.
Anonymous memory read SM_PRIVATE is not provably unchanging: the region walk
takes one from the object's reference count while paging on it is in
progress (osfmk/vm/vm_map.c:16002-16005), and a wire holds no reference
(vm_object_iopl_request, osfmk/vm/vm_pageout.c:8331; upl_destroy, 5683-5685),
so a driver's wire for writing taken while the memory was writable, our own
kext's for a writable block among them, still writes its pages after the
maximum protection lost write, under a count of one. A once-made copy would
then be wrong for the block's life. Such memory is read-only again, why not a
file, and its blocks are copied whole at each commit as before.
What stays unchanging is SM_COW at shadow depth 0, with no write in the
maximum protection, which is sound against wires too (xnu main as read on
2026-11-20):
- such a pending copy is vm_object_copy_quickly's of an object whose copy
strategy is still symmetric (osfmk/vm/vm_object.c:3586-3605), and a wire
makes its object's strategy a delayed copy (vm_pageout.c:8404-8423), so the
object was not wired before the copy;
- a wire through either side after it resolves that side's pending copy
first, shadowing it (vm_map_create_upl, vm_pageout.c:7140-7188), as a write
fault does (vm_map_lookup_and_lock_object, vm_map.c:14866-14897) and a share
does (vm_map_remap_extract, vm_map.c:18314-18396), so the other side's writes
and wires land in a copy of its own.
What the host sees: blocks of anonymous memory SM_PRIVATE no longer carry
RGFX_SURFACE_PAGES_UNCHANGING; those with a copy pending carry it with
RGFX_SURFACE_PAGES_COPY_ON_WRITE. The bundle's classification line drops the
private clause. The tests hold both.
A no-copy buffer over anonymous memory the process mapped read-only, with
no write in its maximum protection, was a read-only block not unchanging
(why 1, not a file): the host copied its pages whole into its copy at every
commit that used it. On the Windows host's 4K desktop that is a 4K block of
ImageIO's (share mode SM_PRIVATE, ref 1, shadow depth 0), 7.93 ms and
31,007 KiB a present.
The bundle now names two share modes of such memory unchanging, read from
xnu's main as of 2026-11-20 (osfmk/vm/vm_map.c's vm_map_region_walk,
16088-16098; the modes' values osfmk/mach/vm_region.h:129-130):
- SM_PRIVATE, the object held by the region alone; a share of it takes no
protection past its maximum (vm_map.c:18037-18058, 18733-18734), and
VM_PROT_COPY maps a copy in its place (vm_map.c:5832-5905);
- SM_COW at shadow depth 0, a copy pending on the region's own object
(vm_object.c:3586-3605; vm_map.c:12727, 14046, 18604), where the other
side's writes go to a copy of its own (vm_map.c:14866-14897,
18314-18396), marked copy-on-write.
A depth of 1 or more, and every other mode, stays neither, why not a file.
SM_PRIVATE's one doubt is documented: the walk takes one from the object's
reference count while it pages (vm_map.c:16002-16005).
What the host sees: such blocks now carry RGFX_SURFACE_PAGES_UNCHANGING
(and _COPY_ON_WRITE for the pending copy), so the host reads their pages
once, as the view is made, instead of at every commit; the GPU's writes
there are dropped as before. The bundle's classification line counts the
two new clauses. The wire, kext and host docs say so.
surface_pages.rs, design.md, dgpu-oracle.md and the bundle cite the entry
`read-only-pages-written`, which the ledger lost when the old platform's rows
went. It now says what the rt platform does with memory whose GPU writes Metal
drops: a copy of its pages, the pages never written; a GPU write stays visible
until the next commit that uses a copy of changing pages, or the next
completion of a command buffer that can write a copy of unchanging pages, where
Metal drops it at the write; a render pass over such a copy completes with its
stores dropped, where the M3 Max faults it (rt-copied-store-outs); and a pinned
bit-24 buffer in a block that is no such copy is written (rt-no-copy-read-only).
rt's translator refusals (rt::Error::Translation) were counted only under
rt-refused-translation, with one first line for all of them, which printed the
translator's error as it displays and debugs: no feature apart from another,
and its location and symbol, names of the guest's functions.
Now the boot diagnostics' refusals line counts each by the feature it refused,
Translation-<feature> (metal2vulkan's Feature's variant, as
Translation-DivergentInterpolation), or by the translator's error's variant
where it refused none (Translation-Cancelled). The first of each name writes
its line in the refusal-detail form, with the feature, what it needs and the
attachment it is tied to, and no function's or symbol's name. The degradation
count stays one code, rt-refused-translation: no new degradation kind.
Diagnostics only; nothing the guest observes changes.
What the guest observes changes. Before, at ENCODER_BEGIN_RENDER, _COMPUTE or
_BLIT, an encoder the platform answered none for (on the Vulkan platform, a
pass metal2vulkan-runtime refuses, as a 4x BGRA8Unorm_sRGB resolve it builds
none of, seen twice in a Mac walk) raised an op fault: the command buffer's
message failed, its CB_COMPLETE carried an internal error, and none of the
buffer ran.
Now the pass is skipped whole, as a pass that names an object whose create the
host refused already is (OpenEncoder::Skipped): its ops are dropped up to its
end, the encoders after it run, and the command buffer completes RGFX_CB_OK. A
Metal app's sends to a nil encoder do nothing and fail no command buffer. rt
counts the refusal under rt-refused-<kind>, as before; the decoder logs the
process's first skip of each encoder kind once. No new degradation code.
No test held the old fault. The new test,
a_pass_the_platform_makes_no_encoder_of_is_skipped_whole, sends a render pass
the platform refuses as a gap and compute and blit passes it answers nil for,
twice each in one buffer, and checks that no op of theirs reaches an encoder,
the encoders after them run, and the buffer completes OK.
On rt, newArgumentEncoderWithArguments: and a function's
newArgumentEncoderWithBufferIndex: were an unbuilt piece
(rt-unbuilt-argument-layout). The host answered ARGUMENT_LAYOUT as refused,
the guest's encoder was nil, and a kernel then read through an argument
buffer whose words nobody wrote. On a guest's probe the RX 550 read zeros,
and the 780M faulted on the null pointers and timed out its gfx ring.
What changes for the guest: both calls now answer metal2vulkan's layout.
That is ArgumentBufferLayout::from_descriptors for descriptors, and
Function::argument_buffer_layout for a function's argument buffer, the
layout the function's translation reads. Every argument kind maps to the
core kind of the same name, nested layouts with their holders. Where Metal
makes no encoder, the call still answers nil, now counted under
rt-refused-metal; the translator's own failures are counted under
rt-refused-translation.
The unbuilt piece and its ledger row go. The tests read
tests/shaders/argument_buffers.metallib. sum_args answers 16 bytes,
aligned to 8, pointers at 0 and 8, from the function and from descriptors.
mixed_args lays out a pointer array, a constant, a texture and a nested
argument buffer. On the Vulkan platform, both kernels read back the words
written at those offsets.
Moves both metal2vulkan revs from 5004f224a7 to 9ea53f7acd, 9 commits further
on its development branch, named checked by its job m3-max-59486. The lock is
unchanged: no manifest changes in the range, and it still carries no source
lines for the metal2vulkan packages. The range changes no API this tree calls:
it adds Feature::DivergentInterpolation and four Metrics fields, and deletes
DriverWorkaround::InterpolationNeedsTheWholeQuad, which nothing here names.
On rt, for the guest:
- Divergent interpolation is refused on every device (f3b9e0253a). A fragment
function that reads an interpolant at a sample or an offset
(interpolate_at_sample, interpolate_at_offset) outside its first block, or
after a discard_fragment in it, is refused by the translator as
Unsupported::not_implemented(Feature::DivergentInterpolation), where Metal
makes it: the render pipeline state's creator answers its NSError, counted
under rt-refused-translation, as the translator's other refusals are. Before,
rt lowered the shape on every device, and RADV's sample and offset reads
there read garbage where the quad's helper invocations had left. The same
reads in the first block, before any discard, are made as before.
docs/accuracy-ledger.md lists the refusal with rt's.
- A looping fragment function's sample-qualified varyings are read at every
sample a pipeline of the device may have, before the loop, on every device
(f3b9e0253a); rt read them inside the loop, where the helper invocations of
a partly covered quad have left. The workaround that keyed this on RADV's
release was set by nothing since the driver-fact tables went, and is
deleted (7aa9abf911 re-pins its runtime sources' hash).
- SEMANTICS_VERSION goes from 2204 to 2205, so rt's shader and pipeline caches
miss once more: the first run on each host translates its pipelines again
(2258522299 re-pins the old render key at it).
- Metrics::held_starts and Metrics::held_start_gap_nanos (3d93acd6be): the
sends of a group a queue held behind its three submissions in flight, and
the GPU's nanoseconds from the latest end of the work submitted before each
to its own first start.
- Metrics::pipeline_creation_nanos and Metrics::translation_nanos (33cdabd1fd,
9ea53f7acd): a pipeline's make split between the driver's
vkCreate*Pipelines calls and rt's calls into the translator (its reads of a
kernel's inputs and partition and of a render variant, its lowerings, links
and plans), failed calls included; the cache digests count none.
- The four counters change nothing the GPU runs, or when. The next commit
writes them in rt's part of the 10 s summary.
- The event-wait deletion (a075319ea1, no semaphore wait submitted for an
event's value) came with the pin before, at 5004f224a7; c919913869 corrects
rt's docs after it and drops a check for waits no segment has any more.
Nothing more changes for the guest.
- c0e1b47df5 and 96d335ef46 are rt's own tests: its layouts ledger keeps each
image's steps in queue order, and an imported-alias test follows the
compositor's order. Nothing changes for the guest.
Moves both metal2vulkan revs from d83fb05624 to 82e7c39216, 65 commits on its
development branch, named green by its checks (m3-max-59311). The runtime's
crate takes its published name there (9a1c8fe6dc): metal2vulkan-rt 0.0.0 is
now metal2vulkan-runtime 0.2.0, its library metal2vulkan_runtime. The
dependency key, the crate's paths (each still `as rt`), the lock's entry and
the docs, comments, log lines and scripts that named the crate follow it. The
rename changes no API.
On rt:
- A command buffer waiting for a shared event's value whose signal is
submitted is Scheduled as it is submitted (4730af16e7): its scheduled
handlers run on the submit thread then, and its queue's later command
buffers are no longer held behind it. A wait for a value that neither the
host set nor a submitted signal promises stays held, Committed, as before
(counted in Metrics::event_holds, fb4b77048c). GPU order and completion are
unchanged. The docs that said rt's completion thread runs a held command
buffer's scheduled handlers now say its submit thread does.
- Copies over buffers are tracked by the memory a buffer lies in, never its
id (7e38a29b69): a texture over one buffer sees a draw through a texture
over another buffer over the same bytes, in one command buffer and across
a held group.
- A kernel that reads buffers through an argument buffer's pointer members,
or through a gpuAddress the CPU wrote into a constant buffer, now makes
(3cdca62567, c0403a1c98); the translator refused it (IdentityDomains).
- A refused kernel input names its kind (98895eb6d2, 1c26e1dc54):
Gap::KernelInput { kind }, so the refusal's text, in the log and in the
NSError's description, carries the kind. It is still counted as
KernelInput.
- Memory goes back sooner. The release of a texture or block that an unsent
upload holds sends the upload at once (0277c68696). A texture longer than
a 16 MiB block has its block to itself and gives it back at its release
(61949e8ba4). Every free of device memory on a normal path is made by the
block-maker thread, and counted against the submits it meets (4c808ffa6d,
09735ad792). New gauges tell texture blocks apart from the consumer's
Private takes (b3f6c859dd).
- ComputePipelineState::dispatch_variant, the key of the VkPipeline a dispatch
runs (82e7c39216), which this tree does not call yet.
- The translator's old path is deleted (0b94d919d9 to 16c831165d): its
profile comes from Vulkan queries alone, with no policy switches and no
driver-fact tables. SEMANTICS_VERSION goes from 2201 to 2203 and
RUNTIME_VERSION from 2540 to 2541, so rt's shader and pipeline caches miss
once: the first run on each host translates its pipelines again.
The rest is metal2vulkan's own: its conformance declarations and ledger, its
generated documents and the tests of each change. The NSError texts the guest
receives, and the comments of the wire header and the guest's sources that the
prebuilt kext sets and the option ROM record, keep the old name here; commits
of their own change them.
cutdel's WIP 9 renames rt_platform/swapchain.rs's "No device recovery, no
drawable fetch" to "No device recovery", with the drawable fetch gone; the
ledger's device-loss row cited the old heading.
The cutdel branch deletes VulkanPlatform, metal2vulkan-runtime and the rt
feature, so RtPlatform over metal2vulkan-rt is the only platform. These
docs still described the old one: its answer policies, its exact
switches, MoltenVK on the Mac, its in-place guest memory, its records
cache, its device recovery and its Metal-answer tests.
- conventions.md: the guest-memory-in-place rule is replaced by the rt
rule (rt allocates GPU memory, the device maps its blocks into the
guest, textures sync at the guest's events, and there is one VkDevice
per process). The degradation codes are now rt-unbuilt and rt-refused,
and the deleted codes are dropped.
- accuracy-ledger.md: restated for rt, which has no switches. It keeps
the device's own arithmetic notes (tagged as measured before rt), the
19 unbuilt pieces and rt's refusal kinds, and device loss.
- api.md, README.md: REIMS_VGPU_EXACT, _CENSUS_DIR and _TRACE_DEGRADE
are gone, and STRICT now covers running out of memory only. The let-go
and the quiesce describe one platform.
- architecture.md, development.md, testing.md, qemu.md: KosmicKrisp in
place of MoltenVK; RtPlatform, rt_window and RtBlocks in place of
VulkanPlatform, the old window sink and HostBlocks; no Metal-answer
comparisons and no opt-in GPU-fault tests.
- lessons.md: the four lessons about deleted code only (the Metal
comparison after MoltenVK, the runtime's shadows, device recovery and
the in-place check) are dropped. The lessons that still bind mark
their deleted names.
- video/vaapi.md, graphics-kext/design.md: the GPU plane copy and the
compositor mirror are marked as gone.
- AGENTS.md: only the Vulkan platform's "Where things are" row changes.
rt writes nothing when its VkDevice is lost, and the platform answered the
lost work with codes alone, so a run that lost its device left no trace on
the host but the guest's own silence: two walks froze that way with nothing
in their logs to say why.
The first command buffer that fails with the device lost now writes one
line on stderr, once for the device, beside the platform's other
degradation lines: it names the GPU (name, PCI vendor and device IDs) and
how many command buffers were committed and not complete at that moment.
Each command buffer that fails so is counted under rt-device-lost, so the
boot's degradation counts say how much work the loss ended. The ledger's
rt device-loss row says so in place of "nothing logs or counts the loss".
The row named what the guest ran in the two rt walks that lost their device.
The ledger keeps walk facts generic, so it now says only that the guest's
running app logged nothing for its last ~3 minutes, until the walk stopped it.
The rt device-loss row said no rt boot had lost its device. Two had, while
every command buffer the loss ended still answered 11: m3-max-53777 on the
3090 and m3-max-54078 on the XTX. In each, the running benchmark stopped
making progress for its last three minutes. The row now says that, and that
what the guest does with 2 and 1 is not measured.
The owner ruled that the cutover ships with no recovery after a GPU device
loss. The ledger listed only the default platform's recovery, so this adds a
row for rt beside it. On rt the device is never made again. The lost work
fails 2 then 1, and every later commit fails at once with 1. A new object is
made only where the driver's Vulkan calls still make one. The window presents
nothing more, while the guest's presents are still answered at each refresh.
The process runs on until the VM ends. What the guest's apps do after that is
not measured.
A guest command buffer the walk cuts into parts went to the GPU as one
kernel submission a part: on the Iris Xe's animation page a waited buffer
took about 11.6 vkQueueSubmit calls of about 180 us each on ANV. Nothing
observes a part's completion but its own handler, which notes its GPU times
and error for the last part's record and lets its place among its queue's
command buffers go; the last part carries every record, ticket and signal
the guest sees.
So each part but the last is marked to join the next one's completion
(CommandBuffer::set_completion_joins_next), and the runtime may send up to
four of a queue's parts found ready together, and the part behind them, in
one submission. Never marked: the last part; a part that waits for or
signals an event, by an op or from the buffer's begin (a device cache's fill,
another queue's buffer in the surface order); and a part the platform keeps
whole, whose commit is the whole's. The guest still sees its command buffer
complete at its last part's own end, with the same GPU times and the first
failed part's error.
Tests: a_buffer_s_parts_but_its_last_join_the_next_completion_unless_they_
signal and a_first_part_that_waits_from_its_begin_is_not_marked; the dealt
and kept-whole tests check which parts are marked.
GitHub #142 reported VMs dying on a Raptor Lake UHD 770 after i915 reset
QEMU's context. At master on ms01's Raptor Lake-P Iris Xe nothing was
reset: the longest guest command buffer took 128 ms, and B26's two
media-analysis buffers about 100 ms. A full GT reset provoked through
debugfs while QuickTime played logged the same kernel line as the report,
and the runtime made its VkDevice again in 209 ms. The guest ran on, but
the desktop picture stayed flat green.
docs/qemu.md now says when i915 resets a context on Gen12, read from i915
and ANV: with GuC the 7.5 s preempt timeout applies to one draw or one
thread group, not to a whole command buffer. It also gives these runs.
The accuracy ledger's recovery row said nothing makes the guest's objects
again. The runtime now carries most of them: a texture or Private buffer
it remakes reads as new, and it leaves a few buffers and caller-image
textures refused.
Two of ten steady Launchpad windows (one per GPU) held 30 batches in 9
groups, and the first opening saved 0.15-1 submissions a present across all
five Grouped walks, not 0.8-1. Docs only.
The doc above exact_policy and the accuracy ledger said only that grouped
completion bought no frame rate on the Iris Xe. They now say what Metal
does, measured on two Macs: each command buffer is seen complete at its
own end, 17-41 us later at the median on a Radeon Pro 5300M and a UHD
Graphics 630, 86-106 us on an M3 Max, never once the next one has ended.
Grouped completion sees a member late by the GPU time of the members after
it, up to the runtime's 16 ms bound. They also say what Grouped did on
RADV, the 780M and the RX 7900 XTX: no grouping in steady Launchpad, and
7-9% fewer kernel submissions in Geekbench's Metal pass for no shorter
run, with completions up to 60 ms late. No code changes.
This changes what the guest observes, on every device but MoltenVK:
- A command buffer's GPUStartTime and GPUEndTime become when its GPU ran it,
as Metal's are. The device posts them in its completion record, and the
bundle answers them to the guest, whose compositor reads them. They come
from two GPU timestamps each command buffer writes, placed on the host's
clock by the runtime's calibration. Until now device_options asked every
device for GPU times from the host: the run the guest saw went from its
submission to the runtime seeing it complete, detection latency included.
Over the same ~35k command buffers of a Launchpad walk, the GPU time the
guest received summed 48 s against 62 s on a Radeon 780M, 10 s against
17 s on an RX 7900 XTX, 31 s against 39 s on an Iris Xe, and 25 s against
30 s on an RTX 3090.
- VkQueue sharing comes on where the runtime's own check finds the GPU idle
at queue switches (NVIDIA's; RADV's single graphics queue has nothing to
share). Host times had kept every device Unchecked (below).
MoltenVK keeps host times: the runtime takes them there whatever the option
says (TimestampsWaitForEveryQueue), as it does on a queue family with no
timestamps.
Cost: +2.5 to +7 us per command buffer at the median across six GPUs,
frames unchanged.
The cost, which the option was set for, was measured only on MoltenVK.
Off it, gpu_times_from_host_latency (release, 1000 one-fill command buffers
each way per run, interleaved) puts commit to completion 2 to 7 us later at
the median: XTX +4 us (13 runs), 780M +4 us (13), RX 550 +2.5 us (10), Iris
Xe +4.5 us (10), RTX 3090 +5 us (10), RTX 2080 +7 us (10), within runs whose
medians spanned 44 to 292 us. Walks of a 26.7.2 guest's desktop and
Launchpad on the XTX, the 780M, the Iris Xe and the 3090 drew the same
presents at the same take-to-show times either way, fatal 0.
Host times also kept the runtime from sharing VkQueues between command
queues (queue_share.rs: a device without timestamps the host reads is
Unchecked), so the accuracy ledger's queue-sharing row never applied to our
builds. It does now on NVIDIA: the 3090 walks moved 9 to 13 queues, take-to-
show 8.08/8.09 ms against 8.15/8.05 with sharing held off and 8.00 from the
host. The row now says which devices it reaches.
A test holds the new answer: the runtime announces GpuTimesFromHost exactly
where the device's driver has TimestampsWaitForEveryQueue, and the times lie
in the command buffer's life. The timing module's debug legs are renamed for
what they measure now ("on the GPU", "GPU end to the handler"), as are the
surface-cache cost bench's.
Moves the runtime from ce54ad8b25 to the v0.2.0 release, d9236a8a11
(RUNTIME_VERSION 2342, SEMANTICS_VERSION 2122, ARTIFACT_FORMAT_VERSION
523). It adds no degradation kind. Two of our tests follow its answers:
the policy's exact forms name its new indirect_records field, and the
two-plane YCbCr argument-buffer write test checks 500 like the other
formats now that the runtime writes those slots through. The accuracy
ledger gains the row for the indirect-records policy.
Checked, at the owner's word, with one cold boot of the x86-64 macOS 26
guest on the RTX 5080 over this tree and vendor/qemu's 2026-11-13 move.