Skip to content

Release 1.90.0 - #162

Merged
DrogaBox merged 42 commits into
mainfrom
release/1.90.0
Nov 26, 2026
Merged

DrogaBox merged 42 commits into
mainfrom
release/1.90.0

Conversation

@DrogaBox

Copy link
Copy Markdown
Owner

Everything that was built since 1.89.0, for one release. The AMD kexts stay at 3.42.0.

What's in it:

Left out: the instructions-per-second line. It reads low whenever another part of the app polls the kext between samples, so it needs the kext to report its window length first.

Local checks: ./build.sh --test passes (35274 checks). GPU/tests/run.sh passes except the MPEG-4 VideoToolbox pick test, which fails only because this Mac has the MPEG-4 plug-in installed system-wide. The JPEG kext host tests pass with the KDK and Mesa. Nothing new was run on the card for this PR.

Droga added 30 commits November 22, 2026 18:01
Stage and verify the GPU payload before root runs it, and refuse /usr/local/libexec when another user can change it.
The scripts decide by their own path whether they run from the app. The
staged copy lives in /private/tmp, so pass the original folder in
GPU_APP_ROOT and use it for that choice and for the Terminal hint.
The release build compiles the pinned digest of the GPU parts'
SHA256SUMS into the installer. Root now compares the staged list with
that digest before checking any file it names. A development build has
no pin, so it says the list is not pinned instead of trusting it.
stage_package and $STAGE_PKG live in GPU/install/encoder.sh, not in
encode/scripts/install.sh.

(cherry picked from commit f82ad087811523427e56c89cd4577d4c7d468fbf)
A VideoToolbox plug-in for 'jpeg' and 'dmb1'. It is the VP9 plug-in's
VideoToolbox side with the VP9 parts taken out, over a backend that hands
each picture to the apps build of the VCNJpegProbe kext through the AMD
accelerator's video context (selector 258), which any process that decodes
video may open.

Off: ./build.sh builds the bundle only with VCN_JPEG=1, and no installer
puts it anywhere. Nothing of it has run on the GPU.

- jpeg/jpegprep.c rewrites a picture into the shape Mesa gives the block
  (SOI, DQT, DHT, SOF0, SOS, scan, EOI), adds Annex K's Huffman tables for
  Motion JPEG without them, and refuses what the block is not given
  (progressive, 4:2:2, 4:4:4, grey).
- jpeg/vcnjpeg.c: session, picture into an NV12 full-range buffer (BT.601).
- tests: plugintest with -DTEST_JPEG, and jpegtest (the preparer against
  ImageIO, 40000 damaged copies, the session against a made-up kext).
…ntext

A video context answers no selector until it is connected to a shared
user client (type 6) of the same task: IOConnectAddClient ->
IOAccelContext2::connectClient -> contextStart. Type 3 alone returned
kIOReturnNotReady on hardware. ja_iokit_open now opens both and connects
them; ja_iokit_close closes both.
…ox test

The JPEG 2.0 block has no output-format register: the sampling in the frame
header decides. As Mesa does on this block (radeon_dec_jpeg_check_format),
0x221111 is written as NV12 and 0x211111 (webcams), 0x221212 (FFmpeg) and
0x222121 as one packed YUYV plane. jpegprep takes the three 4:2:2 forms,
vcnjpeg hands 4:2:2 pictures to VideoToolbox as '422f' (the YUYV split on
the CPU) and 4:2:0 ones as '420f'; the session attributes list both.

tests/gpu/vtjpegtest registers the bundle in its own process only, asks for
exactly that decoder and compares every frame with FFmpeg (-apple runs the
same check with Apple's software decoder, on the CPU). tests/gpu/mkmjpeg422
writes Motion JPEG with the webcam sampling, which neither FFmpeg nor Apple's
encoder writes.

Run on an RX 6800 XT (macOS 26.7.3, VCNJpegProbe apps build): 1280x720, max
difference 1 against FFmpeg in all four runs; 4:2:0 jpeg 3.79 ms a frame
(PSNR 74.7 dB), dmb1 3.98 ms, 4:2:2 FFmpeg form 4.59 ms, webcam form 4.56 ms.
…ault)

