9949e3e79e4cb8f44f2a66f72b9d202bb0baec00
71
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c50dfba740 |
🐛 Answer argument buffers' layouts on the rt platform
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. |
||
|
|
eb601ecc10 |
⬆️ Build on metal2vulkan development 9ea53f7acd
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. |
||
|
|
11055c78d5 |
⬆️ Build on metal2vulkan development 82e7c39216
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.
|
||
|
|
8a7f4c2a7f |
📝 Cite the rt swapchain heading by its new name [ci skip]
cutdel's WIP 9 renames rt_platform/swapchain.rs's "No device recovery, no drawable fetch" to "No device recovery", with the drawable fetch gone; the ledger's device-loss row cited the old heading. |
||
|
|
8c40add9ac |
📝 Say what the tree runs on now the old platform is gone [ci skip]
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. |
||
|
|
f554f99836 |
🆕 Write one line for a lost rt device and count each lost buffer
rt writes nothing when its VkDevice is lost, and the platform answered the lost work with codes alone, so a run that lost its device left no trace on the host but the guest's own silence: two walks froze that way with nothing in their logs to say why. The first command buffer that fails with the device lost now writes one line on stderr, once for the device, beside the platform's other degradation lines: it names the GPU (name, PCI vendor and device IDs) and how many command buffers were committed and not complete at that moment. Each command buffer that fails so is counted under rt-device-lost, so the boot's degradation counts say how much work the loss ended. The ledger's rt device-loss row says so in place of "nothing logs or counts the loss". |
||
|
|
12188cd395 |
📝 Tell the two walks' freeze without naming the app [ci skip]
The row named what the guest ran in the two rt walks that lost their device. The ledger keeps walk facts generic, so it now says only that the guest's running app logged nothing for its last ~3 minutes, until the walk stopped it. |
||
|
|
dc41818ca8 |
📝 Name the two rt walks that lost their device [ci skip]
The rt device-loss row said no rt boot had lost its device. Two had, while every command buffer the loss ended still answered 11: m3-max-53777 on the 3090 and m3-max-54078 on the XTX. In each, the running benchmark stopped making progress for its last three minutes. The row now says that, and that what the guest does with 2 and 1 is not measured. |
||
|
|
64fc8e0df6 |
📝 Say what the guest sees after a device loss on rt [ci skip]
The owner ruled that the cutover ships with no recovery after a GPU device loss. The ledger listed only the default platform's recovery, so this adds a row for rt beside it. On rt the device is never made again. The lost work fails 2 then 1, and every later commit fails at once with 1. A new object is made only where the driver's Vulkan calls still make one. The window presents nothing more, while the guest's presents are still answered at each refresh. The process runs on until the VM ends. What the guest's apps do after that is not measured. |
||
|
|
bf31c11cf9 |
🐎 Mark a command buffer's parts but its last to join the next
A guest command buffer the walk cuts into parts went to the GPU as one kernel submission a part: on the Iris Xe's animation page a waited buffer took about 11.6 vkQueueSubmit calls of about 180 us each on ANV. Nothing observes a part's completion but its own handler, which notes its GPU times and error for the last part's record and lets its place among its queue's command buffers go; the last part carries every record, ticket and signal the guest sees. So each part but the last is marked to join the next one's completion (CommandBuffer::set_completion_joins_next), and the runtime may send up to four of a queue's parts found ready together, and the part behind them, in one submission. Never marked: the last part; a part that waits for or signals an event, by an op or from the buffer's begin (a device cache's fill, another queue's buffer in the surface order); and a part the platform keeps whole, whose commit is the whole's. The guest still sees its command buffer complete at its last part's own end, with the same GPU times and the first failed part's error. Tests: a_buffer_s_parts_but_its_last_join_the_next_completion_unless_they_ signal and a_first_part_that_waits_from_its_begin_is_not_marked; the dealt and kept-whole tests check which parts are marked. |
||
|
|
0717a8730f |
📝 Record how i915 resets QEMU's context on Gen12 [ci skip]
GitHub #142 reported VMs dying on a Raptor Lake UHD 770 after i915 reset QEMU's context. At master on ms01's Raptor Lake-P Iris Xe nothing was reset: the longest guest command buffer took 128 ms, and B26's two media-analysis buffers about 100 ms. A full GT reset provoked through debugfs while QuickTime played logged the same kernel line as the report, and the runtime made its VkDevice again in 209 ms. The guest ran on, but the desktop picture stayed flat green. docs/qemu.md now says when i915 resets a context on Gen12, read from i915 and ANV: with GuC the 7.5 s preempt timeout applies to one draw or one thread group, not to a whole command buffer. It also gives these runs. The accuracy ledger's recovery row said nothing makes the guest's objects again. The runtime now carries most of them: a texture or Private buffer it remakes reads as new, and it leaves a few buffers and caller-image textures refused. |
||
|
|
b6536bbe10 |
📝 Say Grouped held a few batches in steady Launchpad, not none [ci skip]
Two of ten steady Launchpad windows (one per GPU) held 30 batches in 9 groups, and the first opening saved 0.15-1 submissions a present across all five Grouped walks, not 0.8-1. Docs only. |
||
|
|
1498b14175 |
📝 Record Metal's completion envelope where Exact is chosen [ci skip]
The doc above exact_policy and the accuracy ledger said only that grouped completion bought no frame rate on the Iris Xe. They now say what Metal does, measured on two Macs: each command buffer is seen complete at its own end, 17-41 us later at the median on a Radeon Pro 5300M and a UHD Graphics 630, 86-106 us on an M3 Max, never once the next one has ended. Grouped completion sees a member late by the GPU time of the members after it, up to the runtime's 16 ms bound. They also say what Grouped did on RADV, the 780M and the RX 7900 XTX: no grouping in steady Launchpad, and 7-9% fewer kernel submissions in Geekbench's Metal pass for no shorter run, with completions up to 60 ms late. No code changes. |
||
|
|
90be359c9b |
🐛 Answer GPU times from the GPU's own timestamps off MoltenVK
This changes what the guest observes, on every device but MoltenVK:
- A command buffer's GPUStartTime and GPUEndTime become when its GPU ran it,
as Metal's are. The device posts them in its completion record, and the
bundle answers them to the guest, whose compositor reads them. They come
from two GPU timestamps each command buffer writes, placed on the host's
clock by the runtime's calibration. Until now device_options asked every
device for GPU times from the host: the run the guest saw went from its
submission to the runtime seeing it complete, detection latency included.
Over the same ~35k command buffers of a Launchpad walk, the GPU time the
guest received summed 48 s against 62 s on a Radeon 780M, 10 s against
17 s on an RX 7900 XTX, 31 s against 39 s on an Iris Xe, and 25 s against
30 s on an RTX 3090.
- VkQueue sharing comes on where the runtime's own check finds the GPU idle
at queue switches (NVIDIA's; RADV's single graphics queue has nothing to
share). Host times had kept every device Unchecked (below).
MoltenVK keeps host times: the runtime takes them there whatever the option
says (TimestampsWaitForEveryQueue), as it does on a queue family with no
timestamps.
Cost: +2.5 to +7 us per command buffer at the median across six GPUs,
frames unchanged.
The cost, which the option was set for, was measured only on MoltenVK.
Off it, gpu_times_from_host_latency (release, 1000 one-fill command buffers
each way per run, interleaved) puts commit to completion 2 to 7 us later at
the median: XTX +4 us (13 runs), 780M +4 us (13), RX 550 +2.5 us (10), Iris
Xe +4.5 us (10), RTX 3090 +5 us (10), RTX 2080 +7 us (10), within runs whose
medians spanned 44 to 292 us. Walks of a 26.7.2 guest's desktop and
Launchpad on the XTX, the 780M, the Iris Xe and the 3090 drew the same
presents at the same take-to-show times either way, fatal 0.
Host times also kept the runtime from sharing VkQueues between command
queues (queue_share.rs: a device without timestamps the host reads is
Unchecked), so the accuracy ledger's queue-sharing row never applied to our
builds. It does now on NVIDIA: the 3090 walks moved 9 to 13 queues, take-to-
show 8.08/8.09 ms against 8.15/8.05 with sharing held off and 8.00 from the
host. The row now says which devices it reaches.
A test holds the new answer: the runtime announces GpuTimesFromHost exactly
where the device's driver has TimestampsWaitForEveryQueue, and the times lie
in the command buffer's life. The timing module's debug legs are renamed for
what they measure now ("on the GPU", "GPU end to the handler"), as are the
surface-cache cost bench's.
|
||
|
|
b157365a1e |
⬆️ Build on metal2vulkan v0.2.0 (d9236a8a11)'s runtime
Moves the runtime from ce54ad8b25 to the v0.2.0 release, d9236a8a11 (RUNTIME_VERSION 2342, SEMANTICS_VERSION 2122, ARTIFACT_FORMAT_VERSION 523). It adds no degradation kind. Two of our tests follow its answers: the policy's exact forms name its new indirect_records field, and the two-plane YCbCr argument-buffer write test checks 500 like the other formats now that the runtime writes those slots through. The accuracy ledger gains the row for the indirect-records policy. Checked, at the owner's word, with one cold boot of the x86-64 macOS 26 guest on the RTX 5080 over this tree and vendor/qemu's 2026-11-13 move. |
||
|
|
694f2178f3 |
🐛 Complete a depth resolve into read-only memory as Metal's GPU does
A depth attachment's StoreAndMultisampleResolve into a resolve texture over a guest's read-only memory (bit 24, or pages mapped read-only) ended the process where the pass was made, or at the late store action or resolve texture, as the runtime faulted it where the M3 Max completes it with the texture unchanged. The runtime now stores the attachment and drops the resolve (metal2vulkan RUNTIME 2298, in this pin), so the pass is sent and the command buffer completes with the pages unchanged, for the descriptor's action and a late one, into the descriptor's resolve texture or one the setter's SPI named. That is the M3 Max's answer, given to every guest; the x86 Macs write the texture. Beside a stencil attachment that resolves, or whose store action is still Unknown, the runtime faults the pass, and nothing measured Metal's GPU there, so that pairing still dies at the same three sites. A late resolve texture over such memory for an attachment the pass lacks still dies too: RUNTIME 2298 does not reach it. The tests that held the death now assert completion with the pages zeros, and the pairing's death at each site. |
||
|
|
c1fcbf5fd1 |
🔥 Drop read-only surfaces and the deaths through their twins
Only tests have made host-OS IOSurfaces since
|
||
|
|
3ba94c6eb5 |
📝 Record what each write into read-only memory answers [ci skip]
dgpu-oracle.md Q38 records oracle_readonly's runs on the M3 Max (macOS 27.0.1) and the dGPU oracle's Radeon Pro 5300M and UHD Graphics 630 (macOS 26.7.1), each shape with its class: agreed, divergent or outside the envelope, and the x86 finding that bit 24 does nothing there. The accuracy ledger's read-only-pages-written row, the writes module's docs, the command module's note on read-only store faults and design.md's no-copy buffers say what the platform now answers: a store-out faults as the M3 Max's does, every other GPU write completes with its write dropped, a CPU write lands where the pages are writable, and a depth StoreAndMultisampleResolve into such memory still ends the process until metal2vulkan completes it. |
||
|
|
f264ac73b8 |
🐛 Drop kernel and blit-copy texture writes into read-only memory
A kernel's write() of a texture over memory the process maps read-only (Metal's private option bit 24, a no-copy buffer or heap the runtime makes over a copy of the pages on Linux), and a blit's copy into such a texture, ended the process where they were encoded (kept_write), as what Metal does there was read as unmeasured. metal2vulkan measured both on the M3 Max, macOS 27.0.1, plain Metal (probes/readonly_gpu_writes.m; the runtime's read_only_view.rs): a texture over such memory takes a kernel's write() and a blit's copy into it, out of a buffer or a texture, nowhere; each completes with no error and leaves the pages as they were. The runtime's copy drops those writes too: a texture over a copy lies in the copy's memory, or is a shadow of its bytes, and each batch's completion writes back over every byte the GPU changed in a copy that drops writes (copied.rs), so a later command buffer reads the pages' bytes. What changes for the guest: such a dispatch and such a blit copy complete with no error, their writes dropped, where they used to end the process. predication.rs's kept_write_through asks texture_twinned instead of texture_kept for a texture a kernel writes, bound or made resident for writing, so only a surface's read-only memory the runtime twins still dies there. encode_blit.rs sends a copy into a texture over memory the runtime copies (copy_dropped: CopyBufferToTexture, CopyTextureRegion, CopyTextureSlices and their options forms). What stays a death, as nothing measured it: a draw's write of such a texture, another blit's write of one (a fill, mipmaps, an invalidation), and a CPU write of one. Tests: texture_writes_into_read_only_memory_are_dropped runs a kernel's write, a copy out of a buffer and a copy out of a texture into a texture over a bit-24 buffer and one in a bit-24 heap over pages: each completes with no error, the pages stay zeros, and a later command buffer reads zeros. a_blit_into_a_read_only_buffer_is_dropped's copy into a texture over the buffer now completes where it died. gpu/writes.rs's docs and the accuracy ledger's read-only row say the same. No boot: no walk has reached this path (no app in our walks writes a texture over read-only memory). |
||
|
|
68a94da601 |
🐛 Fault measured resolves and depth stores into read-only memory
A pass that resolved a multisample colour attachment into a texture over memory the process maps read-only (Metal's private option bit 24), or kept a depth attachment there by CustomSampleDepthStore, ended the process where it was encoded, as what Metal does there was unmeasured. metal2vulkan has since measured both on the M3 Max, macOS 27.0.1, plain Metal (m3-max-28796, m3-max-28797): a colour MultisampleResolve into a texture over a buffer of bit 24, and a depth attachment in a heap of bit 24 kept by CustomSampleDepthStore, each by the descriptor's action or one the encoder set, fail the command buffer with PageFault, as a Store there does. RUNTIME 2280 (pin 89) faults both itself (store_out.rs), and counts the fault toward its queue's revocation. What changes for the guest: those two shapes now fail their command buffer with PageFault (3), the pass and the encoders after it running nothing, every event signal firing, the pages unchanged, and the queue serving on until its second fault, where they used to end the process. kept_attachment and late_store let them through, and read_only_stores and late_store tell the command buffer of the fault (faults_at_read_only_store), as a Store there is told, so a command buffer that fails another way too still dies at its commit. faults_over and faults_into name the store actions that fault. A colour attachment's resolve texture over such memory, the descriptor's, is marked Unsent::Copied while its store action is Unknown, so a late MultisampleResolve into it faults. The store-out shapes 2280 did not measure stay deaths where they are encoded: StoreAndMultisampleResolve into such a texture (at the pass's creation, or at its late store action), a depth or stencil resolve into one, a resolve into a texture a late resolve setter named, a colour or stencil attachment kept there by CustomSampleDepthStore, and a colour resolve into such a texture that this platform drops because plain Metal leaves a texture of that format untouched (now dying in read_only_stores, at the same selector, where it died in kept_attachment before). Tests: a_resolve_into_read_only_memory_dies becomes a_resolve_into_read_only_memory_faults_its_command_buffer: MultisampleResolve given at once or late faults and the queue runs on, while StoreAndMultisampleResolve dies at renderCommandEncoderWithDescriptor: and at setColorStoreAction:atIndex:. In a_depth_store_into_read_only_memory_faults_its_command_buffer, CustomSampleDepthStore at once or late, and Store, in a heap of bit 24 over pages fault, the queue running on, and DontCare completes. The read-only pass helper takes any pass (pass_line_on). The module docs, gpu/writes.rs's and the accuracy ledger's read-only row say the same. No boot: no walk has reached this path (no app in our walks stores into read-only memory). |
||
|
|
67e65365e5 |
🐛 Let a read-only store's fault revoke its queue, not end the process
A render pass that stores an attachment into memory the process maps read-only (Metal's private option bit 24) faults its command buffer with PageFault. This platform then made the commit of every later command buffer of the process die (READ_ONLY_FAULTED), as Metal was read to fail them all. Measured on the M3 Max, macOS 27.0.1, plain Metal, that reading was of the probe's runs sharing one queue: one fault a process leaves the next command buffer of the same queue Completed (m3-max-29110, twice, a process each), and so do one on the same queue 100 ms on and one on a new queue (m3-max-28796, m3-max-28797); four faulting runs on one queue fail every command buffer of that queue after its second fault. That is the queue revocation the runtime models in command_buffer/revocation.rs, measured on the same Mac: the queue's second page fault or hang revokes it, every later commit on it failing with AccessRevoked (4); other queues, and a new one, serve on. What changes for the guest: a command buffer committed after such a fault runs, where the commit used to end the process; the queue's second fault revokes that queue, every later command buffer of it completing with AccessRevoked, running nothing and signalling nothing; other queues run. Since RUNTIME 2280 (pin 89) the runtime faults such a store-out itself, with the same code, from the same pass on, every event signal firing (store_out.rs), and counts it toward its queue's revocation. This platform no longer commits the fault as failed (commit_failed of code 3): the command buffer commits as any other, and the runtime faults it. The pass is still told to the command buffer, now as a failure the runtime makes (the field type_9 becomes by_runtime, holding type-9 draws' failures and these), so a command buffer that fails another way too still dies at its commit as a combination nothing measured, and is never cut into parts. The executions of indirect command buffers in the encoders such a failure runs nothing of stay unchecked at the commit, as they were while this platform committed the failure. The same now holds for a type-9 draw's failure, whose later encoders' executions were checked, and could die there, though Metal runs nothing of them. Tests: a_store_into_read_only_memory_fails_its_command_buffer and its late store variant now see the next command buffer of the queue and of a new queue run, the faulted one's blit after the pass not run and its signal fired; read_only_faults_revoke_queues_as_metals holds the revocation at the second fault, while a new queue runs and takes a first fault of its own without revocation; a_command_buffer_failing_two_ways_dies_at_its_commit gains the read-only cases and the first encoder that runs nothing. The module docs, gpu/writes.rs's and the accuracy ledger's read-only row say the same. No boot: no walk has reached this path (no app in our walks stores into read-only memory). |
||
|
|
a8a54ad6fc |
🐎 Keep heap colour textures compressed where Metal does
exact_policy forced HeapCompressionPolicy::Uncompressed on every device. On the Iris Xe (ANV, the one driver whose compressed images may keep their texels apart from their bytes) that gave a guest's Private heap render targets an uncompressed image and cost them the driver's fast clear: a guest's clear of a 2048x2048 RGBA8Unorm render target in a Private heap took 146.9 us of GPU time against 28.6 us now (25.8 to 28.7 us for one in memory of its own), and a copy of it 294.1 us against 148.2. The platform now takes the runtime's default, Compressed. REIMS_VGPU_EXACT=all still takes the uncompressed form (exact_answers()); no other name does. What the guest sees change, on the Iris Xe alone: - heapTextureSizeAndAlignWithDescriptor: answers the compressed image for a colour texture Metal keeps losslessly compressed (allowGPUOptimizedContents, no ShaderWrite, PixelFormatView or ShaderAtomic usage, 16 texels or more a side) whose image is 64 KiB or more: its alignment moves from 0x1000 to 0x10000, its size kept (0x1020000 bytes for that 2048x2048 render target). A smaller one keeps the uncompressed image a 4 KiB alignment holds, and its answer (0x4080 at 0x1000 for a 64x64 BGRA8Unorm texture). The x86 Macs answer 4096 (UHD 630) to 65536 (Radeon Pro 5300M). - Such a texture in a Private heap is the driver's compressed image, so a write through a buffer or texture over its bytes may leave its texels as they were. Metal's compressed texture shows no such write as written either: an M3 Max reads opaque magenta in drawn content a buffer fill over its bytes covered. Heaps over the guest's pages (Shared heaps, the bundle's slabs) take an image over the pages under either form. heap-texture-compressed moves from DIES to the relayed precision kinds, with that M3 measurement as its reason: Metal's own answer there is not one value, so a strict run no longer dies where the Iris keeps Metal's compression. Other drivers keep the optimal image they took before under either policy. Cold boots of macOS 26.7.2 and 14.8.9 on the Iris (desktop, Finder, Launchpad, Mission Control, Safari, Maps) logged no fatal line, and their apps made no such texture: only the guest microbench that measured the clears did. |
||
|
|
39dd1213ca |
🔥 Delete heaps over address ranges, which nothing reaches
The wire, the C API and the guest's bundle never ask for a heap or buffer over address ranges. The decoder passes no ranges to new_heap or new_buffer: it makes device-placed heaps (HEAP_CREATE) and heaps over the guest's memory in place (HEAP_OVER_HOST_MEMORY, HEAP_OVER_PAGES, through new_heap_over_host_memory). The C API makes no Metal object, and the bundle refuses a buffer descriptor that names address ranges. tests/address_ranges.rs was their only caller. Deleted with them: Platform's AddressRangeArray, HeapDesc's address_ranges (HeapDesc is no longer generic), the testkit's model of ranges, Backing's record of the guest's pages under a heap (made_over, in_pages, meets_pages, over_guest_pages) with Kept::Copied's pages, the write tracking through a heap's pages that read it, and the inexact-heap-layout relay of a multisample texture Metal keeps losslessly compressed, which only such heaps reached. gather_or_nil stays: buffers over a surface still gather its pages. The tests that made heaps over address ranges to stand in for the guest's pages make them over host memory now, as the decoder does (resource::tests::heap_over and heap_at): the heap-texture, placement and heap-layout tests, and the write test, whose heap buffer and texture now lie in no memory a surface's write check looks for, as a heap over host memory's did before. The test of a heap over less than its granule and the multisample death test went with the path they tested. What the guest and host see: nothing; no call reached what is deleted. A heap over host memory still relays a multisample lossless texture as its notice alone, as before, and does not die of it in strict mode (ledger). |
||
|
|
f09f58266e |
⬆️ Build on metal2vulkan 3bca3ce246's runtime
Pin 66 moves metal2vulkan from be1e8bb311 (RUNTIME_VERSION 2195, SEMANTICS_VERSION 2077, ARTIFACT_FORMAT_VERSION 515) to 3bca3ce246 (2208, SEMANTICS_VERSION 2081, ARTIFACT_FORMAT_VERSION 515). It carries: - half values held at 16 bits, half division and sqrt at 16 bits, and multisample ShaderWrite images listing their views (2196, SEMANTICS 2078 and 2080); - matmul2d of 8-bit floats into float (2197, SEMANTICS 2079); - a completed command buffer's last host-import frees handed to the free thread, so NVIDIA's frees no longer hold submits (2198); - runtime images whose parts no copy writes, a new buffer's zeros and the runtime's attachment images where DontCare stays DONT_CARE starting at zero in one fill (2199-2201); - a Managed buffer's modified range copied in by the GPU as the submission runs, with no CPU copy at the commit (2202): on the RTX 3090 Geekbench's compute geomean goes from 2.11x native to 1.34x; - a surface depth or stencil texture's usage shadow copying its plane's own aspect, and an X32_Stencil8 view's shadow no longer copying depth bytes into the stencil (2203); - the draw merge passes holding their counts in u32 words, which ends the RTX 3090's Xid 109 hang in Apple's Modern Rendering sample (2204); - a large kernel's whole grids run on its partial-threadgroups variant, one pipeline per threadgroup size (2205, SEMANTICS 2081); - a device recovery carrying indirect command buffers, visible function tables and argument encoders, and freeing the lost device's live buffers once it comes to rest (2206); - a merged execution with no whole chunk drawing an empty first draw (2207); - a texture's placement over host pages answered before their import, with no image made (2208, Device::host_pages_texture_placement). The runtime's DevicePolicy gains managed_copy_in, whose exact form, ManagedCopyInPolicy::AtCommit, copies the range on the CPU at the commit as the Radeon Pro 5300M keeps it. REIMS_VGPU_EXACT names it like every other exact form, and docs/accuracy-ledger.md gains its row; without the name, `all` would set a field no name sets and the exact names' test fails. No degradation kind or runtime gap changes. ArgumentEncoder::device() now returns the device by value, which nothing here calls; WorkCounts gains fields, Problem gains HostPagesBacking, and CompiledFunction two accessors, which nothing here matches on or calls yet. What the guest sees changes: a CPU write to a Managed buffer's range after its command buffer's commit may now be read by it, as on the UHD 630; Apple's Modern Rendering sample no longer hangs the RTX 3090 (it draws, at about 200-290 ms of GPU a frame, metal2vulkan's next fixes); a recovery keeps indirect command buffers, function tables and argument encoders; a surface depth texture's shadow holds the right aspect. The device's answers do not change. Cargo.lock keeps its lines. |
||
|
|
ff837ae87d |
🔥 Delete the detach and replace machinery no call reaches
Since apple-gfx's detach and replace went on 11-07, nothing the guest or the host reaches calls a buffer's or heap's detach_backing or replace_backing, or the runtime's rebind_bytes_no_copy behind them: the device's wire has no op for them, reims-vgpu's decoder never calls them, the C API has no entry for them, and the guest bundle's RgfxHeap raises an unrecognized selector at detachBacking and replaceBackingWithRanges:readOnly:, as Metal's base heap does. Only tests called them. Deleted with them: the trait methods and the testkit's, the backing's detached state, its registry of detached objects, held deallocators and kept contents, the per-command-buffer parts and the submission check every commit set for them, and EncodedUseRebound's death, which no rebind can reach now (the runtime's kind stays placed, and a failure of that kind would die unanswered). tests/detach_backing.rs goes; its heap-over-address-ranges cases, with Metal's recorded heap answers, move to tests/address_ranges.rs. reach.metal's comment named the deleted file, so its metallib is compiled again (the bytes this Xcode writes; the record changes for reach alone). What the guest and the host see: nothing changes. The device still answers supportsResourceDetachBacking as before: that answer is the guest's, and changes only with boots. |
||
|
|
a4b6ade41b |
⬆️ Build on metal2vulkan 63232a93ee's runtime
Pin 62 moves metal2vulkan from 0c0cdf0b12 (RUNTIME_VERSION 2165, SEMANTICS_VERSION 2064, ARTIFACT_FORMAT_VERSION 509) to 63232a93ee (2176, SEMANTICS_VERSION 2072, ARTIFACT_FORMAT_VERSION 512), the golden tables and the authored compile census re-blessed. It carries: - a device recovery carrying the textures of new_texture (made new, their contents lost; those over carried buffers keep their bytes), binary archives and dynamic libraries, compute, tile, render and mesh pipeline states (made again from what their creations compiled; a bind of one whose making failed is refused, RemadeAfterRecoveryFailed), sampler states, Private buffers in exportable memory (over their own memory, not zeroed), and no-copy heaps with the buffers and textures placed in them (2166-2170, 2173, 2174, 2176); - every batch the lost generation still holds failed as GpuRecoveryVictim in commit order, and a queue's new place running its handlers only after the old place's, so no command buffer committed around a recovery waits for good (2172); - a Managed buffer's didModifyRange bytes reaching only the command buffer that committed them and later ones, on a device whose memory is not the host's (2171); - a rate-mapped pass recorded at the host step drawing each command that is safe to fan out once, with a copy per region it touches, where it drew it once per region (SEMANTICS 2072, RUNTIME 2175; REIMS_VGPU_EXACT's new name rate_map_regions keeps every draw region by region, and the accuracy ledger has its row); - a 16-byte vector access placed at its address unless its offset is proven a multiple of 16, as Metal places it: a float4 read through a float pointer only 4-byte aligned read k floats low (Geekbench 7 Metal's workload 302 softmax rows) (SEMANTICS 2069), and the reach of a pointer through a base not yet reached kept unknown (SEMANTICS 2070), which 6164d3a66a's tree took as reached and so refused 124 MPS NDArray kernels of an Iris Xe's pipeline records that 0c0cdf0b12 made; - flat simdgroups, the rate map's fan-out variant, generic pointers and matmul2d's macOS 27 runs (SEMANTICS 2065-2068, 2071). The runtime's objects answer their device as an owned handle of the generation serving them, not a borrow: six call sites here take a reference to it, and two fence devices drop a clone that is now one. No degradation kind changes. RuntimeGap gains RemadeAfterRecoveryFailed, which a bind answers as it answers MadeBeforeRecovery. What the guest sees changes: after a device recovery, pipeline and sampler states, exportable Private buffers and no-copy heaps made before it serve again, and command buffers committed around it complete; Managed buffers' modified bytes on a dGPU reach only their own and later command buffers; rate-mapped passes take far less GPU time; and kernels reading 16-byte vectors at addresses not 16-aligned read what Metal reads. The device's answers do not change. Cargo.lock keeps its lines. |
||
|
|
831ce5ef41 |
⬆️ Build on metal2vulkan 0c0cdf0b12's runtime
Pin 61 moves metal2vulkan from 1125fb62d2 (RUNTIME_VERSION 2149, SEMANTICS_VERSION 2062, ARTIFACT_FORMAT_VERSION 508) to 0c0cdf0b12 (2165, SEMANTICS_VERSION 2064, ARTIFACT_FORMAT_VERSION 509). It carries: - the chunk gate on RADV and ANV: copies by runs no longer meet the runtime's Invariant over chunks an object's own import holds; on the Iris such copies are staged on the CPU (2157, 2158); - address pools made before a recovery taking new buffers after it (2159), and an object's device() its generation again, so destroying objects of a lost generation through it no longer crashes (2164); - a process limit on the SPIR-V words of large pipeline makings (2160); - draws, dispatches and ICB replays whose pipeline is still being made held until it is, never dropped (2161, 2162); - a rate-mapped pass's work submitted in pieces of bounded size, big draws cut into index ranges, so no submission nears amdgpu's 2 s job timeout or NVIDIA's context-switch timeout (2163); - IOSurface plane textures taking their buffer's padding_unobserved, so the Iris's tile textures lie in place (2165); - the resident-set search emitted as a loop alone (SEMANTICS 2064), and the host-import gauges split into releasable and held-for-good. Here: the two dropped-while-making degradation kinds leave the answer layer's list and docs, the accuracy ledger's row says the command buffers wait, the GPU-times doc names a rate-mapped pass's pieces, the recovered sink's test runs again, and the generation test holds the device handle it took before the recovery, since fences are now carried across it. What the guest sees changes: no draw or dispatch is dropped for a slow compile (its command buffer completes later), rate-mapped frames no longer hang the 780M's ring or an NVIDIA GPU, and small buffers made after a recovery are made. The device's answers do not change. Cargo.lock keeps its lines. |
||
|
|
d22ca5ea27 |
🆕 Answer the host GPU's own linear texture alignment
The guest's device answered 256 bytes for minimumLinearTextureAlignmentForPixelFormat: and the SPI linearTextureAlignmentBytes and deviceLinearTextureAlignmentBytes on every host, the Radeon Pro 5300M's and the UHD 630's answer, raising the platform's wherever it was less. The answer describes the GPU: each Mac answers its own (the M3 Max 16), and the runtime now answers the alignment at which the host GPU's linear images hold a texture's reads, renders and shader writes in place, at least the device's nonCoherentAtomSize, asking the driver. The floor dates from when the platform answered Metal's 16 on every host, and was chosen for RADV, which takes rows only at multiples of 256. The runtime answers that 256 on RADV itself now. NVIDIA's driver takes a linear image in place only at its own pitch, the tight row rounded up to 128, so rows a guest lays out at 256 are the runtime's shadow wherever that pitch is not a multiple of 256. What the guest sees: its device answers the platform's alignment, the largest of the formats a buffer backs: 128 on NVIDIA's driver, 64 on ANV and 16 on MoltenVK, where it answered 256; 64 on lavapipe; and 256 on RADV as before. Its frameworks lay out their linear textures' rows by it, and its device makes a texture over a buffer at any offset and rows that are multiples of it, where it answered nil to those off 256. No guest reason held the floor: no doc comment or test named a framework that relies on 256 (docs/architecture.md 17.2), and the oracle doc called it a choice inside the envelope for the host's cost. Its test, renamed, now holds the platform's 16 and 128. |
||
|
|
02bb28fedb |
🔥 Drop the LOD bias relay now that the runtime samples it
From 8a585e7a76 the runtime samples a sampler's lodBias as the Mac the device presents does: added to each sample's level of detail for an Intel or AMD Mac, as the 5300M and the UHD 630 add it (dgpu-oracle.md, Q14), and at 0 for an Apple Mac, as the M3 Max samples it. Our device presents the guest's class (DeviceOptions::mac_class), so neither class's answer differs from its Macs' any longer, and the inexact-sampler-lod-bias relay, its kind and its ledger row go. A bias the device cannot take is the runtime's to announce (capped-lod-bias). The state test no longer needs the relaxed mode it ran its makes under. |
||
|
|
386f112738 |
🐛 Give the runtime each sampler's LOD bias
The runtime's sampler descriptor holds a LOD bias since metal2vulkan's pin 47, and keys its states by the bias's bits, -0 as 0, as an M3 Max keys Metal's. Until now the bias stopped here, so two samplers that differ only in their bias were one runtime state, with one gpuResourceID, where Metal makes two. Now each bias is its own state, and the guest sees two IDs as on Metal. The runtime samples every bias as an Apple9 GPU does, at bias 0, while the x86 Macs' GPUs this device imitates add it to each sample's level of detail (docs/graphics-kext/dgpu-oracle.md, Q14). So the inexact-sampler-lod-bias relay stays, now saying the bias is taken and what still differs. |
||
|
|
fe9a056b7b |
🐛 Carry each sampler's LOD bias and reduction mode to the host
A guest's samplers lost lodBias and reductionMode (macOS 26) on the way to the host: SAMPLER_CREATE's extension, RgfxSamplerCreateExt, was on the wire, but the bundle never sent it and new_sampler never read it, so every sampler was made at bias 0 with weighted-average reduction. The guest's state cache already keyed on both, so two descriptors that differed only there were two guest samplers of one host shape. The bundle now sends the extension with every create, on the posted and the asked route. new_sampler sets the platform's reduction mode and its new LOD bias from it, and leaves both unset for a create without one, which keeps Metal's defaults. What the guest sees changes: a sampler of minimum or maximum reduction samples that way, as Metal's does. The runtime's sampler descriptor holds no bias yet, so a non-zero bias still samples at 0, and is now relayed as inexact-sampler-lod-bias, with an accuracy-ledger row, until the runtime takes one. The header follows wire.rs's doc, the ROM's record that header (its bytes are unchanged), and both guest sets are built again from these sources. |
||
|
|
b0ffefd66d |
⬆️ Build on metal2vulkan 101c809066's runtime
Pin 39 moves metal2vulkan from 600b535875 (RUNTIME_VERSION 2046) to 101c809066 (2061), metal2vulkan's verdict sha (its merged-tree check m3-max-17532). It carries: - exit handlers run after the device's work, and work in a handler on the exiting thread answers as on any thread (2054, 2056, 2061): the NVIDIA 10 s exit and the M3's aborts in an exit handler are gone; - NVIDIA's dma-buf imports: no double close (2053), a kind's first imports one at a time with the learned form and type (2058); - the compositor's unshared-queue hold under load (2052, 2059); - a private logic operation drawn in the fragment function on MoltenVK (2057), which fixes arm64 guests' GL logic operations there; - separate depth and stencil textures' unstored DontCare loads follow the DontCare policy (2047); far vertex fetches on lavapipe (2048). What changes here: - NativeLogicOperation (native-logic-operation), the device's logicOp on a 10-bit attachment's own codes, is placed in DIES and relayed on native devices (NATIVE_RELAYED, class (e)), as DeviceAlphaCoverage is: the runtime's default off Apple's GPUs. - VertexFetchMayWrap (vertex-fetch-may-wrap), lavapipe's wrapping fixed-function fetch past 4 GiB, is relayed with the precision kinds, as DontCareUnstoredLoad is: a policy's default whose exact form REIMS_VGPU_EXACT's new name vertex_reach selects (VertexReachPolicy::Exact), matching exact_answers(). The accuracy ledger gains its row, and the unstored DontCare row now covers separate depth and stencil textures. Nothing a guest sees changes on the drivers we ship on by default: both kinds were already relayed and counted outside strict mode. Every API change in the range is an addition (metal2vulkan's api_signatures), and Cargo.lock keeps its lines: metal2vulkan's dependencies are unchanged. |
||
|
|
39caa09d45 |
⬆️ Build on metal2vulkan 600b535875's runtime
Pin move 38: metal2vulkan 30cadd8dda..600b535875 (its round's go), RUNTIME_VERSION 2034 -> 2046, SEMANTICS_VERSION 2032 -> 2034 (translations are made again once), the submission check's CHECK_VERSION 6 -> 7 (each device checks again on its first run). What changes for the guest and the host: - An attachment a pass loads DontCare and does not store, in a pass whose draws reach it, is cleared where the driver measures that clear no slower than its DONT_CARE load (MoltenVK on the M3 Max, RADV on the Radeon 780M), so the draws read zero or the clear value, as an M3's do. On other drivers it stays the driver's DONT_CARE load, announced dont-care-unstored-load: answer.rs relays it with DontCareLoadTiles' kind (Metal keeps none of the attachment past the pass), and REIMS_VGPU_EXACT=unstored_dont_care_loads clears it everywhere (a new row in docs/accuracy-ledger.md, 3.2 us a frame on the 5080). - A tiled texture's take (the copy of a buffer's bytes behind a texture of more than one level) makes every format's later levels, is taken again by an encoding that re-encodes it, and is given back by a command buffer that runs nothing (failed, dropped uncommitted, or left out), a re-recorded segment keeping it; a heap texture's tiled route plans once with one staging buffer (host allocations per newTextureWithDescriptor:offset: 75.25 -> 28.25 on the 780M). - Small heaps take no pooled block ahead, and a device the driver refuses for want of its resources is made again with one shared VkQueue, announced least-queue-plan, a performance kind (the 2080 behind Thunderbolt makes 9 devices where it made 7). - The device checks no longer remap pages under a live pointer import (the follows check is gone, with Device::pointer_imports_follow_their_address); an idle pointer import is released only where a held one costs every submission (RADV, ANV on i915). no_copy_remap_linux.rs leaves a pointer import unmeasured where the device releases idle ones (Device::releases_idle_pointer_imports), as it did where imports followed their address, and remap.rs's docs call what such an import reads after a remap unspecified, as VK_EXT_external_memory_host does. - WorkCounts count command buffers waiting behind another queue's on a shared VkQueue; OpenCL-mode images reflect as the textures bound; a query-only image slot binds a swizzled view unswizzled (CL_BGRA); a copy made after a failed import names why in its notice. The move touches no guest source, QEMU, firmware or reims-ctl, and adds no kind to DIES, so what the platform ends the process on and what device info answers are unchanged: the checks it reaches are the library's (the Mac's xtask check and the Linux workspace tests on ANV, RADV and NVIDIA). Known on NVIDIA at this pin, fixed in the next: a failed dma-buf import can close a file descriptor twice (since pin 37), and a process exiting beside CPU device work waits 10 s. |
||
|
|
7c38a9d3bc |
⬆️ Build on metal2vulkan f84816ddec's runtime
Pin move 23: metal2vulkan development 2e381ae1f0..f84816ddec, RUNTIME_VERSION 1890 -> 1897, SEMANTICS_VERSION 1992 -> 1993. What changes for the guest and the host: - dma-buf imports run with the device's memory lock released, as pointer imports do, so a 780M import no longer holds the device's other makings (62-273 ms seen). - A GPU pool block a queue lets go becomes the device's spare for the next queue, and a device makes blocks only up to its peak of queues holding one. - A texture over a copied host buffer lies in place over the copy where its check passes, not in a shadow (the Iris's refused placements). - A host RAM gather that would wait for a chunk import goes through the CPU. - Host RAM copies over a listed RAM take lists of their own pages from an opt-in source. - In-place reads of two-plane YCbCr textures (500, 505) take Vulkan's Y'CbCr model by default, Metal's behind YCbCrInPlacePolicy::Exact. Our device policy takes Exact on every device, as it takes exact completion and uncompressed heap textures, so the guest's samples stay Metal's as at pin 22: the default reads outside the bounds our YCbCr sampling tests hold to Metal's answers. The conversion's staging, sets and refresh are made at the first conversion. - New counters: linear runs' checked frames, host RAM copy import waits and their time, staged copies and chunk import time. Not in this pin: metal2vulkan 31e642ecc2 (the RTX 5080's first fill staged through the CPU), a65dec2e53 (the exit hook kept registered during a making) and 0beaeca5fe (with_vk_queue hands its closure the VkDevice); they come with pin 24. |
||
|
|
debf26e116 |
⬆️ Build on metal2vulkan 0e420a1834's runtime
Pin move 20: metal2vulkan development eac9da30c7..0e420a1834 (94 commits), RUNTIME_VERSION 1866, SEMANTICS_VERSION 1992. What changes for the guest and the host: - The in-place check gives its verdicts apart for texels that share a line of the device's memory (nonCoherentAtomSize) with bytes beside them and for texels that share none: on the Iris Xe a texture over the guest's pages that renders or is written goes in place where its rows start and end on a line, a 3840x2160 BGRA8Unorm surface's among them (it was a shadow). The accuracy ledger's in-place row says what the default takes now. - The Iris Xe's private self-reads cost 1.70 ms a frame (12.8 before), by metal2vulkan's measure; a usage shadow no longer names a destroyed VkImage after a storage-form swap (a crash); heap sets copy their arrays and are made outside the heaps lock; a moved shadow's image is freed once its move completes; rebound draws cut more per draw; a new Shared or Managed texture starts in memory the driver zeroed where the device can. - A lost VkDevice is recovered, as Metal's device survives its GPU's recovery: the command buffers in flight fail as the hang (GpuHang) and its victims (GpuRecoveryVictim), which core already reports as Metal's, and each recovery is announced (device-recovered, a performance kind the placement test relays by its statement). An object made before the recovery is refused (MadeBeforeRecovery): a creator that meets one answers nil, any other call dies at its selector, where the run died at the first call after the loss before. Nothing makes the guest's objects again on the new VkDevice: the accuracy ledger lists it among our gaps. - minimumLinearTextureAlignmentForPixelFormat: moved from DeviceProperties to Device, which answers the alignment its images hold a texture over a buffer in place at (256 for most formats on RADV, 128 on the RTX 5080, 64 on lavapipe, 16 on ANV and MoltenVK). The guest's frameworks lay out linear textures and texture buffers by it, and an answer stays as it was until the guests boot with the new one, so this platform answers Metal's 16 there as a stand-in (caps' table), the runtime's refusals of the other formats kept. The private linear alignments are the device's now; the graphics lane answers the guest at least 256, which every measured device's answer leaves as it was. The private-properties test holds those two at least Metal's 16, where it held every count at most Metal's. - A pool reservation's device (AddressPool::device) is now the handle of the generation it was made on, whose properties are a copy at another address: the space names a reservation by the properties of the platform's handle it was made through, so a second small buffer of a pool takes the live reservation, where it reserved the pool again and died (PlacementConflict Held) in 45 tests on the Radeon 780M and the Iris Xe. Checks: over development |
||
|
|
ff5160ed2d |
🔥 Copy read-only no-copy bytes instead of twinning them
The Vulkan platform imported a no-copy buffer core made over bytes it maps read-only through a writable twin of the pages. That was for apple-gfx's ranges: buffers of about 29.5 MiB whose copy cost every commit a compare of all their bytes. apple-gfx is gone. The only caller of new_buffer_over_host_memory left is the graphics sink, over the region's read-write pages, so no read-only bytes reach it. A no-copy buffer over read-only pages is now made over a copy whose GPU writes the runtime drops, as Metal drops them and as every other read-only no-copy object already is. Only a surface's read-only alias is still twinned. This removes Backing's twinned flag, twinned_now, twin_kept, imported's twinned argument, NoCopyImport's twinned and the macOS ImportView::twinned. The Linux one stays for its tests. The core-ranges text and the apple-gfx measurement go from the docs and the ledger row. Tests: - The fill into read-only pages is now dropped, not a death. - The dispatch and draw tests of kept writes move to a buffer on a read-only surface, the twin that remains. - The vouch test's unvouched case uses anonymous memory, as the gate now refuses read-only pages before the runtime asks the kernel. |
||
|
|
f58f397574 |
📝 Describe the tests and the layout without the paravirt device [ci skip]
testing.md was the behaviour-lock suite's specification and the paravirt guest ABI; it now says how the code is tested and keeps the Tags convention. development.md's layout, tests and commands, conventions.md's examples and the lessons and accuracy-ledger entries that cited the paravirt device, its FIFOs or QEMU sections that are gone now describe the code there is. |
||
|
|
86d551a2b8 |
✅ Expect pin 19's one-plane YCbCr heap rows and refusal
Pin 19, metal2vulkan eac9da30c7, carries the runtime's fixes for the two answers the accuracy ledger held open on the one-plane YCbCr formats it holds for copies alone. 8eb3b6df31 to 12a78a576b lay such a texture in a heap's bytes in Metal's rows, not the carrier's tiles, so the heap test of those formats, legacy_heap_one_plane_textures_are_metals, is un-ignored, and the plain legacy-heap test no longer leaves them out (677 formats compared on the M3 Max under macOS 27.0.1). 930a285448 and ae07b06fca refuse a kernel's or a draw's read of such a texture as its format's own refusal, where the read gave zeros before, so the read test now holds the death at the dispatch, named by that refusal, beside Metal's read (one_plane_reads_die_at_the_dispatch). No ledger entry is open at the pin. No code changes: the library passed both answers on before and does now. |
||
|
|
a7c211d6cd |
🐛 Place the three degradation kinds metal2vulkan eac9da30c7 adds
The runtime at the pin makes textures it refused before, and announces how they differ from Metal's: surface-texels-tail (a surface plane's texels past the surface, or a 2D array's slices past its first, in a tail of the texture's own), surface-texels-apart (a mipmapped, 3D or multisample texture over a plane, in memory of its own) and heap-one-plane-layout (a heap's one-plane YCbCr texture whose rows or levels lie otherwise than Metal's). Each puts texels where a buffer over the same bytes meets them otherwise than on Metal, as heap-two-plane-layout does, so each joins it in DIES: relayed by default, a death at the creator's selector in strict mode. every_degradation_kind_is_placed_once failed until they were placed. |
||
|
|
cb35f314b9 |
⬆️ Build on metal2vulkan eac9da30c7's runtime
Pin move 19: metal2vulkan development fa07d59e81..eac9da30c7 (216 commits), RUNTIME_VERSION 1845, SEMANTICS_VERSION 1992, ARTIFACT_FORMAT_VERSION 493. What changes for the guest and the host: - On ANV, a fill through one import of host pages, a barrier and a copy through another import of the same pages, in one command buffer, read what the fill wrote (it read zeros); ANV takes MoltenVK's ordered route. - Render passes binding setVertexBytes uploads over host pages join one linear run: the many-passes shape merges once a frame, not once a pass (Radeon 780M GPU time 47.6 -> 14.0 ms). - A command buffer copies in only the copied host buffers it uses (512x640 stitched copies, 8 used: 0.22-6.2 ms -> 0.003-0.16 ms), and a copied buffer reads the caller's pages before it maps them. - A texture over host pages made before its in-place verdict is made without waiting for the check (it waited up to 1.8 s on the 780M). - Read-only pages are a copy whose GPU writes the runtime drops, on every device; Degradation::ReadOnlyPagesWritten is gone, so the platform's list of dying degradations drops it, and the accuracy ledger's row says what is done now. - New: exportable buffers (OPAQUE_FD) and exportable shared events (an OPAQUE_FD timeline semaphore), for host video's device caches; a guest RAM chunk is at most 512 MiB. Checks: the deletion batch's, on the tree that carries this pin (Linux xtask check on the 780M, the Vulkan crate and reims-vgpu on the XTX and the Iris, Mac clippy and the MoltenVK tests); the 5080 leg follows. |
||
|
|
7ad53bc1e6 |
📝 Say in the ledger which pitches stay shadows on RADV [ci skip]
The in-place row said a texture made before the check's verdict is a shadow. It did not say that a texture whose pitch the driver refuses for a linear image is a shadow under either form. On RADV that covers the guest's IOSurfaces: their rows follow IOSurface's own 64-byte alignment, as on an AMD Mac, and no device answer moves them. |
||
|
|
8f632b774d |
🐛 Drop GPU writes into the guest's read-only memory, as Metal does
The guest's read-only Metal objects (a no-copy buffer or heap made with MTLResourceOptions bit 24, a replace with readOnly:YES, a no-copy buffer a descriptor names over pages mapped read-only) were imported on Linux through a writable twin of their pages, and every command that might write through one died where it was encoded. metal2vulkan 023ed62d8c makes such an object over a copy of its pages whose GPU writes it drops, so these objects now go there and take Metal's answers (measured on the M3 Max, macOS 27.0.1, by metal2vulkan's probes/readonly_gpu_writes.m): - a shader's store into such a buffer, through a slot or a loaded address, a blit's fill into one and a pass's visibility results there are sent and dropped, and so is a blit's copy into one, which no probe made on Metal; - a pass that stores an attachment there (Store, StoreAndMultisampleResolve) fails its command buffer with MTLCommandBufferErrorPageFault from that pass on, its event signals firing, and the commit of every later command buffer of its task dies, where Metal fails each with a code nothing recorded; - a pass that does not store it (DontCare, MultisampleResolve, under any load action) completes. A resolve into such memory (Metal gave no verdict over 520 processes), a pass that keeps an attachment there by CustomSampleDepthStore, a texture's write there by a shader or a blit (unmeasured) and a CPU write of such a texture (Metal ends the process) still die where they are encoded, as residuals in the accuracy ledger's read-only-pages-written row. A surface's read-only alias, and a range core maps read-only and makes a buffer over (newBufferWithBytesNoCopy), stay twinned in place, their deaths kept and written into that row. A surface's buffers lie in one import of its pages, so a writer's GPU writes through another import reach its readers, which a copy made at each commit would miss. Core is the only writer of its ranges and never writes them through the GPU, so no death comes there, while a copy costs every commit and completion a compare of all their bytes. Measured on the Radeon 780M, a macOS 26.7.2 guest on apple-gfx at 1920x1080, ten boots: every read-only import was such a range (37 to 44 buffers, 29.5 MiB), no guest object came with bit 24 or a read-only replace, and copying the ranges cost a Finder drag 1.1 and 1.7 per cent of its frames, Safari's scroll up a long page about 8 per cent (four copied boots against two twinned) and QEMU about 25 points of a core. On macOS nothing changes: MoltenVK hands Metal the pages, or a read-only view of them, and Metal answers. |
||
|
|
4f5d1d5069 |
⬆️ Build on metal2vulkan fa07d59e81's runtime
Pin moves 17 and 18 in one: metal2vulkan development 6b4b4b0692..fa07d59e81 (220 commits), RUNTIME_VERSION 1807, SEMANTICS_VERSION 1990, ARTIFACT_FORMAT_VERSION 492. What changes for the guest and the host: - Guest RAM on a dma-buf device is a few long chunks, none made ahead, idle ones released; no making or copy waits for a chunk's import. On the 780M the first object over an unimported chunk took 665-692 ms and now 1-2 ms, and a gather's encode about 660 ms and now 23-38 ms. - On Linux the process's exit waits within a bound for the runtime's work, then runs the earlier exit handlers (QEMU's exit notifiers among them). - A colour attachment stored DontCare stores as the driver stores it by default, announced dont-care-store, and keeps its earlier texels, as Apple's GPU leaves them, under REIMS_VGPU_EXACT=dont_care_colors. - Off macOS, the GPU's writes to no-copy memory made with Metal's private option bit 24 are dropped through a copy, as Metal drops them. - Twenty formats Metal makes and the runtime refused, its one-plane YCbCr formats, the padded 10- and 12-bit display formats and transfer twins among them, are made for copies alone; every read, write and render of one stays refused. - A 2D or 2D-array texture over a buffer whose texels run past its length is made, its tail the runtime's own. - Mesh pipelines with maxVertexAmplificationCount above 1 are made, and their amplified draws refused. - ARGB8Unorm destination alpha is blended in the shader where no Vulkan state gives Metal's blend; an executed command's unstrided buffer reads at stride 2^32-1, as Metal reads it. - Encoding costs less per draw: attachment memory worked out once a layout version, host-byte uses kept in the encoder, per-thread argument-table stamps, a bind memo. No degradation kind is added or removed, so answer.rs places nothing new. Cargo.lock is unchanged: the runtime's dependencies are the same, and the lock keeps its metal2vulkan source lines stripped. RuntimeGap:: IndirectCommandUnstridedBuffer, which this tree never named, is gone. Adapted here: - The Linux remap test and the remap docs read Device:: pointer_imports_follow_their_address, in place of the removed DriverFact:: PointerImportsFollowTheirAddress. - REIMS_VGPU_EXACT names dont_care_colors, selecting DontCareColorPolicy:: Kept (platform.rs, docs/api.md, an accuracy-ledger row). - The texture-gap tests take RGB10A8_2P (624), a format the runtime still refuses, since 501 is now made for copies alone. - The MoltenVK tests take the copies-only formats: the formats-the-runtime- lacks test drops 501 and holds the two-plane RGB10A8 family (624-627); a new test makes and copies the nine one-plane formats at every creator as Metal does; the legacy-heap comparison leaves those nine out. Two ignored tests and two accuracy-ledger entries record the runtime's gaps there, asked of metal2vulkan: a kernel's read of one reads zeros, and in a heap its texels are tiled where Metal lays plain rows. Checked on the Mac (MoltenVK), the 780M (RADV, the whole workspace) and the RTX 5080, and the merged tree on um870's 780M with a video decode boot. The Iris Xe leg is still to run: its host stopped answering before the run ended, and the leg runs when the host is back, with any failure fixed forward. |
||
|
|
ed70015809 |
🐛 Answer nil where the runtime refuses an object for a gap
On the Vulkan platform, a runtime refusal at a creator for a gap of its own
or of the device's (Unsupported, but by a GPU family or a device Metal
itself refuses it on; NotImplemented; AppleOnly; a compile's Unsupported)
ended the process at the creator, where Metal makes the object. A Flutter
app's BGRA10_XR render pipeline on an RTX 5060 Ti took a macOS guest down
this way (Unsupported { feature: Format, needs: NotImplemented }).
Behaviour change, for the guest and the host: by default the creator now
answers nil, a pipeline state or a library creator with the runtime's
refusal as its NSError, so core's nil-without-error death never fires;
textures, views, buffers, heaps, functions, sampler and depth-stencil states,
argument encoders, indirect command buffers and rate maps answer nil. Apple's
guest framework then fails the work that names the object, as where Metal
answers nil: what was a VM going down is that exec faulting. In strict mode
(REIMS_VGPU_STRICT=1) each still dies at its selector with the same line.
This keeps the owner's rule on runtime gaps: the gap stays visible, relayed
as the new kind inexact-refused-create (the first of its kind writes a line
naming the refusal and the descriptor's formats, each one is counted) and a
death in strict mode, and it is handed to metal2vulkan. Nothing here makes
the missing feature. A lost device, a Vulkan failure, no memory, an answer
the runtime cannot prove and every other refusal still die at the creator.
The library's own pipelines and shader library are unchanged.
The kind is placed in every_inexact_kind_is_placed_once, the placement test
of this platform's own kinds, which also checks its code is no runtime
kind's. The accuracy ledger lists it.
|
||
|
|
d225c9528f |
⬆️ Build on metal2vulkan 52969c03d7's runtime
Pin move 14: stacks 28 to 30 on top of c7d79b43ef, in place of pin 13. RUNTIME_VERSION 1769. A host-replayed indirect command buffer keeps a step's chunks where two steps read its records alike, draws whose plans list the same resident uses share them, and a host step compares and decodes its records in place: on the RTX 5080 Laptop GPU the renderBundles page's host step took about 8.9 s a frame at pin 13, 35-40 ms after stack 29, and about 33 ms after stack 30's cuts (the runtime's measurements, the last before its own last two steps). A device-local allocation that fails lies in system memory instead, announced (device-memory-overflow, a performance kind). A pass that reads the clear alone before any draw reads a copy cleared to it instead of splitting the pass. A new Private texture starts as the Mac the device presents keeps it (DeviceProperties::lossless_compression). On MoltenVK, whose blits through two imports of the same pages are not ordered, a no-copy object over a guest RAM chunk binds in the chunk's import. A batch waits for a staging submission only where no earlier batch on its VkQueue did. A half read through an argument buffer keeps the texel's half bits. A mesh the device draws takes its mesh type's primitive, so a mesh of filled triangles draws no line. max_buffer_length is three quarters of the largest device-local heap, rounded down to 16 KiB: the RTX 5080's answer falls from 2^40, and the M3 Max's under MoltenVK stays Metal's own 41,747,087,360, below its 48 GiB bound. The graphics lane already answered at most three quarters of the device-local heaps' sum. New notices: device-line-ties at each draw of width-1 lines on a driver not measured to break a diamond-vertex tie as Metal does, device-subpixel-snap at each draw the band draws on a driver not measured to snap a half 1/256-pixel step up, and device-nan-encoding for every half colour output to a half-float channel on NVIDIA. MoltenVK on the M3 Max announces none of these anew: it takes both facts, and it already noted every such half output. The API grows by Degradation::DeviceMemoryOverflow, DeviceLineTies and DeviceSubpixelSnap; RuntimeDriverDefect::AliasedImportBlitsUnordered; DriverFact::LineTiesAreMetals, SubpixelSnapIsMetals and ColorClearTakesEitherCode; DeviceProperties::lossless_compression and MacClass; GraphicsState::mesh_corners; DriverDeviation and VkProperty MetalUnaryDenormals; WorkCounts' new counters (device_memory_overflows, attachment_read_clears, resident_uses_again_checked among them); RecordView::record_into; and Device's Drop and hand-written Clone. It loses VkProperty and DriverDeviation::MetalHalfColorNans, which nothing here used. Cargo.lock is unchanged: the runtime's manifests are the same at both commits, and the lock keeps its metal2vulkan source lines stripped. The new kinds are placed by answer.rs's rules: - device-memory-overflow is relayed, by its Exact statement. - device-line-ties dies where its tie is not measured on MoltenVK, and a native device relays it, on the rule for native devices: the pixel a width-1 line covers at a vertex two pixels' diamonds share is the driver's, which Vulkan's open diamond leaves to it with no control over it, and its only exact form is Metal's line rule run in the fragment function, an interpreter's. Every width-1 line draw on NVIDIA, lavapipe, RADV and ANV announces it. - device-subpixel-snap dies on every device, as wide-edge-depth-bias does: the band is the runtime's own, and its endpoints snapped to Metal's grid before it offsets them would leave the rasterizer nothing to round, so the hardware allows the exact form. Only a band draw announces it, which on a native device under the default is a line below 1/16 pixel or past lineWidthRange. - device-nan-encoding moves from what stays a death on a native device to what it relays, in the class of a native device's own maths and sampling: it differs in a NaN's bits alone, and there the runtime gives the device's NaN, its native form, and builds no path to Metal's bits where the device has one (its rule since 79166a74b1), as native-nan-encoding and device-texel-conversion's NaNs are relayed already. It still dies on MoltenVK. The placement test's list of the kinds that stay deaths on a native device loses it and gains device-subpixel-snap. The accuracy ledger lists the device's width-1 lines among the device's own answers and the band's snap under the wide_lines form. Outside strict mode no new kind ends a run: a kind of DIES is relayed and counted, and none of these is of DIES_BY_DEFAULT. The last good boots on the RTX 5080 already relayed device-nan-encoding, at a draw that binds an RG16Float texture, and relayed no kind of line. Two tests pinned the runtime's old answers, and take its new ones: - refused_icb_records_die_naming_the_execution: the runtime holds a commit's refusal of the records of a buffer the command buffer made resident for writing for the command buffer's host step, as a command buffer of another queue that this one waits for through an event, encoded after the commit, may still write the records before the work runs, and Metal runs what it wrote. Such records die as the command buffer ends, at the execution's selector, as at pin 11; records only the CPU wrote die at the commit, as before. - the_default_filter_samples_within_its_bound_of_metals: the runtime gathers a two-plane 4:2:0 texture's planes in place too, so on MoltenVK a function that samples and gathers a YCBCR8_420_2P texture reads them in place: its floats and halves are Metal's bit for bit, and nothing that dies is announced (measured on the M3 Max). Its _sRGB twin keeps the default filter, within its bound, and dies of ycbcr-filter-not-exact in strict mode as before. The test gathers every observation before it asserts. |
||
|
|
f1c0dc8cad |
⬆️ Build on metal2vulkan 209b375767's runtime
Pin move 7: the draw-fast round and stack16 on top of 9ec100ba7c. A kept draw is drawn again with only its rebound slots rewritten after buffer, offset, bytes, texture and sampler binds; recorded commands are counted in per-thread shards; a rebind counts only the stage tables it reads. VkQueue sharing now marks a queue long by its command buffers' own GPU time, and a device without calibrated timestamps does not share. RUNTIME_VERSION 1752. The accuracy ledger's queue_sharing row now says a device without calibrated GPU timestamps does not share. |
||
|
|
55cdab6483 |
⬆️ Build on metal2vulkan e71efbe0e9's runtime
metal2vulkan e71efbe0e9 is c8a0481cf8 plus three stacks (RUNTIME 1747): - Command queues share VkQueues where the device's own check finds the GPU idles at each switch between queues (the 5080), with an unshared form for a queue that must never wait behind another's long command buffer: new_command_queue_unshared. The graphics lane's WindowServer queues (RGFX_QUEUE_UNSHARED) now take it through unshared_queue, which made the plain queue until the runtime had one; on a device that shares no VkQueue it is the queue every create makes. The runtime's exact answers keep every queue on its own VkQueue, so REIMS_VGPU_EXACT gains queue_sharing (QueueSharingPolicy::PerQueue), with its accuracy-ledger row; docs/api.md now also lists extended_range_blits there. - Noted textures' pattern reads and writes are logged once each, with no allocation per draw. - A command buffer joins its ended encoders' resources into its residency where its work reads them, not as each encoder ends (end_call with 4096 resident: 205 to 7.2 us on the RTX 5080); a sampler state's creation prunes the live states' map only once it has doubled (1.97 to 0.56 us at 1000 live, 16.75 to 0.48 us at 10000, on the M3 Max); a commit counts its buffers' host imports in place, and the translator's spec_key makes its lists once. |
||
|
|
1aef0afbcc |
📝 Record the cost of extended-range blits in Metal's encoding [ci skip]
metal2vulkan measured DevicePolicy::extended_range_blits Canonical against Kept on the RTX 5080 and on the M3 Max under MoltenVK. Every blit costs measurably more, up to 3x on a Shared 2048x2048 copy out, so by the ledger's rule the accurate form stays behind its switch. The row now carries the numbers in place of "not measured". |
||
|
|
e2d5416387 |
⬆️ Build on metal2vulkan cd578f9cbc's runtime
The runtime brings two things here. - The video API: extra queues, shared-event waits and signals through the event's timeline semaphore, textures over a plane of the caller's multi-planar image, and where a no-copy buffer's bytes lie in the device's import. It sits behind options nothing here sets yet. - MoltenVK carve-outs: on the M3 Max under MoltenVK, half and float moves through registers and the measured pack conversions are Metal's own and no longer record NativeNanEncoding or DevicePackConversion. What still differs keeps its note. It also adds an exact form for extended-range blits: DevicePolicy::extended_range_blits, Canonical where a blit into or out of a BGRA10_XR texture Metal keeps compressed is rewritten to Metal's encoding. Its cost is not measured, so it is a switch, as the accuracy ledger's rule has it: REIMS_VGPU_EXACT=extended_range_blits, with a ledger row. The default keeps the bytes the device's copy moves and announces extended-range-bits-kept, as before. RUNTIME 1731, SEMANTICS 1948. No degradation kind is added or removed. |
||
|
|
eeeb52f6f0 |
⬆️ Build on metal2vulkan 9f5776bf31's runtime
Move the runtime from 7da81ee3d8 to 9f5776bf31. What changes for the guest: - ASTC HDR textures are made where Metal makes them: native where the device decodes them, else in a carrier with a decoded twin of halves. ASTC's 4x2 and 8x4 footprints are held the same way. - A pass drops ASTC attachments, and a draw or dispatch that binds an ASTC texture at a storage slot binds the slot's neutral, where such bindings died before. - Multisampled packed 16-bit colour textures are held in their word's format, where they were refused, and their resolves follow Metal's rules. - Per-draw work: a draw's shape is kept across scissor changes and carried to a later encoder's first draw of the same values. A pass counts its tiles only where a count or a clear reads them, and a pass of one instance leaves out pass-end work nothing reads. metal2vulkan commits: b5e51a65 eb6828ad 9193d3e0 3c3681c8 ad8b94cd fbc08602 287319c4 2a8dd25c 68a29658 a37ab781 8f62289f efc3c67b a5a8ddf9 603c78fc d25c36c7 521c5ee8 19241610 9f5776bf. Two degradation kinds are new, and both die in strict mode (DIES, 137 -> 139): WordResolve (a multisampled word-format attachment's resolve, within one code of Metal's per channel) and AstcStorageNeutral (an ASTC texture at a storage slot its function writes). Runs of either died or were refused before this runtime, so placing them there ends no run that went on. The accuracy ledger has a row for each. Checks: on the Mac, rustfmt, clippy with the tested features and for x86-64 Linux, and cargo nextest of reims-vgpu-vulkan, reims-vgpu and reims-graphics, 1160 tests: 1047 pass and 113 fail, the same 113 that fail at cd511955f7 on this Mac's MoltenVK. On msi's RTX 5080, the same packages on Linux, 802 tests: 3 fail, the 3 known NVIDIA encode_render cases (memoryless slot, ICB draws, protected texture). Not run: the VA-API leg (the homelab hosts did not answer) and a guest boot. The change does not alter what device info, GPU families or feature queries answer. The two new kinds end the process only on runs that died before. The pinned commit is metal2vulkan's local development, not yet published. |