A 1080p H.264 session in an x86 guest, at 8 Mbit/s with a limit of
1,000,000 bytes a second, runs 18.3% to 19.4% over the limit in its
busiest second on all three vendors. On the XTX the stream is the same,
byte for byte, as the stream without the limit. The guest's H.264
encoder is driven by macOS's AMD path: that path counts the limit but
codes no frame over again, and on our device its planning changes no
frame. The 2019 MacBook Pro's 2.3% is from macOS's Intel path, which
does code frames over again. No AMD-only Mac has been measured, so the
known issue keeps the Mac's number scoped, and B101 records the trigger,
the first step and the unfilled third length-record word as a lead only.
B100 had two claims the same rows now disprove. It said the real Mac ran
at another keyframe interval, but m3-max-77623 ran HEVC at the guest's
interval and stayed under the limit in every second. Its "the plug-in's
default" interval was the probe's 60. The HEVC paragraph in known-issues
said the runs don't compare; they now do, both on macOS's Intel path.
An x86-64 guest's hardware HEVC encoding never reached our GPU: macOS's HEVC
encoder plug-in drives only an Intel GPU's driver, found by name, so an app that
required hardware failed at its create (-12908) and others encoded in software
(m3-max-77632, development's set on this host). What the guest sees now, where
the host's video arm lists an HEVC encoder of Main and Main 10 with a constant
QP that codes a frame in place of the last (Linux hosts' VA-API, and NVENC where
its driver codes a frame without advancing its state):
- the accelerator publishes an IntelAccelerator child of its own with
IOGVAHEVCEncode and IOGVAHEVCEncodeCapabilities (Main and Main 10, up to
the encoder's level), so VideoToolbox lists a hardware HEVC encoder
(hevc.gva);
- RgfxGate keeps the Intel driver path the plug-in loads from
/Library/GPUBundles a hard link to the bundle's executable, at every boot;
- the bundle's video driver takes the plug-in's encode commands (function
0x20, sub-ID 0x1000), codes each frame on the host (ENCODE_H265) at the QP
the plug-in's rate control chose, an IRAP picture as a keyframe, Main from
an 8-bit source and Main 10 from a 10-bit one, and hands back the access
unit with 4-byte start codes, whose VPS, SPS and PPS make the session's
format description;
- a frame the plug-in codes again over its data rate limit, at a higher QP,
is sent in place of the last one (RGFX_VIDEO_ENCODE_IN_PLACE): a P
picture of the last frame's order count and source surface; a keyframe
coded again is sent as a new IDR picture;
- a session of a size the host does not encode is refused at its create,
so an app that allows software encodes in software as before.
A host whose encoder has Main alone gets no nub: VideoToolbox hands the
plug-in a Main 10 session whatever profiles the nub lists, and the driver
learns a session's profile only from its first frame. Nor does one that
codes no frame in place, where a retry would predict from the frame it
replaces. H.264 encode and both decodes are as before on either. The
plug-in's per-CTU QP map (its pool 27) is not applied, and its frame
statistics record is not supplied. The route is macOS 26.7.1's plug-in's,
booted on 26.7.2. Windows hosts list no encoder, so encode in software as
before.
Rows (macOS 26.7.2 guest, 1080p, 300 frames at 8 Mbit/s, decoded back by
VideoToolbox; the rate band is vboot's RATE_BAND_PCT, 6%, both codecs), the
same with the frames in place (m3-max-77615, m3-max-77613, m3-max-77614),
byte for byte but for 205 bytes of the Iris Xe's Main stream:
- RX 7900 XTX (m3-max-77475): Main 105.1%, 45.02 dB; Main 10 104.8%, 45.17 dB
- Iris Xe (m3-max-77476): Main 103.5%, 48.04 dB; Main 10 98.1%, 48.86 dB
- RTX 3090 (m3-max-77477): Main 100.7%, 44.81 dB; Main 10 106.1%, 45.06 dB,
where NVENC's own lands 104.6%: known-issues and video/bugs.md B97
At a data rate limit of 1 Mbyte a second, the plug-in coded 2 to 30 frames
of a session again, each sent in place: no gap in the order counts, all 300
frames decoded back, and the most bytes in a second 1.7% to 3.0% over the
limit (RX 7900 XTX m3-max-77611, RTX 3090 m3-max-77609, Iris Xe
m3-max-77627; video/bugs.md B100, to be read on a user's report). With a
keyframe every frame the stream comes to 4.1 to 5.0 times the asked rate, as
a real Intel Mac's comes to 5.7 times with the same QPs frame for frame
(m3-max-77635; design.md, known-issues); every frame decodes back.
Main 10 from a retained pool and from the app's own 8-bit buffers decodes as
from the pool taken per frame on all three. A real Intel Mac's hevc.gva
(macOS 26.7.1, m3-max-77481) replaces the session's pool at the third Main 10
frame, as ours does. Speed (Iris Xe, m3-max-77497): 94 to 118 fps at 1080p
against software's 3.3; 10.3 to 10.8 at 8K against 0.5 (B98, B99).
Tests: the kext's publish condition and its pairing with a host that codes
no frame in place (video_codecs_test: the caps of both decoders and encoders
without the flag publish no HEVC encode and the rest as before), the link's
update on real files (rgfxgate alias_test), and the driver's listing, create
refusals, settings, keyframes, write-back, failures, refused sources and the
frames it sends in place, and those it does not: never a keyframe, so a
session of keyframes from one reused surface sends none (video_driver_tests;
m3-max-77590). Development's set on this host (m3-max-77632) encodes H.264 to
the same bytes as this one and decodes as before. Docs: design.md and
devices.md, video/bugs.md B97 to B100, and known-issues.md's HEVC encoding
line, which now says which GPUs encode HEVC for an Intel Mac guest, and its
section on HEVC over the bitrate asked.
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.
NVDEC's HEVC 4:2:2 decode landed on a proof run on an RTX 5080 Laptop GPU
from the host alone: no arm64 guest has run on that card. bugs.md's untested
list now says so, and when the guest's side is to run: a user's report of
HEVC 4:2:2 on an NVIDIA 50-series host, or an arm64 guest's disk reaching
such a card for another reason.
A boot of an arm64 macOS 26 guest on the RTX 3090 at the change that takes
HEVC 4:2:2 where NVDEC's caps list it (potluck job m3-max-77572) refused
each 4:2:2 session by the caps' answer and decoded the card's other range
extensions in hardware as before, every picture the same as the guest's
software decode. devices.md quoted the refusal's old wording.
What the guest sees: on an arm64 guest of an NVIDIA host whose NVDEC lists
HEVC 4:2:2 at the stream's depth and size, as the RTX 5080 Laptop GPU's
does at 8, 10 and 12 bits, a VideoToolbox session of an HEVC 4:2:2 stream
now decodes on the GPU, each picture copied into the surface's 422v, x422
or tv22 (or full-range twin) with no conversion by the CPU. Its dsta was
refused before, and the guest decoded the stream in software. On a card
whose caps lack it, as the RTX 3090's do, the session is still refused at
its start, and its warning now names the caps ("NVDEC does not decode HEVC
4:2:2 at 10 bits") where it said "NVDEC's decoders here land no HEVC 4:2:2
pictures".
declines_range_extensions takes the caps' answer for 4:2:2 as it does for
4:2:0 and 4:4:4, the decoder's output being NV16 at 8 bits and P216
deeper, and the VideoToolbox decoder checks a picture's chroma format
against the surface's from the picture itself.
Shown on the host, not from a guest on that card: the card test
(an_hevc_picture_lands_in_its_guest_format_as_the_software_decode_has_it)
on the RTX 5080 Laptop GPU decoded our x265 streams of 4:2:2 at 8, 10 and
12 bits through the arm's VideoToolbox decoder into pool-laid surfaces,
every picture byte for byte as ffmpeg's software decode, beside 4:2:0 and
4:4:4 at each depth, and landed 1920x1080 4:2:2 pictures at 344 to 384 a
second (potluck job m3-max-77563). The seam test holds the session-start
decision on the 5080's and the 3090's recorded caps.
NVDEC lists HEVC 4:2:2 on newer cards: the RTX 5080 Laptop GPU decodes it
at 8 bits into NV16 and at 10 and 12 bits into P216 (nvidia-probe). The
HEVC accelerator refused every 4:2:2 SPS, as no output of it was mapped.
Make a 4:2:2 decoder for an SPS of chroma_format_idc 2, into NV16 at 8 bits
and P216 deeper, laid out as NV12 and P016 with the chroma as tall as the
luma: a mapped frame's chroma rows start at the crop's first row and are as
many as the luma's (Mapped::of), a decode surface counts twice the luma's
samples, and AnnexBPicture::chroma names a picture's chroma format for its
callers. A card whose caps lack HEVC 4:2:2 still refuses the decoder at
its make.
No guest sees this yet: the graphics arm still refuses HEVC 4:2:2
sessions at their start, and a host video session's decoders refuse the
range extensions.
The AV1 route had only been checked on arm64 macOS 26.6.2. An arm64 macOS
14.6.1 guest on an RTX 3090 now decodes our svt-main8 stream to its
reference frame by frame, in a session that requires hardware (potluck job
m3-max-77531, at the tree this commit follows). The same boot decoded VP9,
HEVC and H.264 there with no errors. Docs only: nothing changes for the
guest.
An arm64 guest's VideoToolbox session of a 4:2:0 H.264, HEVC Main or Main 10
stream whose coded size lies outside the host decoder's own, as HEVC under
NVDEC's least size of 144x144, was started, and its pictures failed in the
host's decoder: NVDEC refuses to make a decoder of that size, and VA-API's
surfaces or context refuse it. A client that allowed software decoding got
failed frames rather than pictures.
For the guest: such a session's dsta is now refused with
kVTVideoDecoderUnsupportedDataFormatErr, its warning naming the stream and the
decoder's sizes, as the x86-64 route refuses it at create (5dfe92be1), and the
guest's VideoToolbox decodes the stream in software. That covers an H.264
stream wider than 4096 on iHD, as 4112x2160: iHD's H.264 config lists
8192x8192 but its surfaces take 4096x4096 at most, so such a session started
and its pictures failed. Streams inside the sizes start as before.
The sizes are each arm's own. On NVDEC, its caps of the codec at 4:2:0 and the
stream's depth: nMinWidth and nMinHeight up to nMaxWidth, nMaxHeight and
nMaxMBCount, the checks its decoder's make runs. On VA-API, the decoder the VA
crate's decoder picks for the stream, whose profile choice the video crate now
exports (h264_decoder_profiles, hevc_main_decoder): from its surfaces' least
size, none where they list none, up to the least of its config's and its
surfaces' largest, and H.264's 65,535 blocks. The range extensions' check takes
that bound too.
The hosts' drivers list VP9 decode at profiles 0 and 2, and an arm64 macOS
26 guest has no VP9 decoder of its own: every VP9 session fails -12906
without one from the host. The previous commit gave the host VA-API
and NVDEC decoders; this one offers them to the guest.
What the guest sees: the device's video caps gain a VP9 entry, codec 3
(RGFX_VIDEO_CODEC_VP9), where the host's arm decodes VP9, listing profile 0
into NV12 and profile 2 into P010 as the driver answers them, at the arm's
sizes up to 16384 a side, and level 62 (6.2, as vpcC numbers it). On the
paravirtual route (RGFX_FEATURE_VT_MESSAGES) the host then lists a vp09
decoder, reims-vgpu-video.videodecoder.vp9, with those profiles; once a
process registers VP9 (VTRegisterSupplementalVideoDecoderIfAvailable, as on
a Mac) the guest's VideoToolbox decodes VP9 on the host's hardware. A sample
is a frame or a superframe whole, which the host splits. A stream the host
does not decode (profiles 1 and 3, 12 bits) is refused at its session's
start, as an HEVC format the arm lacks is, and the guest has no VP9 decoder
of its own to fall back on: known-issues.md says so. No encoder of VP9 is
listed.
The guest's pictures of the two libvpx streams equal vpxdec's, frame by
frame, on an RX 7900 XTX, an Iris Xe and an RTX 3090 under macOS 26.6.2 and
on the 3090 under macOS 14.6.1, and VP9 decodes as fast as HEVC on the same
route at 1080p and at 8192x4352 (devices.md, with the guest's CPU emulated).
The wire change is additive. An x86-64 guest's kexts read no caps entry past
HEVC's, and the device takes no session of codec 3. An older host's caps
have no VP9 entry, so a newer guest's VideoToolbox lists no vp09; a newer
host's caps list H.264's and HEVC's entries as before, beside VP9's
(vt_decoders_list_vp9_beside_the_others_where_the_caps_decode_it). The
header's hash moves in the option ROM's and both kext sets' source records;
their bytes are unchanged.
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.
What changes for the guest: an arm64 guest's VideoToolbox now lists an av01
decoder, profile 0 at level 19 as Apple's own lists, wherever the arm's
capability query lists AV1 Main (VA-API's AV1Profile0, NVDEC's AV1 at
4:2:0), and decodes AV1 sessions on the host's GPU. Before, it had no AV1
decoder at all, and a session asking for one failed -12906.
A session of another profile, or past the depths or sizes the arm lists
(NVDEC's caps, VA-API's AV1 surfaces), is refused at its start with a
warning that names why. A picture the hardware reports failed reaches the
guest as a decode error, as H.264's and HEVC's do on this route.
AV1's codec number is the host's own: the device's caps, its wire and the
option ROM are unchanged, and x86-64 guests get no AV1, as AppleGVA decodes
none. Measured on a Radeon 780M, AV1 decodes at 0.87 of HEVC's rate at
1920x1080 and 1.02 at 8192x4352 (medians, emulated guest CPUs).
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 asks for AV1, and both arms decode it in
hardware, but the hardware takes only a frame's tile data: the syntax above
it is ours to read, as H.264's and HEVC's is. The codec module now reads
AV1's OBUs, av1C records, sequence and frame headers and tile groups, keeps
the eight reference slots, works out the frames each temporal unit shows,
and hands an Accelerator each frame's tile data with its parameters.
It refuses at a sequence header what no arm decodes or what the arm's
limits exclude: profiles other than Main, monochrome, spatial layers, and
frames larger or smaller than the arm's capability query lists. A record
without a sequence header is read from its first sample.
Eleven small streams of ours (aomenc, SVT-AV1 and rav1e from ffmpeg's
synthetic sources, and an AVIF still's item) are committed with the MD5 of
each shown frame from libdav1d's decode, and the CPU tests decode, truncate
and fuzz them through a recording accelerator. The card tests' judgement,
film grain's by its residual's statistics, lives here too.
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.
The JPEG line said any virtual machine has neither Apple JPEG nor scaler
hardware. Our boots show only that ours have neither, so the line now says that.
Lane vjpegdec's boots of macOS 14.6.1 and 26.6.2 (780M, Iris Xe, 3090) show no
route an app uses reaching the device's JPEG decoder: ImageIO and VideoToolbox
look for Apple's JPEG and scaler drivers by name, find none, and decode in
software. The finding joins the other video formats our GPU gets no route to.
The owner asked for every video format the host's GPU offers to reach the
guest. For these, a boot or a read of the guest's frameworks found no route,
so the guest keeps its own software decoder, or has none:
- VP9 decode on x86-64 guests: AppleGVA sends whole frames to our driver but
never names the picture's output surface (boots m3-max-77225, 77247);
- AV1 decode on x86-64 guests: AppleGVA and the x86 plug-ins have no AV1;
- HEVC encode on x86-64 guests: the encoder plugin picks the Intel vendor,
even for a session that names our GPU, and -12903s (m3-max-77226);
- HEVC range extensions on x86-64 guests: AppleGVA hands our driver a 4:2:0
destination at 10 bits or fewer, which cannot match the full picture the
guest's software decode gives (m3-max-77246, 77257);
- MPEG-1/2, MPEG-4 Part 2, VC-1 and VP8 decode, and VP9 and AV1 encode: no
key or codec entry in the guest's frameworks a GPU driver can serve.
docs/video/devices.md said an arm64 guest is offered no codec on any host:
true of AppleGVA's route alone, and stale since 2d7ce10ea, after which the
arm64e kext serves the guest's VideoToolbox its paravirtual path, which
decodes H.264 and HEVC, and on Linux hosts encodes H.264 and HEVC Main and
Main 10, on the host's video arm. The paragraph now says so, keeping the
measured no-decoder case. video_choice.rs said VA-API decodes alone, stale
since ad8ef4392, which answers the driver's encoders on Linux; Windows still
decodes alone. A listing of the hosts' video formats read both as written.
[ci skip]
A picture that lands by the host's own work (VA-API's copy, NVDEC's, the
Windows host's Direct3D 11 draw) writes the output's planes off the platform's
queues, and the platform's reads see that write only in the command buffers
committed after the landing's external_writes_done, the acquire. A buffer of
another queue ordered after the decode, by its SURFACE_ORDER or by the decode's
early CB_COMPLETE alone, waited on the GPU for the decode's buffer's end, but
could be committed before that acquire and read the planes' earlier picture:
picture 423 on the Windows host, read through a plain shape 22 ms before its
acquire.
What the guest sees: such a buffer's begin, and so its CB_SUBMITTED, its
ticket and its commit, now wait until the decode's session signals the
decode's value, which the landing gives once the planes are said written, or
once the picture ended without landing. The key is the decode's buffer, by its
queue and seqno, kept in its queue's marks from its walk until that signal.
Nothing times the hold out; a hold past 2 s is named in the log, and the
order's summary line counts the holds, those for a landing and the longest,
and the named buffers not yet published, which hold nothing. A doorbell no
longer answers a buffer that uses a block of a decode completed ahead of its
end.
The tests that run a reader behind a fake session's decode now signal the
session's value as the landing does. The completed-ahead reader's test holds
its begin past 2 s and checks the log's lines, and the red test of the reader
named after a decode passes.
The module table in docs/video/backends.md labelled vaapi as Linux only.
lib.rs builds it on Linux and Windows (cfg(any(target_os = "linux",
windows))), where its pool surfaces are Direct3D 12 textures, as vaapi.md
says.
Each queue's ring is taken on a thread of its own, so the host can take a
buffer whose SURFACE_ORDER names a buffer of another queue, committed earlier
by the guest, before the host has walked the named one. Until now the naming
buffer waited for it on the GPU alone, and that can close a loop. The named
buffer, a decode, fills its output's device cache at its begin for the CPU's
newer generation. The fill waits on the GPU for the end of each buffer that
used the cache, the naming buffer among them when it was begun and finished
first. The naming buffer waits on the GPU for the decode's signal, which the
decode's commit carries after its walk. The walk's video op waits on the CPU
for the fill. None of them ever finishes: the Windows host's video decodes
stopped this way.
What changes for the guest: such a buffer's begin now waits, on its queue's
thread, until the named buffer is committed. Its uses then count among no
cache user that the named buffer's fill waits for. Its CB_SUBMITTED and
CB_SCHEDULED, and the buffers behind it on its queue, come after that commit
too. A buffer that names only buffers the host has walked, or not yet
published, is begun as before.
The wait is counted on the surface order's summary line (begins that waited,
and the longest wait), and a wait past 2 s is named in the log with the
buffer it waits for. The module doc of surface_order and the design's
"Surface order" section give the wait and why the waits end. They also give
the one shape that holds: names written wrong, by a process that writes the
slots itself, which can make two buffers of two queues wait for each other
until either queue ends or the device resets.
Tests:
- The test committed alone before (a buffer naming a decode not yet walked
begins after its commit) now passes: the reader's begin waits, it counts one
wait, and no fill waits behind a later buffer.
- New: two buffers that name each other hold their queues, each named in the
log, until one's process closes.
- New: a buffer waiting so is answered at no doorbell, so it holds no ticket.
- Changed, because they held the old order: the device tests of a reader in
another process and of a buffer named while its queue's later buffer is
walked first. Each reader is now committed only after the buffer it names,
then waits on the GPU for its signal.
- The counter test of a fill behind a later buffer now runs on rings the host
gives no published seqnos. That is the one place its order is left.
A touchpad scrolled an x86-64 guest by turning its mouse's wheel, a notch per
10 points, which macOS accelerates as a wheel's: a quick swipe went several
times as far as the fingers moved. The x86-64 kext now starts a precise
scroller beside its mouse, "Reims vGPU Scroller" (product 0x5248): the mouse's
descriptor with a physical range of -1 to 1 on its wheel and pan, which macOS
reads as 127 counts a unit and so marks its events continuous and precise, in
points, as a touchpad's; and HIDSupportsScrollAcceleration false on the device,
which turns macOS's scroll acceleration off for it. SCROLL_DEVICES names it too
(RGFX_SCROLL_DEVICE_PRECISE), so the host sends a touchpad's distance in 1/256
points, and the kext makes one count of it per 10 points, the rest carried on
and started afresh where the scrolling turns back.
For the guest: a touchpad's scrolling, and a Mac host's precise scrolling with
its coasting, come from the scroller, continuous and precise, as far as the
host reports and unaccelerated, in steps of 10 points, with no gesture phases.
A wheel's notches still come from the mouse. The arm64e kext is unchanged.
Why 10 points a step: with the acceleration off a count scrolls 10 points at
any speed (120 counts made 1200 points slow, fast and in lumps, on both axes,
at 127 and 90 counts a unit; potluck jobs m3-max-75987 on 26.7.2 and
m3-max-75994 on 11.7.11). Apple's driver passes each count whole and reads no
resolution multiplier, so no descriptor makes a count worth less. With the
acceleration on, neither a flat acceleration table nor one linear curve
scrolled as far a count at every speed (m3-max-76084).
Measured in windowed walks with a wheel mouse over the window, on macOS 26.7.2
(potluck job m3-max-76127) and 11.7.11 (m3-max-76128): "Reims vGPU Scroller"
reads HIDScrollResolution 127 and HIDSupportsScrollAcceleration No down to its
event service; forty quarter-notch parts 16 ms apart (100 points) made ten
continuous, precise events of 10 points each, up and sideways, where the mouse
would have ramped; the wheel's notches and bursts read as before.
An x86-64 guest scrolled only up and down: QEMU's usb-tablet, which took the
host window's scrolling, has no sideways wheel. The x86-64 kext's mouse now has
an AC Pan beside its wheel, which IOHIDEventDriver makes the scroll event's
sideways axis, and once the mouse is up the kext names it to the host with the
new SCROLL_DEVICES command. From then on the window sends its scrolling to the
guest as SCROLL events instead of QEMU's wheel buttons: a wheel's notches as
they are, and a touchpad's distance as one notch per 10 points, the points a
line is on SDL (FINE_PER_NOTCH), the rest carried to the next event and
counted afresh where the scrolling turns back. The kext posts the notches as
the mouse's wheel and pan reports, at most 8 x 127 a SCROLL.
For the guest: its scrolling comes from "Reims vGPU Mouse", sideways included,
with macOS's own wheel acceleration, as the tablet's did. For the host: the
window's wheel and scroll callbacks are not called for scrolling the guest's
devices take. An arm64 guest names no devices, so its scrolling goes to the
vmapple tablet as before; the arm64e kext's binary is unchanged.
The wire also carries a SCROLL's distance in 1/256 points, for a guest that
names a precise scroller (RGFX_SCROLL_DEVICE_PRECISE), which no kext names yet.
Measured in windowed walks with a wheel mouse over the window, on macOS 26.7.2
(potluck job m3-max-76095) and 11.7.11 (m3-max-76100): notches up, down, right
and left reach the guest three for three on their axes, in the tablet's
directions; eight quarter-notch parts make two; a burst of ten at 16 ms ramps
from 1 to 91 points, as the tablet's did; QEMU's tablet takes no wheel button.
While the guest's screen is recorded or shared, macOS hides the cursor for the
whole recording and draws it into the picture, which the window takes for a
game's hide (lane ptrswitch, potluck job m3-max-75965: one setCursorState(x, y,
false), then no call while the pointer moved, as in a game). Captured, the
pointer then drives the guest's mouse until the share ends, and the release
chord freed it only until the next click captured again.
The person releasing capture (the release chord, or Release Input on macOS)
now leaves the rest of that hide to the tablet, captured again or not, until
the guest shows its cursor (Game::released). Losing the keyboard and the
window's end do not: a player who switches away from a game and clicks back
gets the guest's mouse as before. A player who presses the chord mid-game gets
it back once the game shows its cursor and hides it again.
The remembered hide is cleared where the guest shows its cursor, or where its
hide reads shorter than at the release (a later hide). It is not cleared at
capture's end: every show and hide of the guest's reaches Game::shown (the
window asks at each), so it cannot outlive its hide, and clearing it there
would undo the chord at the next switch away and back.
features.md, the design doc and known-issues.md say so; known-issues.md's
share entry now says to press the release chord once.
While the guest records or shares its screen, macOS hides its cursor and
draws it into the picture, which the window takes for a game: with input
captured the pointer drives the guest's mouse from 50 ms past the first move
until the share ends. Say what the user loses then (the host's pointer
speed, the pointer held in the window, crossing to another display) and how
to keep the plain pointer.
The captured pointer drove the guest's own mouse once the guest had hidden its
cursor for 50 ms. macOS hides the cursor while text is typed until the mouse
moves, so the first move after typing locked the host's pointer: that move was
lost, the next went to the guest's mouse with the guest's acceleration, and
the host's pointer jumped to the guest's cursor once the guest showed it,
about 9 ms later at 125 Hz (x86-64 26.7.2, potluck job m3-max-75911: the
switch fired in each of three typing rounds).
A hide's first captured move now goes to the tablet, as while the cursor
shows, and the window drives the guest's mouse only once that hide has lasted
the settle, 50 ms, past the move. A cursor hidden until the mouse moves shows
at that move, so typing never drives the guest's mouse and no move after it
is lost. A game's hide stays, and its mouse-look begins one move and 50 ms
later, those moves reaching the game through the tablet. A show, a hide that
reads shorter than at its first move, and a change of capture start the count
over. It is the one rule: the count from the hide alone is gone.
The same logic drives the window on Linux, Windows and macOS hosts. The game
tests and both inputs' tests send the hide's first move, and new tests pin the
typing case: a_hide_a_move_ends_drives_nothing,
a_new_hide_starts_the_count_over, and each input's
a_cursor_hidden_until_the_mouse_moves_drives_nothing. The register's entry
changes in a commit of its own.
A class's next slab doubled with each slab it made, up to kSlabMax, and never
came down once its slabs went. A buffer of a page that came after its class
had grown and let go took a slab of the largest size the class reached: 2 MiB
from the region or the process's pages, and 16 MiB from the Shared pool, which
the host zeroes as it gives it. Keeping empty slabs (the commit before) stops
this for a buffer made and freed again and again, but not for one that comes
more than 2 s after its class's last slab went.
Now a class left with no slab, none holding a buffer and none kept, starts
again from kSlabFirst (128 KiB), over every source. While it keeps an empty
slab it goes on growing as before.
What changes for the guest: after an idle let-go, a class's next slab is 128
KiB, or twice its buffer, rather than the size the class grew to, so its
heap's size and the buffers' GPU addresses in it differ, and the host takes
and zeroes a smaller block. test_slab_class_starts_again_once_empty holds it
over the test's source and the pool's; the pool tests that took the grown size
now read 128 KiB.
The guest sets (guest/prebuilt, guest/prebuilt-arm64e) are rebuilt here from
the bundle of this commit and the one before, which changed it too.
A class's slab of the Shared pool went back the moment its last buffer did
(RgfxPoolSlabSource::keepsFreed() answered false), and a large buffer's own slab
skipped the cache. A process that makes one buffer and frees it again and again
in an otherwise empty class then took a pool block for each buffer: a take the
thread waits for, a HEAP_OVER_POOL, the host zeroing the block, then the heap's
destroy and the block's give. Each new slab doubles its class's next one, so
after seven rounds every block was 16 MiB, for a buffer of one page. A user's
guest logged one process making and giving back about 17 such slabs a second,
none of them taken from again. The serialiser test of that pattern at
805c93a65 counted 100 small slabs (1539968 KiB) and 100 large slabs for 100
rounds of each, and 200 pool takes.
keepsFreed() is gone, so every source's slabs follow the one form. Each class
keeps two empty slabs, and large buffers' own slabs are cached, each for
kCacheIdleMs (2 s) at most. The pool source now takes a capacity, as the pages
source does, and the device passes the guest's RAM: the kext tells the bundle
nothing of the pool's length, so the pool's cache holds a sixteenth of the
guest's RAM at most. A refused take still lets the process's own kept and
cached slabs go first.
What changes for the guest: a buffer of the pool may lie in a slab an earlier
buffer emptied, at that heap's GPU address and offset, rather than in a new
block's heap, and the host sees fewer POOL_TAKE, HEAP_OVER_POOL,
OBJECT_DESTROY and POOL_GIVE messages. A kept block is its process's alone for
up to 2 s after its last buffer goes. A new buffer still reads zeros: the test
writes 0xa5 over each buffer before its free and reads zeros in the next.
test_pool_slab_churn_is_bounded holds the bound: one small slab, one large one
and two takes for those rounds. The pool tests that held the old let-go now
let kept slabs go through the idle clock or reclaim(). The guest sets are
rebuilt with the next commit, which changes the bundle too.
On a Windows host, Task Manager's shared GPU memory for QEMU climbs while a
guest decodes video and stays up until QEMU exits. A user saw it pass 6 GiB.
On the lab's UHD 630 it is a counter with no memory behind it: two held 4K
HEVC plays grew it by 11.5 GiB while available memory and the commit charge
did not move. The note gives the two scales measured (a test holding every
picture of a 4K clip, and an H.264 export) and says no NVIDIA or AMD card is
measured on a Windows host.
The kext answers an ask in place it does not carry out with one status for
three reasons: the device uses no surface in place (no SURFACE_PAGES), an ask
with no device cache meets a device that caches every surface (the kext's
`uncacheable`), and the device refused the surface's pages. The bundle counted
all three as "unsupported", and the first copy's line said "the device uses no
surface in place, or refused its pages", which named neither the uncacheable
refusal nor told the other two apart.
The bundle now tells them apart by the ask and by the device's SURFACE_PAGES
and SURFACE_CACHE_EVERY, and counts each under its own name. The guest's
surface copies line gains two counts, "asked uncached where every surface is
cached" and "refused by the device", and "unsupported" now counts only a
device that uses no surface in place. No Metal answer changes. The in-place
fallback test covers each reason.
Both guest sets are rebuilt with it: RgfxGate in guest/prebuilt and
guest/prebuilt-arm64e; Graft and ReimsGraphics keep their bytes.
A device with no Shared pool offers the guest no POOL, and so no
SURFACE_CACHE_EVERY and no MANAGED_AT_COPY. Only one of the ways to lose the
pool logged a line: a GPU that answers no memory heap. A host that gave the
device no guest addresses for one, which QEMU does on a machine with no room
for it, and a Windows host with an arm64 guest logged nothing, so a run's log
did not show why the guest went without the pool.
The device now writes one warning at its start in each of those cases, saying
which of them it is and what the device does not offer. The no-heap warning
is folded into it. The tests pin the line of a device given no addresses, and
that a device with a pool writes none.
The bundle took @synchronized on objects it hands the app, and an app's own
@synchronized on its command buffer then held the buffer's completion. The
lesson says why (Metal takes no such lock, measured by oracle_locks) and how
to spot the next one: bundle_sync_check.sh, and any wait in the bundle on a
lock or queue the app controls.
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.
README.md and docs/video/devices.md said the guest encodes in software on an
Intel UHD 630, as if another GPU could encode on Windows. The Windows arm opens
with encodes off on every GPU (open_on_rt in graphics/vaapi.rs), since rt imports
no shared Direct3D 12 texture, so no Windows host lists an encoder today.
The library wrote its counts line only at a device's reset and at the
process's exit, so a reims-ctl report made while the VM ran had none of
it in its qemu.log.
A host now asks for them with rvg_write_counts (the Rust API's
GraphicsDevice::write_counts), which writes the line before it returns,
where it changed since it was last written. QEMU's reims-graphics-pci
calls it when its new x-write-counts property is set to true over QMP
(vendor/qemu b057a987), and reims-ctl report sets it on a running VM
before it zips the logs, with a line in state.txt saying whether the
library wrote them. A trigger rather than a timer: a timer would touch
only the library, but write a line a minute into every log and still be
up to a minute old at the report; QEMU forwards no signal the library
could take, and Windows has none.
For the host: a new C API function and QOM property; QEMU's log gets the
counts line at each ask. api.md, conventions.md, qemu.md and the report's
help say so.
A VM on reims-vgpu's GPU now needs Linux 7.2 or later on a Linux host, under
any accelerator, where KVM's VMs needed 6.13: reims-ctl's start check refuses an
older kernel, naming the running one and "Linux 7.2 or later", and so does the
reims-graphics device's realize in QEMU (vendor/qemu 458f4b7b). Before 7.2 a
udmabuf over large pages is malformed, and an AMD GPU's import binds the wrong
pages of guest RAM (issue 185); 7.2 builds the table from the pages themselves
(upstream 5bf888673e0d, read from v7.2's drivers/dma-buf/udmabuf.c). The floor
holds KVM's 6.13 reason too. MIN_KVM_KERNEL is MIN_LINUX, and doctor's kernel
line shows on every Linux host.
The floor takes the place of the below-7.2 form: QEMU no longer advises guest
RAM, the device's region or its pool pieces MADV_NOHUGEPAGE, nor logs the 4 KiB
line, and the library's views of guest RAM take no advice (off_huge_pages,
huge_pages_take and linux_release_at_least go, with their tests). On 7.2 and
later nothing changes: QEMU's advice and its collapse with its share line stay.
What hosts see: below 7.2 a start is refused, where it ran with guest RAM on
4 KiB pages; on 7.2 and later the VM starts as before. README, docs/qemu.md,
docs/graphics-kext/design.md and docs/lessons.md say so.
A device loss's lines called a command buffer of the host's own just that,
with its encoders' kinds: no blit operand was recorded and no host image named,
so a report (issue 173, an RX 6600 XT whose lost command buffer was a host blit
or render at the display's start, its fault address in no rt range) could not
tell a window swapchain's image from an image of rt's own.
Objects now carry a role beside their guest id: the platform names a window
swapchain's image, and the host names the scanout's import, a presented
surface's texture and the display's view of it, the display colour's table and
ramps, the cursor's glyph, the overlay's image and a host read's target. In a
command buffer of the host's own, each encoder names its operands: a blit what
its copies read and what its copies, fills and mipmap generations write; a
render encoder the textures it binds. The list of command buffers in flight
says, for each of the host's own, what each encoder renders into, binds, reads
and writes, by role or guest id ("render into colour 0 a window's swapchain
image, blit from the scanout's import into a window's swapchain image"); the
oldest's attachments and lists name roles where there is no guest id; and the
line of a host command buffer lost in flight names its encoders the same way.
A window swapchain's clear at its retire, committed on rt outside the
platform's command buffers, is now on that list from before its commit until
its wait returns, named as such. It holds no index given back: the commit order
the platform's own indices wait on passes over it, as before it was listed.
Diagnostics only: nothing the guest or the C API sees changes, and nothing is
committed differently or at another time.
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.
vendor/qemu 695ad62c: one fact decides the guest RAM's pages, whether the
running kernel is Linux 7.2 or later (uname's release by its leading
MAJOR.MINOR, read once; one that does not parse counts as older), and the
backend logs one line saying which it took. 7.2 is the first release whose
udmabuf builds its scatterlist from the pages themselves (upstream
5bf888673e0d); 6.11 to 7.1 bind a large folio's pages wrong in amdgpu's
import, issue 185.
What users see:
- Linux 7.2 and later: as before the revert, the guest's RAM, and the
device's region and Shared pool, advised MADV_HUGEPAGE, and the RAM
collapsed into huge pages after its prealloc, with the collapse's line
saying how much of it went on them (what a host gets depends on its free
memory as the VM starts);
- below 7.2: all of it on 4 KiB pages at every shmem_enabled, no collapse,
and a line naming the kernel's release and "before 7.2".
docs/qemu.md's section and table say so, and docs/lessons.md's entry.
reims-ctl's note on prealloc is back as it was, true again on 7.2.
vendor/qemu 1a35b9fb: the reims-graphics device advises the RAM it maps from
the library's memory, the region (BAR 2) and each Shared pool piece,
MADV_NOHUGEPAGE as it makes it. ram_block_add advises a block from a pointer
MADV_HUGEPAGE, which took back the library's advice on those memfd mappings:
a macOS 26.7.2 guest's region on a Radeon 780M held 70 MiB of 2 MiB folios
after its boot at shmem_enabled advise (VmFlags hg, ShmemPmdMapped 71680 kB,
walk m3-max-74591), and RADV takes the region's pages as udmabuf dma-bufs, so
on Linux 6.11 to 7.1 its GPU writes would land on the wrong pages as issue
185's did. The host sees the region and the pool on 4 KiB pages.
docs/qemu.md's table and section say so.
vendor/qemu 51382c20: QEMU advises a shared file-backed RAM block of base
pages, the memfd reims-ctl gives every x86-64 VM on Linux, MADV_NOHUGEPAGE in
place of MADV_HUGEPAGE, before its prealloc. The host sees the guest's RAM on
4 KiB pages at every shmem_enabled, where before it was on 2 MiB pages at
advise (CachyOS's default), always or within_size.
The guest's pages reach host GPUs as udmabuf dma-bufs of that memfd, and Linux
6.11 to 7.1 build a udmabuf's scatterlist with an entry per page that names a
large folio's head page and an offset past the page. amdgpu's import walks
that table by DMA page and binds the buffer's pages after the first to other
pages, so the GPU's writes land in other guest memory: issue 185's guest
kernel memory overwritten on a Radeon 890M with Linux 6.18.59. Upstream fixed
udmabuf in 7.2 (5bf888673e0d); hosts on the LTS lines still run the old code.
docs/qemu.md's section says so, as do docs/lessons.md's entry, which now
names the cause, and reims-ctl's note on prealloc.
On Windows a picture whose cache's planes lie over Direct3D 11 textures lands
by a draw from the texture VA-API decoded it into. Where that draw fails, the
textures are cleared to the zeros they owe and the CPU's copy lands the
picture in them instead: read back, staged, and copied into the planes'
images. Nothing counted that: on Windows a plane in such a surface never
reaches the GPU copier, so rt-video-gpu-copy-declined counts only pictures
with no surface at all, and a failed draw showed only as the landing's info
line, the first of each kind.
Each picture not drawn is now counted as video-pictures-undrawn, so a
report's degradation counts say how many pictures took the CPU's copy after a
failed draw. The guest sees nothing new.
Move vendor/qemu to de738a41, which reverts 53e76630, the commit cbdac3b3e
moved it to: once the prealloc of reims-ctl's memfd has run, QEMU no longer
collapses the guest's RAM into huge pages, on any host, and its stderr no
longer has the "after MADV_COLLAPSE" line. Nothing turns it back on.
With the collapse, a user's x86-64 macOS 26.7.2 guest on the reims-graphics
device panicked 80 to 154 s into each of 5 boots, its kernel's memory
overwritten (issue 185; a Radeon 890M on RADV, Mesa 26.1.8, Linux 6.18.59).
The reporter's bisect put it on cbdac3b3e: the device with the collapse
panicked; the prealloc with the collapse skipped ran clean for 20 minutes;
the collapse with plain VGA in place of the device ran clean.
For users: guest RAM is preallocated as before, and is on huge pages only
where the host's transparent huge page settings give them at a fault,
shmem_enabled at advise, always or within_size. At never, most
distributions' default, the guest runs on 4 KiB pages, as before cbdac3b3e.
docs/qemu.md drops the collapse's row and section and says again what was
true before it. docs/lessons.md records the trap: the collapse was proven by
one boot to the desktop at each setting, which a fault minutes into use does
not show.
The bundle sends a render pipeline create with no vertex function, or a
compute create with no kernel (library 0, no name), where the device refused
the library the program's functions were to come from: the library is nil,
and so is each function made from it. The device counted each such create as
decode-bad-reference, the guest protocol error, so a boot's counts line read
as dropped work (25 a refused library in Steam's lab boots). The create names
no library id, so the device counts what it sees: a create naming no vertex
function or kernel, under decode-no-function, a DecodeError of its own.
The refused create's warn line now names the kind of create (render, mesh
render, compute), and its log kind is the why and that kind together, so the
first of each pair is written at warn and the rest are folded under a label
that names both on the repeated-lines line; before, every create of one why
folded into one count with only the first one's type.
What changes for the host's log: the counts line carries decode-no-function
where it carried decode-bad-reference for these creates, and the refused
pipeline create lines name their kind. The guest sees no change: each create
is answered refused as before. No test held the old count; the new test
holds the new one and the lines.
Moves the runtime to metal2vulkan development efd7dbcd4d, which holds
development db3a88526b and the Shared memory coherence form the owner chose
(A-narrow, Telegram 2963). SEMANTICS moves from 2302 to 2304 and ARTIFACT from
596 to 597 (RUNTIME stays 2550), so every host translates its guests' shaders
again once, and rt's stored artifacts and pipeline caches re-key.
What changes for the guest at this pin:
- rt's floor takes a device whose host-cached memory types are none of them
host-coherent. Shared storage lives in the first host-visible, host-cached
type a buffer can use, a host-coherent one first (2c4680acea, 31ca7f6779).
Such a device is one where Mesa's Intel driver over i915 runs a GPU with no
cache it shares with the CPU, as on a user's Intel Arc (Meteor Lake) laptop,
which rt refused with rt-refused-below-floor (Missing::MemoryType). It is
now made. On it, rt flushes the Shared memory a submission's command buffers
reach before it submits them. Before the host can see a command buffer's
progress (its status, a wait, its completed handlers, a shared event's
value), rt flushes then invalidates what the command buffer may write. It
also flushes around replaceRegion, getBytes and the named bytes of an
upload. A range a command buffer reaches only through an address or a
residency set, with no binding or declaration naming it, is neither
flushed nor invalidated there (rt's known gap). The commit after this one
forwards a render encoder's useHeaps, so a used heap's memory is among what
rt flushes. On a device with a host-coherent host-cached type, every GPU our
tests and boots run on, rt takes the same type as before, keeps no ranges
and makes neither call. metal2vulkan measured what that costs there
(efd7dbcd4d's message): +43.1 user-space instructions per command buffer
on a Radeon RX 7900 XTX's burst_2000 (job 74045), and 1.0062 on burst_2000
and 1.0115 on frame_5cb on a Radeon 780M (job 74046).
- A metallib of format 2.2, whose function entries carry no MDSZ and which has
no extended header (an older toolchain's precompiled library, such as the
one a game launcher's SDL2 renderer makes), is read (4bcb58dbb1, SEMANTICS
2303). rt refused it as Container(MissingTag), and every pipeline made from
it was dropped. Its functions, AIR 1.8 with the pre-LLVM-4 metadata and
typed-pointer records (METADATA_STRING_OLD, METADATA_KIND in the METADATA
block, METADATA_OLD_NODE, INBOUNDS_GEP_OLD, LOAD and CALL without their
types), now decode as LLVM 23.1.2's reader reads them (31b3470a3e,
a68c6633c2, SEMANTICS 2304), where each stopped at its first such record.
Lane steamfix's boot of the launcher's disk on these fixes (job
m3-max-73971, um870's RTX 3090) made all 61 of its libraries, the SDL2
renderer's among them, and all 25 render pipelines made from its functions,
with rt-refused-translation 0. A METADATA_KIND record with fewer than 2
operands, or with a kind id stated twice, is now malformed, as it is for
LLVM's reader.
- A compressed copy of whole blocks that ends past a level's edge, inside the
level's last block (the one 4 x 4 block of a level of 4 x 2 texels), copies
that block (9ddd0be2a4). That covers texture to texture, buffer to texture,
texture to buffer, replaceRegion and getBytes, and matches what Metal does
(measured on an M3 Max by metal2vulkan's probe
compressed_copies_of_small_levels). rt refused those copies as
Refusal::TextureRegion (rt-refused-ours), encoding nothing. A copy between
two textures whose regions stop at different edges is now Gap::TextureCopy
(rt-refused-gap), still encoding nothing. A size past the rounded edge stays
refused as TextureRegion.
- The rest of the range is metal2vulkan's validation, probes, conformance
cases, censuses and docs. Its deadbind deletions (the indirect-command
plumbing only its deleted runtime drove, and the Y'CbCr planes chain nothing
has made since its producer went) remove 51 records from api_signatures.tsv,
and this tree names none of them.
For the host: rt's Metrics gain five fields, the Shared memory flushes and
invalidates, their bytes and the calls that failed, all 0 on a host-coherent
type. The counts line carries them from the commit after next. No other API
this tree uses changed, no rt kind of refusal, gap or note is new, and no
dependency changed: the lock, in its stripped form, is unchanged. Our docs
that named the Shared type's flags follow (gpu/identity.rs, pool.rs,
docs/api.md), and rt_platform/copied.rs says which copies rt flushes on a type
that is not host-coherent.
Checks the move cannot reach: QEMU, the option ROM, the guest's kexts and
bundle and reims-ctl build nothing of the runtime. The video crate and its arms
call nothing the move changes, so their checks do not run. The table's row owes
no boot: the move changes no death the platform ends the process on, and on
every GPU we run, rt's floor answers as before and takes the same Shared type,
with no device info, GPU family or feature query changed. Only a device with no
host-coherent host-cached type sees the floor change, and no lab GPU is one.
The Windows tests on the mini run after the merge.
On a Linux host with Iris Xe Graphics (Core i9-13900H), a page that animates once
per display refresh shows about 30% of its frames a refresh late (untraced guest
walks, 27-33% in each). The host CPU runs the graphics threads at about 1.3 GHz
under its default power policy, and the walk-behind-encode form that could have
moved the take sooner did not reach its bar in a model of the traced walk.
Known-issues readers on Intel hosts should know what to expect.
docs/qemu.md's "Windows hosts: sound" now says what vendor/qemu 207be587
and 4d205af8 do: virtio-snd has the backend write each period as it comes,
and dsound holds 60 ms past DirectSound's write cursor. It says what the
old 92.88 ms held, why its sizing counted the timer twice, and the runs on
the mini: each replayed from every start phase, with the smallest reserve
any start needed (up to 58.0 ms busy at 60 ms), the clicks, and the fill at
a period's write (97.3 to 104.0 ms at the median, against 134.2). It also
gives the Linux host's run with the kick, and what the guest's players are
told of the latency: a constant 100-frame safety offset and no latency.
docs/known-issues.md says, for users, that sound comes about 0.1 s after
video on a Windows host, and why it isn't fixed yet. docs/lessons.md has
the trap: a margin sized as a spread plus one of its parts, and a run's own
start phase hiding its worst one.
On a Windows host, a guest's sound clicked 111 times a minute at rest and
172 times busy. After the dsound change it clicks none in either. The text
records how that was measured and the cause the traces showed: QEMU wrote
audio behind DirectSound's write cursor. It describes what the voice now
does, how the 92.88 ms reserve was sized, and the latency the reserve adds,
90 ms at the median. It also says why the first run after the change is
not counted: the host's timers were slow before QEMU started.