Apple's AMDRadeonX6000HWLibs carries the driver of the Navi 21 JPEG block
but never creates its queue. VCNJpeg (jpeg/) is the product side of the test
kext that decoded through it: the queue and one block of buffers (128 MiB,
vcnjpegpool=8..128) are made inside startMMEngineQueues, the only time the
GART bump pointer allows it, and given back in stopMMEngineQueues.

Programs reach it through selector 258 of the accelerator's video context;
only requests with its own header are taken, the rest go to Apple. The block
is powered only while pictures arrive: PowerPlay client 21 and the queue
start with the first RUN, and a thread_call gives both back two seconds after
the last request (idle_logic.hpp). A timeout or a damaged guard stops the
decoder until the next restart.

It checks the LC_UUID of AMDRadeonX6000HWLibs and AMDRadeonX6000 (26.7.3,
25G342) and the place and first bytes of the 20 functions it uses, and uses
lilu.onKextLoad (no Force call). No sysctl, no root user client.

Tests (jpeg/tests/run.sh): the commands, the door with sanitizers and 300000
random requests, the power rule (a 30 fps stream powers the block once and
never off between frames), and the Apple and Mesa oracles when the KDK and
Mesa are given. tests/run.sh builds the kext twice to the same bytes and
compares its table with the running Mac's driver. Nothing has run on a card.
…oder

JPEGVCNDecoder.bundle is no longer behind VCN_JPEG=1; it goes to the VCNJpeg
kext (jpeg/). At session start it refuses, so that VideoToolbox picks Apple's
software decoder, when the kext's decoder is stuck or has no queue or
buffers (the INFO state bits, now JA_STATE_* in jpeg_app.h), and when the
session's size does not fit the kext's picture buffer (vcnjpeg_fits).

vtjpegtest -system decodes through whatever hardware decoder VideoToolbox
picks, the installed plug-in, without asking for our DecoderID.

Formatting of decode/jpeg and its tests with tools/format.sh.
install/jpeg.sh puts VCNJpeg.kext on the EFI or takes it off (efikext.zsh,
like sensors.sh) and checks the macOS build against the new "jpeg" column
of validated-builds.json (25G342: untested-on-gpu; check_lists.sh allows a
value other than false only for the build of jpeg/kext/hwlibs_expect.hpp).
decoders.sh --jpeg (VCNVT_JPEG_DECODER=1) adds the JPEG plug-in, and an
install without it takes off one an earlier install left; install.sh
--with-jpeg does both. check.sh shows the JPEG kext where it is built or
runs; undo.sh takes it off; kextentry knows VCNJpeg (MinKernel 25.0.0).
The loader kext lists the JPEG plug-in like the other five.

The package carries the plug-in and the kext only with VCNVT_JPEG_DECODER=1
(tools/package.sh, Tools/build-gpu-assets.sh). Docs: jpeg/README.md,
install/README.md, macos-updates.md, testing.md, CHANGELOG.
The zip carried the old install/ scripts and validated-builds.json. Rebuilt
with Tools/build-gpu-assets.sh, without VCNVT_JPEG_DECODER: the DMG carries
no JPEG plug-in or kext, only install/jpeg.sh. SOURCE_DATE_EPOCH of the zip
before (1795550629), so the sensors and encoding kexts and the AV1 and VP9
plug-ins are byte-identical to it; the loader kext changes (it lists the
JPEG plug-in) and kextentry knows VCNJpeg. New pin of its SHA256SUMS in
Tools/make-dmg.sh.
Checked from the 26.7.4 release candidate installer, before updating:

- VCNEncodeFloor: AMDRadeonX6000HWLibs F8070234-57B0-3107-AC79-F3AA1C816072
  and AMDRadeonX6800HWLibs C3C1D191-CC3D-38F3-BBBE-2F99B74FE0F1, routed by
  symbol (_PEM_CWDDEPM_PMRequest still exported, same code as 26.7.3).
- vcnencodefix: AppleGVAHEVCEncoder 01F6B94A-A77D-3549-B18B-CBA81F4630B3
  (code byte-identical, site 0x13601, cave 0xE78) and AMDRadeonVADriver2
  F7D8F584-9EC1-39DB-857C-769697294957 for the preset and hevc10 tables.
