The day's journal on the RX 550's host names the processes behind every UVD fault and ring timeout: each was one decoding jpeg-check.sh's grey cases, development's engine or a diagnostic build. 10 faults, and 3 ring hangs the kernel ended by resetting the GPU with VRAM lost, so a guest's grey JPEG on development could reset the host's GPU. The engine that refuses grey made none in 792 starts, each decoding the trial's 32x32 grey image. The module doc and U25 say so.
161 KiB
Bugs and deferred work
Everything known to be wrong, untested or put off in the video devices' host side, so it can be picked up later without being rediscovered.
Each entry says:
- what is wrong;
- the evidence: a run, a test or a source line, tagged measured or read as testing.md, "Tags", says;
- why it waits;
- what would fix it;
- who has it, where anyone does.
Keeping it current:
- An entry is added in the commit that defers the work.
- It is deleted in the commit that fixes it. An ID is not used again, since other docs and the code cite entries by it.
Open bugs
B14. A host session has no VRAM budget
- What: 16 decoder sessions, the bound of F7 (
MAX_SESSIONS,crates/reims-vgpu-video-core/src/host/guest_bounds.rs), can each hold a DPB of driver-maximum surfaces: about 480 MB for 4096x4096 H.264 with 16 frames (F7), so 7.7 GB from one guest on a shared GPU. - Evidence: read: the VA-API H.264 decoder's
configure(crates/reims-vgpu-video-vaapi/src/va/h264.rs) makesdpb_frames + 1 + SPARE_SURFACESsurfaces at the SPS's size. Measured on an RTX 5080 Laptop GPU (16,303 MiB, driver 615.71.09), 2026-10-24: one decoder of a 7680x4320 HEVC Main 10 stream held 1,020 MiB of VRAM, with the DPB its SPS asks for; one process with one held 1,216 MiB, with two 2,236 MiB. NVDEC's surfaces are the DPB plus 3 at the stream's size, so 16 sessions of such a stream would ask for the whole GPU, the host desktop's memory included. The probe stopped at two. - Why it waits: no budget, as Apple's host has none. The host puts no limit of its own on how much of its hardware one VM holds (B31, B39).
- Fix, if that changes: a budget of surface bytes per host session, or fewer sessions.
B26. Some guest command buffers run for seconds on a discrete GPU, over guest memory
-
What: on an RTX 5080 Laptop GPU a few of an x86_64 guest's command buffers run on the GPU for seconds, and the command buffers committed behind them wait. In every boot measured, a VideoToolbox pixel transfer kernel, one dispatch, runs 2.4 to 2.7 s, about 10 s after the guest's SSH is up. In the boots where mediaanalysisd runs its machine-learning analysis, 44 to 52 s later, one of its command buffers, of 452 dispatches, runs 2.4 to 3.0 s, and one exec of 794 dispatches 23.1 to 29.2 s. The guest's GPU watchdog acts on that exec: about 10 s into it the guest restarts its GPU, and resumes FIFO 1 until it completes. Waiters on stamps behind these command buffers log "waiter N waited 2s for stamp N to reach ..." from
reims_vgpu_core::device::waits, with their stamp wait reports. 31 boots on a Radeon 780M logged no such wait. At metal2vulkan 27935d575e the same command buffers take 9 to 10 ms, 309 to 359 ms and 565 to 591 ms, and no boot restarts its GPU (below). -
"resumed FIFO 1 was not faulted" is the guest resuming a child FIFO whose fault bit is clear (
resume_child_fifo,crates/reims-vgpu-core/src/device/fifos.rs, read): the device logs the warning, reports its stamp waits within the process's budget of nine, and resumes the child FIFO. Here the guest's watchdog resumes FIFO 1, which is not faulted but busy with the long exec: a symptom, not a fault. -
Evidence (measured, driver 615.71.09, 2026-10-25): seven boots of that guest to its desktop as the e2e checks boot it (
rvgv-msi-1), five from 62e19c8ef and two fromsteelbrain/video-pin(metal2vulkan 2e4c21ff6f), each with a probe that logged every exec in flight for over 1.5 s: its task, stamp, waits, dispatches and resources. The probe is not committed. Times are from commit to completion.boot runtime transfer kernel 452 dispatches 794 dispatches gpuRestartreportsFIFO 1 resumes 2 s waits p1 dc80eb2bd4 2,449 ms not run not run 0 0 1 p2 dc80eb2bd4 2,525 ms 2,702 ms 26,172 ms 17 5,340 0 p3 dc80eb2bd4 2,610 ms not run not run 0 0 0 p4 dc80eb2bd4 2,441 ms 2,765 ms 23,096 ms 17 4,329 0 n1 2e4c21ff6f 2,657 ms 2,984 ms 25,698 ms 17 5,238 2 n2 2e4c21ff6f 2,678 ms 2,443 ms 27,363 ms 17 5,713 4 d1 dc80eb2bd4 2,481 ms 2,612 ms 29,216 ms 17 6,073 3 -
The guest restarted its GPU in the five boots where the 794-dispatch exec ran, and in neither boot without it. Earlier, 11 of 12 e2e boots on this GPU (builds from c5b409362 to 0976aa973) wrote 15 to 17
gpuRestartreports 60 to 90 s after SSH came up and logged 2,905 to 6,995 FIFO 1 resumes; 7 of those 11 logged 1 to 4 of the 2 s waits. The one with none, at 7cfd37c9b (rvgv-msi-1/20261025-154838), had no probe, so whether mediaanalysisd's exec ran in it is unknown. -
The guest's restarts begin 9.7 to 9.8 s after the 794-dispatch exec's commit, with 15 to 17
gpuRestartreports naming mediaanalysisd, and it resumes FIFO 1 every 0.3 to 0.4 ms until the exec completes, the last resume within 1 ms of the completion. -
The runtime on
steelbrain/video-pinchanges none of it. -
The transfer kernel's command buffer was submitted within 1 ms of its commit (p1, with reims-vgpu's trace), and the long ones ran on the GPU: in their seconds
nvidia-smi dmonshowed the SMs 92 to 100% busy at 2,812 MHz, 58 to 61 W, device memory's bandwidth 0%, and PCIe 73 to 111 MB/s to the GPU and 209 to 290 MB/s from it. QEMU's threads all waited, idle (their stacks). Other tasks' command buffers committed in those seconds completed only after the long one: in n2, 33 that had been in flight over 1.5 s completed in the 3 ms after the 794-dispatch exec, some 26.8 s after their commits. So while one runs, no other task's GPU work completes. -
Every resource those command buffers use is guest memory: the 794 dispatches' 717 detached buffers, 11 detached heaps and an IOSurface texture; the 452 dispatches' 456 detached buffers, 16 detached heaps and an IOSurface texture; the transfer kernel's 4 detached buffers and 3 IOSurface textures, over 960x1088 threads. The Vulkan platform uses guest memory in place (conventions.md, "The Vulkan platform"). On a discrete GPU that is host memory, reached across PCIe, where the runtime puts its own
Sharedmemory too (read, metal2vulkan dc80eb2bd4,memory.rs, which gives the RTX 3090's 4-byte stores 12 bytes apart as 0.08 GB/s there, against 850 GB/s in device-local memory). -
Without a guest, kernels of our own over 16 MiB in and 16 MiB out, in
Privatememory and in guest-like memory (a no-copy buffer over host pages made as guest RAM is,VulkanVm::allocate_aliasable); the best of three, in ms. The runtime'sSharedmemory took about as long as the guest-like memory on each GPU.kernel RTX 5080 Laptop RX 7900 XTX (RADV) Radeon 780M (RADV) stream: 16-byte loads and stores in order 0.38 / 1.69 0.63 / 4.51 0.96 / 1.02 scatter: loads in order, 4-byte stores 4,099 words apart 0.58 / 51.97 1.12 / 24.95 5.14 / 5.86 gather: 4-byte loads 4,099 words apart, stores in order 0.59 / 15.91 0.96 / 26.17 3.40 / 4.43 reuse: 64 loads a thread, spread across the buffer 0.93 / 5.61 2.56 / 4.22 11.00 / 11.41 hot: 64 loads a thread from the first 64 KiB 0.80 / 1.16 2.15 / 3.54 3.41 / 4.48 So on the two discrete GPUs host memory costs 1.4 to 90 times the time, by access pattern, and on the integrated one 1.0 to 1.3 times. None of these patterns is what the guest's long command buffers run (measured, the RTX 5080 Laptop GPU, 2026-10-26): in
nvidia-smi dmonloads and stores like them, the scatter kernel's among them, moved 2 to 31 GB/s across PCIe, where the guest's stalls move a few hundred MB/s; and a kernel of 960x1088 threads each following 900 dependent 4-byte loads through the buffer, which took the transfer kernel's 2,520 to 2,627 ms over guest-like memory (39 to 46 ms inPrivatememory), read 30 GB/s. What does run for seconds is the next item. -
What runs for seconds: stores into host memory that leave gaps, on the RTX 5080 Laptop GPU (measured, 2026-10-26, metal2vulkan 67c64f99d8; the RTX 5080 Laptop GPU on driver 615.71.09, its link at its slot's PCIe 5.0 x8 under load; the RX 7900 XTX and the Radeon 780M on RADV, Mesa 26.2.4):
-
The transfer kernel's three textures are IOSurfaces. The Vulkan platform makes a texture on a surface over a buffer over the surface's pages (
new_texture_on_surface,crates/reims-vgpu-vulkan/src/gpu/device.rs), and the runtime makes no image that aliases a caller's host pages, as such an image startsUNDEFINEDand Vulkan lets its first move read and write every byte it is bound to. It holds the texture as a shadowed texture instead: an image of its own, whose texels it copies in from the bytes before each use and, after a command writes through it, merges back into them, storing only the words that changed (read, metal2vulkan 67c64f99d8,texture.rs,shadow_merge.rs; announced asmetal2vulkan-degrade-shadowed-texture). -
The merge's kernel takes four consecutive 4-byte words an invocation (
bind/shadow_merge.rs; its variant that reads the shadow itself, four consecutive texels of a row), so each of its stores across a warp writes one word in every 16 bytes. On the RTX 5080 Laptop GPU a store into host memory that leaves gaps in the bytes the warp spans takes hundreds of times as long as one that covers them; on the two Radeon GPUs it does not. Without the runtime, raw Vulkan, 8 MiB stored into host memory, the median GPU time of five in ms, with device-local memory in brackets: on the RTX 5080 Laptop GPU an imported memfd of 4 KiB pages (2 MiB pages, anonymous memory and the other host-visible type took as long: 393 to 620 ms for the fourth row), on the Radeon GPUs a dma-buf of the same pages, as the platform imports them there (crates/reims-vgpu-vulkan/src/os/linux/dma_buf.rs).stores across a warp, into host memory RTX 5080 Laptop RX 7900 XTX Radeon 780M one word an invocation, in order 0.32 (0.01) 0.52 (0.01) 0.10 (0.10) four words an invocation, a workgroup apart 0.32 0.52 0.09 four words an invocation, one 16-byte store 0.32 0.52 0.09 four consecutive words an invocation, a store each 590 (0.01) 0.52 0.09 the merge's: a word of two buffers read, the third's stored where they differ, four consecutive words an invocation, each word changed 609 (0.02) 4.48 0.53 the same, the four words a workgroup apart 0.85 (0.01) 2.35 0.33 one word in each 8 bytes 383 2.41 0.20 one word in each 16 bytes 140 1.21 0.20 one word in each 32 bytes 51 0.61 0.20 one word in each 64 bytes 1.15 0.30 0.20 one word an invocation, 4,099 words apart 28 11.2 2.24 loads, four consecutive words an invocation 0.32 1.17 0.10 The RX 7900 XTX's L2 holds host memory (
crates/reims-vgpu-vulkan/src/os/linux/import.rs), so its timestamps may close before the stores reach the pages: from submit to fence its first four rows took 1.3 to 1.4 ms each. Innvidia-smi dmon, the RTX 5080 Laptop GPU running the fourth row showed the guest's stalls' signature: SMs 100% busy, 53 W, device memory's bandwidth 0%, PCIe 0 MB/s to the GPU and 154 MB/s from it. -
Through the Vulkan platform, kernels of our own over textures over no-copy buffers over guest-like pages, each command buffer's output other than the last one's, the median of five after a first, in ms, with
Privatememory in brackets, on the RTX 5080 Laptop GPU:command time the transfer's shape: R16UnormandRG16Unormin,RGBA16Floatout, 4x2 pixels a thread, 1280x720, half the output's words changing238 (0.79) the same, 3840x2160 2,543 (0.96) an RGBA16Floattexture's fill, 1280x720, half its words changing254 (0.62) an R16Unormtexture's fill, 1280x720129 (0.42) an RG16Unormtexture's fill, 640x36054 (0.56) Each took 60 to 80 ms per MiB of words changed, as the merge's row above does (76); at 3840x2160 the fills took 2,519 ms (
RGBA16Float) and 1,230 ms (R16Unorm). Storing the same bytes each time, the transfer took 6 ms after its first run, as the merge then stores nothing. So the boots' transfer kernel, 2.4 to 2.7 s, is the merge of its output into the IOSurface's pages. -
The translation stores a vector through a pointer an argument buffer holds a word at a time: a
device float4store there is four 4-byte stores (Aligned 4), where through a bound buffer it is one 16-byte store (read, the SPIR-V of our own kernels for the RTX 5080 Laptop GPU's profile, metal2vulkan 67c64f99d8). Through the platform, over guest-like memory, 512K threads, in ms:float4through an argument buffer 294, through a bound buffer 4.7;packed_float3through a bound buffer, three 4-byte stores, 338;float2andhalf4through an argument buffer 4.6 and 3.8. Each took 0.7 to 0.9 inPrivatememory. -
Whether the 452 and 794 dispatches' seconds are these stores is unknown: their kernels are the guest's, which run in no test here. Each writes an IOSurface texture, a shadowed texture, and buffers in heaps that argument buffers point to.
-
How the platform imports the pages changes none of it: on the RTX 5080 Laptop GPU 4 KiB or 2 MiB pages, a memfd or anonymous memory, a memfd's views shuffled at 4 KiB to 2 MiB, either host-visible type the driver offers for the import, and the driver's own host memory took as long, by pattern, with the IOMMU passing the GPU's addresses through (
crates/reims-vgpu-vulkan/src/os/linux/import.rs).
-
-
Why the other tasks' work waited too at metal2vulkan dc80eb2bd4: the runtime shared four
VkQueues round robin among every command queue the device makes, and a queue's command buffers go to its oneVkQueue(read, metal2vulkan dc80eb2bd4,queue.rs), so a command queue that shares aVkQueuewith the long command buffer waits behind it. Without a guest (measured, the RTX 5080 Laptop GPU): beside a queue running those 2.5 s dispatches, three of four other queues ran small command buffers 55 to 68 times in 10 s, the longest 149 to 297 ms; the fourth ran 4, the longest 2,526 ms. At 67c64f99d8 the other tasks' work still waits, onVkQueues of its own (below). A Metal queue waits behind another queue's command buffer only inside one command, measured on an M3 Max under macOS 27.0.1 (read, metal2vulkan 67c64f99d8,queue.rs): behind one compute dispatch of 2.50 s, the whole dispatch; behind the same 2.50 s as 256 dispatches of one command buffer, nothing. -
How long the guest's kernels would take over device-local memory is unknown: no guest kernel is run outside a guest here, and the one boot with device copies of some of their resources broke the guest before mediaanalysisd ran (below).
-
What the guest's watchdog acts on (measured, driver 615.71.09, 2026-10-25 and 26): four more boots as above, with the probe, at metal2vulkan dc80eb2bd4. Each wrote 17
gpuRestartreports and logged 4,123 to 6,343 FIFO 1 resumes and 0 to 4 of the 2 s waits; the transfer kernel took 2,445 to 2,629 ms, the 452 dispatches 2,636 to 2,741 ms and the 794 dispatches 22,708 to 29,435 ms.- In every report written while the 794 dispatches ran, all 68 naming mediaanalysisd, the first incomplete command of its exec FIFO is that exec's
ExecIndirect3or theNopbehind it. - Behind it, in two boots, 4 and then 19 to 33 more of its own commands wait on that FIFO.
- In three boots, other tasks' execs committed during it (4 of one task in one boot, and 14 and 19 of two tasks in each of two others, each in flight for over 1.5 s) completed within 11 ms after it.
- In one boot its memory FIFO's
SynchronizeAndDiscardResourceswaited too, with 130 to 150DeleteResourcecommands of its object FIFO behind that. - So the watchdog acts on the long exec itself, with its own later work and other tasks' work waiting behind it.
- In every report written while the 794 dispatches ran, all 68 naming mediaanalysisd, the first incomplete command of its exec FIFO is that exec's
-
At metal2vulkan 67c64f99d8 (measured, driver 615.71.09, 2026-10-26): one boot as the e2e checks boot it and five more with the probe, from 55a1d96e7, the probe in two of them also logging the
VkQueueeach task's queues took. The runtime lends 14VkQueues round robin there where it lent 4, and a task makes two command queues, its own and its paging queue (crates/reims-vgpu-core/src/gpu_task/handshake.rs), and the two boots that logged them made 82 and 84 over the 14. None of it changes B26:- In the three boots where the 794 dispatches ran, they took 26,502 to 30,136 ms, and each boot wrote 17
gpuRestartreports and logged 5,509 to 6,617 FIFO 1 resumes and 1 to 4 of the 2 s waits. The other three wrote no report and logged no resume; the boot without the probe logged 2 of the waits. The transfer kernel took 2,442 to 2,568 ms in all five probe boots, the 452 dispatches 2,729 to 2,916 ms in three. - Behind the 794 dispatches, 64, 4 and 64 execs of other tasks committed during them completed within 50 ms after them. In the boot that logged the queues, neither of those two tasks' queues took the long command buffer's
VkQueue. - In that boot, with the Vulkan platform's timing trace on (
reims_vgpu_vulkan::gpu::timing=debug), the first of them waited, through its paging command buffer, for the value of FIFO 1's event that the long exec's command buffer signals when scheduled (encode_signal_when_scheduled,crates/reims-vgpu-core/src/gpu_task/exec.rs). The runtime submitted that paging command buffer 0.2 ms after its commit, on aVkQueuethe long one did not take, and the runtime saw it complete 0.1 ms after it saw the long one complete (their completion handlers 0.27 ms apart), with its task's later command buffers behind it. From the long command buffer's start to its end, no command buffer of the unlabelled queues, the tasks' among them, completed (the trace's summary of their completions). - So the long command buffer holds other
VkQueues' work: either its scheduled signal reaches another queue's wait only at its end, or the GPU runs no otherVkQueue's work beside it. Which is unknown, and metal2vulkan's to find. Behind the transfer kernel's one dispatch, the other tasks' waits are Metal's own; behind the 794 dispatches, they are not (Metal, above).
- In the three boots where the 794 dispatches ran, they took 26,502 to 30,136 ms, and each boot wrote 17
-
At metal2vulkan 27935d575e (read), the runtime changes both halves of B26:
- The waits: up to 67c64f99d8 the runtime handed a batch's wait for a shared event's value that a GPU signal submitted before it would reach to the
VkQueueof that signal, where it waited out the signalling command buffer's work, however early the signal came; a scheduled signal's too (event_timeline.rs, 2023604104). The paging command buffer above waited for the long exec's scheduled signal of FIFO 1's shared event, so by that rule it waited out the long exec: the first of the two causes above. At 27935d575e the runtime holds such a batch on the host and submits it, with no Vulkan wait, once the value is reached, by the GPU's signal or the host's set, as Metal releases it; a plain event's wait still chains on theVkQueue, where that is exact.WorkCounts::shared_event_waits_heldcounts the waits held so. - The merge's stores: invocation
lof workgroupgtakes the words4Ng + Nk + l(bind/shadow_merge.rs, d53bf44064), the layout under Fix whose row above took 0.85 ms where four consecutive words took 609 ms, and the variant that reads the shadow spreads a row's words the same way (bind/shadow_merge_image.rs).WorkCounts::shadow_merge_dispatches_plannedandshadow_merge_words_examinedcount the merges it plans.
- The waits: up to 67c64f99d8 the runtime handed a batch's wait for a shared event's value that a GPU signal submitted before it would reach to the
-
At metal2vulkan 27935d575e (measured, driver 615.71.09, 2026-10-26): one boot as the e2e checks boot it and three more with the probe, from 221176d06, the probe with the Vulkan platform's timing trace on and logging, besides the execs in flight for over 1.5 s, the end of every exec of 100 ms or more, of 100 dispatches or more, and of the transfer kernel's shape, and the runtime's
WorkCountsevery 5 s. Times are from commit to completion; the worst detach replace and detach are the backing call's alone.boot transfer kernel 452 dispatches 794 dispatches gpuRestartreportsFIFO 1 resumes 2 s waits worst replace worst detach e2e no probe no probe no probe 0 0 0 no probe no probe m1 10.2 ms not run not run 0 0 0 12.1 ms 0.61 ms m2 9.0 ms 358.9 ms 590.5 ms 0 0 0 23.2 ms 1.77 ms m3 9.8 ms 309.4 ms 565.1 ms 0 0 0 20.4 ms 0.36 ms - The transfer kernel took 9.0 to 10.2 ms where it took 2,442 to 2,568 ms at 67c64f99d8, the 452 dispatches 309 and 359 ms (2,729 to 2,916), and the 794 dispatches 565 and 591 ms (26,502 to 30,136), well inside the 10 s after which the guest's watchdog acted: no boot wrote a
gpuRestartreport, logged a FIFO 1 resume or a 2 s wait, the two where the 794 dispatches ran among them. With the same probe on the same tree, one boot each on RADV (Mesa 26.2.4), the transfer kernel took 55.5 ms on the Radeon 780M and 64.5 and 66.5 ms on the RX 7900 XTX, the 452 dispatches 241.5 and 262.9 ms, and the 794 dispatches 467.2 and 690.1 ms. Which of 27935d575e's changes took the 452 and 794 dispatches' seconds away is not separated; the merge's layout is the one measured to take such seconds away (above). - Behind the 794 dispatches no other task's exec waited in either boot, nor behind the transfer kernel in any, of the execs of 100 ms or more the probe logs. Behind the 452 dispatches, in m2, 50 of task 3's execs committed during them completed within 3 ms after them, 349 to 354 ms after their commits; in m3 none did, nor on the two Radeon GPUs. In m2's second the timing trace gives the unlabelled queues' 79 command buffers that completed 337 ms from commit to submission at the median and 353 ms at most, and 0.96 ms behind the queue at the 95th percentile: the runtime held them on the host, not on a
VkQueue. The first of them waited for FIFO 1's event to reach 0xb095, one past the 0xb094 the 452 dispatches' exec waited for, and for its paging event; the trace writes no line for a command buffer done within 500 ms, so their own times are not in it.shared_event_waits_heldwas 0 at the end of each of the five probe boots, so no wait was held by the rule 27935d575e added; which hold it is, is unknown. - Detach replaces: 1,316, 2,550 and 2,381 a boot, the worst of each 12.1 ms (a private heap of 7.3 MiB), 23.2 ms and 20.4 ms (private heaps of 32 MiB), against 18.3 to 173.4 ms at 67c64f99d8; the worst detach 0.36 to 1.77 ms, against 2.2 to 54.9 ms.
- The runtime's counts at each boot's end, m1 to m3:
shadow_merge_dispatches_planned2,899, 3,868 and 2,782;shadow_merge_words_examined1,112,213,782, 1,356,843,479 and 1,331,346,810;functions_translated17, 0 and 11 of 760, 913 and 858 asks, the others shared (functions_shared), from the shader cache on disk.
- The transfer kernel took 9.0 to 10.2 ms where it took 2,442 to 2,568 ms at 67c64f99d8, the 452 dispatches 309 and 359 ms (2,729 to 2,916), and the 794 dispatches 565 and 591 ms (26,502 to 30,136), well inside the 10 s after which the guest's watchdog acted: no boot wrote a
-
At metal2vulkan 6c9cad047a (read), the copy back: where a device copies a shadowed texture back into its bytes faster with a dispatch than with
vkCmdCopyImageToBuffer(a cost the runtime measures per device), the dispatch's kernel stored a texel of two or four words (itsR32G32_UINTandR32G32B32A32_UINTviews) as that many consecutive words an invocation, so a warp's stores left one word in each 8 or 16 bytes: the rows of the table above that took 383 and 140 ms on the RTX 5080 Laptop GPU. At 6c9cad047a invocationlof workgroupgtakes a row's wordsnNg + Nk + l(bind/shadow_copy_back.rs, 7b1553ce76), the same bytes, with a warp's stores on consecutive words; a one-word texel's copy back already stored so, and is unchanged.WorkCounts::shadow_copies_back_dispatchedcounts these dispatches, and no boot below took one. -
At metal2vulkan 6c9cad047a and f0e6acc526 (measured, driver 615.71.09, 2026-10-26): three boots as the e2e checks boot it, with the probe, on a build at f0e6acc526, a runtime that also counts each hold between a command buffer's commit and its
vkQueueSubmit(built for this measurement, not pinned here), with the timing trace on; and two boots at 6c9cad047a with the probe and no video device, beside B37's decode workers. Times are from commit to completion; "behind" is other tasks' execs committed during the 452 dispatches that completed within 50 ms after them.boot runtime transfer kernel 452 dispatches 794 dispatches gpuRestartreportsFIFO 1 resumes 2 s waits behind the 452 dispatches m1 f0e6acc526 9.3 ms 329.8 ms 702.7 ms 0 0 0 4 of one task, to 323 ms m2 f0e6acc526 9.4 ms 348.7 ms 639.5 ms 0 0 0 none m3 f0e6acc526 9.3 ms 371.7 ms 671.1 ms 0 0 0 35 of one task, to 366 ms s1 6c9cad047a 9.4 ms 205.4 ms 493.4 ms 0 0 0 35 of two tasks, to 230 ms s2 6c9cad047a 10.9 ms 244.3 ms 522.8 ms 0 0 0 11 of one task, to 224 ms shadow_copies_back_dispatchedwas 0 at the end of all five, and of a boot each at 6c9cad047a on the RX 7900 XTX and the Radeon 780M, which copied back 137 to 214 million texels a boot by copy. So the copy back's new layout moves none of these boots' times. On the two Radeon GPUs the transfer kernel took 49.7 and 64.0 ms, the 452 dispatches 230.9 and 275.7 ms, the 794 dispatches 550.8 and 688.1 ms, with nothing behind them.- The hold behind the 452 dispatches is there in two of the three boots at f0e6acc526 and in both at 6c9cad047a; in s1, 12 of one task's execs also completed within 50 ms after the 794 dispatches, the longest 523 ms. In m1's and m3's second of it, the timing trace gives commit to submission at most 318 and 364 ms, and behind the queue at most 305 and 344 ms.
- f0e6acc526's counts of those holds (each reason counted at every look of the runtime's scheduler that found a head held for it), from the probe's
WorkCountslines 5 s apart, over the 5 s that hold the 452 dispatches: in m1 and m3heads_held_for_earlier_commits1,118 and 357,heads_held_for_host_steps18 and 17,heads_held_for_checks4,206 and 3,075,heads_awaiting_check_signals605 and 230, andbatches_held_past_a_look2,514 and 2,355, for 2.98 and 1.66 s ofbatch_hold_nanos; in m2, whose 5 s submitted little else (0.7 ms ofbatch_submit_nanos, against 74 and 50 ms), 0, 0, 4, 0 and 4, for 22 ms.heads_waiting_at_their_gate,heads_held_for_event_values,heads_held_for_decodes,heads_held_for_reencodes,heads_held_for_binary_semaphoresandfirst_work_order_waitswere 0 there and over each whole boot. So the looks found heads held behind an earlier commit's batch on another queue, for their host steps and for their submission checks, and none waiting at a host step's gate. - At metal2vulkan f6a96b7da8 (read) those thirteen counts are the pinned runtime's own, so a boot reads them without a runtime built for it.
-
-
Seen to fail guest sessions (measured, driver 615.71.09, 2026-10-24): with the NVIDIA backend, five sessions' decoders or encoders opened 0.9 to 2.4 s after the guest's
dstaoresta, and three of them came too late for the guest's wait of about a second: H.264 and VP9 decodes failedsession: not created: -19092, and H.264 encodessession: create failed: -12903. One of those boots logged seven of the 2 s waits in the same minute. In a boot with none, every session opened in 30 to 67 ms and all passed. Outside QEMU the backend opened an H.264 decoder and both encoders in 24 to 35 ms, back to back and 15 s apart (the NVIDIA crate'snvidia-open-timeexample). So the backend's open waits behind the long GPU work, and the guest sees it; what in the open waits is unknown. In another boot an AV1 decoder opened 3,924 ms after itsdsta, beside nine stamp wait reports ("FIFO 1 pending", 51 commands), and the guest got -19092. -
Seen beside other processes' failed decodes (B37).
-
Why it waits: up to 67c64f99d8 the seconds were the runtime's stores into the guest's pages, in shapes that leave gaps, which the RTX 5080 Laptop GPU stores into host memory hundreds of times slower than the same bytes without them (above); not host memory as such, which the same bytes stored without gaps cross in under a millisecond. Each command buffer is submitted at once and the GPU runs it at full clock. Guest memory in place is ours, by design, and nothing in how the Vulkan platform imports the pages changes the time; the stores' shapes are metal2vulkan's (Fix). It is not the video code's. Up to 67c64f99d8 most boots ran on, and one in two boots with the NVIDIA backend lost a session to it; the four boots at 27935d575e lost none. What is left at 27935d575e, and at 6c9cad047a: the 452 and 794 dispatches' 0.2 to 0.7 s, which the two Radeon GPUs take too (0.23 to 0.69 s), and, in five of the seven boots on the RTX 5080 Laptop GPU since, other tasks' execs held behind the 452 dispatches (above). The owner chose copies in a discrete GPU's own memory, where they move nothing the guest observes; for these resources they move what it observes (device copies, below).
-
Device copies, tried and dropped (2026-10-25): guest-private detach buffers and heaps, not read-only, as
Privateruntime objects whose bytes moved between the guest's pages and the GPU's memory at each replace and detach, and at a suspend; the 794 dispatches' 11 heaps, 88 MiB, among them. In the first boot with them, on the RTX 5080 Laptop GPU, the guest's WindowServer aborted 26 s after it started, on a corrupted malloc free list, during the transfer kernel's 2.8 s, and the session never logged in (measured). A detach record's private bit is not Metal'sPrivatestorage: core makes those objectsSharedover the guest's pages, and the contract makes them the pages themselves (testing.md, the detach column of its table of private buffers and heaps:interplay_lifetime_pause_resident,interplay_lifetime_heap_alias_buffers,interplay_memlive_alias_writeback_race). Copies move all three rows, and the copies' whole-object write-backs land in pages the guest may have moved on from; copies of shared buffers or IOSurfaces would move them too. The suite runs on the Mac's Metal platform and never had the copies. They stay unmerged (lessons.md, "The Vulkan platform"). -
Fix:
- not a copy in the GPU's memory: the guest reaches these resources' pages directly (device copies, above);
- in metal2vulkan, inside the contract: its shadow merge's kernels laying an invocation's four words a workgroup apart (word
4Ng + Nk + lfor invocationlof workgroupg's wordk,Ninvocations a workgroup), which the merge of each word allows, as it reads and writes that word alone: 609 ms per 8 MiB became 0.85 ms on the RTX 5080 Laptop GPU, 4.48 ms 2.35 on the RX 7900 XTX and 0.53 ms 0.33 on the Radeon 780M, in the table above; and its variant that reads the shadow alike, with a warp's stores over consecutive words rather than texels. The runtime lays both so at 27935d575e, and its copy back of a texel of two or four words at 6c9cad047a (above). Still to make: a vector stored through a pointer as one store where the pointer's type's alignment holds. That is metal2vulkan's, with the measurements above; - nothing in the Vulkan platform's imports, whose pages took as long however they lay (above);
- or the GPU device on the host's integrated GPU where it has one, which the runtime ranks after a discrete one (
crates/reims-vgpu-vulkan/src/host_gpus.rs): no help on a host with a discrete GPU alone. - Either way, in the runtime: a command queue that does not wait behind another queue's command buffer of many commands, as Metal's does not, so that one task's long work holds up only its own. At 67c64f99d8 the queues that waited took
VkQueues of their own (above), so sharing one is not all of it; at 27935d575e a wait for a shared event's value no longer waits on the signallingVkQueue(above). At 27935d575e no other task's work waited behind the 794 dispatches in the two boots where they ran, and in one of them 50 of one task's execs waited behind the 452 dispatches' 359 ms, held on the host by a rule other than the one 27935d575e added (above). At f0e6acc526 the runtime's scheduler found those heads held behind earlier commits, for host steps and for submission checks, none at a host step's gate (above). Which commit, and whether Metal would hold them there, is metal2vulkan's to find, with the measurements above.
B28. The host sends no per-frame histogram (,dp2)
- What: Apple's AVD sends a 544-byte
,dp2with every decoded frame, which the guest sets as its surface's data property 2 withIOSurfaceSetDataProperty(read from Apple's guest code); ours sends none (devices.md, "Colour and HDR" and "Where we differ from Apple"). - Evidence: measured with a probe of Apple's host session on the M3 Max (macOS 27.0.1), 29 streams of every codec and depth, 2026-10-24: the bytes
1tshdvaa, six 32-bit words (one that differs between sessions, a frame counter from 1, 128, 32, then 0), then 128 little-endian 32-bit counts that sum to the frame's pixels (147,456 at 512x288) and are the same for two streams of the same pictures with other colour tags. - Why it waits: left out on purpose for x86_64 guests. What the 128 bins count (luma alone or more, how 8 and 10 bits and the range map to them) is not measured, and no reader of data property 2 is known in the guest. Its magic,
1tshdvaa, is in none of the sevendyld_shared_cache_x86_64hfiles of a 25G241 guest, in either byte order, nor ishst1(measured,grep -c -a -F), so no x86_64 guest code knows the format by its tag. It looks to be AVD's statistic for Apple silicon's display, which an x86_64 guest lacks. A frame without it decodes, and its colour attachments are the same (Apple's carries none). - Fix: look for a reader in an arm64 guest's frameworks:
IOSurfaceGetDataPropertycallers with index 2. If one matters, measure the bins on Apple's host with flat streams of known samples (one luma value a stream, at 8 and 10 bits, video and full range), then count them in core's copy into the guest's surface, which reads every luma sample already, and send,dp2from core for every backend.
B29. Dolby Vision is not offered
- What: Apple's host answers
dcapfordvh1with Dolby Vision's capabilities, {VTDoViIsHardwareAcceleratedtrue,VTDoViSupportedLevels"01" to "09",VTDoViSupportedProfiles["05", "08"]}, though itsdecslists no Dolby Vision decoder; ours answers NULL, as for any codec it lacks (devices.md, "Where we differ from Apple"). The guest's capabilities do not show it: its HEVC dictionary has the same Dolby Vision keys on ours, made by the guest itself. What is not offered is the decode of a Dolby Vision stream, whose frames' metadata Apple's host may carry. - Evidence: measured: Apple's host's lists, M3 Max (macOS 27.0.1), 2026-10-24. Read from Apple's guest code:
VTCopyHEVCDecoderCapabilitiesDictionarymergesdvh1's dictionary overhvc1's, and the guest asks the host fordvh1's only where it has a hardware decoder for it. Measured in an x86_64 guest on ours, 2026-10-24: it had none, and itsVTCopyHEVCDecoderCapabilitiesDictionarycarried {VTDoViIsHardwareAccelerated1, levels "01" to "09", profiles ["05", "08"]}, as the M3 Max's does, which the guest makes from HEVC's Main 10 entry; a NULL from ours would have left them out. - Why it waits: left out on purpose, as the guest builds its Dolby Vision capabilities itself and no encoder at hand writes a Dolby Vision stream. With no stream carrying an RPU, what Apple's host sends with such a frame (the RPU as an attachment, or nothing) is not measured, and profile 5's base layer is not plain HEVC to display.
- Fix: write a profile 8.1 stream (HEVC Main 10 PQ with an RPU in NAL units of type 62) from scratch, measure Apple's host's
Demtand the guest's attachments for it, then answerdvh1as Apple's host does for what the backend can carry, profile 8 first.
B31. VideoToolbox's hardware encoder sessions are the whole Mac's, 32 in all
- What: the M3 Max's VideoToolbox has 32 hardware encoder sessions open at once across every process, and answers -12903 at the 33rd. Core lets one host session open 16 encoder sessions (F7), so one guest can hold half the Mac's encoders, and two all of them; the host's own apps and other VMs then get none. Apple's host has no cap at all, so its guest can hold all 32. Decoders: 80 H.264 hardware sessions at 1080p opened and decoded a frame each at once in one process, and no limit was met.
- Evidence: measured with a probe on the M3 Max (macOS 27.0.1), 2026-10-24: 32 of 40 asked opened, H.264 at 1080p and HEVC at 2160p alike, each encoding a frame; with one process holding 20, a second opened 12.
- Why it waits: left uncapped, as Apple's host leaves it (B14).
- Fix, if that changes: a cap in the VideoToolbox backend, process-wide, below 32, answering
estapast it as VideoToolbox does when it has none, -12903; or core's 16 lowered for every backend.
B37. NVDEC fails valid decodes in every process while one of our VMs boots on its GPU
- What: while a VM boots through reims-vgpu on an RTX 5080 Laptop GPU, NVDEC reports valid frames' decodes failed (
cuvidDecodeStatus_Error, status 8) in other processes, and gives other frames wrong with no failed status, VP9's, H.264's and HEVC's alike; every frame predicted from such a frame is wrong too. Through core's host session the guest gets those frames as -12909 with no image; after an H.264 or HEVC one, each frame -12909 too until an I picture (H.264) or an IRAP picture (HEVC), as after a truncated slice (B41), and wrong frames after an AV1 one; and opens and replies later than its 1.1 s waits. The failures come in bursts, most in the boot's first two minutes, when B26's long command buffers run too. At metal2vulkan 6c9cad047a, where those command buffers take under a second, none came (below). - Evidence: measured on that GPU (driver 615.71.09), 2026-10-24, with two stress workers decoding through the backend directly and through core's host session (nvidia.md, "Several processes at once"):
- Beside a VM booting with no video device, so that its QEMU used no NVDEC, and idling 200 s: 12, then 8, of 432 runs failed, in two boots. Seven direct runs, the backend with no session, got status 8. One direct VP9 run gave 30 frames, 17 to 29 wrong, none reported failed. The session's runs lost frames (17 of 20 of a 2160p 10-bit stream), gave wrong ones, or met no reply. The boots logged 4 and 3 stamp waits, and each boot's failures spanned 86 s around them, some within 2 s of a stamp wait; reims-vgpu logs only the waits past 2 s.
- With no VM of ours on the GPU, 4,968 runs passed, and none failed: two workers alone (1,080); beside the damaged-input check (648, whose 432 runs passed); beside AV1 decodes of 643x363 and other sizes (648); beside 4K x265 encodes loading the CPU to 19 (864); beside 8K decodes (864); and 432 straight after each boot.
- Three earlier sightings each fell in a boot of a VM on that GPU, one whose device offered no codec.
- The kernel logged no Xid, and no other NVIDIA line, at the failures.
- NVDEC's, not the session's: the backend's own runs failed with NVDEC's status, read by
cuvidGetDecodeStatus(check_status,crates/reims-vgpu-video-nvidia/src/nvdec/decoder.rs). Each frame the session gave without an image had its guest buffer and then a failed copy, where that status is read: aDfubfor each. The session's "no reply" runs are its 1.1 s waits (dsta, an asynchronousdfrm,dfin) running out during a stall, as the guest's do in B26. - VP9 has no failed status. On damaged streams NVDEC reported 124 to 795 failed copies a stream for H.264, HEVC and AV1, and none of 468 VP9 frames copied. A VP9 frame a stall breaks reaches the guest as good.
- Again beside a boot, and not beside our own load (measured, the same GPU and driver, 2026-10-25). Two workers decoded three streams directly (
nvidia-framemd5: H.264 High and HEVC Main 10 at 1080p, AV1 10-bit at 2160p), against each stream's MD5s from an idle GPU.-
Beside boot d1 of B26, for the whole of its QEMU's 4 minutes, 10 of 223 runs failed, each ending early with an error, whose text was not kept. They came in three bursts:
- 31 to 40 s after QEMU started, in the guest's first busy GPU seconds, the transfer kernel's among them, with the SMs 100% busy in 5 of those seconds;
- 95 to 121 s, the 794-dispatch exec's seconds and the 1.4 s before it;
- 229 to 231 s, 10 s before QEMU exited, with no long command buffer in flight.
-
Without a guest, beside kernels of our own that load the GPU as the guest's do, 480 runs failed none, and 348 beside nothing failed none. Each load ran 60 or 90 s, under the GPU locks:
- the scatter kernel of B26 over guest-like memory, in command buffers of 20 dispatches (1.1 to 1.4 s each; 108 runs) and of 500 (23.7 to 23.9 s; 156 runs), and in
Privatememory (72 runs); - the 2.5 s dispatches shaped as the transfer kernel over guest-like memory (24 runs, and 24 more beside eight other queues running small command buffers), and in
Privatememory (96 runs).
In
nvidia-smi dmonthe loads over guest-like memory looked like the guest's stalls: SMs 100% busy at 2.8 GHz, about 60 W, device memory idle. They slowed the decodes, the 2.5 s dispatches by nine times (6 runs a worker in 90 s against 54), but no decode failed. - the scatter kernel of B26 over guest-like memory, in command buffers of 20 dispatches (1.1 to 1.4 s each; 108 runs) and of 500 (23.7 to 23.9 s; 156 runs), and in
-
- A load that does it, without a guest (measured, the same GPU and driver, 2026-10-25). Each load ran 50 to 60 s, under the GPU locks, beside the two
nvidia-framemd5workers and a decoder of our own on NVDEC and NVIDIA's parser, which reads each picture's status and hashes each frame against an idle GPU's.- The load: 16 workgroups of 64 invocations, each adding 1 to the same 32-bit word 20,000 times with
atomicAdd. The word is in host memory imported withVK_EXT_external_memory_host, and each dispatch runs 190 to 280 ms. - Beside it, every
nvidia-framemd5run failed, 5 of 5 in each of two runs. A pass of our decoder over a 150-frame H.264 stream had 54 pictures reported failed and 128 frames wrong, and in the second run 142. - In a 240 s run, 6 of 10 H.264 passes and 6 of 8 HEVC Main 10 passes were wrong, with nearly every frame of each wrong.
- The same atomics on a word in device-local memory failed none: 53 runs and 89 passes.
- Each invocation on a word of its own, or one workgroup instead of 16, failed none either.
- With 2,000 adds an invocation (dispatches of 27 to 38 ms), decodes failed in one of two runs; with 200, in neither.
- About 25 other loads, run the same way, failed none:
- imports and frees of host memory, allocations, device and pipeline creation, render passes and fills;
- dependent loads and scattered stores over imported host memory at up to 30 GB/s of PCIe, and gathers from images in it;
- graphics passes into linear colour attachments in host memory, blended and with fragment-shader interlock;
- arithmetic loops, threadgroup-memory kernels, and atomics spread over words.
- Sparse binding of host memory was not run, since NVIDIA's sparse buffers take no memory type a host import has.
- A program written from scratch on plain Vulkan and NVDEC shows it (U21). A 1080p H.264 stream decoded right alone (21 passes) and beside the atomics in device-local memory (66 passes). Beside them in imported host memory, 1 of 2 passes was wrong, its last 60 frames.
- The load: 16 workgroups of 64 invocations, each adding 1 to the same 32-bit word 20,000 times with
- What the guest runs then (measured, a boot of the same round with a build that logs each exec of 200 ms or more, 2026-10-25):
- Every failure but one fell in the 48 of the boot's 172 s in which such an exec was in flight. The one was 1 s before a 29 s exec of task 17's MPS kernels.
- Those execs: the boot's render passes of 0.3 to 0.7 s, stacked; task 15's 3.0 s exec; and task 17's 2.8 s and 29 s execs.
- A scan of each library the guest made found no AIR atomic intrinsic (
air.atomic.*) in any. The runtime's translator also takes LLVMatomicrmwinstructions, which have no name to scan for. - So whether the guest's work contends on atomics in its memory is not known. The load found fails NVDEC as the boots do, but is not shown to be what the boots run.
- Most wrong frames come with no failed status. In that boot, a decoder of our own copied each frame twice and compared the copies.
- It found 9 H.264 passes wrong, 7 of them with no picture reported failed.
- It found 6 HEVC passes wrong, with 2 to 52 pictures reported failed and 4 to 118 frames wrong.
- A frame's two copies never differed, so the samples are wrong in NVDEC's surface, not in the copy.
- Decoding the picture again does not fix it (measured, 2026-10-25). A failed picture decoded again at once, with the same parameters, answered status 2 in 10 of 10 tries beside boots and in 88 of 109 beside the atomics load.
- Of the two passes in the logged boot with such a retry, one came out right. The other was wrong from a frame before its failed picture.
- Beside the load, the frames stayed wrong.
- So a retry turns NVDEC's one sign of the fault into a frame called good, whether it is right or not, and the backend makes none. A failed picture stays -12909, with B41's wait for the next I or IRAP picture.
- Not seen beside a boot at metal2vulkan 6c9cad047a (measured, the same GPU and driver, 2026-10-26): the run of 2026-10-24 again, two workers decoding the six streams through the backend directly and through core's host session, 12 rounds, beside a VM booting with no video device and idling 300 s, on a build with B26's probe. In two boots 432 of 432 runs passed, and 432 of 432 alone after each. In the second the workers ran from QEMU's start, through the transfer kernel's, the 452 dispatches' and the 794 dispatches' command buffers (10.9, 244 and 523 ms); in the first from 51 s after it. Neither boot logged a stamp wait past 2 s or an exec of 1 s or more. So the boots' failures went with B26's seconds; which of the work in those seconds failed NVDEC is still not known, and U21's load was not run again.
- Not ours to change. The load is a guest's own work on its own memory, which the Vulkan platform keeps in place, in host memory (conventions.md). Moving that memory to the device to avoid this would copy guest memory.
- Why it waits: NVIDIA's driver: U21. The backend answers as it does.
- Fix: NVIDIA's. Once a driver fixes U21, run the workers beside a boot again. If decodes still fail, find which of the boot's work does it: a build that dumps the guest's translated shaders would show whether its long execs use atomics.
B39. NVENC's sessions are the GPU's, 12 on an RTX 5080 Laptop GPU
- What: NVENC on an RTX 5080 Laptop GPU opens 12 encode sessions at once across every process, and refuses the 13th with
NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY(21), the GeForce cards' session limit. Core lets one host session open 16 encoder sessions (F7), so one guest can take all 12, and the host's own apps and other VMs then get none. The 13th session's NVENC is made at its first frame (read,crates/reims-vgpu-video-codec/src/encode/session.rsand the NVIDIA crate'sencode.rs), so the guest's firstefrmthere gets -12912, the backend's malfunction; not run through a guest. - Evidence: measured on that GPU (driver 615.71.09), 2026-10-24: 12 of 40 asked opened at 1920x1080 and at 3840x2160 alike, each encoding a frame, the 12 holding 686 MiB; with one process holding 8, a second opened 4.
- Why it waits: left uncapped, as Apple's host leaves its encoders (B14, B31).
- Fix, if that changes: a cap in the NVIDIA backend, process-wide, well under 12, answering
estapast it with -12915 (kVTVideoEncoderNotAvailableNowErr), as F7 answers past its bound; or core's 16 lowered for every backend.
B40. A VP9 block may predict from a reference of any size
-
What:
check_references(crates/reims-vgpu-video-codec/src/vp9/header.rs) takes an inter frame when one of its three references is within 2:1 down and 16:1 up, as libvpx does, and leaves the others to "the accelerator's to refuse if a block uses it". Neither accelerator can tell which references a block uses: NVDEC gets all three surfaces (the NVIDIA crate'snvdec/vp9.rs) and VA-API all three in its picture parameters, so a frame whose blocks predict from a reference far outside the range reaches the hardware. libvpx refuses such a block ("Reference frame has invalid dimensions"). -
Evidence: read, then counted with
vp9-info'sref-out-of-range, the inter frames that name a reference out of that range, with libvpx 1.17.0 on the CPU, 2026-10-24:- libvpx's resize names none.
vp9-check.sh's p0-720p-resize, p2-720p-resize and p0-720p-resize-early, and 11 morevpxenc --rt --end-usage=cbr --resize-allowed=1streams of noise, mixed content,mandelbrotandtestsrc2from 240p to 1080p, named 0. Their frames were only ever of the full size, 3/4 and 1/2, each within range of the others; the 240p one never resized. - libvpx's spatial scalability does, as WebRTC senders use it (
VP9E_SET_SVC, which no vpxenc option reaches;crates/reims-vgpu-video-vaapi/tools/vp9-svc.c). With three spatial layers, 320x180, 640x360 and 1280x720, one temporal layer, and inter-layer prediction on, 148 of the stream's 449 inter frames named one; on key pictures alone, 149. Error resilience on or off changed nothing. The 320x180 layer's inter frames name as their third reference the slot that holds the last 1280x720 frame, 4 times their width. vpxdec decoded every frame of these streams with no error, so no block of theirs uses it. - With two spatial layers (any temporal and inter-layer setting), and with three spatial and three temporal layers with inter-layer prediction on or on key pictures alone, none did.
- With three spatial and three temporal layers and inter-layer prediction off, libvpx wrote streams its own decoder refuses at the first inter frame ("Referenced frame has invalid size"), as
check_referencesdoes: every reference of that frame is out of range (U9).
- libvpx's resize names none.
-
The valid SVC streams decode right on VA-API (measured on an RX 7900 XTX and a Radeon 780M, radeonsi, Mesa 26.2.4, 2026-10-24). Five streams from
vp9-svcand libvpx 1.17.0, oftestsrc2under noise, each decoded through the backend's decoder without the host session, so that every layer's frames come out:3 1 0 0,3 1 2 0and3 1 0 1at 1280x720, 150 superframes of 320x180, 640x360 and 1280x720 frames: 148, 149 and 148 of 449 inter frames name a reference out of range;3 1 0 0and3 1 2 0at 1920x1080, 90 superframes of 480x270, 960x540 and 1920x1080: 88 and 89 of 269.
vp9-framemd5decoded every frame of every layer, 450 or 270 a stream, each equal to vpxdec's, on both GPUs. So VCN decodes a frame that names such a reference and does not use it. vpxdec outputs a superframe's last frame alone, so the reference is vpxdec's decode of the stream split into its frames (ffmpeg'svp9_superframe_split), whose top layer is held to the whole stream's decode.--svc-decode-layeris no reference: decoding layer 0 alone, vpxdec found superframe 2's frame corrupt. -
On NVDEC they decode wrongly, whatever the surfaces' size (measured on an RTX 5080 Laptop GPU, driver 615.71.09, 2026-10-24, with nothing but the desktop on the GPU; D16, U11). The NVIDIA backend refuses sample 0 of every such stream, whose 640x360 frame follows a 320x180 key frame. With a build that made its surfaces at the format description's size, 1280x720, so that no frame was refused, the first stream,
3 1 0 0at 1280x720, gave:- all 450 frames decoded with no error. The first five equalled vpxdec's; frame 6, the second 1280x720 frame, differed in 318 luma samples, all in its two top-left 64x64 blocks, by up to 22 (68.0 dB);
- frame 7, the first to name a reference out of range (the 1280x720 slot, from a 320x180 frame), differed in 843 samples over five blocks (46.5 dB), though the frame its blocks predict from, frame 4, was right. Whether that comes of the reference or of what went wrong in frame 6 cannot be told apart in this stream;
- from there the error spread: the top layer was at 48.8 dB against vpxdec by its third frame, 31.6 dB by its 30th and 22.4 dB by its 150th, and 445 of the 450 frames differed;
- neither the decoder reconfigured to each frame's size before its decode, as NVIDIA's parser asks for at each change of size, nor to the size of the frame decoded before it, nor surfaces of 1296x736, larger than every frame, changed it: frame 6 differed first each time. So NVDEC does not take the change of size from the decoder's size. A hypothesis, unmeasured: the errors start where a block has no neighbour above or to its left, where VP9 takes its candidate motion vectors from the previous frame's only when the two are of one size (libvpx's
use_prev_frame_mvs), so NVDEC may use them, or the previous segmentation map, across a change of size; - NVIDIA's own parser is no oracle for these streams: fed the 720p stream's frames, it called its sequence callback at 320x180, 640x360 and 1280x720 for the first three, and then called every later frame 1280x720, the fourth with no references.
The other four streams were not run on NVDEC.
-
Why it waits: refusing a frame that names a reference out of range would refuse real streams, those above, which libvpx and VCN decode, so
check_referencesstays as it is. What any GPU makes of a block that does use such a reference is unmeasured: no crafted stream went to any hardware, and on NVDEC no frame naming one decoded right after a wrong one. -
Fix:
- on NVDEC, nothing until a driver decodes spatial layers (D16): then
vp9-svc's streams throughnvidia-framemd5, against vpxdec; - a stream crafted so that a block uses such a reference, to see what each GPU does with it, on a GPU nothing else uses, since a hang resets it. If one misbehaves, the codec crate would have to walk the frame's modes (its compressed header and tile data) to find the references its blocks use.
- on NVDEC, nothing until a driver decodes spatial layers (D16): then
B41. A truncated H.264 or HEVC slice is decoded on VA-API, and in a frame NVIDIA does not copy
- What: on VA-API a slice whose data ends early goes to the GPU, and its frame is emitted with whatever the GPU made, with noErr, and the frames after it too. Apple's AVD answers -12909 for that frame, and for every frame after it until an I picture (H.264) or an IRAP picture (HEVC) (devices.md, "H.264", "HEVC", and "Where we differ from Apple"). Our parsers stop at the slice header, and radeonsi reports nothing. On NVIDIA, NVDEC's status of the decode, read at the frame's copy, fails the frame, and sets the codec crate's damaged state (
mark_failed,h264/decoder.rsandhevc/decoder.rs) before the next sample (Failures,crates/reims-vgpu-video-nvidia/src/decode.rs), so the frames after it are answered as Apple's are. But the status is read only by a frame's copy, so a frame core does not copy starts nothing: one the guest gave up on (devices.md, "A frame the guest has given up on is decoded and not emitted"), or an HEVC picture withpic_output_flag0, which is not output. - Evidence: measured:
- On Apple's host with a probe's truncated samples (M3 Max, macOS 27.0.1, 2026-10-24): H.264 at 10, 50 and 95%, and HEVC frames 3, 4 and 7 of a 1080p Main stream with B-frames.
- radeonsi, through the host session, on an RX 7900 XTX and a Radeon 780M (Mesa 26.2.4, libva 2.24.1), 2026-10-25, with a scratch build that asked the driver after each wait for a decode: main-gapsrc-720p with frame 20's slice cut to 10, 50 and 95% (
h264-craft --truncate), and x265'sidr,radl,cra,cra7andbla(devices.md, "HEVC") with frame 20 cut to half its slice (hevc-cut truncate), synchronously and asynchronously. For each of the 5,396 waits on each GPU, the truncated frames' among them,vaSyncSurface2andvaSyncSurfaceansweredVA_STATUS_SUCCESS,vaQuerySurfaceStatusVASurfaceReady, andvaQuerySurfaceErrorforVA_STATUS_ERROR_DECODING_ERRORVA_STATUS_ERROR_UNIMPLEMENTED; novaEndPicturefailed. Every frame came out with noErr: H.264's frames 20 to 29 unlike the undamaged stream's, HEVC's frame 20 alone (a TRAIL_N picture). - NVIDIA, the same streams through the host session, on an RTX 5080 Laptop GPU (driver 615.71.09), 2026-10-25: NVDEC reported each truncated frame failed with status 9 (
cuvidDecodeStatus_Error_Concealed). With the damaged state set from it, H.264 gave -12909 for frames 20 to 29, and the HEVC streams Apple's synchronous answers (idr20 to 29,radl20 to 27,cra20 to 28 and one RASL picture skipped,cra720 to 24 and seven skipped,bla20 to 28 and one skipped), every frame that came out equal to the undamaged stream's, synchronously and asynchronously, with zero copy and without. Before, frame 20 alone was refused, and H.264's 21 to 29 came out wrong.
- Why it waits: radeonsi reports no decode error, so on VA-API only a walk of the slice data on the CPU finds where it ends early: H.264's CAVLC and CABAC macroblock layers, and HEVC's CABAC coding trees, each syntax element's context taken from its neighbours, as a software decoder's entropy decoding without its reconstruction. By our estimate that is a parser of guest data about as large as the codec crate's H.264 and HEVC parsing together (about 8,500 lines beside their tests), and a share of a CPU core for every stream, neither measured; whether to build it is the owner's decision.
- Fix: a walk of each slice's data on the CPU beside the GPU's decode, which sets the damaged state where the data ends before
end_of_slice_flag(H.264) orend_of_slice_segment_flag(HEVC), as the JPEG engine walks a scan; or keep the difference.
B61. The first decode after an RX 7900 XTX has idled 5 s takes 0.88 s, within 0.2 s of the guest's wait
- What: on an RX 7900 XTX, a decode that comes after 5 s or more with none took 880 to 890 ms on the host, where the same decode a second later took 1 to 5 ms. The guest waits 1.1 s for a
jdec's reply (devices.md, "The JPEG engine"), and an asynchronousdfrm's, so a larger picture after such a pause may answer too late: a 16384x16000 JPEG takes 488 to 507 ms warm (jpeg-check.sh --large, 2026-10-24), and would take about 1.4 s cold. - Evidence: measured, 2026-10-24. In an x86_64 guest, core's log of each
jdec: the first image, and a 13x80 crop that came after 8 s of refusals, each 880 to 890 ms; the crops one second apart after it 2 to 5 ms. A guest's first H.264 frame took 0.88 s too. The RX 7900 XTX's PCI device has runtime power management on,power/controlautowithautosuspend_delay_ms5000, so the GPU sleeps 5 s after its last use; the Radeon 780M beside it has iton. With the VA-API backend'sjpeg-checkon a 640x480 image, a process each, and no QEMU running: started 7 s after the last, withruntime_statussuspended, the whole run took 915 and 918 ms; at once after,active, 34 and 37 ms; the decode itself 1.6 to 2.8 ms in all four. So the wake is the cost; thatpower/controlonremoves it is not measured. No guest decode is known to have timed out so. - Why it waits: left as it is: every image the guest's probes decode fits in the margin, and the fix is a setting of the host's.
- Fix: keep the GPU awake while a VM uses it:
power/controlonfor the render node's device while QEMU runs, a host setting; or a cheap GPU call from the backend every few seconds while a session is open, at some power. Neither is Apple's way; Apple's hardware has no such wake. Check it with the four runs above, and a cold 16384x16000jdecin a guest.
B73. The guest drops a quarter of its frames at a 4K display, in metal2vulkan's copies
- What: at a 3840x2160 guest display, the screen saver's Aerial showed 4,408 of the 5,972 frames its player enqueued over 200 s, dropping 1,543 (44 to 47 every 6 s), and 1,474 more than 16 ms late. At 1280x720 it dropped 34, and at 1920x1080 45. At metal2vulkan 27935d575e it is the same: 853 of 3,630 dropped in 120 s at 3840x2160, 45 at 1920x1080; at 6c9cad047a, 810 of 3,628 at 3840x2160.
- Evidence: measured in an x86_64 guest on a Radeon 780M, 2026-10-24. The host kept up at every size: 21 to 24 ms of each frame's 33, then 10 to 12 ms waiting for the guest's next
dfrm, and every frame reached the layer 0.35 s ahead of its time at the median. So the drops are the guest's compositing at its display's size, through reims-vgpu's GPU. - Where the time goes (measured, 2026-10-26, at metal2vulkan 67c64f99d8 and 27935d575e; the boots, the tables and the method are in qemu.md, "Linux hosts: a 4K display on a Radeon 780M"):
- The guest's WindowServer commits three command buffers a frame, which take 25.2 ms of the GPU at 3840x2160 (27.2 ms at 67c64f99d8) and 12.0 ms at 1920x1080. It starts each frame about 21 ms after the last present, so at 4K a frame takes 48 ms at the median, and the video's 30 fps does not fit.
- Of the 25.2 ms, 8.4 are the runtime's shadow copies of guest surfaces' textures, 8.7 its conversion of the video's two-plane 10-bit frames, and 8.1 the rest: measured by switches in a copy of the runtime, not committed, that skip its copies of shadows of a million texels or more over bytes, and then its YCbCr conversion too (the frames then show stale texels; the switches measure cost alone). Without both, 39 frames of 1,826 dropped in 60 s at 4K, as at 1920x1080.
- The runtime makes every texture over a guest surface a shadow, as B26 says, and a two-plane YCbCr surface's texture a converted one: at each copy in, its planes copied to a staging buffer and converted by a dispatch into the shadow's image (read, metal2vulkan 27935d575e,
shadow.rs,ShadowSource::Converted). The video is 3840x2160 HEVC Main 10 at both display sizes. - None of it is reims-vgpu's: its task and FIFO threads took 3.8% of a CPU in all, the swap presented 0.17 ms after the frame's last completion at the median (0.26 ms at p99), and the GPU scheduler ran each of QEMU's graphics jobs within 3.6 ms of its submission, 0.01 ms at the median, with 13 buffer frees in 8 s. Its presents import and free nothing: each buffer over one of the display's surfaces lies in the import of a guest task's buffer over it (B92, Evidence).
- The 780M stayed at its lowest shader clock, 800 MHz, through the 4K screen saver at 54% busy, under the host's own power policy.
- At metal2vulkan 6c9cad047a (measured, 2026-10-26, the same two boots at 3840x2160, on a build that logs the runtime's
WorkCountsevery 5 s): 810 of 3,628 frames dropped in 120 s, 1,014 more than 16 ms late, 23.0 presents a second; in the traced boot WindowServer's three command buffers a frame took 24.8 ms of the GPU at the median and 27.2 ms at p90, starting 21.7 ms after the last present. Over the 120 s the runtime copied in 68.7 billion texels of surfaces of a million texels or more (shadow_texels_first_copied_in_large_surfaces), 572 million a second, about three 3840x2160 surfaces a frame, of 68.7 billion copied in all;shadow_texels_recopied_in_large_surfacesandshadow_texels_first_copied_in_againwere 0, as were the later copies in of every other kind. So each of those texels is an encoder's first copy in of its texture: none of a texture an earlier encoder of the same command buffer copied in, and none after the surface changed since a copy in. Copies of one surface by encoders of different command buffers count as first copies too, and no count separates them. - At metal2vulkan f6a96b7da8 (read, not yet measured in a boot):
- A command buffer carries a shadowed texture's image across its encoders: a later encoder of it copies in nothing of a texture an earlier one left holding the bytes, unless something let another writer in between (a write of the bytes another way, an event, semaphore or fence wait, another encoder ending with the texture). A later command buffer still copies the texture in, as Metal shows it what the CPU wrote since. At 6c9cad047a
shadow_texels_first_copied_in_again, which then counted every copy the carry could leave out, was 0 in both boots above, so the carry should take nothing off them. - Three counts divide a large surface's first copies in: the texels the carry took off (
shadow_texels_first_copy_in_carried_large_surfaces), those copied behind an earlier command buffer's standing (shadow_texels_first_copied_in_large_surfaces_stood_earlier), and those of an image that never held one (shadow_texels_first_copied_in_large_surfaces_unstood).shadow_texels_first_copied_in_againkeeps its name and now counts only the copies the carry could not leave out, so its 0 above does not compare with a later boot's. - The YCbCr conversion's module is built for the texture's layout, range and matrix, where one module read them at run time: the same codes, from a module of 288 instructions and 18 loads where it had 465 and 42 for a 10-bit 4:2:0 surface (metal2vulkan's counts). That conversion is the 8.7 ms above.
- A command buffer carries a shadowed texture's image across its encoders: a later encoder of it copies in nothing of a texture an earlier one left holding the bytes, unless something let another writer in between (a write of the bytes another way, an event, semaphore or fence wait, another encoder ending with the texture). A later command buffer still copies the texture in, as Metal shows it what the CPU wrote since. At 6c9cad047a
- At metal2vulkan a759d0e88f (read, not yet measured in a boot):
- A 2D texture over a guest surface's pages whose usage only samples or reads it is a linear image over the pages, with no shadow and no copy in, on a device whose startup check passes. The check is the runtime's: on the device, an image's first move keeps every byte while the CPU writes beside it, for pointer imports, fresh pages and dma-bufs each. The runtime keeps its verdicts in the shader cache, by driver and runtime version. Vulkan does not promise that move (an image over imported memory starts
UNDEFINED), so this relies on the driver, by the owner's ruling of 2026-10-26;REIMS_VGPU_EXACT=host_page_textureskeeps every such texture a shadow (accuracy-ledger.md). Render targets and written textures keep their shadows, and so does the video's two-plane YCbCr surface, through the conversion above. Which of WindowServer's textures a frame reads in place is not known until a boot. WorkCountscounts the textures in place by their pages' class (host_textures_in_place,dma_buf_textures_in_place,fresh_page_textures_in_place), the shadows that stay by cause (host_texture_shadows_*), and the check's runs and verdicts (in_place_checks_*).
- A 2D texture over a guest surface's pages whose usage only samples or reads it is a linear image over the pages, with no shadow and no copy in, on a device whose startup check passes. The check is the runtime's: on the device, an image's first move keeps every byte while the CPU writes beside it, for pointer imports, fresh pages and dma-bufs each. The runtime keeps its verdicts in the shader cache, by driver and runtime version. Vulkan does not promise that move (an image over imported memory starts
- Why it waits: the cost is metal2vulkan's, handed to it on 2026-10-26 with these numbers; reims-vgpu works around none of the runtime's costs.
- Fix: metal2vulkan's: cut the GPU time its shadows and its YCbCr conversion take over guest surfaces. Check it with the same boot at 3840x2160 on the 780M: WindowServer's command buffers at 12 ms a frame or less, as at 1920x1080, and about 45 frames of 3,630 dropped in 120 s.
- Who has it: metal2vulkan.
B78. On a driver other than radeonsi, a VA-API call measured not to wait can hold its caller's thread
- What: the backend's driver calls that wait for the GPU inside radeonsi (
vaGetImage,vaMapBufferof a derived image,vaSyncSurfacewhere a driver has novaSyncSurface2, and a decoder's firstvaEndPicture) are made on the display's call thread by the frame's deadline, and every other call waits for them by its own (vaapi.md, "The display's calls"). The rest are made on the caller's thread with no bound of their own: the submissions (vaBeginPicture,vaRenderPicture, andvaEndPicturebut a decoder's first),vaPutImage,vaDeriveImage, the map of an imagevaCreateImagemade, exports, creates and destroys. A driver whose call among them waits for a GPU that never finishes holds the caller's thread there, a decoder session's or the JPEG engine's, as before; the session's end waits for it 10 s, then leaves it running, detached (core.md, "Decisions", Threads). Themappedway back, for comparison only, waits inDMA_BUF_IOCTL_SYNCwith no bound. - Evidence: measured on radeonsi (Mesa 26.2.4, libva 2.24.1, an RX 7900 XTX and a Radeon 780M, 2026-10-26), each call timed with the graphics ring or 16 compute queues held by a spin of the tests' own (
crates/reims-vgpu-video-vaapi/src/va/spin.rs): none of those calls waited, and each that did is bounded now, its frame failing by its deadline while the GPU was still held (src/va/wait/held.rs). A decoder's firstvaEndPicturewas not timed so then: it waits for the job that begins the decoder's session (U24), which after an unmap waits for the held ring (B92), and is bounded so too now. The other drivers the backend opens on, NVIDIA's VA-API driver where NVIDIA's own backend does not open among them, were not timed. - Why it waits: no run has shown such a call waiting, and radeonsi's GPUs are the backend's own.
- Fix: time each call so, with a ring held, on the driver that shows one, and make that call through
Display::wait_call(crates/reims-vgpu-video-vaapi/src/va/display.rs).
B82. A text plist is read as the plist crate reads it, not as CoreFoundation does
- What: core reads every
=plsparameter and sample buffer leaf with the plist crate (1.10), and Apple's host with CoreFoundation'sCFPropertyListCreateWithData(devices.md, "Messages"). In an OpenStep plist the two differ: an unquoted word the crate parses as an integer is an integer to the crate and a string to CoreFoundation, and<0001>is the string<0001>to the crate and two bytes of data to CoreFoundation. So a guest that writes its own OpenStep=plscan be answered otherwise than Apple's host would answer it: a property it sets to400is an integer here and a string there. - Evidence: measured on the M3 Max (macOS 27.0.1, 26A434), 2026-10-25:
FigCreateCFPropertyListFromDataandplutilread{a = 400; c = <0001>;}as a string and data, and plist 1.10.3 asInteger(400)andString("<0001>"). In XML they agreed on every case tried: a hexadecimal<integer>0x10</integer>, a<dict>with no<plist>around it, a<real>ofnan, and an<integer>padded with spaces, which both refuse. The crate's ASCII reader says it takes some ill-formed plists without complaint (stream/ascii_reader.rs, read), so other differences are likely. - Why it waits: the guest's CoreMedia writes only binary plists (devices.md, "Messages"), so only a guest that writes its own bytes sends text, and every value it reads is held to core's bounds whatever its encoding (hardening.md, F1 and F44). A reader of our own would have to match CoreFoundation's OpenStep and XML grammars, quirks included, and only this Mac can check one against it.
- Fix: an OpenStep reader in core, written to give what
FigCreateCFPropertyListFromDatagives, checked against it on the Mac over the property-lists fuzzer's text plists; XML the same way, if a difference turns up there.
B83. Apple's scaler moves a reduction's samples below its adaptive filter's step
- What: Apple's smooth filter takes other taps by a sharp step, which the reference and the GPU kernels model (scaler.md, "The filter";
reference.rs,adaptive_blend). Two things are left out of the model. A reduction's isolated feature below the step moves its samples toward the bilinear sample by up to 0.11 of the way (an impulse of 112 codes) and 0.2 (an impulse three pixels on), unless another feature lies within three pixels of it; and reductions of dense textures over 160 codes high had 7% to 18% of their samples more than a code off, with the rule and without it. So over the conformance suite the BGRA reductions keep 36 to 46 codes off Apple's at a few samples, such as 46 codes near black that are 0.027 in light, and scale-csc-BGRA-420v and odd-BGRA-420v 22 and 20 codes in chroma; the BGRA enlargements are within 2 to 11 codes. - Evidence: measured with the gap probe on the M3 Max (macOS 27.0.1), 2026-10-25, on synthetic x420 pictures halved: impulses of 16 to 112 codes moved 0 to 0.11 of the way, by their height, an impulse three pixels from the point 0.06 to 0.21 from 72 to 176 codes, and any other pixel raised within three pixels of the point stopped it, one four or more pixels away did not; noise of 160 and 255 codes was 7% and 18% of samples over a code off.
- Why it waits: no rule was found that fits both isolated impulses and steps: a drift of
0.36 (m - 0.12)for a reduction's samples below the step brought halved impulses from 24 10-bit codes off to 7, and halved steps from 3 to 14. - Fix: measure reductions below the step by feature and neighbourhood, over more than the six pixels the step is read from, and model what fits in
adaptive_blendand the kernels.
B87. NVENC's first second at AverageBitRate runs over AVE's
-
What: through the host session, NVENC spends more of a guest's
AverageBitRatein a stream's first second than Apple's AVE does, most on HEVC over noise, and so over 3 s as well. Over 10 s it comes within 0.05 of AVE. The session sends NVENC a VBR peaking at 1.05 times the average, a second of buffer at the peak (crates/reims-vgpu-video-codec/src/encode/session.rs). -
Evidence: measured, 2026-10-25, with the conformance suite's
encodeon the same raw frames: heavy noise at 352x288 (ffmpeg'snoise=alls=40:allf=t+uover grey) at 5 Mbit/s,mandelbrotat 1280x720 at 3 Mbit/s (HEVC 2),testsrc2at 1920x1080 at 4 Mbit/s; H.264 and HEVC; a key frame at the start only, and every 2 s, and with reordering. As a share of the average:encoder first second over 3 s over 10 s AVE (M3 Max, macOS 27.0.1) 0.95 to 1.27 0.97 to 1.16 0.98 to 1.04 NVENC (RTX 5080 Laptop GPU, driver 615.71.09) 1.15 to 1.44 1.05 to 1.22 1.01 to 1.09 radeonsi (RX 7900 XTX and Radeon 780M, Mesa 26.2.4, the same bytes) 0.96 to 1.20 0.88 to 1.05 0.94 to 0.99 The most is HEVC over the noise: NVENC's first second came to 1.41 of the average (1.44 reordered), AVE's to 1.24 to 1.26; over 3 s 1.16 (1.15) against 1.06 (1.07). On that noise, at 167 kbit a frame, NVENC's first IDR picture took 415 kbit and its P pictures twice their share or more for a quarter of a second, coming down over the second; AVE's IDR picture took 864 kbit, its next five P pictures 4.3 to 1.8 times their share, and the ones after about 0.2 of it, which made it up. NVENC's HEVC at a constant 5 Mbit/s, with a second of buffer, made 1.56 of it in the first second on the same noise, and H.264 1.04: the 24% over on 2 s that the NVIDIA encode check's
hevc-cbrcase found (2026-10-24). -
Tried on NVENC, each alone on the same frames: the VBV buffer at half a second, a second, two and NVENC's default; the buffer starting from a quarter to nine tenths full; two-pass at quarter and full resolution; spatial AQ; peaks from the average to 1.5 times it. Nearest AVE was a peak at the average with half a second of buffer: first second 0.73 to 1.41, 3 s 0.97 to 1.13, 10 s 1.00 to 1.03. But NVENC fills a picture cheaper than its share at such a peak (
encode/session.rs), and one picture of the NVIDIA encode check'shvc1-420v-reordered-3840x2160(1 s of HEVC at 2160p, 3 Mbit/s) came out at 30.0 dB, under the check's floor of 30; it is 31.3 dB as the session runs now. Full-resolution two-pass brought the noise's first second to 1.18, and that picture to 28.3 dB, with a second pass on every frame. -
Not measured: under
DataRateLimitsalone the session's NVENC stream peaks at its average, two thirds of the limit, which NVENC runs as a constant bitrate; whether it fills pictures cheaper than their share there where AVE does not, past static bars (0.00 of the limit on NVENC, 0.01 on AVE). -
Why it waits: no setting of ours found brings NVENC's first second to AVE's without one of the costs above. It is NVENC's rate control.
-
Fix: a setting or a driver whose VBR comes to its average sooner; the table's first-second and 3 s columns are the check.
B89. The scaler's kernels reduce 420v slower than VA-API on the Radeon 780M, two transforms slower than the Mac's own scalers on a loaded M3 Max, and vary on the RTX 5080
-
What: on the Radeon 780M three 420v reductions miss the bar the kernels were held to, within 1.5 times the host's native scaler and at most 1 ms behind it (scaler.md, "Speed"). Wall ms, the median of 8 rounds of 3 in one process, interleaved with VA-API's video processing (radeonsi), two runs:
transform kernels, in place VA-API ratio behind 1080p 420v to 720p BGRA 3.62, 3.80 2.54, 2.44 1.43, 1.56 1.08, 1.36 2160p 420v to 1080p 420v 9.78, 9.86 7.69, 7.72 1.27, 1.28 2.09, 2.14 scale-csc-420v-BGRA (1920x1080 to 1280x720) 3.61, 3.89 2.33, 2.52 1.55, 1.54 1.28, 1.37 With the adaptive filter (B83), a Y'CbCr source's chroma taps of its own and an RGB source's linear light, in an A/B of two processes of 4 rounds each against the kernels without them (2026-10-26), wall ms then GPU ms, against VA-API's times above: 1080p 420v to 720p BGRA 3.53 to 4.05 (3.35 to 3.77), 1.60 times VA-API's and 1.51 ms behind; 2160p 420v to 1080p 420v 7.72 to 8.52 (7.09 to 7.71), 1.11 times and 0.83 behind, within the bar that day; scale-csc-420v-BGRA 4.48 to 4.39 (3.84 to 3.96), 1.88 times and 2.06 behind. The same code without them took 9.78 ms on 2160p to 1080p on 2026-10-25 and 7.72 on 2026-10-26, so the 780M's spread between days is wider than what the filter costs.
On the M3 Max, with them, at a load average of 15 to 23 from other work, two transforms were well behind Apple's own scaler (TransformSurface, A), each in the same processes (scaler.md, "Speed"): turn-aniso-BGRA 0.44 ms against 0.29, 1.52 times (1.35 without them), and scale-csc-BGRA-420v 2.07 ms against VideoToolbox's 1.27 and Apple's scaler's 1.29, 1.63 and 1.61 times (1.46 without them; 0.82 to 1.56 in the day's fourteen runs, and 1.08 at a load of 10). With each pixel worked out at one place and the decode through a table of linear light, at a load of 27 to 40, they take 1.48 times Apple's scaler's time (GPU time 0.136 to 0.080 ms) and 1.66 times VideoToolbox's (1.53 to 1.32 ms); at a load of 8 to 24, 1.02 to 1.05 times Apple's scaler's and 1.09 to 1.36 times VideoToolbox's. What is left of turn-aniso-BGRA is the Metal submission's latency, 0.21 to 0.36 ms past its GPU time at a load of 27 to 40, where Apple's scaler takes 0.21 to 0.30 ms in all; scale-csc-BGRA-420v's GPU time is one of two in a process, about 1.5 ms or 0.85 for the same build, as the M3 Max's 1080p and 2160p cases' are. Four more leave the bar against MPS's Lanczos filter alone, which is linear and separable, with no adaptive step, and does less than Apple's scaler: up4-420v 1.70 times and 0.31 ms behind, up8-BGRA 1.57 and 0.24, transfer-up8-BGRA 1.70 and 0.26, transfer-odd-up-BGRA 1.56 and 0.18; all four take 0.70 to 1.11 of Apple's scaler's and VideoToolbox's time.
Every other case meets it there, and every case on the RX 7900 XTX (0.20 to 0.71 of VA-API's time) and the M3 Max. Separately, on the RTX 5080 Laptop GPU three 1:1 transforms came out slower than when
scaler_transformran every transform alone, before the two passes, in both of two pairs of processes (wall ms, before then now): 1080p BGRA turned 90, stillscaler_transform, 2.37 and 2.32 to 2.53 and 2.52; 720p BGRA to 420v, whose two planes one dispatch now writes, 0.96 and 0.81 to 1.02 and 0.91; 2160p 420v to BGRA, nowscaler_quads, 2.78 and 2.67 to 2.82 and 2.89. The 5080's small cases vary 2 to 8 times between processes of the same build, so nothing under a millisecond there shows a change. And in place the 5080's time follows the process's past: the suite's benches (bench_in_place, the median of 20) took 1.5 ms for 2160p 420v to 1080p 420v, 1.0 to 1.1 for 720p BGRA to 420v and 2.7 to 2.9 for 2160p 420v to BGRA when run before the conformance suite's 113 cases in their process, in two processes, and 6.0 to 11.3, 1.0 to 4.3 and 2.7 to 12.7 after them, in eight, the same build; GPU time moved with wall time. -
Evidence: measured on the Radeon 780M and the RX 7900 XTX (RADV, Mesa 26.2.4) and the RTX 5080 Laptop GPU (driver 615.71.09), 2026-10-25, with an A/B harness that ran the kernels and the removed VA-API backend's video processing on the same surfaces (not in the tree). Where the 780M's time goes, for 2160p 420v to 1080p 420v, from variants of the kernels in one process at sustained clocks, about half the A/B's time (4.9 ms of 9.8): 0.6 ms with both kernels empty; 0.9 reading the source; 1.1 decoding it; 1.0 writing and reading the lines; about 1.3 the sums, the encode and the writes. Reads of a source that fits in the cache still cost half of what reads and decoding cost together, so it is not bandwidth alone.
-
Tried:
- one kernel a plane, each threadgroup working out a tile of 32 by 16 pixels with its lines in 28 KiB of threadgroup memory: its outputs equalled the two passes', and it was 1.6 to 4 times slower (wall ms, two passes then one kernel, on the M3 Max and the 780M: 1080p 420v to 720p BGRA 0.58 and 1.07, 2.85 and 4.76; 2160p to 1080p 0.92 and 1.54, 4.89 and 6.28; scale-csc-420v-BGRA 0.48 and 0.87, 3.76 and 6.07). Each threadgroup decodes in 3 to 5 rounds one after another, and its memory leaves room for 1 or 2 threadgroups a compute unit where the lines kernel's 12 KiB leaves 4 or 5, so the source reads' latency, which many threadgroups hide, shows. Kept as a patch against the tree before it landed:
~/.cache/rvg-video-scaler/patches/fused-tile-kernel.patch; - a decode with fewer loads and no integer multiply a pixel: 5 to 10% slower on the 780M (
~/.cache/rvg-video-scaler/patches/decode-steps.patch).
What landed took the 780M from 11.9 to 3.6 ms on 1080p 420v to 720p BGRA, and from 13.0 to 9.8 on 2160p to 1080p.
- one kernel a plane, each threadgroup working out a tile of 32 by 16 pixels with its lines in 28 KiB of threadgroup memory: its outputs equalled the two passes', and it was 1.6 to 4 times slower (wall ms, two passes then one kernel, on the M3 Max and the 780M: 1080p 420v to 720p BGRA 0.58 and 1.07, 2.85 and 4.76; 2160p to 1080p 0.92 and 1.54, 4.89 and 6.28; scale-csc-420v-BGRA 0.48 and 0.87, 3.76 and 6.07). Each threadgroup decodes in 3 to 5 rounds one after another, and its memory leaves room for 1 or 2 threadgroups a compute unit where the lines kernel's 12 KiB leaves 4 or 5, so the source reads' latency, which many threadgroups hide, shows. Kept as a patch against the tree before it landed:
-
Why it waits: the 5080's dependence on the process's past is not understood: which of the surfaces' pages its writes and reads cross (huge pages or not, how the runtime imports them) is a hypothesis, not measured. Nor is what decides which of the M3 Max's two GPU times a process takes: the same build takes either, in processes of one A/B, and the two cases are at the Mac's own scalers' time or near it at a quiet load. On the 780M, the levers left, taller threadgroups of
scaler_lines(less of the source decoded twice at their edges), a tile of three floats a pixel, more threadgroups a compute unit, are each worth about 5 to 10% by the breakdown above, and the cases are 1 to 2 ms behind. Each still fits a 60 fps frame. The adaptive filter, the chroma's taps and linear light, in the same two passes, cost in GPU time 0.61 ms on the 780M's 2160p to 1080p and 0.42 on its 1080p to 720p, 0.20 and 0.05 on the RX 7900 XTX's, on the M3 Max 0.22 on up4-420v (0.16 of it the chroma's taps), 0.13 on up8-BGRA and 0.05 on down4-BGRA, and 0.02 to 0.10 ms on the RTX 5080's scaled cases; nothing at 1:1, where they add no pass (measured 2026-10-26, the A/B above). -
Fix: on the M3 Max, what decides which of its two GPU times a process takes (the 1080p and 2160p cases', scale-csc-BGRA-420v's): find it before changing a kernel for it; turn-aniso-BGRA's Metal submission is the platform's. Then a decode that costs less on RDNA 3: the 780M's source reads and decode are 2 of its 4.9 ms. Measure each lever on the 780M against the table above, and the 5080's three 1:1 transforms against
scaler_transformalone in alternated processes. On the 5080, find what the slow processes' surfaces differ in (/proc/PID/smapsof their pages, the runtime's import of each) before changing a kernel for it.
B90. Where the JPEG engine cannot write host memory, its maps hold the display's lock for milliseconds
- What: the JPEG engine reads its outputs from host memory of ours, written there whole, or, past udmabuf's
size_limit_mb(64 MiB at its stock value), a strip of rows at a time, a 4:2:2 copy's through an alias of its surface (vaapi.md, "Surfaces and readback"). Where it cannot, it reads them through the driver's derived image (vaDeriveImage,vaMapBuffer), orvaGetImage: where no host memory can be made at all, as in a process that may not open/dev/udmabuf; on a driver other than radeonsi; past udmabuf's limit on a driver with no video processing; and from the first decode on which a driver call writing host memory failed. Mesa's VA frontend makes the map under the display's lock, and radeonsi copies the surface on the GPU for it and waits for the copy (U22). While it maps, every other session's calls on the display wait for it, through the display's gate (vaapi.md, "The display's calls"). - Evidence: measured on the RX 7900 XTX and the Radeon 780M (Mesa 26.2.4, 2026-10-26), a thread decoding a JPEG over and over beside a 4K H.264 decode on one display (720
decodecalls a run, each frame waited for), the call thread's holds of the gate and the H.264 thread's waits for it counted by instrumentingsrc/va/calls.rs(not in the tree), in the trees that read these outputs through derived maps:- 8192x8192 4:2:0 copied out: 85 to 91 maps a run on the RX 7900 XTX, 19.7 to 21.6 ms at the mean and 44 to 45 ms at most, and 77 to 78 on the Radeon 780M, 5.5 to 6.7 ms and 34 to 59 ms, the H.264 thread waiting for the gate 84 to 90 and 76 to 78 times a run.
- 4:2:2 copied into
422f, the H.264 decoder kept across the passes: beside 8192x8192, 43 maps a run on the RX 7900 XTX, 20.5 to 20.6 ms at the mean, and 40 to 41 on the Radeon 780M, 5.1 to 5.2 ms; beside 12288x8192, 30 of 30.2 ms, and 28 to 30 of 7.3 to 7.4 ms. The H.264 thread waited for the gate once a map, and the map's hold set the RX 7900 XTX's longestdecodecalls, 27.9 to 29.0 ms and 38.6 to 39.7 ms against 9.8 to 10.3 alone. - Read from host memory, whole or in strips, none of these outputs makes a call that holds the gate (vaapi.md, "What the gate costs").
vaGetImagetakes a rectangle, and a program on libva alone read a YUY2 surface with it a band of 32 MiB at a time, every byte right: each call held the lock 13.1 to 14.8 ms at the mean, and 16.8 to 20.3 at most, for a band of 8192x8192 on the RX 7900 XTX, and 9.5 to 10.2 and 13.5 to 15.5 ms on the Radeon 780M, four a decode, each two thirds of a whole map's 20.5 ms on the RX 7900 XTX and twice its 5.2 ms on the Radeon 780M, since it copies the band into the image on the CPU with the lock held (U22).
- Why it waits: on radeonsi at udmabuf's stock limits, every output of the engine's is read from host memory; what is left is a host where udmabuf cannot be opened, the other drivers, whose maps are not measured, and a fallback no run has taken.
- Tried:
vaGetImageof bands of 2, 8 and 32 MiB in place of the derived map, so that each hold would be short (measured, Mesa 26.2.6, 2026-11-07, jobs 4279 and 4284: B90's bench, a thread decoding a 4:2:0 JPEG of 4096x4096 or 8192x8192 over and over, read through the driver's images, beside a session decoding a 64x64 JPEG over and over, three runs of each). The bands held the lock longer than the map, in all and at most:- on the Radeon 780M, 36 to 63 ms a decode of 4096x4096 against the map's 6.8 to 8.0 ms, and 153 to 187 ms of 8192x8192 against 24 to 26 ms; its longest hold 38 and 153 ms against 1.9 to 4.9 and 7.1 to 12.5 ms;
- on the RX 7900 XTX, 32 to 56 ms of 4096x4096 against 12.5 to 13.0 ms, and 81 to 114 ms of 8192x8192 against 39 to 46 ms; its longest hold 14 to 44 and 55 ms against 6.7 to 7.2 and 17 to 26 ms;
- why a band's call holds the lock so long is not measured. So the engine keeps the derived map.
- Fix: Mesa's, U22.
B92. After memory of the process's GPU is freed, its next VA-API work waits for every job then on the GPU
- What: a surface or buffer destroyed unmaps its memory from the process's GPU VM, and amdgpu has every later submission of the VM, on any ring, wait for every job the VM had in flight at the unmap (U23). RADV's jobs in the process are of that VM, a guest's command buffers on the display among them, so a VA-API frame submitted after an unmap waits for the work the GPU had then, and fails by its deadline as stalled where that work runs past it. The JPEG engine keeps the surfaces of its decodes for later ones of the same shape, so that a run of decodes frees nothing (vaapi.md, "Surfaces and readback"); it still destroys the least recently used past its 64 MiB, and a failed decode's, and every other unmap of the process, another session's or metal2vulkan's runtime's, still has the next VA-API work wait.
- A new decoder's first picture waits on the CPU. radeonsi submits the job that begins a decoder's session in the decoder's first
vaEndPicture, and waits there for it, with the display's lock held (U24). After an unmap that job waits for every job then on the GPU, and the call waits as long: a decoder made just after another session let go of its own, beside a JPEG decode, a guest's command buffers or a playing session's work. The backend makes a decoder's firstvaEndPictureon the display's call thread, by the frame's deadline (render_decode,crates/reims-vgpu-video-vaapi/src/va/buffer.rs), so past it the frame fails as stalled, and the display's other calls wait behind it for the gate, each by its own deadline. Each JPEG decode is its context's first picture, made so too: on an RX 550 (Polaris 12's UVD, Mesa 26.2.6, 2026-11-07), with the compute rings that take its work held, a decode'svaEndPicturewaited 1.22 s indrmSyncobjWait, until the GPU was done, where it was made on the decoding thread past its deadline before (crates/reims-vgpu-video-vaapi/src/va/jpeg.rs).
- A new decoder's first picture waits on the CPU. radeonsi submits the job that begins a decoder's session in the decoder's first
- Evidence: measured on the RX 7900 XTX and the Radeon 780M (Linux 7.2.9, Mesa 26.2.4, 2026-10-26), with the graphics ring held by a spin of the tests' own (
crates/reims-vgpu-video-vaapi/src/va/spin.rs) and the GPU scheduler's tracepoints of a job's dependencies (gpu_scheduler:drm_sched_job_add_dep,drm_sched_job_unschedulable):- destroying a 256x256 host surface the GPU was done with queued a page-table update on an SDMA ring that depended on the spin's job; the next JPEG decode's job depended on that update and ran only once the spin ended, 59 and 60 ms on, and the decode failed by its deadline. With nothing destroyed, each decode ran beside the spin. The spin's jobs and radeonsi's were of one DRM client.
- The engine destroyed each conversion's surfaces after it, so the decode after a conversion waited the same way, and on the RX 7900 XTX every decode after it, until the spin ended. With the surfaces kept,
jpeg_conversions_then_copies_out_do_not_wait_for_a_held_graphics_ring(src/va/wait/held.rs) passes on both GPUs. - A macOS guest booting on the Radeon 780M through QEMU unmapped 36 and 586 buffers in traces of 3.5 and 4.1 s, 21 and 515 of them on metal2vulkan's threads. At metal2vulkan 6c9cad047a the runtime counts each block its own allocator frees under one cause (
WorkCounts::memory_frees: a dedicated block, a pooled block emptied, a kept empty block gone stale or given back for room, an import of host memory, a buffer's fresh pages, the device's teardown), and what elseobject_churn.vk_memory_freedcounts was freed outside that allocator. In boots of that guest at 6c9cad047a (measured, 2026-10-26), the process made 9,984vkFreeMemorycalls on the Radeon 780M and 9,778 on the RX 7900 XTX (vk_memory_freed), of which the runtime's allocator freed 2,084 and 1,985 blocks: 1,861 and 1,777 imports of host memory, 183 and 163 pooled blocks emptied, 35 and 41 kept blocks gone stale, 5 and 4 dedicated ones, none given back for room, of fresh pages or at teardown. Through 120 s of a 3840x2160 screen saver on the 780M it made 856, 121 of them the allocator's (115 imports). So about four frees in five are outside the allocator, which the runtime lists as dma-buf imports, GPU pools' blocks, neutrals, spares and rollbacks (read, metal2vulkan 6c9cad047a,work_counts.rs); no count splits them. - What those frees are (measured, 2026-10-26, in B73's traced boot at 3840x2160 on the Radeon 780M at metal2vulkan 6c9cad047a, from
REIMS_VGPU_TRACE'simpandimpfreeofbacking::ImportTrace, an import counted from the first keep-alive made over its bytes while none lived to the last of them gone, beside the runtime'sWorkCounts): of the boot's 8,427vk_memory_freed, 1,951 were the allocator's, 1,758 of them imports of host pointers, as many as the detach temporaries below; the 6,476 others are, but for 10, the dma-buf chunks imported and no longer live (dma_buf_imports6,673,dma_buf_memories_live207 at the end). By where the platform hands the runtime host memory (ImportSite), 7,846 imports were freed: 1,858 of no-copy buffers over a task's pages (NoCopyBytes, over a mapping core makes afresh for each buffer and unmaps at its deallocator); 1,758 of core's detach temporaries (NoCopyDescriptor), each imported as its buffer is made and freed in the detach core makes at once, on the same thread; 2,304 of replaces' aliases and 156 of heaps' (Replace,Heap, a fresh alias each); and 1,770 of buffers over a surface's memory (SurfaceBase). The display's presents freed none: each of the 4,083 buffers the FIFO thread made over the display's surfaces, but the first, was made while a guest task's buffer over the same surface lived, and lay in its import (the runtime'shost_aliases.rs), its keep-alive going at its release, on the FIFO thread (host_keep_alives_covered, 5,407 in the boot). Bytes imported again after their last import was freed, by first byte and length: 267 imports over surfaces, of 126 ranges; 648 of no-copy buffers over a task's pages, 669 of detach temporaries, 1,159 of replaces' aliases and 38 of heaps', each over a fresh mapping or allocation at a range the process's address space gave again. Through the screen saver's last 98 s, 338 imports were freed, 3.4 a second, 61 of them over surfaces, the bytes of 5 of which came back; through 105 s of it in the untraced boot, 515vk_memory_freed, while 2,546 buffers lay in a live import. - B90's bench, a thread decoding an 8192x8192 4:2:0 JPEG over and over beside a 4K H.264 decode of 720
decodecalls a run, made its H.264 decoder again for each of its 12 passes, letting the last go. Every one of itsdecodecalls over 30 ms was a new decoder's first, its firstvaEndPicturetaking 38 to 48 ms on the RX 7900 XTX and 38 to 131 ms on the Radeon 780M; itsvaSyncSurface2questions of the JPEG decode waited as long, and ended with it. With the scheduler's tracepoints, on the RX 7900 XTX: the old decoder's unmaps queued a page-table update on an SDMA ring that depended on the JPEG decode then running; the new decoder's first VCN job, its session's create, queued 7 ms later, depended on that update; and its firstvaEndPicturewaited inDRM_IOCTL_SYNCOBJ_WAITfrom 0.05 ms after that job was queued to 0.04 ms after it was done, 43.5 ms in all (127.6 ms on the Radeon 780M, the same way). With the decoder kept across the passes, as a session keeps its decoder, nodecodecall took over 30 ms, in five runs on the RX 7900 XTX and two on the Radeon 780M: their 99th percentile was 6.7 to 8.8 ms and 8.9 ms, under the decode alone's 10.6 to 10.7 and 12.2 to 12.5 ms. So the rise B90 saw in the 99th percentile in strips, to 38 to 49 ms on the RX 7900 XTX from 22 to 25 with the maps, was these first decodes: a run's 99th percentile is its 8th longest call of 720, and 8 to 10 of a run's 12 first decodes waited so in strips, 3 to 6 with the maps. - A program on libva alone (U24): a new 128x128 H.264 context's first
vaEndPicture, beside 40 queued processing runs of 7680x4320, took 1.31 ms at the median on the RX 7900 XTX and 5.91 ms on the Radeon 780M, and 14.34 and 142.66 ms with an idle 256x256 surface destroyed just before it; on a context used before, 0.03 to 0.11 ms at the median either way. Another thread'svaSyncSurface2of an idle surface, timeout 0, made meanwhile, took as long. - 30 of the backend's H.264 decoders made and let go in turn, 10 frames of 4K each, each frame waited for: beside a session decoding the same stream over and over on a thread of its own, 5 of their first
vaEndPictures took over 5 ms on the RX 7900 XTX, 9.0 ms at most, and 16 on the Radeon 780M, 21.8 ms at most, the playing session'sdecodecalls taking 9.5 and 8.8 ms at the 99th percentile and 14.2 and 12.3 ms at most. Beside the graphics ring held 8 ms in every 16 by the tests' spin, as a display's work holds it, and alone, none took over 5 ms on either GPU. a_new_decoders_first_picture_after_a_free_on_a_held_gpu_fails_by_its_deadline(src/va/wait/held.rs), with the graphics ring held and a decoder let go: the new decoder's first decode answeredOkonce the spin ended, after 1.00 s on the RX 7900 XTX and 0.59 s on the Radeon 780M, while its firstvaEndPicturewas made on the caller's thread. Made on the call thread, it fails by its deadline, 57 and 58 ms on (50 ms in the test), and the display's other calls by theirs.
- Why it waits: the waits are amdgpu's (U23), and a process cannot keep its VA-API jobs out of RADV's VM. The ring is busy that long only under a guest command buffer that runs for seconds (B26). A new decoder's first picture would wait no longer than the job that begins its session, on an idle VCN 1.3 ms on the RX 7900 XTX and 5.9 ms on the Radeon 780M, if radeonsi did not wait for that job on the CPU (U24). Keeping decoders for later sessions of the same shape, as the JPEG engine keeps its surfaces, would spare only a session of a shape seen before, at the VRAM of each kept decoder's pool and context, and would hand a new session a context whose state radeonsi kept from the last; beside a playing session the wait measured 9 and 22 ms at most, once a session, so it is not done.
- Fix: amdgpu's (U23), and for a decoder's first picture radeonsi's (U24). Short of it, nothing of the process unmaps while a guest's work runs, metal2vulkan's runtime's frees among it. Only a surface's bytes stay mapped from one import of them to the next (Evidence). A buffer of the platform's own over a surface's bytes, kept from their second import on so that later buffers lie in its import, would have taken out at most 141 of the traced boot's 7,846 imports freed (its 267 imports again, less each range's first) and 5 of the screen saver's 338, while keeping up to 126 more imports in every RADV submission's list, each about 0.75 µs of amdgpu's work a submission on the Radeon 780M (read, metal2vulkan 6c9cad047a,
host_residency.rs): not made. The detach temporaries' imports, which core detaches before any command names their buffers, are the runtime's to leave out.
Upstream bugs
Bugs in drivers, libraries and tools that our code or our checks work around.
-
U1. ffmpeg's native HEVC decoder is wrong on
--ctu 16streams with SAO and deblocking. Our HEVC check uses x265's reconstruction as a second reference because of it (vaapi.md, "Testing HEVC"). -
U2. libva's header.
VAIQMatrixBufferHEVC's documentation gives two orders for the scaling lists; radeonsi needs raster, which ours sends (crates/reims-vgpu-video-vaapi/src/va/hevc.rs). -
U3. radeonsi rewrites the packed parameter sets an encoder gives it. With packed SPS, PPS (and VPS) and slice headers, the coded buffer holds parameter sets of the driver's own: H.264 High's
transform_8x8_mode_flaggoes from 1 to 0 and its VUI restriction fields change; HEVC's height goes from 1080 to 1088 with a conformance window, its transform depths from 0 to 4 against the 0..0 the driver reports, and its bitstream restriction is dropped. The VPS and HEVC PPS come out as packed. With no packed slice header the coded buffer holds no parameter set at all. So our configuration record is read from what the hardware emits (vaapi.md, "The encoders"). Measured with a libva program of our own, which encodes one frame and compares, on an RX 7900 XTX and a Radeon 780M alike (Mesa 26.2.4, libva 2.24.1, 2026-10-24). -
U4. libvpx's VP9 encoder. In realtime mode, an ROI map with a skipped segment held to INTRA or GOLDEN writes inter frames libvpx's own decoder refuses, so no test stream covers that pair (T10).
-
U5. libva-nvidia-driver 0.0.18 answers
VAConfigAttribMaxPictureWidthandHeightwith 0 on any thread but the one that opened the display (measured with a libva program of our own, 2026-10-24: 8192x8192 on the opening thread, 0x0 on a second one, and 8192x8192 again on the first; radeonsi the same on both). Our backend asks every query on the opening thread and keeps the answers (crates/reims-vgpu-video-vaapi/src/va/caps.rs), so it does not depend on it. -
U6. NVENC with lookahead. In synchronous mode with lookahead on (P6 and P7 at high quality), after
NV_ENC_SUCCESSonly the oldest pending output locks, though the header says all of them do, and frames are lost. The NVIDIA backend turns lookahead off (D12). -
U7. NVDEC with AV1 and VP9 frames of a 4n+3 side. Through NVIDIA's own parser, both codecs decode such frames wrongly at 8 and 10 bits. Our VP9 decoder decodes them right, with its surfaces and maps rounded up to even sides and the frame's own size in the picture parameters, so the parser's VP9 parameters may be the cause there; our AV1 decoder decodes them as wrongly as the parser does, so the NVIDIA backend refuses them, with -12911 (
crates/reims-vgpu-video-nvidia/src/decode.rs). -
U8. ffmpeg's H.264 decoder leaves frames out after a frame number gap that wraps. On a stream whose SPS allows gaps, with order count type 2 and an I picture just after a gap of 5, ffmpeg n9.0.2 output 50 of 60 frames, missing 30 to 39; with a gap of 9 and four references, 54, missing 30 to 35 (measured, 2026-10-24). Apple's AVD, our VA-API decoder and the source's own decode agree on all 60. Streams written from scratch found the condition: the skipped frame numbers wrap past MaxFrameNum (16 here, from frame_num 13), and 15 - G frames are lost for a gap of G, while the same gaps from frame_num 0 lose none. The cause, read in ffmpeg's
h264_slice.c, is that the gap code movesprev_frame_numpast the wrap without adding MaxFrameNum toprev_frame_num_offset, so the pictures after the gap get order counts one MaxFrameNum low and are dropped as out of order; with it added, all 52 of the streams' decodes gave 60 frames. The gap streams' reference is therefore their source's (crates/reims-vgpu-video-vaapi/tools/h264-check.sh). -
U9. libvpx's SVC encoder writes streams its own decoder refuses. With three spatial layers, three temporal layers (the 0212 pattern) and
VP9E_SET_SVC_INTER_LAYER_PREDoff, at realtime CBR, libvpx 1.17.0's encoder wrote an inter frame whose every reference is out of VP9's size range, and vpxdec stopped there: "Referenced frame has invalid size" (vp9-svc 3 3 1 0and3 3 1 1, 2026-10-24; B40). A report needs a program written from scratch on libvpx's API, and a check of libvpx's current release. -
U10. radeonsi's video processing writes a bottom chroma siting as a top one. A BGRA to NV12 run given
VA_CHROMA_SITING_VERTICAL_BOTTOMgives the Cb plane, byte for byte, thatVERTICAL_TOPgives, with either horizontal siting; top, centre and both horizontal sitings land where they say (measured, Mesa 26.2.4, libva 2.24.1, an RX 7900 XTX and a Radeon 780M, 2026-10-24). Nothing of ours names a siting to radeonsi now: the scaler device transforms on its own kernel (scaler.md, "The kernel"). libva'sBOTTOMis 0x03,TOP's andCENTER's bits together; that Mesa takes it asTOPfor that reason is a guess, not read in Mesa's source. -
U11. NVDEC decodes VP9 spatial layers wrongly. libvpx's three spatial layers with inter-layer prediction (
vp9-svc 3 1 0 0, 1280x720) went through the NVIDIA backend with surfaces of the top layer's size. The first five frames equalled libvpx's; then the second top-layer frame was wrong in its two top-left 64x64 blocks, and the error spread to 22.4 dB by the 150th top-layer frame, with no status (measured, RTX 5080 Laptop GPU, driver 615.71.09, 2026-10-24; B40, D16). VCN decodes the same streams right through the same codec crate. NVIDIA's own parser calls every frame after the third 1280x720, so a report needs a program written from scratch that drives NVDEC with VP9 headers of its own parsing. -
U12. libaom shows forward key frames it codes not showable. With
--enable-fwd-kf=1 --fwd-kf-dist=16and key frame filtering at its default, libaom 3.15.1 and 3.15.2 code a forward key frameshowable_frame0 and show it later withshow_existing_frame, which 6.8.2 does not allow: aomdec stops at that frame ("Buffer does not contain a showable frame") and the dav1d command line at 48 of 60, while ffmpeg's libdav1d and Apple's host decode all 60 (devices.md, "AV1"). With--enable-keyframe-filtering=0the stream is valid. Ours shows such a frame, as Apple's host does;crates/reims-vgpu-video-vaapi/tools/av1-check.sh's aom-360p-fwdkf-filtered is such a stream, checked against libdav1d alone, and aom-720p-fwdkf the valid one. -
U13. kvazaar writes no first access unit when it codes fields with a GOP of 8 or 16. With
--source-scan-type tfforbffand--gop 8(--preset fast's) or--gop 16(the default), kvazaar 2.3.2 (CachyOS's 2.3.2-2.1) wrote 59 field pictures for 30 frames and no VPS, SPS, PPS or IDR picture: the stream starts with a TRAIL_R picture, and ffmpeg and our parser cannot open it ("PPS 0 has not been received"). With--gop 0or a low-delay GOP it wrote all 60, starting with the parameter sets and an IDR picture, and those decode.--debugwith fields aborted onrecon_buffer_size == 0(encmain.c:747) with--gop 8, crashed with--gop 0on a plaintestsrc2, and withlp-g4d3t1wrote pictures that are not the decoded fields (10.8 dB against the decode, which is 36.8 dB against the source).hevc-check.sh's kvz-720p-fields useslp-g4d3t1, and checks it against ffmpeg's decode with kvazaar's MD5 SEI instead of--debug. -
U14. radeonsi's VBR and CBR pass the HRD buffer they are given. With an HRD buffer of 0.5 Mbit and VBR or CBR at 1 Mbit/s, the key frames of a picture whose key frames cost most came out 2.09 to 2.44 times the buffer (measured with a libva program of our own on an RX 7900 XTX and a Radeon 780M, Mesa 26.2.4, libva 2.24.1, 2026-10-24). Mesa sends the firmware the buffer and
enforce_hrd1, andVAEncMiscParameterTypeMaxFrameSizeat the buffer left the first key frame where it was. Our VA-API streams underDataRateLimitsdo not depend on it: the driver runs a constant QP, and ours picks each picture's (vaapi.md, "Rate control underDataRateLimits"). -
U15. radeonsi decodes narrow 10-bit VP9 and AV1 inter frames wrongly. On an RX 7900 XTX and a Radeon 780M (Navi 31 and Phoenix, Mesa 26.2.4, measured 2026-10-24, again on the 780M 2026-10-25), a 10-bit VP9 Profile 2 or AV1 stream 32 or fewer samples wide decodes its key frame right and its inter frames wrongly, with no error: ffmpeg n9.0.2's
-hwaccel vaapidecode of vpxenc's and aomenc's 10-frame streams oftestsrc2at 32x32 equalled its software decode in 1 frame of 10, at 48x48 in 10 of 10, and ours through the host session the same. 8-bit streams decode right from the driver's smallest, 16x16, and 10-bit ones from 33 wide (34x64 checked in P010; odd widths at 10 bits were not checked). The VA-API backend refuses such a session atdstawith -12911, as Apple's decoder refuses a size it does not decode, so the guest decodes it itself (NARROWEST_DEEP,crates/reims-vgpu-video-vaapi/src/va/backend.rs). Left: a stream whose frames narrow to 32 or fewer mid-stream after a wider start is not refused, and is not measured. Undo the refusal once Mesa decodes them, and 10-bit decodes at 16x16 and 32x64 match. -
U16. libva-nvidia-driver lists video processing and does nothing for it. Its README says "Hardware decoding only", yet it lists
VAEntrypointVideoProcforVAProfileNone, and every call of a processing run answersVA_STATUS_SUCCESSwith nothing written: into a linear NV12 surface imported from a dma-buf, every byte stayed as it was, where radeonsi wrote the source's samples (measured with a libva program of our own, libva-nvidia-driver 0.0.18, libva 2.24.1, an RTX 5080 Laptop GPU with driver 615.71.09; radeonsi on the Radeon GPUs; 2026-10-25). Ours does not depend on it: only radeonsi gets such writes (Display::writes_imports,crates/reims-vgpu-video-vaapi/src/va/display.rs; D22), and the scaler device transforms on its own kernel, not on VA-API (scaler.md, "The kernel"). The driver answersvaQueryVideoProcPipelineCapswithVA_STATUS_ERROR_UNIMPLEMENTED(measured, same driver and GPU, 2026-10-25). The JPEG engine's conversions ask nothing of the pipeline and are kept where their trial run answers success; whether a scaled JPEG decode on this driver, which listsVAProfileJPEGBaseline, comes back unwritten is not measured. VA-API is the video device's backend on an NVIDIA GPU only where NVIDIA's own backend does not open. -
U17. Mesa's VA frontend holds its display's lock while
vaSyncSurfacewaits for a processing run._vlVaSyncSurfacewaits for the output surface'spipe_fence, which a video-processing run leaves, withdrv->mutexheld, where it waits for a decode's fence under the context's lock alone;vaBeginPicture,vaRenderPictureandvaEndPicturetakedrv->mutextoo, so while one thread waits for a run, every other thread's calls on the display wait behind it (read in Mesa 26.2.4,src/gallium/frontends/va/surface.candpicture.c). Measured on an RX 7900 XTX and a Radeon 780M, 2026-10-25: with the copy of one frame on a thread of its own, the next frame's decode calls took 0.9 to 5.0 ms at 4K, against 0.3 to 1.0 ms with nothing beside them. Ours waits for a run bypollon the dma-bufs it writes beforevaSyncSurface(crates/reims-vgpu-video-vaapi/src/va/fence.rs), and the decode calls then took 0.3 to 0.9 ms. Not reported upstream yet. -
U18. metal2vulkan's runtime lists only the GPUs of its own loader environment. Its instance loads the drivers the loader's environment names (
VK_DRIVER_FILES, as reims-ctl pins a VM to lavapipe), and it lists and identifies the physical devices of that instance alone (Device::system_default_identity_with,Device::registry_ids_with; read in the runtime's source at the pinned commit, 2026-10-25). The GPU device's GPU is the runtime's default device's, which it identifies with its PCI address and DRM render node, and the video device opens its backend there. Where that GPU is a software rasterizer, has no backend with any part, or is none, the video device falls back to the host's other hardware GPUs, which a VM pinned to lavapipe does not show the runtime. Socrates/reims-vgpu-vulkan/src/host_gpus.rs'shardware_gpuslists them on a Vulkan instance of its own that loads every driver the loader finds (VK_LUNARG_direct_driver_loading), made only on that fallback (crates/reims-vgpu/src/video/backend_choice.rs'spick). It stays: a runtime call that ignored its own loader environment would cut against the runtime's design, for one narrow path. -
U19. NVENC's
doNotWaitlock waits in synchronous mode and gives an IDR picture wrongly, and a second lock of a buffer never returns. Synchronous mode is the only one on Linux. Measured on an RTX 5080 Laptop GPU, driver 615.71.09, NVENC API 13.1, 2026-10-25, 4K HEVC Main with no B pictures and IDR pictures forced,nvEncLockBitstreammade as soon asnvEncEncodePicturereturned, with our backend's probe (nvenc::encoder::tests::what_each_lock_returns) and a program of our own written from scratch, which compared each picture's lock with the same picture of a second, identical session locked 40 ms later:- A lock with
NV_ENC_LOCK_BITSTREAM::doNotWaitreturned only once its picture was encoded, 6.0 to 16.4 ms later, as a waiting lock does, and never answeredNV_ENC_ERR_LOCK_BUSY, which the header says it may in synchronous mode. - Without split-frame encoding (P4 with the high-quality tuning at 4K, or
splitEncodeModedisabled), it answeredNV_ENC_SUCCESSwith an IDR picture'sbitstreamSizeInBytes200 to 400 times the picture's: 391,140,259 to 398,125,977 where a later lock answered 1,031,535 to 1,032,383, and 408,745,268 and 521,579,237 for pictures of 1,031,228 and 2,347,367 bytes. The bytes were right. Reading that size crashed a probe. - With split-frame encoding (P4 with the low-latency tuning at 4K, which turns it on, or two strips forced), the size was right and about half the bytes were not: after the picture's VPS, SPS and PPS came a second VPS, SPS and PPS and 165 zero bytes, then the first strip's slice, 1,518,722 of an IDR picture's 3,039,958 bytes differing from byte 94. ffmpeg decoded it, with no error, to another picture. In some runs a P picture's second strip differed too. The bytes were the same 40 ms later with the buffer still locked, so they were not bytes still being written.
- A waiting lock made at the same moment, or either lock made once the picture was encoded, gave the right size and bytes.
- A second lock of a buffer already locked and unlocked, with no picture submitted into it since, never returned, with
doNotWaitor without it: one left running spun a CPU core insidenvEncLockBitstreamfor 14 minutes. The header does not say whether a buffer may be locked twice.
Ours does not depend on any of it: the NVIDIA backend makes only waiting locks, on a thread of each session's own, and waits for the answer until the deadline (nvidia.md, "How a session waits for the GPU";
crates/reims-vgpu-video-nvidia/src/nvenc/locks.rs), and a session locks a buffer only while a picture submitted into it waits for its lock, once, and submits a picture into a buffer only once the last one's lock is made (Submitted,crates/reims-vgpu-video-nvidia/src/nvenc.rs). - A lock with
-
U20. nvJPEG's hardware decoder reads a 16-bit quantization value as its low 8 bits. A JPEG whose DQT holds values over 255, as cjpeg writes below quality 25 without
-baseline, decodes onNVJPEG_BACKEND_HARDWAREwithNVJPEG_STATUS_SUCCESSand wrong samples: a 640x480 image of 1-pixel black and white columns fromcjpeg -quality 5came back with every luma sample more than 1 off, up to 111, against libjpeg-turbo 3.2.0 and nvJPEG's own hybrid decoder, which agree; and within 1 of the hybrid decoder's decode of a copy whose values are cut to their low 8 bits (measured, RTX 5080 Laptop GPU, libnvjpeg 13.2.3, driver 615.71.09, 2026-10-25). The same tables as 16-bit values under 256, and SOF1, decode right. The NVIDIA backend writes the stream nvJPEG reads from the parser's tables, and refuses a value over 255 there with kIOReturnBadMedia, before nvJPEG sees it, as VA-API refuses it (crates/reims-vgpu-video-nvidia/src/jpeg/stream.rs,a_quantization_value_over_255_is_refused_before_nvjpeg). A report, with a program written from scratch, is written and not filed yet. -
U21. NVDEC decodes wrongly in one process while another process's Vulkan compute contends on an atomic in imported host memory.
- The load: 16 workgroups of 64 invocations
atomicAddone 32-bit word of host memory imported withVK_EXT_external_memory_host, in dispatches of 190 to 280 ms. - Beside it, NVDEC answers
cuvidDecodeStatus_Errorfor some pictures of valid H.264 and HEVC streams in other processes, and gives many more wrong with status 2. The kernel logs no Xid, and every call succeeds. - The same atomics in device-local memory, spread over words, or in one workgroup leave the decodes right.
- Measured on an RTX 5080 Laptop GPU, driver 615.71.09, 2026-10-25 (B37).
- The decoding process gets no sign of which frames are wrong, so nothing of ours works around it.
- A report, with a program written from scratch, is written and not filed yet.
- The load: 16 workgroups of 64 invocations
-
U22. Mesa's VA frontend holds its display's lock while
vaGetImageandvaMapBufferof a derived image wait for the GPU.vlVaGetImagemaps each plane of the surface withtexture_map(PIPE_MAP_READ)and copies it out, andvlVaMapBuffer2maps a derived image's surface withtexture_map, both withdrv->mutexheld (read in Mesa 26.2.4,src/gallium/frontends/va/image.candbuffer.c). For a tiled surface radeonsi's map copies it on the GPU and waits for the copy, so while the GPU is busy, every other thread's calls on the display wait behind the map. Measured on an RX 7900 XTX and a Radeon 780M, 2026-10-26: with the graphics ring held, another thread'svaSyncSurface2of an idle surface, with a timeout of 0, returned only oncevaGetImagehad, 380 ms on; with the GPU free, a 4K JPEG decode's map took 1 to 5 ms (B90). Ours makes those calls on the display's call thread and bounds the others by their deadlines (vaapi.md, "The display's calls"). Not reported upstream yet. -
U23. amdgpu has every submission after an unmap wait for every job its VM had in flight at the unmap. The page-table update of an unmap waits for every job of the VM (
amdgpu_vm_clear_freedsyncs to the VM's root reservation,AMDGPU_SYNC_EQ_OWNER),amdgpu_gem_va_update_vmleaves that update's fence asvm->last_update, andamdgpu_cs_vm_handlinghas each submission wait forvm->last_update, so a job that uses none of the memory unmapped waits for every job then queued or running, on any ring (read in Linux 7.2.9,drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c,amdgpu_gem.candamdgpu_cs.c, and the same onmasterat 21a7f44fd076, 2026-10-25). libdrm_amdgpu opens a GPU once a process (amdgpu_device_initializegives each caller with a descriptor of the same GPU the device the first made, which submits through a duplicate of the first descriptor), and Mesa 26.2.4's RADV and radeonsi both open it so, so a process using both has one DRM client and one VM on each GPU. Measured with a program on libva alone, 2026-10-26: a 16x16 JPEG decode submitted beside 40 queued processing runs of 7680x4320 was done in 0.46 ms at the median on the RX 7900 XTX and 4.47 ms on the Radeon 780M, and in 12.98 and 140.66 ms, as the runs ended 13.37 and 144.97 ms on, when an idle 256x256 surface was destroyed just before it (B92). A report, with that program, is written and not filed yet. -
U24. radeonsi's decoders wait on the CPU in their first
vaEndPicturefor the job that begins their session, with the display's lock held. radeonsi begins a VCN decoder's session in its firstend_frame:si_dec_init_decoderwrites the create command's message into the embedded buffer of the decoder's current slot (emb_buffers[cur_buffer], one of four) and submits it, anddecode_cmd_buildthen maps the same slot's buffer for write, withoutPIPE_MAP_UNSYNCHRONIZED, soamdgpu_bo_mapwaits with no timeout until the create job is done;vlVaEndPictureholdsdrv->mutexthroughout. Every VCN video decoder has a create command, H.264's, HEVC's, VP9's and AV1's; the JPEG decoder has none (read in Mesa 26.2.4,src/gallium/drivers/radeonsi/mm/si_video_dec.c,src/gallium/winsys/amdgpu/drm/amdgpu_bo.c,src/amd/common/ac_vcn_dec.candsrc/gallium/frontends/va/picture.c, and the same onmainat ab1502fd, read 2026-10-26). Measured with a program on libva alone, 2026-10-26: a new 128x128 H.264 context's firstvaEndPicturetook 1.31 ms at the median on the RX 7900 XTX and 5.91 ms on the Radeon 780M with VCN idle, against 0.03 and 0.08 ms on a context used before; with an unmap just before it, behind 40 queued processing runs (U23), 14.34 and 142.66 ms, until the runs were done, where a used context's took 0.03 and 0.11 ms at the median and its decode waited on the GPU instead. Another thread'svaSyncSurface2of an idle surface, timeout 0, took as long as each (B92). Ours makes a decoder's firstvaEndPictureon the display's call thread (crates/reims-vgpu-video-vaapi/src/va/buffer.rs). A report, with that program, is written and not filed yet. -
U25. radeonsi's JPEG decode of grey on Polaris's UVD writes a wrong luma into a Y800 surface. The driver lists
VA_RT_FORMAT_YUV400forVAProfileJPEGBaseline, and a grey stream decodes without an error into a Y800 surface, the driver's or one imported, whose luma then holds none of the stream's samples. Measured on an RX 550 (Polaris 12, Mesa 26.2.6, Linux 7.3.1, 2026-11-07): ffmpeg's VA-API decode of a 640x480 grey JPEG cjpeg made oftestsrc2differed from its software decode by 77 at the mean and 243 at most, its first bytes 0, 0, 128, 63, where its 4:2:0 decode of the same picture was within 1; the engine's own decodes of the 14 grey cases ofjpeg-check.shwere wrong in every sample. Into an NV12 surface of the driver's, the decode left the chroma as it was and wrote a luma right for some streams and wrong for others: 11 of the 14 cases right, and 3 wrong (1x1, 7x4095, and 333x211 with restart intervals); a flat 32x32 stream's luma not written at all; and 15 more grey streams of cjpeg's and jpegtran's, 16x16 to 640x480, all wrong, a 640x480 one that decoded right among them once jpegtran gave it restart intervals. Into an NV12 surface imported from ours, or onevaPutImagehad written, it was wrong again. The grey decodes also fault the GPU: that day, processes decoding the grey cases (development's engine, into Y800, and diagnostic builds of the NV12 routes) made UVD fault reading outside its mappings 10 times (VM fault ... read from 'UVD') and 3 times hung UVD's ring until the kernel reset the GPU, VRAM lost, so a guest's grey JPEG could reset the host's GPU; processes that refused grey made none in 792 engine starts, each with the trial's 32x32 grey decode. Ours: the JPEG engine's trial at start finds it, and refuses grey where the driver decodes it wrong, as one it does not list (crates/reims-vgpu-video-vaapi/src/va/jpeg.rs, "What the engine decodes"). Not reported upstream yet: the report is written from scratch inputs, for the owner to file.
Untested, or tested by unit tests only
-
T1. HEVC. kvazaar 2.3.2's streams cover what x265 does not write, each checked with
hevc-infofor what it holds (vaapi.md, "Testing HEVC"): tiles uniform (3x3) and explicit (4x3), tiles in slices of their own at 1080p, at 1366x766 and at 4K (4x4), WPP rows in dependent slice segments, with an open GOP's CRA and RASL pictures, cut and spliced there too, slice headers that code their own short-term sets, 8 current references, low-delay B, and field pictures (field_seq_flag), which Apple's host and ours both decode as pictures of half the frame's height. Every frame equalled kvazaar's reconstruction and ffmpeg's decode, whose MD5 of every picture kvazaar's own SEI confirmed (measured, 2026-10-24): on an RX 7900 XTX and a Radeon 780M, 108 of 108hevc-check.shchecks each and 44 of 44 through the host session; on an RTX 5080 Laptop GPU's NVDEC, 62 of 62; on the M3 Max's VideoToolbox, 22 of 22; and on Apple's host, which took each atdstaand gave every frame's luma as ffmpeg's, synchronously and asynchronously (devices.md, "HEVC").What neither encoder writes,
hevc-craftwrites into copies of their streams, every picture decoding as the source's (vaapi.md, "Crafted HEVC streams"): list modification in P and B slices, identities and, where long-term pictures moved to the end ofRefPicListTemp0, list 0 put back in another order; short-term sets predicted from one another in the SPS, named by the headers or predicting the headers' own (delta_idx_minus1); and long-term pictures, predicted from and not, in P and in B slices, naming the SPS'slt_ref_pic_poc_lsb_spsand coding their own LSBs, with an MSB cycle and without. Fourteen such streams from x265's and kvazaar's, at 720p and 1080p, Main and Main 10, with B-frames and open GOPs and without, decoded with every frame their source's, as ffmpeg's and libde265's decodes of them did (measured, 2026-10-25): on an RX 7900 XTX and a Radeon 780M, 42 of 42hevc-check.shchecks each and 28 of 28 through the host session; on an RTX 5080 Laptop GPU's NVDEC, 28 of 28 through the session, synchronously and asynchronously; on the M3 Max's VideoToolbox, 28 of 28, each crafted again on the Mac with its--checkpassing before the hardware saw it. Not reached by them, so unit tests only:- a long-term picture's MSB cycle other than 0: every stream is shorter than its
MaxPicOrderCntLsbof 256; - a long-term picture in a list beside other pictures, which no rewrite can make without changing the decode (the motion vectors' prediction between a long-term and a short-term reference, 8.5.3.2.7 to 8.5.3.2.9), and so a modification that reorders list 1;
- PCM: its SPS fields are parsed and passed on, but no stream with PCM blocks reached a decoder;
- Main 10 from kvazaar, which CachyOS builds for 8 bits alone, and tiles with WPP, which kvazaar says no profile allows.
Field-coded HEVC with kvazaar needs
--gop 0or a low-delay GOP, since its GOPs of 8 and 16 write no first access unit then (U13). What Apple's host does with a picture of more than 8 current references is not measured.Apple's
dfrmorder for HEVC is measured (devices.md, "HEVC"): frames come out in decode order, as for H.264, and a failed frame, a dropped RASL picture and the state after a failure are matched on every backend.kvz-720p-ref15 and kvz-720p-tiles-narrow, which break Main's limits, are not sent to Apple's AVD: invalid streams stay off the M3 Max's media hardware, which panicked twice. Apple's answer to them is unmeasured; ours refuses them, -12910 then -12909.
- a long-term picture's MSB cycle other than 0: every stream is shorter than its
-
T2. AV1. Hidden key frames shown later and streams of several operating points are covered (vaapi.md, "AV1 on the AMD GPUs"): libaom's forward key frames shown from their slots, with key frame filtering off (aom-720p-fwdkf) and on (aom-360p-fwdkf-filtered, coded not showable), key frames shown through an overlay (aom-720p-kfflt2), and
av1-svc's (crates/reims-vgpu-video-vaapi/tools/av1-svc.c) two and three temporal layers, two spatial layers of two sizes and of one, and three of each. Each decoded every frame equal to libdav1d's on an RX 7900 XTX and a Radeon 780M, through the host session too, and on Apple's host (devices.md, "AV1"; measured 2026-10-24). Unit tests only: a temporal unit missing its top spatial layer, of which ours emits the highest layer it has, since no encoder here drops one (av1-svc encodes with drops off); and a key frame shown byshow_existing_frametwice, which ours refuses and which Apple's host was not given. -
T3. H.264. Apple's answers are measured (devices.md, "H.264"), and ours match them but where "Where we differ from Apple" says.
- Interlaced video is refused at
dstawith -12911, as Apple's host refuses it. x264 writes no field pictures, so no PAFF stream, or one mixing fields and frames, was tried on either. Both needframe_mbs_only_flag0, which is what is refused. - Long-term references, MMCO 2 to 6 and frame number gaps are covered on an RX 7900 XTX and a Radeon 780M by
h264-craft's streams (vaapi.md, "Crafted streams"). Only one shape of each was written. Fields' marking is untested, since fields are refused. - Damage: a truncated slice is found on NVIDIA by NVDEC's status, and not on VA-API (B41); a lost frame is concealed on VA-API and NVIDIA, and on VideoToolbox by Apple's decoder.
- Decoding ahead (core.md, "Decoding ahead") is built for VA-API, and checked on these streams through the host session with the guest's messages unchanged.
- Interlaced video is refused at
-
T4. Encode on VA-API.
- HEVC has no B-frames, since radeonsi reports no second list.
- Odd sizes are encoded at the even size below, as Apple's AVE encodes them (devices.md, "The encoder session"), on every backend: the conformance suite's
-641x361cases pass on an RX 7900 XTX and a Radeon 780M, NVENC and the M3 Max's VideoToolbox, and so do VA-API session encodes of H.264 and HEVC at 641x361 against ffmpeg (2026-10-24). In an x86_64 guest, H.264 and HEVC encodes at 641x361, 640x361 and 641x360 came back as 640x360 streams at 44 dB of luma PSNR or more against their sources' top left. Left: a side of 1, which rounds to 0 and whichestarefuses with -12902 and noEpba, where AVE went on toEpba(what it then encodes is not measured); and whether the host session's AVE rounds as the in-process one does, since AVE does not encode in a probe. - The hardware's slice headers have not been compared with ours, nor our defaults with Apple's AVE.
- In an x86_64 guest with VtWaitPatch (D11), H.264 and HEVC encodes came back with every frame and no error (measured, 2026-10-24).
-
T7. Surfaces read-only for their clients reach no host from an x86_64 guest. 26.7.1's x86_64 kernel refuses a surface over a process's own memory ("no support for client range"). The direction over IOSurface's own memory leaves the mapper's bit clear (measured in an x86_64 guest; devices.md, "Surfaces read-only for their clients"). So the host's answers are checked by core's tests and the glue's lend test alone: a read lend serves such a source, and a write is refused with kIOReturnNotWritable, -12911 or -16990. Left: an arm64 guest's, whose IOSurface takes client ranges, and which of its components make such surfaces. What Apple's scaler does with one in a VM is not measured on the M3 Max, whose kernel panicked when its scaler wrote into such a surface.
-
T8. Other
IOSurfaceAcceleratorScalerVersionvalues: ours answers 0; what a guest does with another value is untested. -
T9. The JPEG engine's only real user is arm64 CMPhoto, and it is untested. No x86_64 guest component calls the engine; a probe of our own calls it directly. On arm64, a
jcapthat succeeds sends CMPhoto's encodes tojenctoo, which answers -16994. Whether CMPhoto then encodes in software is unmeasured, until there is an arm64 guest (devices.md, "The JPEG engine"). -
T10. VP9.
- Unit tests only: a skipped segment held to INTRA or to GOLDEN. libvpx's encoder writes such segments only into streams its own decoder refuses (U4), and
vp9-craftcannot add them, since they change how the tiles parse. The rest of the reference and skip features is covered byvp9-segments(crates/reims-vgpu-video-vaapi/tools/vp9-segments.c; vaapi.md, "VP9 on the AMD GPUs"): segments held to LAST, INTRA and GOLDEN, skipped with and without LAST, beside quantizer and loop filter deltas, at 8 and 10 bits, 198 of 198 checks on an RX 7900 XTX and a Radeon 780M, 4 of 4 through the host session, and all six streams in an x86_64 guest (measured, 2026-10-24). - Not measured on Apple's host: a frame that predicts only from frames decoded before one it refused. Apple's decoder refuses every frame after a frame of another size, those of the description's size too, until a key frame of that size (measured on Apple's host session, M3 Max, macOS 27.0.1, 2026-10-25, with libvpx's spatial layers and its dynamic resize), and ours, which decoded the frames after one a backend refused against the references it kept, now refuses each frame after one that does not decode until a key frame decodes (devices.md, "VP9").
dsta'sDpba,dsup,dcopanddsetwere measured with buffers lent from a pool of theDpba's attributes, and ours answers as Apple's but forMaxDecoderPixelRate(D24); so was avp09description with novpcC, which ours now refuses with Apple's -8971 (devices.md, "VP9"). - Apple's answers were measured on one Mac, the M3 Max on macOS 27.0.1, not the guest's 26.7; another chip's AVD may refuse other sizes.
- In the guest, only our own decode probe was tried: whether Safari or WebKit registers the supplemental decoder and decodes on ours is not measured, nor
VTIsHardwareDecodeSupported('vp09')after the registration (no before it). - The largest VP9 sample sent through a guest was 423,570 bytes (p0-720p-resize). Samples past 0x200000 bytes, sent in fragments as the guest's decoder cuts them, decode on Apple's host session and on ours with every backend (p0-2160p-big, 2026-10-25; devices.md, "VP9"); the guest's own cut of one is not seen.
- Unit tests only: a skipped segment held to INTRA or to GOLDEN. libvpx's encoder writes such segments only into streams its own decoder refuses (U4), and
-
T11. The VideoToolbox backend has met no guest. No VM with the video devices has run on a macOS host; the backend is checked through core's host session with a stand-in guest (videotoolbox.md, "Checks"). Also untested there: VP9 against a software VideoToolbox decode, as there is no software VP9 decoder; the encoders'
H264EntropyModeand colour properties, which reach the session untested (DataRateLimits,Qualityand the rest of the rate properties are the encode suite's); and the decoders' own speed, apart from the stand-in's. A property cleared on a running encoder (anesetwith no value) is refused by VideoToolbox with -12902, which the guest gets, for each of the six keys tried (AverageBitRate,MaxKeyFrameInterval,RealTime,AllowFrameReordering,ExpectedFrameRate,Quality), and the property keeps its value: frames still came out one by one afterAllowFrameReorderingfalse was cleared (measured with a probe of the H.264 hardware encoder, M3 Max, 2026-10-24). What Apple's AVE answers is not measured. The Metal platform's lends of a guest surface (crates/reims-vgpu-metal/src/os/device_lend.rs) are checked by unit tests on surfaces made directly over pages of the test's own, not through the mapper from a guest's descriptor. -
T12. The glue's VideoToolbox arm has not run in a VM.
crates/reims-vgpu/src/video/backend_choice.rsopens VideoToolbox's backend on macOS, which has unit tests on the M3 Max only. NVIDIA's arm has run: on a host with an RTX 5080 Laptop GPU the video device named NVIDIA in QEMU's log, and an x86_64 guest decoded H.264, HEVC, AV1 and VP9 and encoded H.264 and HEVC on it, all matching (2026-10-24). On a host with an RX 7900 XTX and a Radeon 780M, both devices ran VA-API (backends.md, "Picking a backend"). With the devices on the GPU device's GPU, the NVIDIA arm ran again: the same guest decoded and encoded on it with the scaler device beside it refusing its features, and VMs pinned to the RX 7900 XTX and to the Radeon 780M ran both devices on that GPU's VA-API (measured 2026-10-25; backends.md, "Picking a backend"). -
T16. The NVIDIA decoders.
- HEVC as T1: tiles, dependent slice segments, slice headers' own short-term sets and field pictures reached NVDEC in kvazaar's streams, every frame bit-exact through the session both ways (measured, RTX 5080 Laptop GPU, driver 615.71.09, 2026-10-24; nvidia.md, "Tests"), and long-term pictures, list modification and predicted short-term sets in hevc-craft's, 28 of 28 runs (driver 615.71.09, 2026-10-25). Left as T1: PCM, which no encoder here writes, and what T1 lists after hevc-craft's.
- AV1's global motion:
invalidis set whereshear_is_validfails, after ffmpeg'snvdec_av1.c. Our flags equalled NVIDIA's parser's in the nine streams compared field by field (nvidia.md, "The decoders"); whether any of them carries global motion was not looked at. aom-720p-gm-zoom and aom-720p-gm-pan-10bit carry 15 and 22 ROTZOOM models, which is all libaom writes (SVT-AV1 4.2.0 wrote none on the same sources), none with an invalid shear (vaapi.md, "AV1 on the AMD GPUs"); on NVDEC both decode bit-exact whole against libdav1d and libaom, and through the session (same GPU and date). Translation and affine models, and an invalid shear, no encoder here writes, so the unit tests alone reach them. - AV1 streams whose frames change size go through the session whole: the host session lends each frame a buffer of its own size, and the stand-in hashes each so. On NVDEC aom-360p-resize-569, aom-360p-resize-465-10bit and aom-720p-resize decode so, every frame at its own size, and so do AV1 streams of several spatial layers (same GPU and date). AV1's 4n+3 sides are still refused (U7).
- In the guest, one stream of each codec and size was decoded: the guest's other paths onto NVDEC, Safari and the wallpaper's playback, were not looked at.
- NVENC's HEVC CBR, 24% over its 5 Mbit/s target on 2 s of heavy noise at 288p where H.264's came within 4%, is its first second, and what the guest's streams keep of it is B87.
-
T17. Where the conformance suite's stand-in guest and its references are not the guest's, or not independent of the code they check.
- The encode and motion-estimation stand-ins send
,ginas NULL, where the guest sends {VTGuestBuildVersion} (devices.md, "The decoder session"), which the decode stand-in sends (read: the conformance crate'ssrc/encode.rsandsrc/motion/check.rs). Core reads,ginas a dictionary and nothing in it, so no answer differs. What it takes: the decode stand-in's dictionary in their+encand+mep. - The checks' shell scripts are not run through shellcheck: it is on none of the hosts the checks run on.
- The encode and motion-estimation stand-ins send
-
T18. The scaler's kernel has met no guest. It runs through core's scaler device in its tests and the conformance suite's scaler cases on the M3 Max (Metal and MoltenVK), an RX 7900 XTX, a Radeon 780M, lavapipe and an RTX 5080 Laptop GPU (scaler.md, "The kernel"), and QEMU realized the device on it paused; the guests of scaler.md, "In a guest", ran before it, on VA-API's video processing. Also untested: a buffer over an IOSurface a guest lends on macOS, where the tests' surfaces are the process's own memory. Check: the scaler probe in an x86_64 guest on each of those GPUs, and on a macOS host.
Put off on purpose
- D3. VideoToolbox in an x86_64 guest does not use the scaler.
VTPixelTransferSessionandVTPixelRotationSessionran in an x86_64 guest, with nothing reaching the host. That is the guest's choice, not ours. - D4. AV1 profiles 1 and 2 (4:4:4, 4:2:2, 12-bit) are not listed: core has no such pixel formats, and the Radeon 780M has no Profile 2.
- D5. An arm64 Linux host: a host running
vmappleon KVM on Apple silicon (Asahi), with libva-v4l2_request, is not built, as there is no such machine to run it on. - D7. JPEG 4:1:1, and JPEG encode. radeonsi lists no
YUV411render target for JPEG and no JPEG encoder on an RX 7900 XTX or a Radeon 780M, and nvJPEG's hardware decoder refuses 4:1:1 (NVJPEG_STATUS_JPEG_NOT_SUPPORTED) on an RTX 5080 Laptop GPU (measured, libnvjpeg 13.2.3, 2026-10-25), so the engine refuses 4:1:1 streams on both with kIOReturnBadMedia and answers everyjencwith -16994 (vaapi.md, "The JPEG decoder"; nvidia.md, "The JPEG engine"). On NVIDIA both could be had: nvJPEG's hybrid decoder decodes 4:1:1 within 1 of libjpeg, at scale 1 alone, and its GPU encoder (nvjpegEncodeYUV) encodes 4:4:4, 4:2:2, 4:2:0, 4:4:0, 4:1:1 and grey, 4000x3000 4:2:0 in 0.97 ms and 16384x16000 in 10 ms on the GPU, each stream decoding in libjpeg-turbo 3.2.0 with no warning (measured, same GPU and day; its hardware encoder answersNVJPEG_STATUS_ARCH_MISMATCH). Put off: core has no encode path forjenc, whose options are not read (devices.md, "The JPEG engine"), and Apple's answer to a 4:1:1 decode is not measured. To add encode: read CMPhoto'sjencoptions and its destination in a guest, then an encoder part in core's backend, then nvJPEG's encode behind it. - D8. ProRes, a JPEG engine and 4:2:2 or 4:4:4 decode on VideoToolbox. Apple's host offers ProRes and JPEG decoders to its guest (devices.md), and the M3 Max's VideoToolbox decodes both in hardware, and lists 4:2:2 and 4:4:4 profiles of H.264, HEVC and AV1 besides (devices.md, "How the guest finds the host's codecs", "The levels Apple lists", and "AV1",
dcapforav01). Core has no ProRes codec and no pixel formats past 4:2:0, and the VideoToolbox backend has no JPEG engine (videotoolbox.md, "ProRes", "JPEG"). - D10. No tool copies a test VM between hosts. The first VM on the NVIDIA host was made from a Radeon host's VM by hand: a snapshot, its free space zeroed in a scratch VM,
qemu-img convert, and a copy over the network. A tool that crosses hosts waits until a second cross-host VM is wanted, since the next VM on that host is better copied from the one there. - D11. VtWaitPatch knows only 25G241's convert pages. The guest plugin that makes an x86_64 guest's 10 s reply waits hold (devices.md, "What an x86_64 guest has") patches the guest's timeout conversion where a validated page's SHA-256 is that of 25G241's
x86_64orx86_64hconvert page, and arms nothing on any other. Another guest build needs its digests, its two sites' offsets and a proof read from its own caches, and a boot; until then that guest's 10 s waits expire at once, as Apple's x86_64 build has them. It waits for a second guest build. reims-util's OpenCore images carry the plugin, with the two drivers. - D12. NVENC runs without lookahead. The NVIDIA backend turns it off in every preset's configuration (
crates/reims-vgpu-video-nvidia/src/nvenc/encoder.rs), since with it on frames are lost (U6). P6 and P7 lose the quality lookahead brings, unmeasured. - D14. NVIDIA's smallest frames are larger than Apple's. NVDEC decodes VP9 and AV1 from 128x128 and HEVC from 144x144, so a session with a side of 64 to 127 (143 for HEVC), which Apple's host decodes, is refused at
dstawith -12911, as Apple's decoder refuses a size it does not decode, so that the guest decodes it itself. NVDEC's H.264 starts at 48x64, below AVD's 64, and so decodes there (devices.md, "Where we differ from Apple"). NVENC encodes H.264 from 145x49 and HEVC from 129x33, so smallerestas are refused. Each is the driver's answer (measured withnvidia-probe, RTX 5080 Laptop GPU, 2026-10-24). - D15. NVENC's AV1 encoder is not offered. NVENC lists AV1 Main on an RTX 5080 Laptop GPU, but core's encoders are H.264 and HEVC.
- D16. A VP9 frame larger than its key frame is refused on NVIDIA. The decoder's surfaces are the key frame's size, so a later intra-only or inter frame larger than it is refused as unsupported mid-stream, where VA-API makes a new pool. libvpx's resizing never codes such a frame, but its spatial scalability does in every stream: a superframe's lowest layer is the key frame, and each layer above it is larger. So B40's SVC streams, as WebRTC senders make them, are refused at sample 0 on NVIDIA (measured, RTX 5080 Laptop GPU, 2026-10-24), and their top layers decode on VA-API. The frames after a refused one are refused with -12909 until a key frame decodes, as Apple's decoder refuses every sample of these streams (devices.md, "VP9"): through the host session,
vp9-svc 2 1 0 0and3 1 0 0at 1280x720 gave -12910 for their first superframe and -12909 for each of the 59 after it, and split into one frame a sample, the 320x180 or 640x360 key frame shown, then -12910, then -12909 for each of the 118 or 178 after it, synchronously and not. Before, the 59 superframes after the first of the two-layer stream came out with images, 118 frames decoded from slots the refused frame had not refreshed (measured, RTX 5080 Laptop GPU, driver 615.71.09, 2026-10-25).- The refusal stays, with its message naming this (
crates/reims-vgpu-video-nvidia/src/nvdec/vp9.rs), as the backend refuses AV1 of a size NVDEC decodes wrongly rather than show it (U7): an error, so that the guest decodes the stream itself, is better than a wrong picture. Surfaces sized to take every frame were built and measured: a key frame made them at the largest of its own size, the format description's, and that of any frame that had outgrown them since, within NVDEC's caps; a frame that outgrew them was refused and grew them at the next key frame, and a sample that starts at a key frame was decoded again at once on a decoder that held it; each picture was decoded into them and mapped at its own size. NVDEC then decoded the 720p SVC stream wrongly from its second top-layer frame on, with no error, down to 22.4 dB against libvpx by its 150th, and no decoder size or reconfiguration tried changed that (B40, "On NVDEC"; U11). - It waits for an NVIDIA driver that decodes spatial layers. On a new driver, build that sizing again and decode
vp9-svc's streams throughnvidia-framemd5, against vpxdec, before anything else.
- The refusal stays, with its message naming this (
- D17. NVIDIA does not decode ahead. The NVIDIA backend maps a picture once its decode is done, copies it with
cuMemcpy2DAsyncon the decoder's stream, waits for the stream and unmaps it, all under its decoder's one lock: into the guest's pages wherever CUDA registers the guest's buffer (nvidia.md, "Zero copy";crates/reims-vgpu-video-nvidia/src/zero_copy.rs), else into page-locked staging memory, which the CPU then copies into the guest's pages, inside the guest buffer's lend and outside that lock. CUDA registered every buffer of an x86_64 guest's in three boots (measured, 2026-10-25). It does not decode ahead (core.md, "Decoding ahead"): each copy is waited for before the session's next decode. Through core's host session, with the staged copy, it decodes 4K at 129 to 186 fps and 1080p H.264 at 425 to 464, the read back taking 3.6 to 3.7 ms and the CPU's copy 2.7 to 3.0 ms of each 4K HEVC Main 10 frame (nvidia.md, "How fast a session decodes"); zero copy made 4K 19% to 37% faster through the stand-in guest. Decoding ahead would overlap the copy with the next decode; a VP9 resize, which reconfigures the decoder, must still be kept from racing a frame's map, and the decoder's one staging buffer would need a second for a read back while the last is copied. It waits, as the rate is past 4K120: worth doing if 4K60 at 10 bits, or several sessions at once, comes to matter on NVIDIA. - D18. Motion estimation keeps Apple's host's sizes. Core starts a motion session from 2 a side to 16384 a side and 16384x8192 of area, and answers -12902 past them, as Apple's host does (
crates/reims-vgpu-video-core/src/motion.rs,MIN_SIDE,MAX_SIDE,MAX_AREA). A size is otherwise the backend's: what the host takes is its backend's, and the protocol is Apple's. The largest also bound what a guest makes the host allocate, which is host safety, so they stay. A side of 1 could be lifted, but no backend's estimate of a picture 1 wide or high has been measured, and no guest is known to ask for one. To lift it: a 1xN and Nx1 case in the motion suite on each backend, thenMIN_SIDEfrom each backend's answer. Put off as of little use. - D19. JPEG scales under 1/8 are refused, as Apple's hardware refuses them. Core answers a
jdecwhoseDecodeWidthandDecodeHeightneed a scale under 1/8 with kIOReturnBadArgument, as Apple's hardware did for 1/16 (devices.md, "The JPEG engine";scaleincrates/reims-vgpu-video-core/src/host/jpeg.rs). It is the hardware's limit, not the protocol's, but the guest has only seen Apple's four scales, and how it reads an image of another scale is not known; VA-API's video processing also scales at most 8 times down in one pass (scaler.md). Put off: new work, for a guest path no Apple host drives. To lift it: a two-pass route in the VA-API backend first, then a case injpeg-check.sh, then a boot in which a guest's decode at 1/16 comes back whole. If the guest does not take a scale Apple's host never gives, the refusal stays, and devices.md says why. - D20. VA-API's JPEG decoder refuses
444ffrom 4:2:0 and 4:2:2, as Apple's hardware does.Route::ofanswers it with kIOReturnError, citing Apple's measured refusal (crates/reims-vgpu-video-vaapi/src/va/jpeg.rs). That copies the hardware's limit. Mesa's video processing writes no 4:4:4 surface, so444ffrom 4:4:4 already goes through NV12 at twice the output's size both ways, whose chroma is the layout's (vaapi.md, "Scales and conversions"); the same run from a 4:2:0 or 4:2:2 decode would upsample its chroma. Put off: new work, for a layout the guest's CMPhoto is not known to ask of a subsampled image. To lift it: that route through NV12 at twice the output's size inRoute::of, for 4:2:0 and 4:2:2 decodes; thenjpeg-check.shcases of each compared with core's scaler reference, as the other conversions are; then a JPEG decode to444fin a boot. - D21. The H.264 encoders list no ConstrainedBaseline or ConstrainedHigh.
ProfileLevellists Baseline, Main and High at AVE's levels, 3.0 to 5.2 and Baseline's 1.3, and at AutoLevel (H264_LEVELSandprofile_levelsincrates/reims-vgpu-video-core/src/host/encoder/properties.rs): every H.264 name the guest's SDK has butH264_ConstrainedBaseline_AutoLevelandH264_ConstrainedHigh_AutoLevel(macOS 12 and later,VTCompressionProperties.h). radeonsi hasVAProfileH264ConstrainedBaseline, ConstrainedHigh is High without B pictures, and NVENC hasNV_ENC_H264_PROFILE_CONSTRAINED_HIGH_GUID, so the backends could encode both; each needs its constraint flags written and its own encode check. Put off: new encoder work.- AVE lists both.
VTCopySupportedPropertyDictionaryForEncoderfor H.264 at 1920x1080, hardware required, listed among its AutoLevel values, in this order: Baseline, ConstrainedBaseline, Main, High, ConstrainedHigh, High422, High444Predictive (measured with a probe, M3 Max, macOS 27.0.1, 2026-10-25). So the VideoToolbox backend could list them too, where AVE does. That Apple's host lists the same throughesupis a hypothesis: itsesupanswers its encoder's supported properties (devices.md, "The encoder session"). - What it takes:
- Core's encoder profiles as an enum, since a constrained profile shares its
profile_idc.ProfileLevellists the constrained ones at AutoLevel alone, in AVE's order, andecopstill answers High's AutoLevel before a set. - The codec crate writes Constrained High: 100 with
constraint_set4_flagandconstraint_set5_flag, no B slices, the 8x8 transform, on VA-API's High profile and on NVENC's Constrained High GUID. The guest's Baseline and Constrained Baseline are both written as Constrained Baseline (66 with flags 0 and 1), as Baseline already is. - Encode cases: for each H.264 encoder listing them,
-constrained-baselineand-constrained-high, withProfileLevelset andAllowFrameReorderingtrue. Check the SPS'sprofile_idcand flags (set 1 for Constrained Baseline, sets 4 and 5 for Constrained High), CAVLC in the PPS for Constrained Baseline, no B slice and no reordering, and frames decoded by ffmpeg within the suite's 30 dB floor. The suite decodes back on the backend alone, so ffmpeg needs a second decode added (decode_backincrates/reims-vgpu-video-conformance/src/encode_check.rs). - The flags as the drivers write them. radeonsi writes parameter sets of its own (U3), and NVENC writes its own SPS (
recordin the NVIDIA crate'sencode.rs). If either writes other flags, the backend leaves that profile out of its list, or the record's SPS is fixed. NVENC's Baseline flags are not measured either. - A boot whose guest encode sets
ProfileLeveltoH264_ConstrainedHigh_AutoLevel. The guest's encoder forwards anesetas it is (read from Apple's guest code); whether the guest's VTCompressionSession checks the value againstesup's list first is not known, and the boot shows it. - A line in devices.md, "Where we differ from Apple", only for profiles a backend lists that AVE does not.
- Core's encoder profiles as an enum, since a constrained profile shares its
- AVE lists both.
- D22. What zero copy leaves to the CPU's copy (core.md, "Zero copy"). Zero copy keeps what the guest observes as it was: its replies, its holds, the order of writes into its memory, and the layout
Dpbaasks for. Each case below is copied by the CPU, with its reason in the log once a session:- Rows radeonsi does not take: 1080p 8-bit, 360p, 1366x766. radeonsi imports rows of a multiple of 256 bytes alone (
crates/reims-vgpu-video-vaapi/src/va/zero_copy.rs), and Apple'sDpbaasks for 64-byte alignment, so the guest's 1080p 8-bit rows are 1920 bytes (measured in an x86_64 guest:rows of 1920 bytes).Dpbakeeps Apple's layout, so a layout of our own is not the fix. What would fix it: a radeonsi that takes such rows (not asked upstream: it refuses them withVA_STATUS_ERROR_ALLOCATION_FAILEDrather than writing them wrong, and the staged copy back's own linear surfaces keep to 256 bytes too). The copy costs 0.24 ms of a 1080p frame on an RX 7900 XTX (measured in an x86_64 guest). - Odd sizes on radeonsi. Into an odd-sized import, every sample past the first chroma pair came out other than the probe expected, at 8 and 10 bits, with nothing written outside the planes (measured with a libva probe of our own at 641x361; vaapi.md, "Zero copy"), so frames of an odd width or height are declined. Why is not known: radeonsi may lay an odd-sized linear surface out otherwise than its descriptor says, or the probe may expect the wrong samples at the odd edge. What would tell: the probe's import read back through
vaGetImagebeside its bytes. They stay on the CPU's copy as a residual: they are rare, the copy of such a frame is small, and splitting it, the GPU writing the even part and the CPU the last column and row, would still copy and would rest on a layout radeonsi writes wrongly for a reason not known. - A buffer past 64 strips at the host's udmabuf limits. A buffer is imported in strips of rows, as many as udmabuf's
list_limitandsize_limit_mbcall for (vaapi.md, "What udmabuf takes"): at the stock limits, 1,024 runs and 64 MiB, a guest's buffer takes one to four strips up to 4K and 17 or 18 at 8192x4352 P010, so only a host whose limits are below the stock ones meets it. What would fix it: more strips, at a run's fixed cost each. Nothing at the stock limits needs it. - 8-bit AV1 on the RX 7900 XTX, one frame at a time. There the device's write of a 4K frame took 8.73 ms, against the CPU path's read back and copy, 6.68 ms, and the stand-in guest ran 93 fps on against 117 off; HEVC's write took 0.7 ms less than its CPU path on the same GPU, and the Radeon 780M's AV1 0.1 ms less (measured at the stock limits, three runs each, 2026-10-25; vaapi.md, "What it saves"). Part is the strips: in one strip over runs of eight pages, AV1's write took 1.3 ms less, HEVC's 0.4 ms less. Why AV1's runs cost more on that GPU alone is not known: radeonsi may lay its AV1 decode surfaces out otherwise, so that a run of part of one reads more of it. What would tell: a run's time against the rows it reads, from AV1 and HEVC decode surfaces, on both GPUs. It stays on: the frame is still past 4K60, the CPU's 1.2 ms copy is saved, and zero copy is on wherever a backend allows it.
- Whether VA-API's zero copy should stay on where decoding ahead hides the copy. With the copy's wait outside the driver's lock (vaapi.md, "The driver's lock"), the CPU path's copy runs beside the GPU's next decode, and the stand-in's asynchronous 4K sessions ran 0% to 12% faster with zero copy off on both AMD GPUs: the device's write into the guest's pages took the GPU 1.0 to 3.1 ms longer than the staged run into our own memory (measured, 2026-10-25). Why is not known: the stand-in's pages lie one a run, as a guest's do, and the GPU's page tables may map them in smaller pieces than our own memfd's, besides the strips' runs. Zero copy saves the CPU 1.2 to 3.1 ms of each such frame, and both ways run past 4K60. It stays on, as zero copy is wherever a backend allows it, until a guest measures it asynchronously on and off at the stock limits: its frame rate and its host's CPU.
- VA-API drivers other than radeonsi. NVIDIA's writes nothing and answers success (U16); the NVIDIA backend is the way there. Intel's drivers are not measured: a driver joins
DRIVERS_WRITING_IMPORTS(crates/reims-vgpu-video-vaapi/src/va/display.rs) once a run that writes into its imports and reads its frames back throughvaGetImagepasses on it. - Real guests' buffers on the VideoToolbox backend: on, unmeasured (videotoolbox.md, "Zero copy"). The backend writes a frame into a lent IOSurface by a pixel transfer, and in the stand-in guest wrote 3690 frames so, every one with an image of every even-sized stream, each matching, into IOSurfaces of their own memory. The Metal platform lends a device writable surfaces over the guest's pages (
CLIENT_MEMORY_LENT, true, incrates/reims-vgpu-metal/src/os/device_lend.rs) with no probe run first: no transfer into an IOSurface over client address ranges has run on Apple's hardware, and none can be a guest's until a VM with the video devices runs on a macOS host. A failure then is fixed forward, orCLIENT_MEMORY_LENTset false. The refusals of protected surfaces and of those read-only for their clients stand, since a transfer into a read-only one panicked the M3 Max's kernel. Zero copy is on at every size on VideoToolbox. - Odd sizes on VideoToolbox. A transfer of 641x361 wrote the last luma column and row as the ones before them, where the CPU copies the frame's own samples (1001 luma samples and 1002 chroma bytes unlike, measured on the M3 Max, 2026-10-25), so frames of an odd side are declined, as on radeonsi, and stay on the CPU's copy as a residual. What would fix it: the even part by the transfer and the last column and row by the CPU, which would still copy.
- A frame cut to its buffer, or a buffer of another format, on VideoToolbox. A transfer would scale or convert, so only a frame of the buffer's whole size and format is written; the CPU copies what fits, as before. None of the stand-in guest's streams met it.
- Whether VideoToolbox's zero copy should stay on below 4K. On the M3 Max the transfer takes longer than the CPU's copy at every size: 1.62 ms against 0.17 ms of a 1080p 8-bit frame, 3.13 ms against 1.70 ms of a 4K 10-bit one. It saves the writing thread's CPU only at 4K 10-bit, 0.28 ms against 1.42 ms, and at 1080p costs about as much CPU (videotoolbox.md, "Zero copy"). It stays on everywhere, as zero copy is wherever a backend allows it, until a guest on a macOS host measures it; if that run shows the same, it goes on only where the copy costs the CPU more than the transfer, 4K 10-bit on the M3 Max.
- The decoder writing into the guest's buffer itself, which Apple's host does, is not built: a decode surface is a reference past the guest's release of its buffer, so it would lengthen the holds the guest sees (core.md, "Zero copy").
- Not decodes: the JPEG engine's output, and the encoders' reads of guest surfaces, are copied as before; zero copy covers video decode, and the scaler's kernel reaches its surfaces in place itself (scaler.md, "The kernel"). The same seam would serve them (
GuestSurface::device_memory,crates/reims-vgpu-video-core/src/surfaces.rs). - Read-only and protected surfaces are never lent to a device, on purpose: a device must never write pages the guest made read-only (on the M3 Max a write into one panicked the kernel), and a protected surface's memory is not the CPU's to lend.
- Rows radeonsi does not take: 1080p 8-bit, 360p, 1366x766. radeonsi imports rows of a multiple of 256 bytes alone (
- D23. The NVIDIA JPEG engine needs libnvjpeg, which NVIDIA's driver does not install. libnvjpeg comes with a CUDA toolkit or its redistributable
libnvjpegarchive, not with the driver (nvidia-utils 615.71.09 has no such file, measured 2026-10-25), so on a host without a toolkit the NVIDIA backend has no JPEG engine and the guest is told so, as Apple's host without JPEG hardware tells it (nvidia.md, "The JPEG engine"). The backend looks forlibnvjpeg.so.13, then.so.12, on the loader's path alone, and needs nothing else of the toolkit: libnvjpeg 13 links the CUDA runtime in. Shipping it with reims-vgpu is the owner's call: the CUDA Toolkit EULA's Attachment A lists the NVIDIA JPEG Library (libnvjpeg.so,libnvjpeg_static.a) as distributable, in object code, with an application that has material additional functionality, accessed only by it, unmodified, not as a stand-alone product, under terms consistent with the EULA (sections 1.1.1, 1.1.2, 1.2 and 2.3, read 2026-10-25). GPUs on which nvJPEG has no hardware decoder (its documentation names Ampere's A100 and A30, Hopper, Ada, Blackwell and Jetson Thor) have no engine either; nvJPEG's hybrid decoder, which opens on any CUDA GPU, decodes within 1 of libjpeg but has no scale of its own, so it would need one of ours. - D24. A VP9 decoder does not list
MaxDecoderPixelRate. Apple's VP9 decoder lists it withUsingHardwareAcceleratedVideoDecoderandSuggestedQualityOfServiceTiers, and reads it as 7365427200 for every stream, as its AVC and AV1 decoders do (measured on Apple's host session, M3 Max, macOS 27.0.1, 2026-10-25; devices.md, "VP9"): its hardware's decode rate. No backend here reports a rate of its own, so ours lists the other two alone and answersdcopof it -12900, as for a property it lacks (supported_properties,crates/reims-vgpu-video-core/src/host/decoder.rs). Who reads it in the guest is not known. To add it: a rate from each backend, VideoToolbox's from its own decoder's property, and a measure of VA-API's and NVDEC's, then the key indsupwhere the backend has one. - D25. The graphics device's video driver reports a host's decode failure one picture late. The guest lane's video driver (
guest/bundle/src/RgfxVideoDriver.cpp, docs/graphics-kext/design.md, "A decode the driver cannot complete is a decode error") fails the schedule of a decode it cannot send, which VideoToolbox reports askVTVideoDecoderMalfunctionErr(-12911) for that picture. A decode the host fails after it was sent is known only at the picture's status query, and AppleGVA reads no failure there: a detail word, a failed query and the statuses 0 and 3 all leave the picture decoded (measured on the guest with the RTX 5080, 2026-11-03). So the driver marks the picture's session and fails the session's next schedule: the failed picture itself is taken for decoded, and the error comes with the picture after it (queryReportandscheduleFails,guest/bundle/src/RgfxVideoStatus.hpp). Put off: no answer AppleGVA reads at the query is known. To lift it: an answer of the query that AppleGVA reports, from AppleGVA's own handling of its drivers' query results, then a boot whose host fails one decode, which VideoToolbox should report for that picture.