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".
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 take that grew the pool was carved only once the host said its piece was in,
and its worker zeroed it after that, so the host's add and the zeroing ran one
after the other on the take's path: on the 2080's gate walk the zeroing of
context 39's 560320 KiB take took 22.78 ms, and a 256 MiB add took 2.3 ms on
the 780M (11-19).
Now the pool's thread carves the take at its piece's first byte as it places
the piece, before it asks the host's add, and the take's worker zeroes the
carve while the host maps the piece; the take is still answered only once the
host said the piece is in. The zeroing's time counts as the take's zeroing
(pool-take-wait-zero-ns), and only the rest of its wait for the piece as its
growth (pool-take-wait-growth-ns and the pool-take-waited line), so the wait
codes' test checks the growth with the zeroing.
For the guest: a take that grows the pool is answered at its own piece's first
byte. Before, it took the first fit once the piece was mapped, which under a
race could be bytes another take freed meanwhile, or, with another context's
take carved first in the new piece, a further piece of its own.
A take that fits no piece waited for its own piece on the pool's one thread,
which served every ask in turn: the headroom's 16 MiB blocks from rt (each up
to 72 ms where rt's maker makes one), then the take's own block, and a piece
going back blocked the thread until its holds and the host's remove were done.
On the 2080's gate walk, context 39's take of 560320 KiB waited 271.54 ms for
its piece, of which 139.5 ms was rt's allocation of its block; the rest was
the wait behind that thread's other work and the add.
Now the take's worker takes the block of its own length from the source, with
the pool's lock let go of, so only that take waits for its allocation. A new
thread, reims-vgpu.graphics-pool-ahead, takes the blocks of the pool's own
asks (the headroom and the host's pool_grow). The pool's thread places the
takes' blocks before the taker's, and gives a piece back a step at a time: it
asks the host's remove once no hold is left and gives the block back once the
host removed it, waiting for neither, with the 1 s warning kept.
For the host: pool_add and pool_remove stay on reims-vgpu.graphics-pool, one
at a time, in the order the pieces are placed, each add before its remove.
A take's block may now be placed ahead of headroom blocks asked before it,
so the order of the adds, and the pool offsets the guest's takes get, can
differ under a race from before. The new tests fail on the code before this
(job m3-max-58851): another context's take, the headroom and a give-back now
go on while a take's own block is being made.
FEATURES_LO bit 9 was listed as reserved in design.md and is now
IMPORT_ADDRESSES_LATER. A guest that takes it beside IMPORT_ADDRESSES:
- gets a pages block's SURFACE_PAGES answered before the host makes the
block's view and its import, at gpu_address 0;
- makes its buffers over the block at gpu_address 0, and the host places each
at the view's address plus its offset;
- asks for a buffer's address with a new ring-0 query, PAGES_BUFFER_ADDRESS
(0x23d, RgfxPagesBufferAddress), answered by an RgfxPagesAnswer.
Why: on Iris, rt's import of a 17 MiB block of 4244 runs took 15.96 ms of
the block's 16.19 ms answer, and the guest's call waited for all of it. With
this bit, the import runs on the host after the answer is given.
This commit alone changes nothing for a guest: the host offers no new bit
yet, and no kext takes it. The header is cbindgen's (cargo xtask header).
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.
The pool asked its source for 64 MiB pieces. metal2vulkan-rt's unit is 16 MiB:
a take of up to a unit lands in a unit rt's block maker made ahead, with no
Vulkan call, while a longer take makes an allocation of its own length on the
pool's thread and rt frees it as one call once it has been idle 250 ms. A
driver may hold the device's submissions for the whole of such a call, longer
the longer it is: on an RTX 3090 a free on rt's slow path held a submit 72 ms
for 64 MiB and 20.6 ms for 16 MiB, and rt's ALLOCATION_LEN records a 16 MiB
Shared allocation holding one 3.3 ms at the median and one of 256 MiB 51 ms
(measured).
A piece the pool asks for itself is now one unit, BLOCK_LEN, read from rt
(MemoryClass::Shared.block_len()). The headroom keeps the bytes it kept, 64 MiB
(HEADROOM), as four empty pieces: the pool asks a unit for each piece the
headroom is short, counting the asks its thread has yet to serve and the one it
serves, and gives back only the empty pieces above the lowest 64 MiB of them. A
take longer than a unit still has a piece of its own length.
What the host sees: pool_add and pool_remove carry 16 MiB pieces where they
carried 64 MiB ones, four adds at the guest driver's take of POOL where there
was one, and, as the guest's use grows and shrinks, up to four times the adds
and removes for the same bytes, each piece a mapping of its own (QEMU: an
unmergeable RAM region, a KVM memory slot in each address space).
What the guest sees: a block's offset in the pool, and its GPU address where
the guest took POOL_ADDRESSES, follow the 16 MiB pieces. Blocks that shared a
64 MiB piece now lie in up to four, and a take longer than 16 MiB, which fitted
the old piece, has a piece of its own past the headroom's.
The tests that held the one 64 MiB piece count the headroom's pieces, and
a_piece_is_one_rt_unit pins the unit, the headroom's bytes and the long take's
own piece.
A carve passed over the zeroer's claimed chunk to the next fit past it, so where
a take's first fit held some of that chunk, the block's offset and GPU address,
which reach the guest, depended on how far the zeroer had got. The 3090 leg
caught it: a_block_of_a_source_with_no_addresses_takes_the_hosts_next_pick
found the freed block's bytes carved at 0x10000, not 0, the zeroer writing the
lower half of them as the take came.
Such a take now waits for the chunk's write, as a take only the chunk kept out
of every piece already did, and is carved at its first fit: one chunk's write
at most, counted with the other claim waits, and blocks lie where they would
with no zeroer. The wait's count goes down from there to the take's carve with
the pool's lock held, so the zeroer claims no new chunk under the waiting take.
With 64 MiB pieces, most of a take's bytes lie in a piece no block held
before, which the take's worker zeroed while the guest waited: on a 3090
walk the take path zeroed 3794 MiB (928 MiB with 256 MiB pieces), and the
takes' zeroing waits rose from 41.5 to 120.6 ms. The pool's zeroer only
zeroed a freed block's bytes in a piece another block still held.
The zeroer now zeroes, ahead of the takes, every byte no block holds and
no zeroing reached in each piece a block lies in and in the headroom, the
lowest empty piece, from its place on, before the host maps it. It
zeroes no other empty piece: one above the headroom goes back whole past
its delay, untouched. It takes the lowest such run first, the one a
take's first fit meets, from the run's top down.
It no longer writes with the pool's lock held: it claims a 64 KiB chunk
and holds its piece under the lock, writes it with the lock let go of,
and marks it zeroed under the lock again. A carve passes over the
claimed chunk, so no byte is zeroed twice and the chunk's piece goes back
only once the write is done. Where the claimed chunk alone keeps a take
out of every piece, its worker waits for that one write instead of
asking for a piece, counted (pool-take-claim-waits, -wait-ns).
The zeroer's bytes are counted as pool-zeroed-ahead-bytes (was
pool-zeroed-after-free-bytes), its writes' time as pool-zero-write-ns and
-write-max-ns, and its holds now cover the pick and the mark alone.
The pass that zeroes the scanout's room for a new WindowServer was described
from the code, without a measured frequency. A walk on the 3090 under KVM
(job m3-max-50552) read the guest's kernel buffer before and after each step,
and checked that each read continued the one before it. A logout with
autologin off made one pass, and was given the VRAM range once. The login typed
at the login window kept the same WindowServer and made no pass. The boot's
count was not read, because the 128 KiB buffer had dropped the boot's lines.
metal2vulkan development bf55e38ee3 enables VK_EXT_zero_initialize_device_memory
on no device and drops BlockInfo::zeroed: the runtime writes every zero itself,
where new_buffer's zero_from asks for them. So every block counts as unzeroed.
- The pool's take workers zero each carve whole, but for the bytes the zeroer
zeroed after an earlier free (pool-take-zero-skipped-prezeroed-bytes stays).
- A buffer or heap in a block of its own is zeroed: zero_from Some(0), a Shared
heap and a Managed buffer's bytes through the mapping, a Private heap by rt's
fill. A buffer pinned in a known block passes its zero_from as asked.
Gone with the fact: the pool's BlockInfo::zeroed, the codes
pool-take-zero-skipped-bytes, rt-zero-skipped-private-bytes and
rt-zero-skipped-shared-bytes, and the Placed mark, its module and the known
blocks' marks, which only the skip read. The tests that held the skip now hold
the zeros: a take over a given-back carve and past it zeroes all of it, a pinned
Private buffer reads zero at each placement, and the scratch test counts rt's
zeros alone. The guest's bytes read zero as before.
This builds only against bf55e38ee3 or later, so it lands with that pin.
A command buffer that holds only a video decode whose output lies in device
caches, where the VA-API arm copies the picture into the caches by its video
processing on the GPU, now posts its CB_COMPLETE as the session says the
decode is done and the copy is issued, instead of at its platform end after
the copy. The guest's decoder hands the picture on while the copy runs: the
start of a 4K stream decodes one picture at a time into new surfaces, and
each picture's chain waited for its copy.
What changed for the guest:
- such a CB_COMPLETE comes before the copy into the output's caches ends,
in its queue's order of records (a queue's turns of completion posts), and
carries GPU times of 0;
- the guest's writer slots, which it empties at the CB_COMPLETE, then name
the decode no more, so the host keeps each such decode by its blocks until
its platform end: a later command buffer of another queue that uses the
output waits for that end, on the GPU, or on the CPU for a video op; a
present waits for it as for a writer named; a lock's download waits on the
end value as before. Counted as buffers and presents held;
- the buffer's later work, its surface timeline, its caches' copy into the
pages, its context's drain and its place among its queue's buffers in
flight all stay at its platform end, so a reset, a close and a quiesce see
the decode in flight as before.
What changed for the host: raise_interrupt may now be called on a video
session's picture landing thread, reims-vgpu.graphics-video-land, inside the
landing's video processing run (reims_vgpu.h, docs/api.md section 5). QEMU's
reims-graphics-pci raises its interrupt from any thread, and is unchanged.
The bundle asked the kext for Private blocks of 256 MiB. On metal2vulkan-rt each
was an allocation of the driver's in the take: on NVIDIA's driver about 0.08 ms
a MiB with the device's other calls held, 21 ms for 256 MiB. It now asks for
16 MiB (kPrivateBlockBytes), rt's allocation unit, which rt's block maker makes
ahead of need, so a take is a range of an allocation already made.
A pick whose span and alignment are more than 16 MiB takes a block of its own:
their length rounded up to 64 KiB, holding that pick alone, at the block's first
aligned byte. It goes back to the host with the pick's free. On a 780M desktop
boot, 4 of 77 Private objects were longer than 16 MiB (32 MiB each), 250 MiB in
all.
What the host observes: PRIVATE_TAKE asks for 16 MiB or one object's span rather
than 256 MiB, and a context holds more, shorter blocks, an own block given back
at its object's free. What the guest observes: its Private objects' gpuAddress
values lie in those blocks. Picks, refusals and gives are otherwise as before.
The tests that held 256 MiB blocks now hold 16 MiB ones and the own block.
docs/graphics-kext/design.md says so.
Where the guest took MANAGED_AT_COPY and the platform makes the Managed
buffer at an address other than its CPU copy's (a copy in no block the
platform knows, such as one over the region), the host refused the
create, so the guest's id stood for a refused object: nil where bound,
its uses dropped. Metal makes that buffer, so the host must not refuse
it.
The host now keeps the buffer the platform made. It is the buffer the
same create makes from a guest that did not take the bit: the same
platform call, the same pin left unkept and counted, the same binding.
Each such create is counted as managed-at-copy-unkept, the first logged.
What changes for the guest on a unified rt host: such a create is a live
buffer, bound and used as without the bit, rather than a refused object.
Its gpuAddress is the address the guest posted, which the buffer is not
at, as a guest's own pick is not on that host today. Nothing changes
where the copy lies in a block the platform knows, nor on a host that
does not offer the bit.
The wire header's doc for the bit says so. The prebuilt sets and the
option ROM's record are rebuilt from it in their own commit.
The tests compare the answers with the same create's without the bit:
the decoder test its result, the platform's calls, the binding, the GPU
address, the unkept pin's count, a didModifyRange and a synchronize; the
rt GPU test its result, the binding and rt's address over the region.
What changes for the guest: on a host whose GPU shares the CPU's memory, on
metal2vulkan-rt's platform, with the Shared pool, the device offers feature
bit 63. A guest that takes it makes each Managed buffer at its CPU copy's
GPU address, so the gpuAddress its argument buffers and pointers hold is the
buffer's bytes, and it takes no Private block for it. Before, the guest held
its own pick in a Private block, rt made the buffer at the copy's address
instead, and a kernel reaching the buffer through its gpuAddress read the
Private block; each pick also held a Private take (1308 such picks and four
256 MiB Private blocks on a 780M desktop walk).
Where the guest took the bit and the platform does not make the buffer at
the copy's address (a copy in no block it knows), the host refuses the
create, as Metal answers nil, counted managed-at-copy-refused; it never
makes the buffer at an address of its own. A GPU of its own memory keeps two
copies, the Vulkan platform pins each buffer at the guest's pick, and a
device with no pool keeps the slabs' copies in region heaps: none offers
the bit, and their guests see no change.
On development the Private blocks' takes run on a worker per context, and
their release waits until no worker holds the ledger (ce64175ac). The pool's
zeroer met both rules badly:
- a take worker whose carve covered the chunk the zeroer was zeroing waited
for that chunk, so a take waited on the zeroer;
- the release waited for the pool's take workers and its zeroer to leave
their loops, but not for their threads to let go of the pool. The pool's
clock holds the platform, so a thread whose handle was the last could drop
rt's device past the release, the bug ce64175ac fixed for the ledger.
The zeroer now zeroes each chunk, 16 KiB, with the pool's lock held, and lets
the lock go between chunks. A carve is made under the same lock, so it never
meets a chunk half zeroed: no claim and no wait on either side. A holder of
the lock waits at most one chunk's zeroing, as for any other holder. The
zeroer shares no ledger, lock or thread with the Private blocks' workers.
The Private blocks' thread count (Threads, Live) moves to the pool's module.
The pool's take workers and zeroer are counted in it from their spawn until
they let go of the pool, and the release waits for that count. A new test
pins it: after the release, the pool's only handle is the caller's.
Zeroing was 91% of a take's wait on the 3090's desktop walk (220.0 ms of
242.0 ms in all, m3-max-53890): each take zeroed the bytes an earlier block
of its piece had held, on its own worker, before its answer.
A free now hands the freed block's bytes to the pool's zeroer
(reims-vgpu.graphics-pool-zero), when another block still holds the piece.
The zeroer zeroes them 64 KiB at a time, with the pool's lock let go of, and
records them as reading zero. A later take over them leaves them as zeroed.
An emptied piece is never zeroed, because it may go back whole. A release
never waits on queued bytes: they are dropped.
A take over bytes still queued zeroes them itself, as before, and the
zeroer's job skips them. A take over the 64 KiB the zeroer is zeroing at
that moment leaves those bytes to it, zeroes the rest, then answers once
they are done: the zeroer's writes to them may still land. Every take still
reads zero.
Two counts are new: pool-zeroed-after-free-bytes and
pool-take-zero-skipped-prezeroed-bytes.
rt's BlockInfo::zeroed (metal2vulkan dd4193cab3) says a block reads zero as
rt hands it out: the driver zeroed its allocation and no block held a byte at
or past it before. The owner's rule: zero unless the block says zeroed and
these bytes were never handed out. A block's mark of the bytes ever handed out
(Placed) rises past each placement, and only bytes below it are zeroed:
- own() and own_managed(): a Shared or Private buffer in a block of its own
skips rt's zero or the platform's memset where the block is zeroed;
- heap zeroed(): a heap's block of its own likewise;
- in_known(): a Private buffer pinned in a known block skips rt's GPU fill
where none of its bytes is below the block's mark, which every lookup in
the block raises (buffers, heaps and Managed device copies pinned there);
- the Shared take worker zeroes only the first bytes of a carve below its
piece's mark, raised as the carve is carved.
Skipped bytes are counted by class: rt-zero-skipped-private-bytes,
rt-zero-skipped-shared-bytes and pool-take-zero-skipped-bytes. Every byte
still reads zero to the guest; on a device without zeroInitializeDeviceMemory
nothing changes.
Guest-visible: a device heap the bundle pins in a Private block now starts
at a multiple of 256 KiB from that block's first byte, on both platforms,
where it started at the next 32 KiB granule. Heaps' gpuAddress values move;
no other pick does, and no wire field changes.
metal2vulkan-rt binds a heap's texture at the heap's offset in its block's
memory plus the texture's offset, and refuses one whose place there is off
the image's alignment, though Metal's rule (the offset a multiple of
heapTextureSizeAndAlign's align) places it. With heaps on the 32 KiB granule
every texture whose image asks 64 KiB or more (the 780M, Iris Xe, the XTX)
could land off it: pl8rt counted 85 such refusals in one boot, and the
window overview's thumbnails stayed grey.
256 KiB is the largest image alignment measured on the hosts' GPUs (a
multisample target on an RX 7900 XTX) and the current runtime's own heap
base alignment. The pick counts from the block's first byte, not from 0,
because the block's address is aligned only to the host's 64 KiB while its
memory starts at a multiple of 2 MiB on rt. Where no block is held the heap
lies at a multiple of 256 KiB in the context's range. The leading gap stays
in the block's free list, so later smaller picks reuse it once picks wrap.
In the per-shape form every surface's GPU form is its device cache, and the
platform makes no texture over a surface's buffer that is not a shape's. A
block in place named cached whose pages the host made no view of, or no
buffer over, was refused, and the kext gave the surface a copy block whose
textures then lay over no shape. On metal2vulkan-rt, whose platform holds no
lease of the guest's RAM to map views by, that was every such block: a
measured x86-64 boot refused 246 of them, each NotMapped.
Such a block now takes its cache all the same and is answered OK: its pages
are copied by the host's CPU through its mapping of the guest's RAM, each
fill and download through a Shared buffer of its own, as a deferred block's
copied pages already are, and the buffers over the block are the cache. It
is counted as rt-surface-pages-copied, the first logged. Runs that are not
the surface's bytes in whole guest pages, or that the host maps no part of,
are refused as before, and the default form keeps its refusal.
What the guest sees: a cached SURFACE_PAGES answered RGFX_STATUS_OK where it
was RGFX_STATUS_REFUSED, so the surface lies in place over the cache rather
than over a copy block.
Where the device caches every surface in place (SURFACE_CACHE_EVERY), no
host texture lies over a surface's pages: each is a view of an image the host
fills from the plane's place and pitch in the cache and writes back there, by
copies that address them in texels of the view's format. The host's linear
texture alignment, 256 bytes, then turned surfaces into copies for nothing:
15 of the 259 copy views of an rt boot, an x420 3840x2160 video output with
plane 0 at 568256 bytes and rows of 8000 among them, and rt refuses every
texture over a copy.
Under the feature a plane's offset and rows need only be multiples of 16
bytes, the largest texel of a format of texels, so every view's fill and
write-back address the plane whatever format of texels it takes. Without
the feature nothing changes.
For the guest: such a surface's view is in place, cached, where it was a
copy counted for alignment.
Where the device caches every surface the kext gives in place, a view that is
a copy is the fallback. It is still made, never nil, and counted by why:
alignment, unsupported, refused by the kext, or no room in the kext (now
apart from refused). The first of each reason goes out at the default level
with the surface's format and shape, and so does the minute's copies line
where a copy was made in it. A walk's guest log, which keeps the default
level, then shows what still takes copy blocks on rt.
On metal2vulkan-rt (Row 9, ruled (a)), a pages block of pages its process
maps read-only gets one known import of its view, made at its SURFACE_PAGES,
as a writable block does.
What the guest sees on rt:
- That SURFACE_PAGES is answered with the import's GPU address where it was
answered with 0.
- Each BUFFER_OVER_PAGES of bit 24 over the block lies at that address plus
its offset, pinned in the import, over the block's pages. Before, it lay at
the guest's own pick with an import of its own, unpinned.
- A GPU write through such a buffer reaches the pages, where Metal drops it.
That is rt's rt-no-copy-read-only, which held before too.
- A heap, an ICB's slots and a Managed CPU copy over such a block are still
refused.
The Vulkan platform is unchanged: no address, and buffers over copies of the
pages.
The known-import test now holds a read-only block's address, its pinned
buffer and its import's forget. The old platform's test still holds the 0.
The pool started with no piece, so the guest's first take waited while the
pool's thread made a block and the host mapped it: 47.7 to 58.7 ms on a
Windows host, where the block's pages are touched one by one. The pool now
keeps its one empty piece from the moment the guest's driver takes POOL.
What the host observes: the first piece's pool_add now follows the guest's
DRIVER_FEATURES write that takes RGFX_FEATURE_POOL, from the pool's thread,
instead of following the first POOL_TAKE. A driver that does not take POOL
gets no piece. A take of POOL after a reset asks none while a piece the
guest may use is empty or one is asked. pool_add still never comes before
the device's make returned. The guest's first take is carved from that
piece where the host mapped it by then.
The device tells its host through a new Host::pool_taken, called inside
the write each time the bit goes from not taken to taken; the graphics host
answers it with the pool's headroom rule, the test State::use_piece makes.
The tests that took a block first now map the piece the take of POOL asked
for before the take.
A Windows host offered no pool, so an x86-64 guest under WHP kept the region's
slabs and its processes' own pages until the pool's cost there was measured
beside the region's: what the guest's CPUs get from a pool block, what making
a block stalls, and the frames of a desktop walk, on homelab-mac-mini-2018's
UHD 630 (docs/qemu.md, "Windows hosts: the Shared pool"). An x86-64 guest on a
Windows host is now offered POOL and POOL_ADDRESSES, as on a Linux or macOS
host, and its processes take pool blocks for their buffers' slabs. An arm64
guest, which runs under TCG on a Windows host and was not measured there, is
still offered none.
The pool's tests run on Windows too now, with the two test-only GPU address
reads they use.
An Apple GPU's device (an arm64 guest's) makes a Shared heap, which until now
was a block of the device region, HEAP_OVER_HOST_MEMORY. Since the arm64
guest takes the Shared pool too, that heap was the last of the bundle's
buffers and heaps the region held where the pool is on.
What the guest sees: where the device has the pool (the slabs' one source),
newHeapWithDescriptor: of Shared storage takes a block of the pool of the
heap's size rounded up to 64 KiB and makes it one HEAP_OVER_POOL of the heap's
size, type and options, at the block's GPU address where the host gives one
(POOL_ADDRESSES), else at the process's pick. The heap's gpuAddress is that
address, its buffers lie at their offsets from it, and its bytes are the
block's, which the host zeroed. Its drop gives the block back, and no address
where the host gave it. A heap the pool has no block for, past the 4 GiB
longest block, or with no address left, is nil, as Metal's heap is where its
memory runs out; nothing falls back to the region. Where the pool is off, a
Shared heap is a region block as before. A new shell test makes one at the
host's address and its buffer, and the two nils.
A queue's upload chunk, where set*Bytes: puts its bytes, is a buffer of the
device's slabs, and where the slabs had none for it, a block of the device
region of its own. Where the slabs are the Shared pool's alone (the commit
before), that block was the one region use left for an upload chunk.
What the guest sees: where the pool is on, a chunk the pool has no block for
is none, with no BUFFER_OVER_HOST_MEMORY over a region block, and the command
buffer whose bytes found no room completes with MTLCommandBufferErrorOutOfMemory,
as it did where the region was full, and as Metal's does where its memory runs
out. RgfxSlabs::inRegion says which the slabs are. A new shell test takes a
chunk of a pool that refuses and then gives a block. Where the pool is off,
chunks fall back to the region as before.
Where the device has a Shared pool, the kext maps its blocks and Managed
buffers lie over Shared copies (POOL and MANAGED_BUFFER_SLABS, which every
host that offers the pool offers), the pool is now the slabs' one source. A
Shared or Managed buffer, a Managed texture's CPU copy or an upload chunk the
pool has no block for (the kext refuses the take for the slab and for slabs
half as large down to the buffer's size), or one past the 4 GiB longest block,
is nil, as Metal's newBufferWithLength: is where memory runs out. Before, such
a buffer took a slab of the device region, which every process shares and
which the planner's ruling R1 keeps for the rings and the scanout alone.
What the guest sees: no HEAP_OVER_HOST_MEMORY for a slab where the pool is
on; a refused take is followed by the same take once more and then halved
takes, all of the pool. The halving that was the region's alone is the own
source's, so the pool's slabs halve too. The pool's tests change to the pool
alone: the Managed class without a heap, the take past 4 GiB and the refused
take are nil, and a new case shows a halved slab taken where only 64 KiB is
free.
Where the pool is off (Windows hosts, arm64 guests), the slabs are as before.
The pool's docs said an arm64 26 boot under TCG read its first blocks
unaligned through the kext's own mapping, but the probe's kernel log lines
never appeared, and the range sits just past the guest's RAM, not above 2^36.
Name what the boots showed instead: processes ran on blocks mapped
write-back with no fault under TCG (macOS 26 and 14) and under HVF on an M3
Max (macOS 27.0.1), where each piece maps into the VM as RAM, 16 KiB aligned.
The arm64e kext now carries POOL and POOL_ADDRESSES as the x86-64 kext does:
its processes lay their buffers' slabs in pool blocks the kext maps
write-back, at the GPU addresses the host gives the blocks, where they used
the region's slabs and the kext's chunked pages before. The pool's carried
constants and the arm64 build of the pool blocks' test go, since neither
differs by architecture any more. design.md says which hosts offer the pool
and what the probe boot showed.
On metal2vulkan-rt a no-copy buffer's GPU address is the device address of the
host's import of its pages, which only the host knows, so a guest pick cannot
match it. Where the kext and the device both took IMPORT_ADDRESSES, the bundle
asks PagesBlock for its third output, the GPU address the host gave the block's
view, and makes each BUFFER_OVER_PAGES over the block there plus the pointer's
offset in its page, with no pick of its own and none given back at its destroy.
What the guest sees changes: a no-copy Shared buffer over writable memory the
kext wires answers a gpuAddress in [2^43, 2^44) on the Vulkan platform (at its
pages' import on rt) instead of a pick in the context's range, and two no-copy
buffers over the same bytes, which join one block, answer the same gpuAddress.
A Managed no-copy buffer's own address stays its GPU copy's pick; only its CPU
copy, the Shared buffer over the pages, moves. Read-only memory, copied memory
and blocks given no address keep their picks, and a guest without the bit sees
nothing change.
design.md gains the "Import addresses" paragraph, PagesBlock's third output and
the kext's bit 18.
This change is visible to the guest. Where the kext and the device both took
PRIVATE_BLOCKS, these objects now get their gpuAddress inside blocks the
host gives the context, rather than in the context's own range in
[2^46, 2^47):
- Private buffers;
- heaps that are not Shared, and the buffers in them;
- Managed buffers, whose GPU copies are what the address names.
On the Vulkan platform those addresses lie in [2^44, 2^45). On
metal2vulkan-rt's device they are the Vulkan device addresses of the host's
memory, which is the reason for the move. Shared buffers, the pool's heaps
and no-copy buffers keep their addresses.
How the bundle picks inside its blocks:
- Picks are next fit through the blocks, on the same span and granule
rules as the context's range.
- A block is taken from the kext when none has room: 256 MiB, or the pick's
span and alignment rounded up to 64 KiB where that is more. 256 MiB is
rt's pooled block, and it keeps a freed span from being picked again soon
after its destroy.
- Free ranges never join across blocks, so no pick spans two of them.
- One empty block is kept for the next picks. Any further empty block is
given back after the last object's destroy has been posted.
- Where the host refuses a take, the bundle picks in the context's range as
before and logs the first refusal.
The serializer tests cover picks in blocks, a block of its own for a large
pick, giving back and keeping, blocks side by side, refusal and threads.
docs/graphics-kext/design.md gains "Private blocks" and the two selectors.
Where the device and the kext both took POOL_ADDRESSES, the bundle asks
PoolTake for its fourth output and makes the block's HEAP_OVER_POOL at that
address, picking none of the context's: on metal2vulkan-rt's device the
address is the block's Vulkan device address, which the guest cannot pick.
The heap's destroy gives no address of the process's back (ownsAddress), so
a host address that meets one of the process's picks never frees the pick.
The pool takes' log line counts the heaps placed at the host's addresses.
What moves for the guest: every Shared pool slab's heap, and so each
buffer placed in it (gpuAddress, contents' GPU address), moves from the
context's range [2^46, 2^47) to the host's address: [2^45, 2^46) on the
Vulkan platform, the block's device address on rt. A buffer's address is
still its heap's plus its offset; Managed buffers' own addresses, Private
buffers and the region's slabs are the process's picks as before.
test_pool_slab_source_at_host_addresses holds the new placement; the
existing pool slab test holds the old one for a kext without the bit.
On the arm64 device, a command buffer named in SURFACE_USE only the cached
IOSurfaces it encoded a use of. A surface the GPU reached only through a
residency set the buffer used, or its queue held, was never named: its device
cache kept the generation of its last named use, and a copy-mode surface's
copy was not synced, so the GPU read what it held before the CPU's writes.
What the guest observes changes: at its commit, a buffer names each texture
over an IOSurface, or view of one, committed to a residency set it uses or its
queue holds, as a resource it reads. A cached surface's cache is filled first
where the CPU wrote it since, and a copy syncs. The set keeps its committed
IOSurface members as its own commit changes them, so a buffer's commit reads
them without walking the set. The x86 device makes no residency sets, and is
unchanged.
A cached IOSurface's device cache was filled at the read-write lock that
moves the surface's generation, not at its unlock. A command buffer committed
while a CPU held the lock filled the cache with the pages mid-write, and the
CPU's writes after it reached the GPU only at the surface's next lock.
What the guest observes changes: the first command buffer committed after the
unlock that uses the surface now reads the CPU's writes made under the lock.
The bundle tracks a cached surface's unlock seed from a commit that found it
locked for writing, as copy mode does, and that buffer's SURFACE_USE carries
the new RGFX_SURFACE_USE_REFILL flag. The host fills the cache again at the
generation it holds, unless a command buffer that may write it was committed
since its last copy into the pages, whose write a fill would lose.
The flag is under the new feature bit RGFX_FEATURE_SURFACE_REFILL (bit 58),
which every host offers and both kexts take; the bundle sets it only where
its kext took the bit and answers the surface seeds. The bundle counts the
surfaces named mid-write and the refills, and the host its refills and the
refills it kept from, in their summaries.
design.md gains "The Shared pool", which the wire, the host and the kext
cite: the range and who gets it, a take and its wait with no deadline, the
heap over a block, a give and a close, what moves to the pool and what stays
in the region, and why no empty slab of the pool is kept. The slab section
says the pool comes first where the device has one.
The x86-64 kext takes the device's POOL where offered, and sets its own Pool
bit (1 << 15) where it did. A process takes a block through selector 16
(PoolTake): the kext posts its context's POOL_TAKE, maps the block the host
answers with into the process write-back, and lists it. It gives the block
back through selector 17 (PoolGive): the kext unmaps it, then posts the
POOL_GIVE. At the client's close the kext unmaps every block it lists before
the CONTEXT_CLOSE, which gives them all back. HEAP_OVER_POOL joins the
context ring's commands a process submits itself.
The take waits for the host's answer with no deadline, THREAD_UNINT like
the kext's other asks of the host: the host answers each take of an open
context, and the close waits for its takes in flight, so the kext never
gives up on a take whose answer then comes late. Where the host stops
answering, each taking thread waits, holding one of the 32 lifecycle
waiters, until it does.
The arm64e kext takes no POOL and sets no Pool bit: selectors 16 and 17
answer kIOReturnUnsupported there, and its processes keep the region's
blocks and the kext's chunked pages. Selectors 16 and 17 are numbers the
sandbox lets a web content process call.
metal2vulkan's replay player must stop, typed, where the GPU may reach a
no-copy buffer through an address in memory alone. The guest says so with
BUFFER_ESCAPED, but the note ended in the decoder: no stream carried it, and
only the stats file's counted totals showed it.
The decoder's first note for each buffer now also records it, where the
process records (REIMS_VGPU_RECORD): an m2v.bufferEscaped call on the
buffer's stream id, [kind], the note's RGFX_BUFFER_ESCAPED_* act (0
gpuAddress, 1 argument encoder, 2 resource id, 3 residency set), of the whole
buffer. It is queued on the decoder's thread at the note, so it lies after
the m2v.write records of each commit made before the note and before those of
each commit made after it. A later note, a note for a refused create and a
bad reference write none. Each record is counted by its selector in the stats
file, and the recorder_fix "buffer-escaped" names the change.
Nothing changes for the guest or the C API's host. With REIMS_VGPU_RECORD
unset the note costs one more relaxed load (recorder::on).
The pass that zeroes the scanout's room for a new owner runs only when a new
WindowServer process opens the server connection, never at boot or on the
same WindowServer's reopen. It zeroes the display's whole share, so the host
backs all of it from the first replacement on. The paragraph now says so, with
the measured stores on KVM (103 ms) and WHP (802 ms).
The kext zeroed each span of a new block through a kernel mapping it made for
that span and took down after it. Over a boot to the desktop and a probe's 905
new bodies (rzboot2, a macOS 26.7.2 guest on a 780M host), making and taking
down those mappings took 402.5 ms of the zeroing's 433.3 ms, and they were its
longest waits at boot: 114 ms for one staging chunk, 19 ms for one surface
header.
The kext now maps the blocks' range into the kernel once for each cache mode at
its start, write-back from the region and write-combined from the region's
write-combined descriptor. It keeps both mappings for the kernel's life, as it
keeps the doorbells' mapping, and writes a new block's zeros through them, so a
block's zeros cost only their stores. The kept mappings hold the kernel's
address space and page tables only, and none of the host's memory: no page of
the region is touched until it is zeroed or used. On a Windows host (WHP) the
kext's zeros are the first touch of a region page that was never touched
before. Where the kernel will not make a kept mapping, each span is mapped
alone, as before. The kext logs each kept mapping's size and how long it took
to make, once at its start.
The scanout's room holds the display's pixels, and the region keeps them past
the process that wrote them. A task that opened the framebuffer's server
connection after another (the next WindowServer, after a crash or a logout)
was handed the room through the VRAM range, a surface lock or the scanout
grant with the last owner's last frame still in it.
The framebuffer now zeroes the display's room when a task that is not its
last owner opens the server connection, through a write-back mapping, the mode
the windows and the locks map the scanout in. The task owns nothing until the
zeros are in, and every other task's hold of the scanout is taken back first.
A room the kernel will not map for the zeros fails the open. The last owner
opening again keeps its bytes, and the first owner finds the boot screen,
which no process wrote and which the first present clears, as before.
What the guest sees: the screen shows black, not the old owner's last frame,
from the new owner's open until its first present. The pass is one zeroing of
the display's room, up to 128 MiB, per new owner, logged with its mapping and
store time.
scanout_owner_test checks that a new owner's first read of the room is zero
and that it owns nothing before, and that the last owner's open again keeps
its bytes.
A region block's offset goes to any process once the device answers its
release or its holder's close, and the region keeps its bytes across the
device's reset and the guest's reboot. A new block held whatever its last
holder left: another app's command buffers' bodies, its shader library's
staging chunks, its buffers, or a surface copy of its window's pixels.
The kext now writes zeros over every span a window maps of a new block
before the window maps it, each through a kernel mapping of the cache mode
the window maps it with (write-combined from the region's write-combined
descriptor, write-back from its own), and allocBlock maps from the same
spans, so what is zeroed is what is mapped (RgfxBlockZero.hpp). A surface's
new block is zeroed over the part its holders map: the whole copy for a copy
block, the header for one in place. A span the kernel will not map fails the
grant. A block held again (a shared or revived surface block) and a pages
block, never in a window, are left.
The kext logs what the zeroing took by kind (bodies, split, write-back,
surface copies, surface headers), and offers it as feature bit 1 << 14
ZeroedBlocks, after which the bundle takes the region's slabs as clean
rather than zero them again. block_zero_test checks the spans and the
cross-process cases natively; guest/bundle/tools/block_zero_probe.c checks
them in a guest, a block filled by one process and read by the next.
On Linux and Windows, a no-copy buffer over pages the process maps read-only
lies over a copy of those pages. Once such a buffer's identity has escaped,
the GPU may read the copy through memory after the guest's CPU has changed
the pages, with no binding naming the buffer. This commit records how often
that situation arises, and pins the runtime behaviour that keeps it correct.
The behaviour is unchanged: the decoder adds nothing to any command buffer.
Metal requires an encoder to make resident (useResource:usage:) any buffer a
function reaches through memory, and that names the buffer as a use. At the
commit, the runtime copies in every copy that a command buffer's uses name,
and every copy where its work may reach memory that no use names
(metal2vulkan's command_buffer/mod.rs:4747-4772 at the pinned commit, which
picks the copies at 4754-4766). A reach of a buffer that no encoder made
resident is undefined in Metal, and on the runtime it reads zero
(residency.rs).
What the decoder adds is bookkeeping:
- each process's count of its live escaped copies (Context::escaped_copies),
which a copy joins at its first note and leaves when it is dropped;
- escaped-copy-commits, which counts each command buffer begun by a process
that holds one, in the degradation counts line and the recorder's stats.
The first such command buffer is logged at info.
on_vulkan_an_escaped_copy_reached_by_its_address_reads_the_cpus_writes pins
today's runtime. A kernel reaches the escaped copy only through an address it
loads, with the encoder having made the copy resident. It reads the pages' old
bytes, then their new ones after the CPU's write.
The host reads a no-copy buffer's bytes in place. The guest's Metal can hand
that buffer's identity to the app, or write it where the GPU reads, with no
message naming the buffer, and from then on the GPU may reach the buffer
through memory alone. The host had no way to know which buffers that happened
to. This commit adds a note for it, so the host can tell them apart.
The note is RGFX_CMD_BUFFER_ESCAPED (0x23b), RgfxBufferEscaped of 32 bytes:
the buffer's object id and the act, one of GPU_ADDRESS, ARGUMENT_ENCODER,
RESOURCE_ID and RESIDENCY_SET. The device offers it as
RGFX_FEATURE_BUFFER_ESCAPED (bit 56), and both kexts carry it. The submit gate
takes it in a batch, like a Managed range's write: unwaited, a fixed size,
naming no block and making no object.
The bundle marks each covered buffer as it is made (_rgfxEscape, set by
rgfxOwesEscapeNote) where the host took the feature. The first of these acts
in the buffer's life posts the note, before the act returns:
- a read of the buffer's gpuAddress;
- an argument encoder's setBuffer(s) of it, or setTexture(s) of a texture or
view over it;
- a read of such a texture's or view's gpuResourceID;
- the buffer, or such a texture, joining a residency set.
Every later act is one relaxed load.
Wire order holds the note ahead of any command buffer that could use the
identity. The note goes on ring 0, posted or held in the serialiser to go
before the next commit's messages, and the device carries out a command buffer
only after every ring-0 message its process posted before it. Across threads,
the act's slow path posts the note under the buffer's lock and then clears the
mark with a release store. Every commit takes an acquire fence before it posts,
so a commit after an act that found the mark clear posts after the note.
The covered buffers are the app's no-copy buffers over its own pages
(BUFFER_OVER_PAGES, writable or read-only, bit 24) and over bytes already in
a block of the process (BUFFER_OVER_HOST_MEMORY). Managed buffers, heaps over
pages, IOSurface shadows and buffers placed in a slab's heap
(BUFFER_AT_OFFSET) are not covered.
A slab buffer made with an address of its own is covered too: a Shared buffer
past 2 MiB over a slab of the process's own pages, a device buffer, or a
no-copy buffer's shadow (RgfxSlabSource::Made's ownsAddress). It reaches the
host as the same BUFFER_OVER_PAGES or BUFFER_OVER_HOST_MEMORY message as an
app's no-copy buffer, and the host takes every such message alike. Leaving
slab buffers out would leave the host unable to read the mark as "this
buffer's identity never left".
The host marks the buffer's entry escaped, once for its life, and a later
note changes nothing. A note for an object that is not such a buffer is a bad
reference. A note for an object whose create the host refused is dropped, as
any naming of one is. Escapes are counted in the degradation counts line and
in the recorder's stats (`counted <code> <n>` lines), with no new stream
records:
- buffer-escaped-gpu-address, -argument-encoder, -resource-id and
-residency-set, by the act that noted the escape;
- buffer-escaped-read-only-pages, the escaped buffers over a copy of their
pages;
- no-copy-buffers, every no-copy buffer made, of which the escapes are a
share.
Each act's first escape is also logged at info.
This changes nothing the guest observes. No one waits for the note, it has no
reply, and the mark changes no answer, object, address or command. Both
prebuilt sets and the option ROM's record are rebuilt from these sources. The
ROM's bytes do not change: its record changes only by the wire header's hash.
A guest's render pipeline drew its patches with Metal's default tessellation
state, whatever its descriptor set: power-of-two partitions, a maximum factor
of 16, no factor scale, constant factors per patch and clockwise output. The
bundle never sent the seven tessellation fields, so the device never saw them.
For the same reason the device never saw maxVertexCallStackDepth or
maxFragmentCallStackDepth, and created every pipeline with a depth of 1.
The bundle now reads each of these properties and sends it. Each tessellation
field travels as Metal's raw value, and tessellationFactorScaleEnabled as a new
flag, RGFX_RENDER_PIPELINE_TESSELLATION_FACTOR_SCALE (bit 8). The depths are
read only where the descriptor answers their selectors (macOS 12 and later);
older guests send 1.
The decoder passes every value through FullRenderPipelineDesc to the runtime's
RenderPipelineDescriptor. A state equal to Metal's defaults becomes the
runtime's `None`, so a pipeline that sets nothing is created exactly as
before. A raw value the runtime has no enumerator for dies at the send, as
every other enumerated field does. The recorder's tag-13 map carries the
values as three keys after privateState: `tessellation`,
`maxVertexCallStackDepth` and `maxFragmentCallStackDepth`.
Guests now see patches tessellated with the partition mode, maximum factor,
factor scale, step function, winding and control point index type that their
pipeline sets. They also see pipelines created with the call stack depths
they asked for.
The tessellation fields and the call stack depths share this commit because
they share one wire record. RgfxRenderPipelineCreate grows from 464 to 496
bytes, with eight u32s appended at offset 464, and both prebuilt sets and the
option ROM's record are rebuilt from these sources. The ROM's bytes do not
change.
metal2vulkan's new runtime counts its GPU times on CLOCK_MONOTONIC on Linux
(its ruling of 2026-11-18: lavapipe calibrates no CLOCK_MONOTONIC_RAW domain),
while the device's clock, which the guest's kext maps the device's times by, is
CLOCK_MONOTONIC_RAW. At the cutover every GPU time the platform answers has to
be moved onto the device's clock before the guest sees it.
reims-vgpu-graphics's clock::runtime does that by a paired read (the
platform's clock, the device's, the platform's again; the least bracket of
three), fresh at each conversion, and names the platform's clock in one
constant, PLATFORM. Its one call is the CB_COMPLETE record's GPU start and end
in the decoder: the only platform GPU time that reaches the guest. One pair
moves both, so the run's length, which is what the guest reads, stays exact.
The runtime the library runs today counts the device's clock on Linux and
Windows, so PLATFORM is Domain::Device and the times pass unchanged: no value
the guest sees changes. The cutover sets it to Domain::Monotonic on Linux;
should the new runtime count CLOCK_MONOTONIC_RAW there, the module goes.
oracle_storage mtexcap on the AMD Radeon Pro 5300M: a replaceRegion: made after
the commit is seen, whole or partial, until the command buffer is submitted (a
wait on an unsignalled shared event holds it unscheduled until the signal), and
not once the GPU has started it: the bytes are taken at the submission, as a
Managed buffer's. The Intel UHD Graphics 630, one copy, sees every replace.
metal2vulkan's planner is ruling on when the new runtime takes a Managed
buffer's CPU bytes on a discrete GPU. capture's new steps, run at 4 KiB
and 64 MiB on the 5300M and the Intel 630, answer it: the 5300M takes the
bytes at the submission, after the commit returns (a write at once after
the commit is seen whole, one 20 ms after scheduling is not), and a second
didModifyRange: does not reach a command buffer already running. The
Intel 630, one copy, sees every write.
Q2 gets the three steps' rows, the 64 MiB answers of all eight, the job
ids, the 64 MiB run's memory, and the window's timings. The sentence that
said no step writes between the commit and the submission now says step 5
does, and that the 5300M's spin once saw the CPU's flag write.