- Decoders: the same driver UUID in both kValidatedDrivers lists and
  25G422 in validated-builds.json as untested-on-gpu. The driver was read
  from the installer's cryptex (rawpatch): 2760/2760 functions identical to
  26.7.3, only an Apple build path in __cstring differs.

Not run on a card on 26.7.4.
- jpegprep: a sample that ends in fill bytes (0xff 0xff, no EOI) made the
  fill loop stop at the last byte and read one past it. Refused now.
- vcnjpeg: the picture buffer was sized from the frame's SOF before the
  kext saw it, so a frame of a few hundred bytes saying 16384x16384 made
  the decoder process allocate about 400 MB. A picture larger than the
  kext's buffer is refused before anything is allocated or sent.
- the scan must name the frame's three components in the frame's order,
  and the frame's ids must differ (T.81 B.2.3): checked in jpegprep and,
  since any process can reach the door without it, in the kext's
  parseStream too (new Stream::BadScan).

Each has a test (jpegtest, cmds_test); the first two fail on the code
before.
…ix mode 1

- on_picture never sends a B-VOP whose TRD is 0 (direct mode divides by
  it), also with VCNMPEG4_ALLOW_B=1; it fails as a missing reference.
- The VOL block and the decode block carry the size aligned to 16, as
  Mesa's radeon_create_decoder does for MPEG-4 (mesa-25.0.0): 1920x1080
  goes out as 1920x1088. Nothing changes for sizes that are multiples
  of 16. The pictures keep the real size.
- vcnmpeg4_matrix_mode is gone: mode 1 sent the transposed matrix in
  zigzag order, the order that gave 23-27 dB on MPEG-2. Matrices always
  go in stream order.
- vcnmpeg4_cut_mode (VCNMPEG4_CUT in decode_legacy), for experiments:
  1 sends each VOP from its start code, without VOS/VOL/GOV in front.
- layertest covers the MPEG-4 layer (B refusal, TRD 0, block mode 3,
  cut mode, aligned session); legacyparse covers the alignment and
  block mode 3.
The kext takes a raised GFX minimum (OD8 id 1) with the rest of the OD8
state, through the same 0xa1 call and the same owner rules and way back.
It is taken only inside the card's own 0x9f range for id 1 and never above
the GFX maximum of the same state (the driver's FMIN <= FMAX rule); anything
else is refused as GfxMinRange (12). It keeps the clock up at idle, so it is
taken only while the watchdog has fresh readings, and the watchdog's 95 C
and missing-readings rules hold it while it is held.

Channel version stays 2: setOd8 also takes 14 scalars (the 13 of 0.7.0
still work), status flag 512, held bit 16, and OD8WriteState publishes
GfxMinHeld and Takes. gpucontrol gains "gfxmin MHz" for hold and check.

The app shows a GFX minimum clock section under the maximum in Settings >
GPU control, only when the kext publishes Takes with the minimum, and
remembers it with the rest of the OD8 state. The curve rules copy and its
fixture cover the new check; the first 100 fixture lines are unchanged.

Not added: the memory maximum (its 0x9f minimum is the stock 2000 MHz on
the RX 6800 XT, so nothing is lower, and a memory clock change blanks the
display) and the fan minimum speed and target temperature (the driver does
not offer them while it offers the fan curve).
Any process may reach the kext's door (VideoToolbox runs the plug-in in
whichever program decodes Motion JPEG), so instead of picking programs the
door now limits how one client holds the decoder:

- a client is its video context and its pid: a context freed and another
  allocated at the same address by another process no longer inherits the
  buffers (and the previous picture); RELEASE checks the pid too
- one turn lasts at most 5 s in all, however often the owner asks; the
  process that held it that long waits 2 s before it may take it again
- a client turned away with BUSY gets the next turn (kept 50 ms; the
  plug-in asks every 2 ms), so the one that just finished cannot take it
  back first
- only the owner's requests keep the block powered
- when a turn ends the JPEG is cleared as well as the picture: if the block
  ever reads past the write pointer (RB_SIZE is 0xfffffff0, as in Mesa;
  not tried on the GPU), it finds zeros, not another client's JPEG

Restart intervals stay as they are: the block reads DRI from the stream,
as Mesa gives it (vlVaGetJpegSliceHeader writes it, no IB register in
Mesa either). Noted in the README with what is still untried on the GPU.

