diff --git a/docs/known-issues.md b/docs/known-issues.md index b6b197afe..e38dcaf79 100644 --- a/docs/known-issues.md +++ b/docs/known-issues.md @@ -127,10 +127,27 @@ exceptions: same way on a real Intel Mac, which came out at 5.7 times the bitrate asked in the same test. The video still plays back correctly. -An app can also set a hard limit on the bytes in any one second. In our tests at 1080p with -such a limit, the busiest second came out 1.7% to 3.0% over it, and every frame still played -back. A real Intel Mac stayed under the same limit, but we ran it with a keyframe every 30 -frames and ours with macOS's default spacing, so the two runs don't compare directly. +An app can also set a hard limit on the bytes in any one second. In our tests at 1080p, with +8 Mbit/s asked and a limit of 1,000,000 bytes a second, the busiest second came out 1.7% to 3.0% +over it, and every frame still played back. For HEVC, your GPU is driven by the same path of +macOS's encoder as a real Intel Mac's GPU, which codes a frame over again when it breaks the +limit. A real Intel Mac in the same test stayed under the limit in every second. + +## H.264 from Intel Mac guests doesn't hold a hard data-rate limit + +An app that encodes H.264 can set a hard limit on the bytes in any one second. When an app in an +Intel Mac guest encodes H.264 on your GPU, the limit is not acted on: on our AMD test GPU, the +video came out exactly the same with the limit as without it. In our tests at 1080p, with +8 Mbit/s asked and a limit of 1,000,000 bytes a second (the same as the bitrate asked), the +busiest second came out 18.3% to 19.4% over the limit on the AMD, NVIDIA and Intel GPUs we +tested, and more than half of the one-second windows were over. The video as a whole stays +within about 2% of the bitrate asked, and plays back correctly. + +macOS's encoder takes one path for a Mac's Intel GPU and another for an AMD GPU, and for H.264 +your GPU is driven by the AMD path. The Intel path codes a frame over again when it breaks the +limit. The AMD path plans each frame against the limit and doesn't code frames over. A real Mac +on the Intel path went 2.3% over the limit in its busiest second in the same test. We haven't +measured a real Mac with only an AMD GPU, so we don't know yet whether one holds the limit. ## Sound comes after video on Windows diff --git a/docs/video/bugs.md b/docs/video/bugs.md index a3899783a..762929d3d 100644 --- a/docs/video/bugs.md +++ b/docs/video/bugs.md @@ -125,10 +125,19 @@ Everything known to be wrong, untested or put off in the reims-graphics device's ### B100. An Intel Mac guest's HEVC under a hard data rate limit goes up to 3% over it in a second -- **What:** with `kVTCompressionPropertyKey_DataRateLimits` at 1,000,000 bytes in one second, 1080p, 300 frames at 8 Mbit/s and the plug-in's default keyframe interval (6 keyframes in 300 frames, 60 frames apart or closer), the most bytes in one second of the guest's stream came to 1.7% to 3.0% over the limit: Main 1,021,534 and Main 10 1,027,996 on an RX 7900 XTX, 1,017,335 and 1,021,809 on an RTX 3090, 1,029,488 and 1,029,273 on an Iris Xe. The plug-in coded 2 to 30 frames of each session again at a higher QP, each in place of the last, and every frame decodes back. -- **Evidence:** **measured**, 2026-11-27, m3-max-77611, m3-max-77609, m3-max-77627. A real Intel Mac's `hevc.gva` (a 2019 MacBook Pro, macOS 26.7.1) under the same limit kept it at a keyframe interval of 30: none of 271 one-second windows over, the most 957,229 bytes, 86.6% of the asked rate (**measured**, m3-max-77635). The two ran at different keyframe intervals, so they do not compare as equal. -- **Why it waits:** the retries and their QPs are the plug-in's, and no run has yet put the guest and a real Mac at one keyframe interval. It is to be read when a user reports an HEVC stream breaking its hard data rate limit. -- **Fix:** first the guest's and a real Mac's rows at one keyframe interval; then whatever separates them. +- **What:** with `kVTCompressionPropertyKey_DataRateLimits` at 1,000,000 bytes in one second, 1080p, 300 frames at 8 Mbit/s and a keyframe interval of 60 (6 keyframes in 300 frames, 60 frames apart or closer), the most bytes in one second of the guest's stream came to 1.7% to 3.0% over the limit: Main 1,021,534 and Main 10 1,027,996 on an RX 7900 XTX, 1,017,335 and 1,021,809 on an RTX 3090, 1,029,488 and 1,029,273 on an Iris Xe, the whole streams at 79% to 91% of the asked rate. The plug-in coded 2 to 30 frames of each session again at a higher QP, each in place of the last, and every frame decodes back. +- **Evidence:** **measured**, 2026-11-27, m3-max-77611, m3-max-77609, m3-max-77627. A real Intel Mac's `hevc.gva` (a 2019 MacBook Pro, macOS 26.7.1) under the same limit and keyframe interval kept it: none of 271 one-second windows over, the most 951,996 bytes (Main) and 965,808 (Main 10), 86.1% and 86.7% of the asked rate (**measured**, m3-max-77623); at a keyframe interval of 30, 957,229 bytes and 86.6% (m3-max-77635). The guest's HEVC encoder is driven by the same path of macOS's encoder as that Mac's, its Intel path, which codes a frame that breaks the limit over again: the guest's frames coded in place are those. +- **Why it waits:** the retries and their QPs are the plug-in's. The guest's busiest seconds lie later in its streams (frames 31 to 60, 91 to 120, 178 to 207, 181 to 210, 257 to 286), most of them holding a keyframe, where the Mac's is its first; and over its first frames the guest's QP holds at its first frame's for 8 frames or more (8 on the XTX, 8 to 9 on the 3090, past 14 on the Iris Xe) and then climbs one step a frame, where the Mac's climbs from the second frame (20, 23, 26, 28, 30). Neither has been read. It is to be read when a user reports an HEVC stream breaking its hard data rate limit. +- **Fix:** first why the guest's seconds that run over do, and what holds its QP over its first frames; then whatever else separates it from the Mac. + +### B101. An Intel Mac guest's H.264 under a hard data rate limit is not held: up to 19.4% over it in a second + +- **What:** with `kVTCompressionPropertyKey_DataRateLimits` at 1,000,000 bytes in one second, the same as the asked 8 Mbit/s, 1080p, 300 frames and a keyframe interval of 60, the most bytes in one second of the guest's H.264 stream (`h264.gva`) came to 1,184,706 (18.5% over) on an RX 7900 XTX, 1,183,347 (18.3%) on an RTX 3090 and 1,193,675 (19.4%) on an Iris Xe, with 150, 150 and 156 of 271 one-second windows over; the whole streams came to 101.8% to 102.1% of the asked rate. On the XTX the stream is byte for byte the one without the limit: the limit is not acted on, and no frame was coded again. +- **Evidence:** **measured**, 2026-11-27: m3-max-77530 (XTX), m3-max-77609 (3090), m3-max-77627 (Iris Xe); the same session without the limit, m3-max-77615 (XTX). A 2019 MacBook Pro (macOS 26.7.1), whose `h264.gva` is driven by macOS's Intel path, came to 1,023,426 bytes in its busiest second (2.3% over), 1 window of 271 over, at 97.2% of the asked rate (m3-max-77623). +- **What macOS's encoder does** (macOS 26.7.1): it runs the rate control itself and hands the driver a QP for each frame, on one path for an Intel GPU and another for an AMD GPU's driver; the guest's H.264 encoder on our device is driven by the AMD path (its HEVC encoder by the Intel path, B100). Both paths count the bytes each frame reports against each one-second window of the limit. The Intel path codes a frame that breaks the limit over again at a higher QP; the AMD path plans each frame against the room left and codes none over. On our device that planning changed no frame. The AMD path also reads back one more word of each frame's length record, which our driver leaves at 0: a lead for why its planning changes nothing here, and nothing more. No meaning is known for it, and it is not filled. +- **Why it waits:** the path is the one macOS takes for an AMD GPU, and no Mac with only an AMD GPU has been measured, so whether macOS holds the limit there is not known. Driving H.264 by the Intel path instead would change every H.264 session (that path's own parameter sets, and a quality for each macroblock), which is the owner's call. +- **Trigger:** a user report of H.264 breaking its hard data rate limit. +- **Fix, once triggered:** first a real AMD-only Mac's row under the same limit, if one is reachable; else the sizing of the Intel-path route, to the owner. ## Upstream bugs