The host now takes VP9's profiles 1 and 3 and profile 2 at 12 bits where the
driver decodes them. devices.md gets a section on which hosts take which, how
the pictures land, the Iris Xe's boots and the 1080p rate; vaapi.md the
surfaces, iHD's lists and its 4:2:2 failure, and the new streams' card runs;
nvidia.md, backends.md and design.md drop the refusal of profiles 1 and 3 they
stated; known-issues.md names the formats each tested GPU decodes.
The hosts' drivers list VP9 decode (radeonsi, iHD and NVDEC at profiles 0
and 2), and the owner's order is to offer the guest what the host lists. This
is the host's half: the decoders. Nothing offers them to a guest yet, so no
guest sees a change.
The codec module (codec/vp9) does on the host what VP9's hardware APIs leave
to the caller: it splits a superframe into its frames, reads each frame's
uncompressed header and keeps what persists between frames (the colour
configuration, the loop filter's deltas, the segmentation's features and the
eight reference slots), derives the quantizer scales and filter levels, and
hands each frame whole to an accelerator that decodes the compressed header
and the tiles. It refuses profiles 1 and 3 and 12 bits before anything
reaches a driver, and a frame that predicts from an empty slot is a picture's
error, after which a key frame decodes. Every field is checked against the
bytes before it is used: the CPU tests feed it truncated and hostile streams
and superframe indexes (the fuzz targets vp9-streams and vp9-samples).
VA-API's arm (vaapi::va::vp9) fills VADecPictureParameterBufferVP9 and the
slice parameters per frame, with a context per run of one format and size.
NVDEC's (nvidia::nvdec::vp9) fills CUVIDVP9PICPARAMS, whose bit-fields are
held in words of our own naming and checked against NVIDIA's header with the
rest of the layout. NVDEC makes a decoder at a frame's exact size, and a
frame that predicts from one of another decoder, a resized stream's, is
refused as a picture's error (bugs.md B96).
Two streams libvpx made from a synthetic source (640x360, profile 0 and
profile 2 at 10 bits, three superframes each) and vpxdec's per-frame MD5s
are committed; the ignored card tests decode them bit-exact on the RX 7900
XTX's radeonsi, the Iris Xe's iHD and the RTX 3090's NVDEC.
VA-API's AV1Profile0 decoder and NVDEC's cudaVideoCodec_AV1 decode the codec
module's frames, at 8 and 10 bits into NV12 and P010 (NVDEC's P016, which
holds samples as P010 does). The hardware applies
film grain into a second surface, which is what the caller gets, while the
frame without grain stays the reference.
NVDEC takes its references by surface: ref_frame_map, each ref_frame[] and
primary_ref_frame name the surface a slot holds. A slot's number in
primary_ref_frame, with ref_frame[] left zero on key frames, faulted
libnvcuvid inside cuvidDecodePicture on the RTX 3090; a frame naming a slot
that holds no frame is now refused before NVDEC sees it.
The ignored card tests decode the committed streams on the hardware, frame
by frame against libdav1d's MD5s. A frame the hardware reports failed is
allowed and counted; a wrong frame delivered as decoded fails, on any card.
Grain of the driver's own synthesis, iHD's, is held to the specification's
by its residual's mean, deviation and block variances, with grain of other
parameters shown to fail the same check. On the RTX 3090 NVDEC reports a
superres stream's inter frames failed (bugs.md U36).
An arm64 guest's VideoToolbox paravirtual decoders now take HEVC's range
extensions, 4:2:0, 4:2:2 and 4:4:4 at 8, 10 and 12 bits, wherever the host
arm's own query lists a decoder of the stream. Until now they took 4:4:4 at
8 bits alone and refused the rest at the session's start.
What changes for the guest:
- dsta and dsts take a range extensions stream where VA-API lists the
decoder of its profile with the render targets and surfaces it needs.
iHD on an Iris Xe lists all six profiles, but its Main 12 has P012 and
P016 surfaces alone, so 4:2:0 at 8 and 10 bits stays refused there.
- They also take it where NVDEC's caps list its chroma format, depth and
size: 4:2:0 and 4:4:4 on an RTX 3090.
- Where nothing lists the stream, the refusal stays as before and names
the stream and the arm's reason. radeonsi lists no decoder of them.
- Each picture lands in the format the guest's own software decoder gives
the stream, which Dpba names: 420v/x420/tv20, 422v/x422/tv22,
444v/x444/tv44 and their full-range forms.
- NVDEC's 4:2:2 is not built: the 3090 lists none, and those streams stay
refused there.
- The x86-64 caps are unchanged.
The codec takes the range extensions at 4:2:0, 4:2:2 and 4:4:4 and at 8,
10 and 12 bits, with their tools. It still refuses extended precision and
high precision weighted prediction offsets past 8 bits. Its CPU tests
decode streams of each chroma format and depth, and an SPS cut at every
length or with any bit flipped is refused or decoded whole, with no panic.
VA-API decodes on the stream's range extensions profile into P012, YUY2,
Y210, Y212, XYUV, Y410 or Y412 surfaces. The CPU splits the packed ones
into the guest's two planes; the GPU still splits XYUV where its import
check passed. NVDEC's 4:2:0 lands as Main 10's, and the CPU interleaves
its 10 and 12-bit 4:4:4 planes. Each picture the CPU converts is counted
as video-pictures-cpu-converted.
CoreVideo has no format with the layout of Y210, Y212, Y410 or Y412, and
the Mac's decoders answer 422v, not yuvs, for 4:2:2 at 8 bits, so the
conversions stay. Under TCG on the Iris Xe, hardware sessions took 0.36
to 0.66 s for 30 pictures at 1080p of every listed profile, against 1.88
to 5.32 s for the guest's software decode (docs/video/devices.md). The
conformance suite decodes x265's streams of every listed profile.
Say the measure, not the absolute: the charge an open of a texture's NT
handle on its own device adds to the GPU Process Memory counters never
comes down, even past the device's last release, and available physical
memory, the commit charge and DXGI's usage did not move with it (over 1440
MiB of charge, the lab's UHD 630 and WARP, potluck job m3-max-75692). The
lesson turns over: such a figure is not a leak until one of those moves
with it, which the first job reads. d3d11_surface.rs keeps its own figures
for rt's import, and gains only what was measured on the open.
On Windows an open of a texture's NT handle on the device that made it
stays charged to the process's GPU memory once the open, the texture and
the handle are all released. vaon12's import by NT handle is such an open,
and so was the plane draws' OpenSharedHandle: each pool stayed charged
twice, 72 MiB each time for six 3840x2160 NV12 textures, in the GPU Process
Memory counters (what Task Manager shows), which DXGI's usage does not
count. Measured on the lab's Intel UHD 630 under Windows (driver
31.0.101.2145, Mesa 26.2.7) with a program on Direct3D 12 and libva alone;
the opens alone did the same on WARP.
The pools now hand each texture to vaon12 as its ID3D12Resource
(VA_SURFACE_ATTRIB_MEM_TYPE_D3D12_RESOURCE), and the draws wrap the same
resource on D3D11On12: Direct3D 12 makes one device a process and adapter,
so the three are one. Nothing opens a pool texture by a handle any more, so
the textures are made in no shared heap and get no handle. A display whose
driver lists no resource memory type for its H.264 or HEVC decode surfaces
is refused at its open, as one is where libva does not load.
For the host: a decode session's pool no longer stays charged to the
process after it ends, which removes the same two opens the VM makes.
Verified on the lab's Intel card under Windows; expected on NVIDIA under
Windows. pools_let_go_give_back_their_memory is new and reads the process's
charge, and pool_textures_let_go_give_back_their_memory now reads it too.
A Mac's hardware decoder answers the pictures after an H.264 picture that
does not decode with no error and an image, concealed, until the next IDR
picture (held85's damage run, potluck job m3-max-60715). Ours refused each
of them with h264::Error::Unrecovered until an I picture decoded, so the
device landed nothing in their outputs, which kept their earlier bytes.
What changes for the guest: in an H.264 stream, the pictures after one that
does not decode now decode and land in their outputs as any, predicting
from what the DPB holds, a frame the failed sample lost stood in for by a
copy of the last reference. The picture that did not decode still lands
nothing; it is still the session's warn line and is still counted in the
session's end line. On NVIDIA, an H.264 picture NVDEC fails no longer
fails the pictures after it either. HEVC is unchanged: its pictures after
one that does not decode are refused until an IRAP picture.
The codec decoder's damaged state, mark_failed and Error::Unrecovered go;
its tests now hold that the pictures after a failure come out, in decode
and in display order. Ignored hardware tests on both arms (vaapi:: and
nvidia::) decode a stream whose fourth sample is damaged and read back
every other picture. docs/video/devices.md gains what a Mac's picture holds
for a stream started at a P picture (m3-max-74665: decoded against zeros,
green), which ours leaves as the output's earlier bytes or zeros.
The Windows run is owed on the mini.
The Iris Xe run of the route's ignored test (m3-max-71683) answered what the
docs left open: iHD passes the XYUV trial at 64 bytes in whole rows, as it
does NV12 and P010, so a 1366-wide picture's rows of 5464 bytes go to the
CPU, and over 40 pictures, each byte-equal to the CPU's split, the GPU's
way took 0.57 ms of the calling thread's CPU time a picture (median)
against 12.1 ms for the read back and split.
The import check now tries XYUV beside NV12 and P010, and where it passes,
the graphics arm has the driver write a 4:4:4 picture into a scratch of its
device's and the device's GPU split it into the guest's surface; the CPU's
split through vaGetImage stays where it does not. The VA-API doc and the
device's design said the CPU split it always. They now say what the check
tries, what the arm does with its answer, and radeonsi's measured answer:
none, since its vaCreateImage refuses an XYUV image.
What the guest sees now: where the driver lists HEVCMain444 VLD with 4:4:4
render targets (iHD on Intel's Iris Xe), VideoToolbox's paravirtual
sessions of HEVC 4:4:4 at 8 bits are made, as on NVDEC. Where it lists none
(radeonsi), they are refused at their start with "VA-API: the driver has no
HEVC Main 4:4:4 decoder" in the refusal line.
The accelerator sends the range extensions' picture and slice parameters,
the base and Rext structures in the usual buffer types, and decodes into
XYUV surfaces. A frame is read back through vaGetImage and split on the
CPU into the surface's luma and Cb/Cr planes. The import check has no XYUV
answer, so no GPU route lands these pictures yet. hevc-check.sh decodes
x265's Main 4:4:4 streams where the driver lists the profile, and expects
the driver's refusal elsewhere.
VideoToolbox's paravirtual decoders refused every HEVC stream outside Main,
Main 10 and Main Still Picture. At login, an arm64 macOS 26 guest opens a
tile session of an HEVC 4:4:4 stream at 8 bits (a HEIC image's), which was
refused.
What the guest sees now: where NVDEC lists HEVC 4:4:4 at 8 bits
(cuvidGetDecoderCaps, Yuv444 output), such a session is made and its
pictures land in '444v' or '444f' surfaces, by their range. Where the arm
declines it, the session is still refused at its start, and the refusal
names the arm's reason. 4:2:2, monochrome, 12-bit and deeper 4:4:4 streams
stay refused.
The codec crate parses the range extensions of the SPS, the PPS and the
slice header, each held to its range, and splits its check: the codec's own
refusals, then the arm's. NVDEC's pictures take the range extensions' pic
params, and its decoder writes three planes. The CPU interleaves them into
the surface's two planes. The tests that held the old refusal now hold the
new answer, and hevc-check.sh expects each refusal's own reason.
The ignored VA test now copies every picture of the 1366x768, 854x480,
642x362 and 426x240 streams on the RX 550 and the 780M, equal to the CPU's
copy, where the copier before this branch declined them. Cold boots playing
such clips show the pictures land by the hardware in their caches' exported
surfaces on both GPUs, so no walk on these cards reaches the copier.
The GPU's copier declined a picture whose planes' rows are not whole 32-bit
words, an NV12 picture 1366, 854, 642 or 426 wide, its rows 2 bytes past a
word, and those pictures took the CPU's copy: the frame read back, copied
into staging and blitted row by row. On an RX 550, whose radeonsi imports
no CoreVideo layout in place, that is every picture of such a stream.
The copier now hands the kernel each plane with no margin (unit 0): a row's
last word takes the row's bytes and keeps the cache's others, by an atomic
AND and OR, so the cache holds the bytes the CPU's copy writes, as before.
It still declines a plane whose first byte or pitch is off a word, and now
a plane whose last row's last word would end past its buffer. Rows of whole
words, 1080p's among them, copy as they did.
A picture whose landing in its output's device caches ran past the
hardware's deadline (a stall) was signalled with the caches never acquired:
the backend kept the work, which may still write them, and the device's
reads of the caches came after the signal with no acquire of what the
hardware wrote, then or later. The guest's next command buffer read them
regardless.
Each arm now takes a mark on the landing's thread before the hardware call
that may stall (VA-API's sync of a decode into a cache, and its video
processing's write into one; NVDEC's copies into CUDA's imports of the
caches), and a stalled landing (Landing::failed_in_caches) waits for the
work its thread kept since the mark to be let go, the device done with it,
then acquires the caches and signals the failure. The VA-API arm drops the
frame first, which keeps its target where its pool stalled. The wait is
bounded: STALL_HOLD, 10 s on the session's clock, past the hardware's own
5 s; past it the process dies at a fault of the decode, since the caches can
be neither read before their acquire nor waited for unbounded.
For the guest: a stalled decode's command buffer completes failed, as before,
once the hardware is done with the caches rather than at once, with the
caches acquired, so its reads and the next picture's see what the hardware
left; a hardware that is not done 15 s after the frame's first wait ends the
process. A stall that kept nothing (a decoder stalled on an earlier frame,
which writes nothing more) is acquired at once. Tests:
a_failed_landing_in_a_cache_says_it_written_before_its_signal (its stall now
acquired before the signal),
a_stalled_landing_in_a_cache_says_it_written_once_its_kept_work_is_let_go,
a_stalled_landing_whose_kept_work_is_not_let_go_ends_the_process.
Since rt copies a texture over an exported block in only at a change of the
block's bytes (the pin's bef2ec1df4), a cache's acquire (external_write_done)
is the one change a write by the host's video makes. A picture that failed
to land in its cache returned before the acquire, so the device kept reading
the cache's bytes from before the hardware's write. The paths: VA-API's
frame.sync() error for a picture decoded into its cache, and the video
processing's write_in_place error into a cache; NVDEC's write_into_device
outer error.
Each now ends through video_host::failed_in_caches, which says the planes
written as the landing would have, then fails with the landing's own error,
so it is logged and counted as any failure and its signal follows the
acquire. Where the error is a stall, the work may still write past its
deadline, so no acquire is said. A refused acquire is logged. A test pins
the pattern: a stopped failure acquires once before its value is signalled,
a stalled one acquires nothing, and both count as failed with their command
buffers completing failed.
The session's end line also counted a picture that the VA-API arm's GPU
copier landed from its scratch as "in a device cache, by the hardware". It
now counts it as "staged by the hardware and copied" (Landing::copied_by_gpu,
Way::Staged), with a test.
What the guest observes changes only where a landing fails: its texture reads
what the hardware left in the cache, as it would on a Mac, rather than the
cache's last picture. The rest is diagnostics.
The example of the line a session logs for its GPU copies left its times
as ellipses. It now carries what an RX 550 (radeonsi) logged in a cold
boot's Safari video beside the guest's 3D work: 303 HEVC 1080p pictures,
5.087 ms each from the driver's write to the copy's end and 8.387 ms at
most, and 591 H.264 1080p pictures, 2.145 ms each and 30.980 ms at most
(walk job m3-max-66397).
On the rt platform on Linux a decode's picture lands in its output's device
cache by the driver's video processing writing the cache in place, and where
the driver's import refuses the cache's layout, by the CPU: the frame read
back into host memory, copied into the session's staging and from there into
the cache. The guest's decoder asks its outputs of CoreVideo, which lays them
out itself (measured: at 1920x1080, rows of 1920 bytes, the luma plane at
byte 32 and the chroma at byte 2088992), and radeonsi's import refuses that
on the AMD GPUs we have: the RX 550's refuses rows below its pitch of 2048
bytes, the 780M's rows off a multiple of 256. On the RX 550 a walk's 1080p
H.264 and HEVC clips took that way for each of their 894 pictures (walk b1,
m3-max-66052).
Now the session's copier, gpu_copy's ScratchCopier, takes such a picture at
that refusal: the driver's video processing writes the picture into a
scratch of the session's, laid out as the driver's imports must be (each
plane at its dma-buf's first byte or whole rows after it, the even width's
rows at a pitch on 256), and fill's videoEncodeFill kernel copies each
plane's crop from it into the cache at the cache's own offset and pitch, as
plain words; the copy is waited for before the picture counts as landed, as
the CPU's copy is. The copier is reached only where the in-place write was
refused, for a plane in a device cache outside its surface, whatever the
GPU or its driver: every host whose import refuses the guest's rows takes it
(the RX 550 and the 780M), and none is chosen by name. It declines, so that
the CPU copies as before, a plane in the guest's pages or in a surface, a
crop that does not fill its rows in whole 32-bit words (rows of 1366 or 642
bytes), and an offset or pitch off a word.
Where the platform "makes no GPU copies" on Linux: f716a52d2a opened VA-API
on rt with no copier, and 13fb154934 kept it ("the copies make no copier,
for the same reason as before"), the reason f716a52d2a gave being only "as
no GPU copier is given". Neither, nor docs/conventions.md or lessons.md,
records a measured cost, a driver trap or a rule for it: the copier was not
built yet. This crosses no rule of the Vulkan platform's.
GPU memory stays the runtime's: the scratch is rt's, a dma-buf buffer made
through rt and exported through rt's API, one per session, zeroed by a blit
at its make. It is host-only: the guest never maps it, nothing read from it
decides anything, and the kernel's bounds come from the planes' layouts the
host computed. The driver writes it as it writes an in-place cache, the
runtime acquires it after (external_write_done), and the kernel reads only
bytes the driver wrote.
Guest-invisible: each plane's crop rows are the bytes the CPU's copy writes
and every other byte of the cache is as its fill left it, the layout the
device answers is unchanged, and the picture lands at the same point of its
decode. The ignored test
a_picture_copied_by_the_gpu_from_its_scratch_is_the_cpus_copy
compares every byte of the cache with the CPU's copy: 32 pictures of 8
streams (H.264, HEVC and HEVC Main10, 640x360 to 3840x2160) equal on the
RX 550 (m3-max-66105) and the 780M (m3-max-66127), the 1366x768 and 642x362
streams declined.
Each picture so copied counts video-pictures-gpu-copied and its crop's KiB
video-gpu-copied-kib, and a session logs its copies at its end. The fills'
test that held "the platform makes no GPU copies" now holds that the
device's fills make a copier each decode session.
A VA-API decode session made its surface pool up front, its DPB, the picture
and two spare, at the stream's coded size, and gave them to its context as
render targets. A session whose pictures land in the device's caches decodes
only its references into surfaces of its own, so it held surfaces no picture
used.
The pool now starts empty and the context is made with no render targets. The
pool makes a surface when a picture is to be decoded into one of its own and
none is free, up to 48, and lends the one freed last first. A kept context's
shape no longer holds a surface count. Mesa's vlVaCreateContext reads no
render target (read from code, Mesa 26.2.4), and surface::lazy's tests check
the decision off the GPU and, on it, that streams of the driver's own encoder
decode to the same pictures with surfaces made as needed as made up front.
Measured with the process's DRM fdinfo, 8 surfaces at 1080p NV12, 4K NV12 and
4K P010:
- radeonsi (Mesa 26.2.6; Radeon 780M, m3-max-64940; RX 7900 XTX, -64945) makes
no buffer until a surface's first use: +0.0 MiB once made, then 31, 108 and
203 MiB on the 780M (41, 144, 279 on the XTX) once each held an image. Nothing
changes there.
- iHD 26.3.5 (Iris Xe, m3-max-64988) makes each surface's buffer object at its
full size when the surface is made, +28, +96 and +192 MiB drm-total, and
backs none of it until first use (drm-resident +0.0). A session no longer
holds the objects of surfaces it never decodes into.
- On Windows each surface made is a committed D3D12 resource
(CreateCommittedResource in d3d12.rs's shared_texture, read from code), which
allocates when it is made: a session whose pictures land in caches no longer
holds its spare surfaces' memory there. Not measured.
A make takes 0.001 ms or less on radeonsi and 0.004 ms on iHD. The first
access unit, which holds the config, context and first surfaces, took the same
time either way within the runs' spread on all three GPUs (H.264 1080p on the
XTX 12.95 ms as needed, 13.18 up front), with two or three surfaces made as
needed against five up front.
Nothing changes for the guest: the device's answers, the pictures and their
order are the same.
The guest now gets right pictures from concurrent decode sessions on a
Windows host. Intel's Direct3D 12 video driver for the UHD Graphics 630
(igd12dxva64.dll 31.0.101.2145) decodes wrong pictures on a device's later
video decode queue while an earlier one lives, and Mesa's vaon12 makes a
queue for each VA context, all on the process's one device. Of two guest
sessions decoding at once, one got wrong pictures.
While a device of ours is held, its ID3D12Device::CreateCommandQueue (the
vtable's slot 8) answers every ask for a video decode queue with one queue
it keeps, a reference added for each asker. Other queue types, and devices
no hold holds, go to the slot's own method. No vendor decides: every device
gets the one queue. The slot gets its own method back when the last hold on
a device with that vtable goes, and the kept queues go with the last hold on
their device.
Measured on the UHD 630, 4K H.264, frames per second in all: one session
25.4-27.4, two 53.2-56.1, four 113.6-116.0 with one queue, against 22.9-26.9,
49.7-52.2 and 101.8-111.9 with a queue each, where the sessions decoding
wrong ran fastest. The new test of two decoders at once passes 3 of 3 with
the one queue and fails without it; the churn test decodes none wrong in 3
runs. docs/video/bugs.md U33 records the driver's bug and the split.
On Windows the kept-context change held only a context's teardown and
destroyed a pool's surfaces and its config at once, beside the display's
live contexts. That passed the two-thread test, but rounds of 2 and 4
decoders each decoding the stream at once, each picture waited for and not
read back, had a decoder's vaEndPicture fail in every run of 6 on vaon12 on
the UHD Graphics 630 (potluck jobs m3-max-61922, 61930, 61939), where
development, which holds every teardown, passed 4 of 4, and holding the
surfaces' teardown too passed 2 of 2 (m3-max-61948).
So every teardown is held again while a context lives, and a decoder's
context is kept with its config and its pool: Context::new_decoder makes
the three, or takes the three back for a decoder of the same shape (now
with the surface format and count), so beside a live context nothing is
made or destroyed for a shape kept. A kept pool lets go of its
video-processing context first, which as a live context would keep the
held teardowns from ever being made, and a stalled pool is neither kept
nor taken back. The release_teardown doc's measured claim that destroying
a pool's surfaces at once passed is corrected with these runs, and the
full-pace test runs their shape.
On Windows every teardown asked for while another VA context lived was
held until none did, which stopped Intel's Direct3D 12 video driver
faulting, and kept each short 4K decoder's memory (about 211 MB of DXGI's
local count) until the long decoder beside it ended.
Measured on the UHD Graphics 630 (job m3-max-61642): holding the
context's destroy alone passes the two-thread test, with the pool's
surfaces, or the surfaces and the config, destroyed at once. Held
contexts still grew DXGI's local count by 34,905,201 bytes each. So a
config's and a pool's surfaces' teardowns are now made at once, and a
decoder's context let go while another lives is kept with its config
and taken back by the next decoder of the same config, size, render
targets and DPB, instead of one made beside it. Kept contexts are
destroyed with the held teardowns once no context lives. Linux is
unchanged, and so is what the guest sees.
The churn test makes ten short decoders beside a long one, compares their
pictures with the long one's, and on Windows asserts DXGI's local count
grows by less than one held context over the last nine.
On an Intel GPU under iHD, a guest's encode session got other bytes from a
frame the rt GPU wrote into the encoder's input than from the same frame
uploaded. The input was imported linear, and iHD codes a linear import
differently from a surface of its own:
- H.264's P pictures differed at 640x360 and smaller;
- every HEVC Main 10 picture differed, intra ones too, at about ten times
the bits.
iHD's own inputs are Y-tiled (I915_FORMAT_MOD_Y_TILED). Their pitch is the
coded row's bytes rounded up to 128, and their chroma plane sits at the pitch
times the coded height rounded up to 32 rows. An import declared and written
in that layout coded as the upload did, byte for byte, in every profile at
five sizes up to 1080p. The one exception is where iHD differs from one
upload to the next anyway (HEVC Main at 640x360 and 1080p). Measured on an
Iris Xe, iHD 26.3.5.
What changed for the guest: on iHD, the GPU-filled path's samples are the
ones the upload path would give. Nothing changes on radeonsi: its own inputs
are in AMD's 64 KiB swizzle, so its inputs stay linear at rows of 256, which
it codes as the upload.
The changes:
- `VideoEncoder::input_layout` makes one surface as the encoder's pool does
and exports it. Where that surface is in Y tiles in this layout, the input
takes its pitch, chroma offset and size. Otherwise the input is linear, as
before.
- `import_input` takes the tiling, and `Target::import_as` declares Y tiles
in the DRM PRIME descriptor.
- The fill asks the layout once per shape, sizes the input from it, and
passes the kernel its tiling word.
- `TargetTiling::byte_at` is the Y-tile address the tests write and check
by.
Tests:
- The VA crate's import test now writes its input in the encoder's own
layout, so on iHD it writes Y tiles.
- The rt kernel test fills every case into a linear input and a Y-tiled
one, and compares the whole input byte for byte.
- New unit tests cover the Y-tiled layouts iHD gave, the misfits that are
refused, the tile address, the linear layout and the fill's declines.
The VA crate's encoder read its frames only from host bytes, which it uploaded
into a surface of its own pool. The rt platform can make the encoder's input
itself: a dma-buf block the encoder's display imports, which the device's GPU
writes the frame into where its planes lie, with no upload and no staging
copy.
`VideoEncoder::input_shape` names the input such an import must be: NV12 or
P010 at the encoder's coded size. `import_input` (Unix) imports a dma-buf as a
linear surface of that shape through DRM PRIME, as a decode's targets are
imported, keeping the caller's memory while it lives. `encode_target` codes
the frame written there, margin included, and reads none of the frame's
planes; an import of another shape is refused. A stalled frame's import is
kept with its session, as the driver may read it still.
Two ignored tests on the VA-API host: frames written into an import code byte
for byte as the same frames uploaded, for each profile the driver encodes, and
an import of another shape is refused.
What changes for the guest: a host session's decode whose picture is one of
the stream's that does not decode no longer faults its command buffer. Such a
picture is one whose bytes do not read as H.264 or HEVC reads them, one that
predicts from a picture the decoder does not hold (a session or a seek that
starts at a P picture), or one after a picture that did not decode, before the
next I or IRAP picture. It now lands nothing: its command buffer completes as
any, its output keeps its bytes, and the session decodes again from the next I
or IRAP picture. This holds on VA-API and NVDEC, for H.264 and HEVC, and on
VA-API also covers a RASL picture the stream's random access skips, which
faulted there while NVDEC already landed nothing for it. A stream the decoder
does not take, an avcC or hvcC record's error, and the hardware's or the host
API's errors still fault.
Why: a Mac's hardware decoders answer each such picture alone and decode on
(measured with VideoToolbox on a MacBook Pro of 2019, macOS 26.7.1: H.264 with
no error, HEVC with kVTVideoDecoderBadDataErr or ReferenceMissingErr and no
image). Before, a guest boot on a Radeon 780M counted 85 decode faults
("a reference frame is missing", "PPS 4 has not been received", "no I picture
has decoded since a picture that did not decode") for H.264 streams started at
a P picture or with a damaged header, and an HEVC picture that faulted would
end AppleGVA's session with kVTVideoDecoderMalfunctionErr from that picture
on. The codec errors say which are one picture's (is_picture_error), and NVDEC's
error keeps them apart (Error::Picture), still reported as bad data.
iHD's decodes write their render target Y-tiled whatever the linear import
says (U30, measured on the Iris Xe), so its target check fails every kind and
its pictures reach the device's caches by its video processing alone, into
each cache's surface, whose planes lie as iHD's runs write them. The docs
said those pictures were copied by the runtime device's GPU on iHD, which the
Linux open never made; they now say which way each layout takes.
cutdel's newest tip deletes vaapi.rs's crop_extent with the old
platform's copier; the route's text named it as where the crop is
fitted. The crop is still the CPU copy's, so the sentence keeps that
and loses the name.
The cutdel branch deletes VulkanPlatform, metal2vulkan-runtime and the rt
feature, so RtPlatform over metal2vulkan-rt is the only platform. These
docs still described the old one: its answer policies, its exact
switches, MoltenVK on the Mac, its in-place guest memory, its records
cache, its device recovery and its Metal-answer tests.
- conventions.md: the guest-memory-in-place rule is replaced by the rt
rule (rt allocates GPU memory, the device maps its blocks into the
guest, textures sync at the guest's events, and there is one VkDevice
per process). The degradation codes are now rt-unbuilt and rt-refused,
and the deleted codes are dropped.
- accuracy-ledger.md: restated for rt, which has no switches. It keeps
the device's own arithmetic notes (tagged as measured before rt), the
19 unbuilt pieces and rt's refusal kinds, and device loss.
- api.md, README.md: REIMS_VGPU_EXACT, _CENSUS_DIR and _TRACE_DEGRADE
are gone, and STRICT now covers running out of memory only. The let-go
and the quiesce describe one platform.
- architecture.md, development.md, testing.md, qemu.md: KosmicKrisp in
place of MoltenVK; RtPlatform, rt_window and RtBlocks in place of
VulkanPlatform, the old window sink and HostBlocks; no Metal-answer
comparisons and no opt-in GPU-fault tests.
- lessons.md: the four lessons about deleted code only (the Metal
comparison after MoltenVK, the runtime's shadows, device recovery and
the in-place check) are dropped. The lessons that still bind mark
their deleted names.
- video/vaapi.md, graphics-kext/design.md: the GPU plane copy and the
compositor mirror are marked as gone.
- AGENTS.md: only the Vulkan platform's "Where things are" row changes.
Each zero-copy import made a video-processing context of its own, on its
strips' surfaces, and a driver's first run on a new context costs it a few
milliseconds its later runs do not. A guest's decoder makes a new pool of
buffers for each stream, so each stream's start paid that on the decode
thread once a buffer: on the Radeon 780M (radeonsi, Mesa 26.2.6), 43 new
imports over three streams in Safari issued their first run in 5.3 ms at
the median, against 94 us on a context of their size that another import
had already run on.
The imports of a frame size now share one context, made on no surface with
the size's first import and destroyed with its last: the table of contexts
holds weak references only, so a context holds no memory past the imports
that use it. One import's runs are issued on it at a time. The import check
keeps a context of its own.
The new ignored test checks that two imports of a size share a context, that
another size gets another, that each run writes what its frame decoded, and
that the context goes with the size's last import and a new one is made for
the next.
On the rt platform, a Windows host answered the guest no hardware video. It
now opens the VA-API arm there, on Mesa's VA-on-D3D12 driver, at the DXGI
adapter whose LUID Vulkan answers for rt's device (HostGpu::luid). The guest
sees H.264 and HEVC decodes where the driver has them, and no encoder, as on
Linux's rt arm.
rt imports no image of the shared Direct3D 12 texture a picture decodes into:
the UHD 630's driver faults binding a two-plane image imported from its D3D11
handle, and refuses single-plane images from the D3D12 resource. So the
session's copier declines each picture at the GPU's copy, counted as
rt-video-gpu-copy-declined, and each lands by vaGetImage and the CPU's copy.
On the old platform on that GPU the CPU's copy took 18.77, 68.35 and 79.28 ms
a picture (1080p NV12, 4K NV12, 4K P010) against the GPU copy's 1.47, 4.18
and 10.36 ms; bugs.md B94 records it and the measured way out.
A session's end line now says how many surfaces' memory its decodes landed
in and the most of them live at once, told apart by the memory's identity
(the device cache's, else the mapping its pages lie in), and, where the CPU
copied pictures, the copies' mean and longest time. These size the exported
surfaces a session would need on rt and the CPU's cost of landing there
today. Log lines only: nothing the guest or host observes changes.
On the UHD Graphics 630 host, QEMU ended in an access violation inside
Intel's Direct3D 12 video driver as a guest's 4K H.264 session ended beside
its next: a decoder let go while another lived on the display broke the
other's next vaEndPicture. A test of two threads' decoders, each let go
round after round while the other decodes, ends the same way under vaon12,
and keeps ending so with every call made alone, with no teardown inside
another context's picture, and with the other contexts' pictures done
first. Kept until no context lived, every teardown passed.
So on Windows a context's, a config's or a pool's destroy asked for while
another context lives on the display is held, and made in the order asked
once the last live context's teardown is asked for; the log says so once a
process. What changes for the host: the process no longer ends there, and an
ended session's surfaces stay allocated while another session lives. Linux
is unchanged: the same test passes on radeonsi with every teardown made at
once.
vaapi.md: a Windows pool's surfaces are shared Direct3D 12 textures, the
stand-in for a lost frame is the GPU's copy there, and the GPU's landing
copies from a frame's texture. devices.md: Windows pictures land by the
runtime device's GPU, the CPU's copy where the device imports none.
devices.md says what a Windows host's video runs on (VA-API alone, through
libva-win32 and vaon12) and what the UHD 630's driver answers; vaapi.md how
the module loads libva there and what it leaves out without dma-bufs;
backends.md and AGENTS.md's map that the VA-API module builds for Windows.
On an NVIDIA host the device listed no VideoToolbox encoder, so an arm64
guest's apps found no hardware encoder and encoded in software. The NVIDIA
arm now answers one encoder for each codec NVENC encodes a profile of, each
session on an NVENC encoder of its own (NvGuestEncoder):
- the guest's settings map onto NVENC's as an x86 guest's do, and Quality
onto the same preset and tuning (speed_of), the middle where it is unset;
- a frame goes NVENC's two ways: copied by the GPU from the buffer over the
lent surface's pages into memory NVENC reads, else read by the CPU;
- key frames are placed by the codec module's KeyFrames, NVENC's parameter
sets go into the configuration record (Record), and no B-frames.
What changes for the guest: on an NVIDIA host, `encs` lists the H.264 and
HEVC encoders NVENC has, and VTCompressionSession's hardware encoders open
and encode there.
The VA-API arm's guest encoder kept its source checks, its view of the
source's planes, its encoder list and its Quality conversion to itself, and
the codec module's encoder kept its configuration record inside it. NVENC's
guest encoder, next, needs each of them, and also the NVIDIA arm's GPU fill
and preset choice of its host encodes, so they move where both arms reach
them, unchanged:
- the video crate's codec::encode::record::Record: the avcC or hvcC of the
parameter sets the hardware writes, and samples without them;
- reims-vgpu's graphics::vt_encode: the encoder list, Quality as a
percentage, and a source frame's planes, checked, in a buffer over the
surface's pages and in host bytes;
- the NVIDIA arm's speed_of (the preset and tuning of the device's quality)
and Fills::encode_filled (a frame copied by the GPU, else declined).
Nothing the guest or the host observes changes.
Where the host's video decodes into device caches, a picture the driver's
check refused to decode into its cache (its codec and format), or whose planes
do not lie as a target's must, landed by the runtime device's GPU copy, which
imports the decode surface as images by their DRM format modifiers, and else
by the CPU through the session's staging. On an RX 550 both apply to HEVC Main
10: its radeonsi fails the check's second step for P010 (the first wrong byte,
0x40, is the low byte of the check's 0x5a5a scribble as a 10-bit sample, read
from the reference's overwritten target), and its RADV lists no
VK_EXT_image_drm_format_modifier, so every 10-bit picture was read back and
copied by the CPU. A 26.7.2 guest's walk there (m3-max-21989) played a
2160p30 HEVC Main 10 clip at 22.2 fps with 109 frames dropped.
The cache's memory is a dma-buf the arm already exports for its decodes
(CacheTargets). The arm's first landing, the driver's video processing into a
linear VA surface over a dma-buf of the planes' pages (Frame::write_to_guest),
now also takes such a cache: CacheBytes hands the cache's memory as the
device memory of the write, each range at its own byte of the one dma-buf, and
the write is acquired as a decode into the cache is
(Buffer::external_write_done). Its import goes as the cache does, by the
cache's identity. Where the driver's import check refuses the format or the
planes' alignment, the picture lands as before.
What the guest sees: the same pictures in its outputs, landed in the cache by
the driver's GPU work rather than by the CPU. The session counts such pictures
"in a device cache, by the hardware".
Tests: the ignored hardware test
a_picture_written_into_a_dma_buf_cache_by_video_processing_is_the_cpus_copy,
on a VA-API host with the conformance suite's streams.
A video op faulted its command buffer where its surface's device cache was not
filled, or its last picture not copied into its pages, within 2 s; and a VA-API
picture failed where the runtime device's GPU copy of it took over 2 s. The
fault was seen once, behind a 2 s GPU stall on a loaded host. A Mac's video work
waits for the GPU's earlier work on its surface however long it takes.
The op now waits until the fill and the copy are done. Each ends as the
platform sees its command buffer complete, which it does on every path, failed
where the device was lost; a reset of the device ends the wait, as it ends every
wait of the decoder's, so none holds a reset up. A wait past 2 s is named in the
log. The device caches' waits take what ends them in place of a timeout, and a
deferred fill's make is waited for in the same slices, so a reset ends that wait
too where it waited without end before. The plane copier waits on its fence with
the maximum timeout, which Vulkan returns from in finite time once the device is
lost.
For the guest: a decode or encode whose output's or source's device cache is
slow to fill, or slow to be copied out, no longer faults its command buffer
after 2 s, and a VA-API picture whose GPU copy is slow no longer fails its
decode; both wait, and only a reset of the device or a lost device fails them.
VA-API's zero copy kept a guest buffer's import by the mapping's identity
and the frame's size and format alone. One mapping can hold several buffers
of one size: macOS 26.7.2's HEIC decodes (Preview opening a desktop picture,
Freeform's welcome) write each tile of a grid image into one surface at the
tile's own offset. Every tile after the first found the first tile's import,
so its frame was written over the first tile's planes, the check that
declines a luma plane off a page's start on iHD was skipped, and the guest
showed the other tiles as zero YUV (green) on the Iris Xe.
The import is now kept by the place and pitch of the buffer's planes as well:
core's DeviceImports takes a variant of the backend's own type, compared
whole. What changes for the guest: each tile's frame lands in its own planes,
or is copied by the CPU where the driver takes no import of them. The new
VA-API test writes two buffers of one memory, stacked and side by side, and
failed with the old key on the Iris Xe.
Every build, test, boot and copy on the shared machines has run as a
potluck job since 11-05, and the job's lease is the lock: --gpu holds a
GPU, --exclusive gives a timing run the whole machine. gpu-locks.sh and
metal2vulkan's maclock took lock files potluck never sees, so a run under
them could still share a GPU with a potluck job.
AGENTS.md, the boot section of docs/qemu.md, the video checks, the cost
benches' docs and the oracle README now name potluck's lease. The
conformance scripts take no lock of their own, and lane-gate runs its
tests under its job's lease. A build holds no GPU: it builds in a job
without --gpu, and the tests run in the same workspace holding one.
The documented VA-API check, `cargo nextest run -p reims-vgpu-video
--run-ignored only -E 'test(/^vaapi::/)'`, failed from a clean checkout:
the target probe's ignored test, in that set, needs RVG_VA_STREAMS, the
streams the conformance scripts write with x264, x265 and ffmpeg.
The probe becomes a tool rather than a test, since the target check's own
tests are the check. The probe prints how many pictures of each way came
out as the driver's own surfaces', and asserts only that it decoded
something; the target check's tests check every byte of their targets'
memory after each picture, and run in the set with no streams. Taking the
streams where the scripts leave them would still fail from a clean
checkout, and running the probe inside the scripts would add its decodes,
about 150 s on a 780M, with no verdict, to every conformance run.
The tool is an ignored test at the crate's root (`probes::`), outside the
`vaapi::` and `nvidia::` sets the hardware hosts' checks run, as the
fuzzers' long runs and reims-vgpu's RVG_VA_STREAMS tests sit outside them.
It is not an example: an example reaches only the public API, and the
probe's import hook (`surface::MAKE_SURFACE`), which has every surface a
decoder's pool makes imported over the probe's memory, exists only in a
test build. Its code and unsafe blocks stay in the `va` module. Without
RVG_VA_STREAMS it still fails, naming it. Nothing it compares changed.
The cut of the VA arm's H.264 answer to 65,535 macroblocks kept the driver's
largest width and lowered the height. radeonsi answers 4096x4096, which came
out as 4096x4080, but iHD answers 8192x8192 in VAConfigAttribMaxPictureWidth
and Height, which came out as 8192x2032: the guest's video driver would then
refuse 3840x2160 and every H.264 stream taller than 2032 at its create, and
VideoToolbox would decode 4K H.264 in software on Intel hosts.
iHD decodes nothing wider than 4096: its surfaces' bound is 4096x4096, and
ffmpeg's VA-API decode refuses every size from 4112x2160 to 8192x1024 on an
Iris Xe (iHD 26.3.5). So where the driver's largest size holds more than the
bound, the answer is at most 4096 wide and as tall as the bound leaves there:
4096x4080 on both drivers, holding 3840x2160 and 4096x2160. The test now
feeds iHD's answer too, and the sizes users play.
For the guest: on an iHD host H.264's largest size is 4096x4080, where it was
8192x2032 since the bound came in.
iHD and radeonsi answer 4096x4096 as their largest H.264 decode, yet give
every frame of a 4096x4096 stream back with its luma all zeros, every call
succeeding: ffmpeg's VA-API decode as ours, on an Iris Xe, an RX 7900 XTX
and a Radeon 780M. 4096x4080, 4080x4096 and 15 other sizes decode right.
4096x4096 is the one size within the drivers' bound of 65,536 macroblocks.
So the VA decoder refuses a picture of more than 65,535 macroblocks at its
SPS, and the graphics device answers H.264's largest size under the bound,
4096x4096 as 4096x4080: the guest's video driver then refuses such a stream
at its create, and VideoToolbox decodes it in software, where before every
frame reached the guest black. Recorded as bugs.md U28.
The codec module refused every SPS of profile_idc 88, at the first picture,
which through the graphics device reaches the guest as undecoded frames:
AppleGVA's H.264 decoder hears of no failure. Apple's AVC decoder on an x86-64
Mac decodes such a stream in hardware (measured on a Radeon Pro 5300M's
AppleGVA flow and an Intel UHD 630's, macOS 26.7.1: JM 19's Extended stream of
CAVLC B slices decoded as JM's reconstruction). Its pictures are Main's where
they use none of Extended's own tools, so the SPS is taken, the VA-API arm
asks for VA's Main profile, else High, and data partitioning and SP and SI
slices stay refused at the slices that use them.
For the guest: an Extended stream now decodes on the host where it reached the
client as undecoded frames.
The HEVC decoder refused a PPS with a tile column under 256 luma samples or a
row under 64, the Main profiles' bounds (A.3.2 to A.3.4), after the guest had
scheduled the picture. kvazaar writes such streams without a warning. The
hardware decodes them: columns of 128 and 192 samples and rows of 16 and 64
matched kvazaar's MD5 SEI and reconstruction on every frame on radeonsi (a
Radeon 780M), on iHD (an Iris Xe), on NVDEC (an RTX 5080 Laptop GPU), and on an
x86-64 Mac's Apple decoders (Intel UHD 630, and AMD's driver on a Radeon Pro
5300M). A column of 64 samples, one CTB of 64, came out wrong on every frame,
with no error, on radeonsi and on the Mac's AMD driver, and right on NVDEC and
the Intel ones.
The decoder now refuses only tile columns under MIN_TILE_COLUMN_WIDTH, 128.
No driver reports the bound, so it is the same on every host. For the guest,
kvz-720p-tiles-narrow (a 192-sample column) and a stream with a row of 16
decode on every frame. A stream with columns of 64 is still refused.
hevc-check.sh decodes kvz-720p-tiles-narrow and kvz-720p-tiles-short, and
expects kvz-720p-tiles-col64 to be refused at its PPS.
What changes for the guest: on a host whose GPU shares the CPU's memory
(RGFX_FEATURE_SURFACE_CACHE_REFUSED), with VA-API's hardware video (the
Radeon 780M's radeonsi, the Iris Xe's iHD), the video caps now say
RGFX_VIDEO_CAPS_OUTPUT_CACHED, with no output layouts, as a host of a GPU
of its own memory says them where its video lands pictures in caches. The
guest's video driver then asks its output surfaces cached, with their
layout, as any other surface (RgfxAskUncachedScope no longer covers them),
and the device keeps a cache of those it answers RGFX_STATUS_CACHE: an
output whose textures would not lie in place in its pages, or whose view
has no room for its mappings. A picture lands in such a cache by the
runtime device's copy of the decode surface (or the CPU's, through the
session's staging, where that copy is refused), and a CPU read of a decoded
frame has the cache copied out into its pages first. An output that lies
in place stays in its pages, as before.
For the host: VaapiVideo::lands_in_device_caches is true, and the device
offers cached outputs wherever the kext makes caches (video_caps, out of
GraphicsDevice::with_platform). The caches lay the first plane on 256
bytes of their memory (the commit before), so textures over the decoded
planes lie in them rather than in the runtime's shadows.
Measured on guest boots of macOS 26.7.2, Safari playing 4K60 HEVC clips
(8-bit, then 10-bit; then two and three at once), against development
81f187735 on the same host, vm.max_map_count 1048576, before this change
was rebased onto development's df50639ea (a laid-out cache's bytes between
rows declared unobserved), which the boots did not include:
- Radeon 780M (radeonsi and RADV, Mesa 26.2.6): the runtime's shadow
texels copied in per presented frame fell from 10.2-15.6 M to 0.00-0.03 M.
18 of 85 sessions landed in caches (4K outputs whose planes exceed
udmabuf's 1024 pieces), the rest in place; 148 caches were made aligned.
Presented fps 55.8/55.5 single, 53.9/57.0 two, 52.1/51.9/54.0 three
(development 57.0/57.2, 56.0/57.5, 53.9/53.3/52.6), drops 14/14/6 at
three (13/15/5). Mappings 5.7-6.6 k both.
- Iris Xe (iHD, ANV Mesa 26.2.6), where ANV answers a cache for every
surface: all 85 sessions landed in caches, and the process's mappings
peaked at 13.3 k (311 k on development). Shadow texels 0.07-0.32 M per
frame both. Presented fps 53.3/54.0 single, 54.4/53.6 two,
54.5/55.2/55.0 three (development 57.1/56.6, 55.4/53.9, 54.0/51.8/54.0),
at most 2 drops a clip; a second pair of boots, development's first,
gave 56.5/55.4 single (development 54.1/55.7): the single clips' spread
is the boots', not the change's.
- Both: 0 pictures copied by the CPU, 0 fatal lines. A guest process
reading every decoded frame on the CPU (decode_md5 against ffmpeg's
framemd5) matched on 63 of 75 streams both ways, the same 12 failing on
development, the three 4K streams (in caches) among those matching. The
byte-exact test lands every third of 4951 pictures of the conformance
streams in a cache made as the device makes one, equal to the CPU's copy.
- RTX 5080 Laptop GPU (NVDEC): its caps and caches are as before (no cache
made aligned); the boot's playback swung as development's does there.
On VA-API every picture the reims-graphics device decoded was read back and
copied into the guest's output planes by the CPU (B93): CoreVideo lays each
plane 32 bytes into its page, and neither radeonsi's nor iHD's video
processing writes that layout, so the in-place write declined every picture.
Where the in-place write declines, the arm now exports the decode surface as
dma-bufs (vaExportSurfaceHandle, each plane a layer of its own, kept with the
surface's pool), imports each plane once into the runtime device as an image
of its DRM format modifier, and copies it with vkCmdCopyImageToBuffer into the
buffer the output plane lies in, the surface's pages or its device cache, at
the plane's offset and rows: the Vulkan platform's PlaneCopier, one a session
on a runtime queue of its own, which waits for the copy on a fence. The copy
writes the crop the CPU's copy writes and nothing past it, after the decode is
done, and the session signals the decode once the copy is done on the GPU.
Which way each host's pictures take, in order, each where those before it
refuse:
- radeonsi (Radeon 780M, Mesa 26.2.6): the in-place write declines
CoreVideo's planes (it imports planes 256 bytes apart alone); every picture
lands by the GPU's copy: radeonsi exports one object of modifier
0x200000010401b04, and RADV imports each plane.
- iHD (Iris Xe, intel-media-driver 26.3.5): the in-place write declines them
(iHD writes a plane only at its dma-buf's first byte, U26); every picture
lands by the GPU's copy: iHD exports one Y-tiled object (0x100000000000002),
and ANV imports each plane.
- A host whose driver exports a surface other than as a layer a plane, whose
runtime device lists none of the dma-buf image extensions or refuses the
modifier for the plane's format, or whose plane lies in a buffer the GPU's
writes do not reach (pages the runtime copies, a detached buffer): the CPU's
copy, as before. The session logs each reason once at that point, as `a
picture copied by the CPU: <the in-place write's refusal>; and the GPU's
copy: <its refusal>`, or `; and no GPU copy: <why>` where the device made
the session no copier.
The in-place write stays first wherever the import check passes for the
planes' layout.
For the guest nothing changes: the planes hold the same bytes, padding
included, and the decode's event and completion come as before. For the
host, the pictures land by the hardware instead of the CPU, the session's
counts say so, and each session logs its GPU copies and their GPU time at its
end.
Checked on the Radeon 780M and the Iris Xe: the conformance suites
(h264-check.sh 62 and hevc-check.sh 156 checks pass on each), the video
crate's ignored VA tests (15 on each), and a new ignored test,
a_picture_copied_by_the_gpu_is_the_cpus_copy_byte_for_byte, which lands every
picture of the suites' Annex B streams by the GPU's copy and by the CPU's into
the same CoreVideo-like layout at two pitches and compares every byte: 4849
pictures of 79 streams equal on the 780M, 4951 on the Iris (the latter going
on past the leading pictures random access skips). The workspace's Linux
tests pass on the radeonsi host (1862).
In cold boots of a macOS 26.7.2 guest playing 4K 60 fps HEVC in Safari,
against the arm before it on the same GPU: on the 780M no picture was copied
by the CPU (9979 before), 10000 by the GPU at 1.01 ms of GPU time each, and
three clips at once played at 53.2, 53.7 and 52.5 fps with 3, 2 and 0 frames
dropped (50.0, 50.3, 52.0 and 10, 11, 5 before); on the Iris none (9899
before), 10040 at 0.52 ms each, 53.8, 54.2 and 56.4 fps with 4, 3 and 0
dropped (52.3, 51.7, 53.5 and 71, 74, 1 before).
The host's video was five crates: core, codec, conformance, and the VA-API
and NVIDIA backends, with the examples and tools split between two of them.
One device uses them, from one library. They become one crate,
crates/reims-vgpu-video, with the modules core, codec, vaapi and nvidia, the
last two built on Linux alone. The conformance readers and writers, which only
the examples use, stay a crate of their own beside it, at
crates/reims-vgpu-video/conformance (reims-vgpu-video-conformance). The files
move with git mv, their paths rewritten, with no re-exports left behind. The
NVIDIA examples build on every host, as a stub off Linux.
Dead code goes with them: NVDEC's VP9 path and the codecs nothing asks it for
(NvdecCodec is H.264 and HEVC), and the Vulkan platform's listing of the
host's GPUs (host_gpus::hardware_gpus and gpu_device_gpu), which nothing
called, with its serde_json dependency.
AGENTS.md, development.md, docs/video and the nextest filter name the one
crate.
The paravirt video devices, their JPEG engine and scaler, and Vulkan Video
are gone, so docs/video says only what is left: the reims-graphics device's
video on NVDEC or VA-API, and the crates under it.
- devices.md: what the device answers the guest (the caps, the layouts,
OUTPUT_CACHED where NVDEC lands pictures in device caches) and what a
decode does, on each arm.
- backends.md: the two arms, their crates and traits, and the conformance
suite, which is VA-API's h264-check.sh and hevc-check.sh.
- core.md, vaapi.md and nvidia.md: the crates as they stand; vaapi.md adds
the 2026-11-07 runs of both scripts on the Iris Xe and a Radeon 780M.
- bugs.md keeps the entries the code and the other docs cite that still
hold, rewritten without the deleted devices; B26 is condensed.
- scaler.md, videotoolbox.md, hardening.md and vulkan.md go.
- AGENTS.md's video rows name the arms, the docs and the two scripts.
The VA-API doc still named a list of drivers trusted with imports, which
the import check replaced, and imports of a dma-buf a plane, now one of
both planes. It said nothing of the reims-graphics device's arm. bugs.md
said Intel's drivers were not measured.
vaapi.md gains "The import check" (what it tries, the drivers' answers,
its cost, the sweep) and "The reims-graphics device" (the chooser, the
two landings, the boots' results). The staged copy back's whole-rows
layout and zero copy's one dma-buf are described as they now are.
bugs.md gains U26, iHD's writes into an import, and B93: on VA-API the
device's pictures are all copied by the CPU, since CoreVideo's layout
of the guest's frames is one neither driver's video processing writes.
Core's JpegDecoder now answers what its backend decodes at all
(JpegDecodes: the samplings and the largest picture): VA-API's the
samplings its driver lists and its largest size, NVIDIA's the four it
measures at any size. The guest hears of it only through the refusals it
already got, so nothing it sees changes.
The conformance suite's jpeg-check reads it. A stream outside the answer
that a case asked to decode now passes when refused as UnsupportedStream
("refused as answered"), and fails when it decodes; inside the answer every
refusal fails, as before. jpeg-check.sh's last line counts the passes, the
refused as answered among them, and the failures.
On an RX 550 (radeonsi, Polaris 12) the driver lists 4:2:0, 4:2:2 and grey
up to 4096x4096, so 19 cases failed on development (job 4315): every 4:4:4
one, and the 16384-wide 4:2:2 case. Each was the engine refusing a stream
by the driver's own answer.