apps_test: 18 new checks (other pid at the same address, the next turn,
the 5 s limit and the wait after it, refused requests do not keep the
block on, JPEG cleared, driver stop forgets every client).
Resolve the decoder test list after the HDR attachments change: the JPEG
plug-in test builds with -Icommon too, and the colour tests run only for
AV1 and VP9.
The OD8 state now also takes a lower GFX voltage (OD8 id 37, the
firmware's VddGfxOffset). Read end to end in the 25G342 driver: it is
offered with PP_OD8VoltageSliderSupport (the Navi 21 default) as a range
from the card's minimum to its stock value (881 to 1075 mV on the test
RX 6800 XT), the driver writes value minus the top as the offset of the
whole voltage curve and reads back top plus offset. The kext takes it
lower only, in 25 mV steps from stock, reads it back exactly, and sends
the stock value in every other call so no way back leaves an offset.

Two raises, only when the request asks for them and only inside the
card's own OverDrive range: a GFX maximum above stock up to the 0x9f
maximum (setOd8 flag 4), and a power limit above the start-up one up to
the start-up limit plus the card's power percent, cut at +15 % (set's new
3-scalar form; 261 W on the test card). One step past either maximum is
refused. Each raise needs fresh watchdog readings and is held under the
watchdog: 95 C or 10 s without readings puts stock back and turns
writing off (new WriteOff 16 for the power limit).

Not added: the memory clock and fast memory timings. Both start with an
IRI call (0x110018) that Apple's display glue does not implement, so the
driver cannot apply them on macOS.

Channel version stays 2: setOd8 takes 15 scalars too, set takes 3,
replies 21 and 22, Od8Check 13, status flags 1024 and 2048, held bits 32
and 64, VoltHeld, Takes 119, PowerRange CeilW. gpucontrol gains
"volt mV", "overclock" and "hold power W raise".

The app adds a GFX voltage section (it suggests stock minus 25 mV as a
starting point and never applies it by itself) and an Overclock section,
off by default, with no suggested values. A voltage or a raise is never
sent again by itself at launch. docs/GPU_CONTROL.md describes every
control, its range and its risks.

Tested on the host only: controltest 432 checks, the curve rules
fixture grew to 149 cases (the first 120 unchanged), ./build.sh --test.
Not booted.
…again

A user reports that with the AV1 and VP9 decoders a wake from sleep hangs
the Mac a while later, with glitches first, and that right after a wake a
VP9 video was red and broken in Chrome while Safari played it fine. His
log shows Chrome's decoder process keeping two VP9 sessions open across
the sleep, an AV1 session it opened after the wake never decoding a
frame, and the hang after the next wake.

Read in IDA (AMDRadeonX6000, 26.7.3 KDK): the kernel keeps a decoder's
video context across a sleep but stops the VCN rings before it
(systemWillSleep -> setSuspendResumeState(false)) and starts the engine
again at wake (powerUpHW, internalDidWake -> enableContext), restoring
only clocks and the power client; saveVCNSession is empty. Nothing tells
the program: AMDRadeonVADriver2, AppleGVA and VideoToolbox have no sleep
handling. AMDRadeonVADriver2 sends the engine a create-session command
when a decoder opens and a destroy-session command, waited for with no
time limit, when it closes.

So, in decode/common:
- vcn_sleep_mark: the time spent asleep since boot (mach_continuous_time
  minus mach_absolute_time) and kern.waketime. No notification: the
  decoder service's sandbox does not allow the user client
  IORegisterForSystemPower opens.
- vcn_session_lost: a session opened before a sleep writes nothing more
  into its bitstream pool and schedules nothing; its frames fail as a
  malfunction, so VideoToolbox makes a new session.
- vcn_session_close of such a session skips DeleteContexts,
  FreeBitstreamBufferPool and DeleteDriver and only destroys the
  accelerator, on the background queue; the kernel's close of the video
  context sends the engine nothing.
- vcn_session_open refuses while a session of the same process from
  before a sleep is still open, in any of the plug-ins (they ask each
  other through the local notification center): VideoToolbox decodes in
  software until those are closed.

