The compiler gives mixed_args' array<device const uint *, 2> [[id(0)]] as a
struct member taking two indices, with a nested layout of the two pointers 8
bytes apart, and the translator's layout answers it so (measured on the 780M
and the RX 550). The tests expected a plain buffer array of two; they now
expect the struct, and the decoder test writes the pointers at the struct's
offset plus its member's.
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.
sum_args is the shape a guest's probe reads wrong on the rt platform: two
pointers of an argument buffer, which the guest's encoder writes at the
offsets the host's layout gives. mixed_args holds every kind a kernel reads
through an argument buffer on rt (an array of pointers, a constant, a read
texture, a pointer to a nested argument buffer), for the layout of each kind
and the words the guest writes there. The metallib follows from a Mac.
Walk A on the 2080 at metal2vulkan 9ea53f7acd booted the same guest twice,
with rt's cache directory empty and then kept. The planner closed the
two-step make and the early create reply on these numbers: a second boot's
makes in the benchmark's first load cut sum 442 ms against 4124 ms, so cold
makes are a first boot's cost. docs/qemu.md keeps VM measurements.
Rebased onto development, the first-of-kind line tests' expected strings ran
to 101 and 102 columns, past the tree's 100 (42d93ec745). Layout only: the
strings are the same.
The boot diagnostics count rt's refusals by name (each gap, Draw-<kind>,
Refused-<variant>, Limit-<variant>), and a walk's counts say how many of each a
boot met, not what the call asked. The first of each name now writes one line
with rt's error as it displays and as it debugs, which carries the error's
fields, and the structure the call site knows: a draw's primitive type and its
pipeline state's rasterization fields; a copy's kind and each end, a texture
(format, type, samples, size, levels, slice, level, origin) or a buffer's
layout; a pass's attachments (format, type, samples, level, slice, load and
store actions, resolve texture, clear depth) and render target size. The
refusals counted under codes of their own (a pixel format's, an imageblock
length's, a heap texture's place) write their name's line too, and each line
names the code its refusal is counted under.
The draw's line no longer names the pipeline's vertex function, so the lines
carry structure alone. Whether that function writes point size is the
translator's to know, and no call of rt's answers it here, so the line says it
is not known.
Diagnostics only: no answer the guest or the host observes changes.
The NVIDIA crate keeps the first runtime it is opened with in a static for
the process's life (nvidia::wait's RUNTIME), and with it the rt platform the
test handed it: that platform is never dropped, so no last drop races the
exit there. rt_test_end::drop_last at the NVDEC and NVENC tests waited for a
hold that never ends, and 6 of 6 failed its 30 s bound on an RTX 3090. Drop it
from them; the VA-API tests, whose video threads do end, keep it. The module
docs and docs/lessons.md now say so.
A test that hands its platform to the video crate leaves the threads of
what it made there (a VA display's call thread, an NVDEC or NVENC
session's) holding the platform after the test returned. Where the last of
them ends as the process exits, its drop destroys rt's instance and closes
the Vulkan loader beside the exit's handlers, and with NVIDIA's driver
installed beside another the exit then runs code of libEGL_nvidia.so.0,
unmapped by then: on the Iris Xe, graphics::vaapi's tests of writes into
dma-buf caches printed ok and died of SIGSEGV in 3 of 9 processes
(measured with LD_DEBUG=files and their cores).
rt_test_end::drop_last waits until the test's own hold is the platform's
last and drops it on the test's thread; each video test of the rt
platform ends with it. Nothing the guest or the host sees changes.
The Windows target has no cache_writes (it is cfg(unix)), so rustdoc's
-D warnings fails there on the three intra-doc links to it. Name it in a
code span, saying it is Unix's.
iHD's decodes write their render target Y-tiled whatever the linear import
says (U30, measured on the Iris Xe), so its target check fails every kind and
its pictures reach the device's caches by its video processing alone, into
each cache's surface, whose planes lie as iHD's runs write them. The docs
said those pictures were copied by the runtime device's GPU on iHD, which the
Linux open never made; they now say which way each layout takes.
On iHD every picture of the device's video was read back and copied by the
CPU: the arm made its device caches dma-bufs only where the driver's check of
decodes into targets passed, and iHD fails it for every kind at the first
picture, since its decodes write their render target Y-tiled whatever the
linear import says (measured on an Iris Xe, intel-media-driver 26.3.5). The
caches stayed plain, so the arm's way of writing a picture decoded elsewhere
into its cache by the driver's video processing, which iHD's import check
passes, was never taken.
The arm now keeps its cache targets, and so has the device make its caches
dma-bufs, where either check passed: the decode check a kind, or the import
check NV12 or P010 (cache_writes). A codec whose formats all failed the decode
check is handed no target. writes_into_device_caches names what the switch now
means. A GPU test pins that the driver's video processing writes a dma-buf
cache's surface, laid out as the device asks the platform for one, as the
CPU's copy writes it.
make -C guest prebuilt and prebuilt-arm64e on the M3 (m3-max-59429), at
3010578b8d, for this branch's guest changes: the kexts' UNCHANGING_PAGES (kext
feature 1 << 19) and the pages block's flags with their why; the bundle's
classification of read-only memory at a no-copy buffer's make and its counts;
its read-only shadows copied whole at each sync, and their counts; and the
wire header's prose. prebuilt-check passes on both sets.
make -C firmware prebuilt (m3-max-59461) rewrote the ROM's record for the new
wire header; the ROM's bytes are unchanged (sha256 749434f87f56...), and
prebuilt-check passes.
The pin batch renames metal2vulkan's runtime crate from metal2vulkan-rt to
metal2vulkan-runtime. The comments that name it in the wire header and its
source (wire.rs) and in two bundle headers are hashed into the guest sets'
and the ROM's source records, so they change here, with the sets and the ROM
rebuilt after them. The paragraphs the longer name pushed past 100 columns are
rewrapped, and the header's text matches its source. Prose only.
RGFX_CONTEXT_VA_BASE's doc said no range the host places reaches the
contexts' range, [2^46, 2^47): the runtime's buffers from 2^32, the Vulkan
platform's model of Metal's layout from 2^40, and the pool's and Private
blocks' addresses in [2^45, 2^46) and [2^44, 2^45). On rt none of that holds
as said: a buffer the host places, and each Shared pool and Private block,
lies at the driver's Vulkan device address. Measured 2026-11-20, those lie
below 2^46 on the RTX 3090, the Iris Xe and the RX 550, and in the upper
canonical half on RADV's Radeon 780M and on the UHD 630's Windows driver; none
in [2^46, 2^47) (rt_platform::buffer, "A pinned address", and the test
on_vulkan_the_host_s_own_ranges_lie_outside_every_unit, 184a2792b2). The
[2^45, 2^46) and [2^44, 2^45) picks are the host's only where the blocks'
source gives no address, the testkit platform's. The doc and the header text
it feeds now say that. Docs only.
A copy of read-only memory kept a base, compared every page with it at each
commit that used it, and at completion compared again to drop the GPU's
writes. The owner's rule is no compare-and-skip on read-only copies: memory
that is not provably unchanging is copied whole at each commit that uses it.
What the guest sees: the GPU's writes to read-only memory are still dropped,
as Metal's are, but now at the next commit that uses the memory, when its
bytes are written into the range again, not at the completion of the command
buffer that wrote them. A command buffer that writes read-only memory still
in flight when another commit uses it has those writes overwritten. The
writable memory and the writable shadows keep their merge, unchanged.
On the host (rt, copied.rs): a dropping copy keeps no base, copies all of its
pages at each commit, does nothing at completion, and no longer holds its
command buffer's handlers back. Counted for each kind (writable, read-only,
unchanging): rt-copied-*-commits, the bytes (writable-compared-bytes,
read-only-copied-bytes, and restored-bytes, as before) and rt-copied-*-sync-ns,
and the read-only commits and bytes by the block's why
(rt-copied-read-only-why-N-*), which the surface pages' import hands the
copy.
In the bundle (RgfxMemoryShadow): a read-only shadow keeps no agreed copy and
is copied whole at each sync. The process's commits, write-backs, bytes and
time for each kind are logged as "RGFX: memory shadows, totals" within a
minute of a change.
Read-only memory under a no-copy buffer lies over a copy on rt wherever the
GPU cannot import it as it is, and every commit that uses the copy compared
all of its pages with their base. Much of that memory is a file's pages on
the guest's read-only system volume, which nothing can change while the
buffer lives, so the compare buys nothing there.
What the guest sees: the device offers feature bit 31, UNCHANGING_PAGES, with
READ_ONLY_PAGES, and the kext takes it (kext feature 1 << 19). At a no-copy
buffer's make over read-only memory, the bundle asks the guest's kernel once
whether the range is one file-backed region whose maximum protection has no
write (a shared mapping, or a private one whose maximum was lowered), whose
every page is the file's own, on a volume mounted read-only (proc_pidinfo's
fsid against getfsstat; no path is opened). Such a block is the app's own
memory, as before, marked RGFX_SURFACE_PAGES_UNCHANGING (and
_COPY_ON_WRITE); the kext's wire of a private mapping makes the process's
copy, as a Mac's does. Any other read-only block carries why not in its
flags' bits 8 to 11, which the host only counts.
What the host does: an unchanging block's copy is filled once, as its view is
made, never compared at a commit, and written again whole at the completions
of the command buffers that can write it, which drops the GPU's writes as
before. The views' summary counts the other read-only blocks by why, and
each texture over one (read-only-pages-textures-why-N, with one line per
format, size and why).
A private mapping whose maximum protection still has write is not provably
unchanging, since its process could raise its protection and write its copy:
it stays a plain read-only block, why "writable max protection".
rt's part of the 10 s summary now also writes four of rt's metrics by their
fields' names, after held_release_starts in `counted`, each what it rose by
since the part before:
- held_starts and held_start_gap_nanos: 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;
- pipeline_creation_nanos and translation_nanos: a pipeline's makes split
between the driver's vkCreate*Pipelines calls and rt's calls into the
translator.
The walks read them cold and warm, against a scene's length, to see what rt's
in-flight grouping and its makes cost. The part's test holds all four, a rise
and a new device's zero.
A diagnostic line the host writes, which the contract leaves free: nothing
changes for the guest.
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.
rt binds a heap texture at its absolute place in the block's memory, so a
Private heap the guest pins must start at a multiple of every alignment the
GPU answers for a heap texture. The guest pins at 256 KiB from its block's
first byte; the test checked three shapes on the GPU it held.
The test now sizes each SDK pixel format with four usages as 1D, 2D, 2D
array, multisample, multisample array, cube, cube array and 3D textures, of
one level and of every level, and fails where the GPU asks more than the
guest's kHeapAddressAlign, or more than a heap of its own starts at. It
places a texture of each alignment answered at offset 0 and at the alignment
in a heap pinned in a known block at the guest's alignment and in a heap of
its own, and in a heap pinned on the old 32 KiB granule checks that rt's
refusal is counted apart, as rt-refused-heap-texture-place. A GPU whose
images ask more than 256 KiB then fails the checks before a boot meets it.
Measured largest on 2026-11-20 at rt d83fb05: 256 KiB on the RX 7900 XTX and
the RX 550, 64 KiB on the Radeon 780M and the Iris Xe, 16 KiB on the M3 Max
(KosmicKrisp), 1 KiB on the RTX 2080 and the RTX 3090. None is above the
guest's pin, so neither the device's answers nor the guest change; the
module doc records the numbers.
clippy -D warnings refused two lines of the dispatch key's commit: the
converted arguments rt's make ahead and key take were a tuple of three types
(type_complexity), now RtDispatch with a field each, and the fake numbered its
keys with an `as` conversion, which core denies, now u64::try_from as the
testkit's other counts do.
Nothing the guest or the host sees changes.
A compute state's entry kept the last 64 shapes its buffers' pre-passes
handed, so two shapes of one VkPipeline (grids of more whole threadgroups, a
tiling kernel's other sizes) each took a compile thread, as did each state of
one kernel, and a shape rt makes nothing for was handed anyway.
The pre-pass now asks the state for the platform's key of each dispatch's
pipeline (dispatch_variant) and hands a make only for a key the device has
not handed. One memo for the device, in the decoder's shared state, not one a
state: rt's key is of the compiled content, which every state of one kernel
shares with its VkPipelines, and names no other content's pipeline even once
its own is gone. So the states the guest's processes each make of one kernel
hand its pipelines once between them, and the bound holds the memo's memory
whatever the number of states. It keeps the last 1024 keys (MEMO, 64 a state
before; it now holds every state's, and a key of rt's is about 150 bytes, its
lengths inline, held in a set and in the order: about 300 KiB), forgetting
the oldest first; a key forgotten and met again hands one make, which finds
the pipeline made. A buffer still hands 32 at the most (MOST). A dispatch with
no key, one rt would make nothing for, hands nothing, counted
(dispatch-prepass-no-variant).
Nothing the guest or the host sees changes: every dispatch's result and error
are its own, decided in the walk. New tests on the fake hold that dispatches
of one key, of two shapes of a state or of two states, are made ahead once;
that a dispatch of no key is made ahead never, and counted; and that a key a
buffer handed is not handed by a later one. The test that each buffer
completes as without the pre-pass stays.
The dispatch pre-pass memoes a command buffer's dispatches by their shape, so
shapes that run one VkPipeline each hand a make, and a shape rt would make
nothing for is handed anyway. rt's ComputePipelineState::dispatch_variant
(metal2vulkan 82e7c39216) answers the key of the VkPipeline a dispatch runs,
of the compiled content: dispatches of equal keys run one pipeline, whichever
state of that content they are of, and there is none where prepare_dispatch
makes nothing.
The platform gets DispatchVariant, an opaque Copy + Eq + Hash key, and its
compute pipeline dispatch_variant, with prepare_dispatch's arguments and a
default of None. RtPlatform answers rt's, and None for a value past rt's 32
bits, where its make ahead makes nothing; the two share the arguments'
conversion. The fake answers one key of each state and dispatch, or the
test's (World::key_dispatches). A GPU test holds rt's answers: one key for two
states of one kernel and for grids of more whole threadgroups, others for a
wider threadgroup and for another kernel, and none for a size past the
state's most, a grid of no threadgroups or a value past 32 bits.
Nothing calls it yet, and nothing the guest or the host sees changes.
The rename of metal2vulkan-rt to metal2vulkan-runtime lengthened each mention
by five columns, and 43 lines of comments, docs and string literals ran past
the tree's 100 (the C API's two paragraphs were rewrapped in a16076ff37). Each
moves its last words to the next line of its paragraph, cascading where that
line runs over in turn; no word changes. A string literal moves words only
across its backslash-newline continuations, so every string reads as before:
each file's comment words, code tokens and decoded strings were compared
before and after, all equal. No log line, message or test changes.
The doc of the test of rt's Managed buffer over its copy said the GPU reaches
the buffer by a blit because rt's translator refuses a kernel that loads the
address from an argument buffer (reach.metal; IdentityDomains,
rt-refused-translation). metal2vulkan 3cdca62567, in this pin, lowers a
pointer loaded from memory or made from an integer under the identity domains
as the device address it holds: a kernel reading buffers through an argument
buffer's pointer members, or through a gpuAddress the CPU wrote, now makes,
and rt's argument_tier tests read through each exactly. reach.metal loads an
address, reads through it and stores a word through it, which is that case
(read from code). The doc keeps that the test's GPU work is a blit.
At metal2vulkan's ask, so that a GPU failure's log shows where rt's copies
and memory went.
The counts line (degradations, at each reset and at exit) now carries rt's
over-copies by the cause rt gives each copy, as it carries their totals:
rt-over-copies-<cause> and rt-over-copy-bytes-<cause> for host-memory,
dma-buf, dma-bufs, dedicated, surface, spilled, linear, linear-features,
pitch, render-reach, alignment and image-memory, folded from rt's
over_copies_<cause> and over_copy_bytes_<cause>. rt counts each copy under one
cause, so the causes sum to rt-over-copies. rt-over-copies-imported stays an
axis of its own: an imported block's copy is counted under its import's cause
too. A cause with no copies writes nothing, as before.
rt's part of the 10 s summary adds two lists by rt's field names:
- counted, what rose in the period: texture_clears, texture_clear_bytes,
texture_clear_barriers, external_acquires, barriers, held_releases,
held_release_bytes and held_release_starts. A held release sends the
uploads holding its object at once; that is no degradation, so it goes
here rather than on the counts line. submissions is already on the line,
as its submits.
- gauges, as they are, in front of the block gauges already there: textures,
textures_copied_over, texture_block_bytes, texture_own_bytes and
spilled_bytes.
Diagnostics: lines of the host's log, which the contract leaves free. The
fold's test and the part's test take the new codes and fields.
The runtime took its published name with the pin to metal2vulkan 82e7c39216:
its crate is metal2vulkan-runtime. The NSError a refused creator answers on
the Vulkan platform still carried the old name, as its domain (RT_DOMAIN) and
in its description, and so did a failed command buffer's error description.
For the guest: a refused creator's NSError now has the domain
"metal2vulkan-runtime" (it was "metal2vulkan-rt"), with code 0 as before. Its
description now says "... is not built on metal2vulkan-runtime (<code>)" or
"metal2vulkan-runtime refused it: <why> (<code>)", and a failed command
buffer's error description says "metal2vulkan-runtime's command buffer
failed: ...". Its domain and code are unchanged. Nothing else changes. The test
of the refused creator's NSError takes the new texts, and now holds the domain
as a literal rather than through RT_DOMAIN.
The walks read rt's memory from the host's summary of each ten seconds, and
metal2vulkan 82e7c39216 gauges its texture blocks apart from the Private
blocks the consumer takes (b3f6c859dd). rt's part now ends with those seven
gauges as they are, by their fields' names: texture_block_held_bytes,
texture_block_sparse_bytes, texture_block_sparse_blocks,
private_take_held_bytes, private_take_bytes, private_take_sparse_bytes and
private_take_sparse_allocations. A walk tells a texture block's free bytes and
the sparse blocks a release leaves from the consumer's held takes, at each
summary.
A diagnostic: a line of the host's log, which the contract leaves free. The
part's test takes the gauges.
Moves both metal2vulkan revs from 82e7c39216 to 5004f224a7, 6 commits further
on its development branch. 82e7c39216 carries 20292c789e, under which rt
starts a render pipeline's fragment push fields at the vertex function's push
end, and with it a tessellation pipeline whose vertex and fragment functions'
push fields fill the floor's 256 bytes is refused at link ("unsupported:
Tessellation; needs AnyOf: Limit MaxPushConstantsSize, required 260, available
256"), where Metal makes it. The lock is unchanged: no manifest changes in the
range, and it still carries no source lines for the metal2vulkan packages.
On rt, for the guest:
- The tessellation push spill (23d6572c18, its tests 0eecb4512b, 7d8a13ade2,
a640235b0c): a post-tessellation vertex function's push window starts at
24 bytes, past the synthesized control stage's range, and the fields the
pair cannot push spill into their parameter blocks, as a function's fields
past its window already do. Such pipelines now make, on every device.
SEMANTICS_VERSION goes from 2203 to 2204, so rt's shader and pipeline
caches miss once more.
- No semaphore wait is submitted for an event's value (a075319ea1). A
command buffer waiting for a shared event's value is still held until the
host sets it or a signal of it is submitted, as before; once it goes, the
device's one VkQueue and the barrier that ends each segment order its
commands after the signaller's, so the submission carries no wait. GPU
order, completion and what the guest reads are unchanged; a waiter no
longer waits on the driver's semaphore after its signaller's end. The
swapchain's module doc, which said rt submits such a wait once its signal
is submitted, now says it submits none.
- Validation fixes (5004f224a7): nine of metal2vulkan-validation's tests take
Device::from_queries' answers after the translator's old-path deletion.
That crate is not a dependency here; nothing changes for the guest.
The range adds no Metrics or Gauges fields and changes no API this tree calls.
The runtime crate's rename lengthened two doc lines of the C API past 100
columns. cbindgen measures a function's doc with its one-line signature, so it
wrapped rvg_graphics_device_pool_grow's signature, and the committed header no
longer equalled its output (`cargo xtask header --check` failed on b347's Mac
and Linux legs). Rewrap the two paragraphs, pool_grow's and
rvg_quiesce_for_exit's, and their copies in reims_vgpu.h, so the header keeps
its form. No word changes.
The pin's lock kept serde under metal2vulkan and metal2vulkan-air, and
serde_derive under serde, which cargo's resolve at metal2vulkan 82e7c39216
does not list: a build rewrote those three lines (the pin's lint job,
m3-max-59328). The lock now holds what that resolve writes, still with no
source lines for the metal2vulkan packages. What builds is unchanged.
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.
design.md said host device addresses never reach the guest (section 6 and the
handles paragraph). On rt a pin lies at the guest's pick only where a block the
host knows holds its range; any other pinned buffer is made at the driver's own
device address, which the guest's GPU work then sees in place of its pick, and
the platform counts it (rt_platform::buffer, "A pinned address"). Both places
now say that. Docs only.
A walk without the trace had no count of rt's first-use waits, nor of the
compute pipelines the device's dispatch pre-pass made ahead: the trace's
rtmetrics event carries the waits but not the makes ahead, and no line carried
either. The rt-diag lines, written with the counts at a device's reset and at
the exit, now give rt's VkPipelines created, its first-use waits with their
milliseconds and the longest, those of a compute variant and of lines among
them, and the pipelines made ahead with their milliseconds.
A diagnostic only: nothing the guest or the host observes changes.
On the rt platform a dispatch's first use of a shape (its threadgroup size,
threadgroup memory lengths and grid) makes the kernel's VkPipeline on the walk's
thread, and the buffer's commit, with its process's wait for it, waits for that
make.
As a queue's service thread begins a buffer with a compute encoder, its
pre-pass (graphics::decode::prepass) reads the dispatches through the
message's views of the table and hands each shape not handed before to the
compile pool, one compile a shape, which calls the state's prepare_dispatch
while the walk goes on: rt makes the VkPipeline at the size the dispatch
gives, and lowers nothing. A dispatch then finds its pipeline made, or waits
for the one thread making it. It is bounded: a compute state's entry
remembers the last 64 shapes handed, a buffer hands 32 at the most, and the
pool runs these makes on all its threads but one, after every library and
pipeline create.
The walk waits for none of it. Right after the walk and commit, before the
message lets go of anything, the pre-pass is closed: the shapes no thread took
are dropped, and the walk's thread waits for those being made, so a compute
state the guest destroyed during the walk is still let go of where its view
closes, and the indices it gives back go back in the same order. Each wait is
counted (dispatch-prepass-waited, -wait-ns, -wait-max-ns), and the first of
each walk end (committed, refused, faulted) is logged.
Nothing the guest or the host sees changes: prepare_dispatch reports nothing,
and each dispatch's results and errors are decided in the walk as before. The
tests on the fake platform hold that each buffer completes as before, and that
a make the walk never reaches ends before the buffer's views close.
docs/conventions.md names the one exception to "compiles run only inside the
wait that needs them".
On the rt platform a compute state's make lowers every variant a dispatch can
run, but a kernel's VkPipeline depends on the dispatch's threadgroup size, its
threadgroup memory lengths and its grid tiles, so rt makes it at the
dispatch's first use of them, on the walk's thread, and the commit waits it
out. rt's ComputePipelineState::prepare_dispatch makes that VkPipeline ahead,
on the caller's thread, at the size the dispatch gives, and lowers nothing.
The platform's ComputePipeline gets prepare_dispatch, with a default that makes
nothing, and the platform's Dispatch for its grid. RtPlatform calls rt's,
skipping a value past rt's 32 bits, which the dispatch itself refuses. The
fake notes each call beside its call log (World::prepared) and can hold one
(World::hold_prepare), for the device's tests.
Nothing calls it yet, and nothing the guest or the host sees changes: the call
reports nothing, and every result and error stays the dispatch's own.
rt_refused answers the refusal it counted, which the encodes' match arms gave
as their value against trace_event_op's unit: each arm is a statement again.
clippy took the posting tests' timed field's type as too complex: it is Timed.
post_from_handler's doc still described the Vulkan platform before rt: handler
threads its scheduler fed, and a buffer's own handlers run inside the commit
that took its last batch. rt runs them on its submit thread, before the
submission goes to the driver or after it for a buffer that presents a
drawable, and on its completion thread for a buffer held for a shared event's
value; never inside a commit. rt_platform::command's module doc named only the
submit thread. Both now say what rt does.
A traced walk needs to say, for each command buffer that waits for an event,
which command buffer signals the value it waits for, so the waiter's stall can
be read off the signaller's timeline. Each wait and signal of an event that rt
takes now writes evwait, evsignal or, for a shared event's signal at its
scheduling, evsched: the command buffer as its cbdone names it, the event by
its object's address, and the value.
rt runs a command buffer's submission handler on its submit thread, and the
handler's CB_SUBMITTED and CB_SCHEDULED posts raise the queue's vector there,
inline; where records are handed over on the ring, the same thread posts them
all and runs what follows each. Before moving either off rt's thread, the walk
measures them: on rt's submit and completion threads, where the trace is on,
the device writes qraise (the queue, the raise's nanoseconds, the host's
callback among them) and qhanded (the queue, the handed records it posted, and
their nanoseconds). The device asks the host whether it times posts on the
thread (Host::times_posts_here), so with the trace off a raise costs one more
call. A test pins both events and their absence on another thread.
Moves both metal2vulkan revs from 268b496894 to d83fb05624, 25 commits on its
development branch, named green by its checks.
On rt:
- Textures over the same bytes of a buffer, each in an image of its own,
alias (e2a9f1fa6b): a write through one now marks the others over those
bytes stale, so a later encoder reading through another texture sees it.
A compute benchmark's image filter, which writes a buffer through one
texture and reads it through a second over the same bytes in the next
encoder, failed its own output check on the Iris Xe (ANV) and the 780M
(RADV); the Iris recording replayed on lavapipe with the fix matches the
passing card's answer within 1 LSB.
- Its tests: two textures over one buffer and the buffer itself across
fenced compute encoders (15bec89775), no copy more where nothing aliases
(b89f7d51d5), and partition-oblivious kernels over grids their workgroups
do not divide (f1276160f6, d83fb05624).
The rest is metal2vulkan's own: its conformance ledger's rows for the RX 7900
XTX, the RTX 2080 and 5080, the RX 550 and lavapipe, its docs and comments
naming no deleted runtime, and its validation's allocation counts removed.
No public API that this tree calls changes.
The 2080 scene walk spends most of a frame's time in rt's submit stage. To
tell whether that time goes to a held submission or to long driver calls, the
10 s summary's rt part now also writes rt's vkQueueSubmit2 calls: how many,
their time inside the driver, how many took over 100 ms, and the longest since
the device was made. It also writes the submit thread's waits for rt's queue
lock: their time in all and the longest since the device was made. The counts
and times are what rose since the last part, as the part's other counts are.
The two longest are rt's maxima since the device was made, written as they
are.
A diagnostic line: nothing changes for the guest or the host's API.
on_vulkan_the_host_s_own_ranges_lie_below_every_unit asserted that a buffer the
host places lies below RGFX_CONTEXT_VA_BASE (2^46). On rt a buffer's address is
the driver's device address, and two drivers give theirs in the upper canonical
half, above the contexts' range's end (2^47): RADV on the Radeon 780M
(0xffff8001_03400000) and Intel's Windows driver on the UHD 630
(0xffffb802_03a80000), where b339 failed. RADV on the RX 550 gives
0x1_0340_0000, and the RTX 3090 and the Iris Xe pass below 2^46.
What the guest's own picks rely on is that no host range meets the contexts'
range, [2^46, 2^47): rt finds a known block by its address alone, so a pick
there would otherwise be made inside a block it is not meant for. None meets it
on any of those devices. The test, now ..._lie_outside_every_unit, asserts that
the host's buffer lies wholly below the range or at or above its end, and
rt_platform::buffer's docs record the addresses measured.
Tests and docs only: nothing changes for the guest or the host.
The guest class test held the Metal answers: a new Private render target read
before its first write showed opaque magenta for an arm64 guest, as an M3 Max
reads it, and zero for an x86-64 guest. What such a texture reads before its
first write is undocumented Metal, which the device does not emulate, and rt
takes no guest architecture. So the test is renamed
on_vulkan_a_new_private_texture_reads_zero_for_every_guest and expects zero
for both.
For the guest: an arm64 guest's new Private texture now reads zero before its
first write, where Metal on an M3 Max reads opaque magenta. An x86-64 guest
reads zero as before. The texture never shows its memory's earlier bytes.
reserve_guest_texture_ids checks that a few plain textures made after the
reservation lie outside the guest's ids. On rt a ResourceId has the index in
its low word and the translator's word for the descriptor in the high one, so
the check compared the whole 64-bit id with the guest's indices and missed
every overlap. It now compares the low word, and its error line says "resource
index".
Diagnostics only: the error line is all that changes, and nothing changes for
the guest.
The 14 ignored tests now run on the rt platform. Each one asserts what rt does,
by the degradation code rt counts it under, where before it held what Metal
does:
- a texture buffer is refused (rt-refused-gap), so the five range tests run
past it. Pins in no block the device knows lie at rt's own address, counted
under rt-gpu-address-unpinned;
- a counting visibility mode is refused once (rt-unbuilt-render-command).
Disabled is built, and no draw writes a count;
- every rt buffer takes its m2v.bufferEscaped [0] record when it is made, so
the guest's notes write none. A 0-byte buffer is refused as Metal answers nil
(rt-refused-metal);
- of the table kernels, one reads an input rt does not supply (rt-refused-gap)
and one binds through a descriptor (rt-refused-translation). Both decodes
answer refused;
- a varying-rate map's descriptor and layer are each refused
(rt-unbuilt-rate-map), and the create answers invalid;
- the 505 texture is refused (rt-unbuilt-iosurface-texture);
- the managed 2D array is refused in place (rt-refused-gap) on the RTX 3090
and the Radeon 780M. As two copies it shows its CPU copy once the guest's
replaceRegion: and synchronizeTexture: go through the decoder;
- a placed texture's resource id holds the guest's index in its low word and
rt's descriptor word in the high one. The cold-device test compares the low
word, and before this passed without checking anything on rt;
- the stage-input and tessellation pipelines are refused, with an error that
names the code.
Tests only: nothing changes for the guest or the host.
The reasons said no rt device was on the Mac before KosmicKrisp at the
cutover. The cutover is done; what keeps the tests off the Mac is that rt's
floor refuses MoltenVK and they have not run on KosmicKrisp, which the M3
Max does not have installed.
core::testkit::metal_answers read Metal's answers recorded beside the old
platform's tests, the long ones as xz files through lzma-rs. Those tests and
their answer files went with VulkanPlatform, so nothing calls it and no
answer file is tracked. lzma-rs, byteorder, crc and crc-catalog leave the
lock with it.