AV1, VP9 and the legacy decoders call it. vtvp9test gets -renew and a
line per pass, vtav1test -loop and -renew, for a sleep test. New tests:
sessiontest section 12 and staletest (two plug-ins in one process), with
a made-up sleep. Not run on a GPU or across a real sleep.
At launch the remembered OD8 state was refused once with "the fan
watchdog has no fresh hotspot and fan readings" and never asked for
again. The kext's PMLog copy only moves when someone reads the
accelerator's PerformanceStatistics, and right after launch nothing had
yet. Now the app reads PerformanceStatistics right before every OD8
change and every raised power limit, and a remembered request refused
for missing readings is tried again every 3 s for 30 s. Real refusals
(out of range, not allowed, another program) are never sent again, and
the owner's own choices still show a refusal at once.

The remembered GFX voltage and the raised GFX maximum now come back at
launch too, the raise only while "Allow overclocking" is on (also
checked again after a wake). A raised power limit is still not asked for
at launch. Footers, docs and the changelog say so in every language.

The "Fan always on" switch only edited the fan editor's draft, which
went out with "Apply curve"; the voltage and clock controls sent the
held state without it, so the switch could read on while the kext held
zero RPM at stock. While a curve is held the switch now sends at once
with that curve.

gpucontrol status says "GFX max raised" for a maximum above stock and
shows a held voltage.

./build.sh --test: 34986 checks OK; concurrency gate OK.
The page can now keep a setup under a name and put it back in one click: a
power limit, or the whole fan, clock and voltage state. A profile saves what
the kext confirmed, together with the card it was made on (its PCI device id
and the limits the kext reported), in the app's defaults under one versioned
key. Names are trimmed and unique; a file from a newer build is left alone.

Loading goes through the same call the controls make, so every limit is
checked again: a profile made on another card still loads, and a value this
card does not take now is left out with a sentence under the list while the
rest of the state goes as usual. A raised GFX maximum, and a power limit
above the start-up one, need "Allow overclocking", as they do by hand. With
Remember on, a loaded profile becomes the remembered state once the kext
confirms it.

Profiles live in Settings > GPU control > Profiles: one row each with Load,
Rename and Delete, a checkmark on the one that matches what the card holds
now, "Save current settings..." asking for a name in a sheet, and a
confirmation before deleting. All strings in every language, a section in
docs/GPU_CONTROL.md and a changelog line.

./build.sh --test: 35195 checks OK.
- The fresh-readings read before a write now goes to the AMD accelerator
  only, so an Intel iGPU or another card that enumerates first can't
  swallow it and leave the kext refusing for want of fresh readings.
- A remembered retry that a sleep cut short starts its 30 s window again
  after the wake instead of running out during the settle delay.
- Picking by hand the exact value a remembered retry is asking for makes
  it the owner's: their refusal shows and the remembered filter no longer
  rewrites it.
- A remembered power limit above the start-up one is dropped while "Allow
  overclocking" is off, like a raised GFX maximum already was.
- The card id a profile records is read from the AMD card only.
- The line about the last profile loaded stays until what the card holds
  changes, instead of going away with the next status reading.
- The name sheet saves the name as typed, not the one it opened with.
On a kext build the curve rules were not checked with, a profile with a
fan state used to load nothing at all. Now the fan part is left out (and
named under the list) while the clocks and the voltage still go; only a
profile that is nothing but a fan state is refused.

A profile's line under its name lists the values ("A fan curve, a GFX
maximum of 2300 MHz…") instead of reusing the status sentence that starts
with "RyzenStatus is holding".
…to lists it

A VCNJpeg loaded by another config file (one picked in OpenCore for one
boot) was taken as installed, so the plan skipped it even though the
config.plist it installs to had no entry for it. The skip now also needs
the target EFI partition mounted, with the entry as expected and this
build of the kext. When that cannot be told before the password, the
install step looks; it changes nothing that is already in place.
Five made-up Macs in tests/install_plan.sh cover it.
…1.90.0

# Conflicts:
#	GPU/CHANGELOG.md
#	GPU/README.md
A session that finds the system slept since it opened now drops its old
driver objects without sending them anything, opens a new driver,
context and buffer pool in the same plug-in session, and drops frames
until a key frame. The sleep is also noticed when the wall clock runs
ahead of mach_absolute_time, and kern.waketime is read at most every
100 ms. Sessions from before a sleep no longer stop new ones from
opening; they are counted once per process for the log. The loss is
checked before a frame takes a picture slot.
…uilt at its next key frame

A real sleep test showed 0.3.6 failing every frame of the sessions open
across the sleep, while 0.3.5 kept decoding them correctly. The AV1 and
VP9 sessions now keep decoding after a sleep and replace their driver
objects at the next key frame that refreshes every reference, with no
frame dropped. Only when the old session fails after the wake is it
rebuilt at once, dropping frames up to a key frame. A command on the old
session may take 15 s before it is given up on. -12911 is left for a
rebuild that fails.
Droga added 12 commits November 26, 2026 00:03
26.7.4 also goes into the MPEG-2, VC-1 and MPEG-4 driver list (same
driver code as 26.7.3) and gets the legacy and jpeg keys that came after
the branch: legacy untested-on-gpu, jpeg false.
When gpucontrol hold kept the OD8 state, the GPU control page said
another program had the control. The kernel names the process behind
each user client (IOUserClientCreator), so the app now looks at the
clients of the sensors kext: when every one but the app is the
gpucontrol it installs (its path and signature), the page says so, with
the plain symbol and no "changed by another program" notice. Anything
else attached is still another program.
It says whether GPUSensors.kext is loaded, its version, and whether it
found a supported card. It is informational and never FAIL: without
the kext, or with a card it does not support, the row is UNKNOWN and
neutral, because the CPU probes do not depend on it. The card check
uses GPUControlStatus.hasNoSupportedCard, which main already has.
Decoders 0.3.7 now lists everything since 0.3.5: the colour and HDR
metadata, the optional MPEG-2, VC-1 and MPEG-4 decoders, the MPEG-4
guards and the sleep rebuild. JPEG decoder 1.0.0, GPU sensors 0.9.0,
the encoding fix 1.3.0 and the macOS 26.7.4 lists are marked for 1.90.0.
- App 1.90.0 (163); Hardware Validation expects app 1.90.0. The
  AMD kexts stay at 3.42.0.
- GPU-Package.zip rebuilt from da655f8 with SOURCE_DATE_EPOCH
  1795608000 (2026-11-25 12:00 UTC), with the JPEG decoder and the
  MPEG-2, VC-1 and MPEG-4 decoders in it (both still installed only on
  request): decoders 0.3.7, encoding fix 1.3.0, GPU sensors 0.9.0,
  VCNJpeg 1.0.0, loader 1.1.0. New GPU_PAYLOAD_SUMS_SHA256 pin.
- CHANGELOG for 1.90.0.
The check wanted the power limit text above the first release heading,
which is true only until a release takes it. It now looks above the
second heading: the newest release, or before it.
Staging the parts as root called /usr/bin/chown, which does not exist on
macOS, so every install that staged a package stopped there: the
encoding fix from install.sh, and every action of the installer window.
Both places now use /usr/sbin/chown.

A test now checks that every absolute command path in GPU/install,
GPU/encode/scripts and the installer app exists on the Mac that runs
the tests.
…ders

The guided install had only the encoding fix and GPU sensors boxes, so
on a Mac with the JPEG decoder or the MPEG-2, VC-1 and MPEG-4 decoders
an install took them off. Two new boxes, JPEG and MPEG-2, VC-1 and
MPEG-4, start ticked when that part is on this Mac. The check, the
guided install and the decoder and loader buttons all follow them, so
a kept part is no longer listed as left over.

An ordinary update no longer looks like an error. The summary at the top
says in one line whether an update or an install is ready, what to click,
and that the Mac restarts once; red is left for what the person has to
fix. A decoder check that only waits for the loader the guided install
puts in shows as part of the update. The rows have plain names and
states, and their checks start folded. Files left by earlier versions
are one neutral line with the list under Details. The plan sheet lists
the steps in plain words, what is kept as it is, and the restart; what
install.sh printed is under Details.
Same build as before (SOURCE_DATE_EPOCH 1795608000, JPEG and MPEG-2,
VC-1, MPEG-4 decoders in the parts), from 101b8e8. New pin.
@DrogaBox
DrogaBox merged commit 7c9d10e into main Nov 26, 2026
4 checks passed
@DrogaBox DrogaBox mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants