Repository navigation
1.90.1: decoders 0.3.9, GPUSensors 0.9.3, installer fixes - #163
Merged
Merged
Conversation
1.90.0 called /usr/bin/chown in the install path. macOS has no /usr/bin/chown (it is /usr/sbin/chown), so the copy step failed after the password and every install stopped there. Nothing looked at those strings before the disk image went out: they are text in scripts and in the installer window, and a machine never complains about a path it has not run yet. tests/command_paths.sh reads the files that run as root (install/*.sh, common.zsh, the C helper) and the installer window, takes every absolute path they name under /bin, /sbin, /usr/bin, /usr/sbin and /usr/libexec, and requires each to exist and be executable. A path written as "/usr/local/bin/gpucontrol" is not read as "/bin/gpucontrol", paths built at run time from a variable are skipped because there is nothing to check, and a comment naming a missing command fails too, which is the right answer for a comment about a command. It is in the list tests/run.sh asks before a disk image is built, and CI runs it as its own step, so the class of bug fails in a PR instead of on someone's Mac. Run against the 1.90.0 line it reports the shipped call as "bad:2: /usr/bin/chown"; against this branch's 140 command paths, all are there.
…d off The installer decided whether the loader kext is needed from two boot arguments: amfi_get_out_of_my_way, and -amfipassoff or -liluoff. The app already knew that amfi=0x80 turns AMFI off as well — it is what Sources/RyzenStatus/Core/Permissions.swift reads — so a Mac booted that way was told nothing lets the plug-ins in and the loader kext was needed, although nothing was in their way. Both questions are now answered the way the app answers them: a boot argument with or without a value, -name or name, 0x80 read as hex and 128 as decimal, and a switch with no value counting as 1. A switched-off AMFIPass is also recognised when the switch carries a value (-amfipassoff=1, and amfipassoff=1 without the dash), the form Lilu's own parser takes; before, only the bare dashed form was seen. The two inputs can be stood in for in a test (VCNVT_BOOT_ARGS and VCNVT_LOADED_KEXTS), and tests/amfidetect.sh reads the whole matrix through them: AMFIPass loaded and switched off (this Mac's arguments), loaded and running, not loaded, -liluoff, the dashed and undashed value forms, and amfi_get_out_of_my_way with 0, 1 and no value next to amfi=0x80, 0xFF, 0x7F, 1 and 128.
The window said "enter your administrator password when asked" while it was building the install plan, which runs as the user and asks for nothing. The running step now says whether it takes the password, and only those steps say so; the plan's own line just shows what it is doing. The changelog listed the encoding fix's builds as 15.8.2, 26.7.2 and 26.7.3, while the list the installer checks (install/validated-builds.json) turns the fix on for 14.8.9, 15.8.2, 15.8.3, 26.7.3 and 26.7.4 and off for 26.7.2. It now names those. The installer's new JPEG and MPEG-2, VC-1 and MPEG-4 boxes were not mentioned at all: they are now one line saying they start ticked when that part is on this Mac, so an update keeps it. tests/run.sh failed on a clean clone in legacypick, and not because of the plug-in. The test registers the plug-in with VTRating 400 so VideoToolbox picks it over Apple's MPEG-4 decoder; on 26.7.3 that is below what answers, so another decoder took the Simple profile stream, ours was never asked, and the two checks about who gets it failed. The plug-in is registered with 2000 now, above the decoder it has to beat. The check for the fallback also stopped requiring that the decoder taking over be Apple's and be software: on 26.7.3 the one that answers calls itself hardware accelerated, which is not ours to decide. What it checks is that a session starts and that our plug-in was not the one used.
The driver reads the PMLog only when someone reads the accelerator's PerformanceStatistics, so with nothing polling, the kext's copy aged out and the fan watchdog refused a curve or a raised clock with "no fresh readings". While a fan curve, an OD8 state or a raised power limit is held, the worker now asks the library for the same reading itself, once a second, through the power management object the driver used: one PEM_CWDDEPM_QueryPMLogData call, which is one PMLog query of the power firmware, the message a read of the statistics sends. It stops as soon as nothing is held, never samples while asleep, and after a wake it only uses an object the driver itself read with since that wake. Keeper and KeeperState are published next to the readings, and the app's checked releases gain 091.
The switch previewed only the two fields it builds, so with a curve held under raised clocks or a lowered voltage it got a verdict on a state the card never receives. It now previews the whole state the controller sends (the held settings with the new zero RPM field), and when that is refused it shows the refusal next to the switch, in the page's words, instead of staying silent while the switch moves. CHANGELOG.md and docs/GPU_CONTROL.md say, for users, that the switch applies at once while a curve is held. Reading the accelerator before an OD8 write walked three class names of which two name no service at all (one spelled AmdRadeon..., the real name is AMDGraphicsAccelerator; AMDGPUAccelerator does not exist), so freshen() returned without reading and the driver's counters were never refreshed by it. It and the accelerator cache now use the class every RX 6000 accelerator inherits, with the cache keeping IOAccelerator as last fallback.
A review of the 0.3.7 sleep work found five things to fix; this commit is those five. A sleep that lands inside a decode call no longer kills the session. The timeout is measured on a clock that stops while the machine is asleep, so the frame that was on the GPU when it slept times out right after the wake, and nothing looked at the sleep again: 0.3.7 stopped the session with -12911 there. Both codecs now ask the session again in the timeout branch and take the same after-wake path as any other failure, so the frame is dropped with no error and the frames up to the next restart point too. Two restart points are accepted, both of which a stream may send without ever sending a key frame: an AV1 intra-only frame that refreshes all eight reference slots (spec 7.2.2, 7.20), and a VP9 intra-only frame that refreshes all eight and resets all four probability contexts with reset_frame_context 2 (bitstream spec 6.2; 0.3.7 took only error-resilient mode and 3). The rules now live in the headers as vcnav1_is_restart and vcnvp9_is_restart, where a test can read them without a stream. The 15 s limit now covers the first command on the rebuilt session: right after a wake the engine can still take seconds, and 0.3.7 gave the fresh context the usual second, which could stop a healthy session on its first frame. The old accelerator is always closed on the teardown queue, never on the thread that decoded the key frame. The quiet path closed it inline, where the kernel's close of a video context can still wait after a wake. The replacement log line now says what the old driver objects cost (up to 96 MiB per replacement), so they are accounted for where they are left behind and not only when such a session is closed. A dead counter, rebuilds, is gone. The firmware-result rule is unchanged: what those values mean has not been checked on a GPU, so any nonzero result on a session from before a sleep still forces the replacement. sessiontest covers each fix. The same test file fails six times on the 0.3.7 tree (the sleep inside the call, the close on the decoding thread, the limit across the rebuild) and passes here, 81 checks for AV1 and 80 for VP9.
After a system sleep these three decoders stopped at the first picture: a session from before the sleep cannot take one, vcnlegacy_decode marked it broken, and every later picture failed as a malfunction, so VideoToolbox made a new decoder and the stream stopped. AV1 and VP9 stopped doing that in 0.3.8. A session from before a sleep is now replaced the same way, with one difference these three codecs need: the pictures up to the next intra picture are dropped instead of decoded. An I picture is coded from nothing before it in all three (ISO/IEC 13818-2 6.3.1, SMPTE 421M 7.1.1.3, ISO/IEC 14496-2 6.3.3), so it decodes the same in a session that has seen nothing, and it is where the codec layer closes the dead session and opens a new one. The host sees the stream carry on: no picture fails and no error reaches VideoToolbox. The pictures after that I which predict from the GOP before it — what a closed_gop of 0, or broken_link set, allows — are dropped too, until the new session has decoded the two references they need, instead of being drawn from a DPB it does not have. Only a sleep is rebuilt from: a driver call that fails, a command that does not finish and a firmware error stop the session as before. layertest now tells the codec layer its session is from before a sleep, and checks all of that for the three codecs: it fails 12 of its 24 checks on 0.3.8 and passes all 32 on 0.3.9.
0.3.8 let an AV1 intra-only frame with refresh_frame_flags 0xFF and a VP9 intra-only frame with reset_frame_context 2 start a session over after a sleep. Neither is a restart point: - AV1: refresh_frame_flags 0xFF on an intra-only frame is a conformance error (dav1d refuses it in strict mode, src/obu.c), so that branch could only ever take a broken stream. - VP9: reset_frame_context 2 resets only the context frame_context_idx names (libvpx vp9_setup_past_independence). The other three stay in the old driver's buffers, so a later frame reading one of them would decode on the new session's default probabilities: a wrong picture. The rule is back to 0.3.7's (a key frame; for VP9 also an intra-only frame that refreshes all slots with error_resilient_mode or reset_frame_context 3), kept in vcnav1_is_restart / vcnvp9_is_restart with the tests turned around.
The AMFI checks in install/common.zsh and install/decoders.sh are read by the installer's window and by the DMG, and both take those scripts from the zip the app carries inside. The zip in the tree was the one from 1.90.0, so the window would have shipped the old checks. Rebuilt with Tools/build-gpu-assets.sh on this Mac (71 files, with the JPEG and MPEG-2, VC-1, MPEG-4 parts as in 1.90.0; the pin is the SHA-256 of its SHA256SUMS); the decoders inside are 0.3.9, as they are in this tree.
Comparing pixels with a reference decoder needs the frames themselves, not only their MD5: -dump writes <dir>/f<N>_<W>x<H>.yuv, one tight I420 file per picture, and refuses to run without SVC_TEST_GO=1 in the environment so no stray script writes files from a decode on this Mac's card.
…y the slots of a failed frame The video engine predicts bit-exactly from a reference up to 2x smaller than the frame and not from a smaller one: vp90-2-22-svc_1280x720_3's 640x360 layer (320x180 reference) matches libvpx, its 1280x720 layer (320x180, 4x) does not. A picture that differs from the reference decoder is worse than no picture, so such a frame is refused as a stream failure and VideoToolbox falls back to another decoder. A frame that fails now also empties the slots it should have refreshed, in both the VP9 and the AV1 session code, so the frames that read them are refused with "missing reference" instead of decoding against older pictures. Ported from Izzy's commit 1caa8b41 "Decoders 0.3.6: refuse what the engine cannot do bit-exactly" (github.com/wh0ami7/vcn-video-decoders, branch macos-unique-functions-fixes), adapted to this tree's 0.3.9 session code and test layout. sessiontest-vp9 covers both rules against a made-up driver, decode/tests/mutants.sh checks that it fails on three damaged builds, and the test now also takes the spatial-SVC clip and the 2x scaled-reference clip. Measured on this Mac (RX 6800 XT, the installed 0.3.7): vp90-2-05-resize 10/10, vp90-2-06-resize 100/100 and vp90-2-13-mv-with-scaling 3/3 pictures match the official libvpx per-frame MD5, which covers scaled references up to 2x in both directions; vp90-2-22-svc_1280x720_3 is 0/20, the 4x case.
Rebuilt with Tools/build-gpu-assets.sh (VCNVT_JPEG_DECODER=1, VCNVT_LEGACY_DECODERS=1, SOURCE_DATE_EPOCH=1795608000): 71 files, the six decoders at 0.3.9. Against the previous package only the AV1 and VP9 decoders, VCNVTLoader (it carries their CDHashes), BUILD-INFO.txt and CHANGELOG.md changed. GPU_PAYLOAD_SUMS_SHA256 in Tools/make-dmg.sh follows.
Formatted, and the fallback to another decoder is marked as not checked. Same line count, so the built decoder does not change.
-amdpnopchk only concerns the CPU kext, not GPU changes. -amfipassoff and -liluoff turn AMFIPass off rather than relaxing library validation, so they mean the loader or amfi=0x80 is needed; the made-up internal CA option is gone.
shields.io computes both from the GitHub API on every view; the downloads total timed out (HTTP 408) and GitHub showed a broken image. cacheSeconds=86400 lets shields.io serve the last result.
- App 1.90.1 (164); Hardware Validation expects app 1.90.1. The AMD kexts stay at 3.42.0.
A GPU profile loaded a few minutes after a wake started the PMLog keeper, which called PEM_CWDDEPM_QueryPMLogData with the object stored before the sleep. Its pem[2] was NULL and the library faulted in PSM_IsIPState (kernel panic on this Mac, 2026-11-27). The object is no longer stored while the GPU sleeps, the stored one is dropped at every wake, the keeper refuses an object whose first three words are NULL, and the pointer is written before its sleep count and read after it. The app's checked releases gain 092.
Rebuilt with Tools/build-gpu-assets.sh (VCNVT_JPEG_DECODER=1, VCNVT_LEGACY_DECODERS=1, SOURCE_DATE_EPOCH=1795608000): 71 files. Against the previous package only GPUSensors.kext, BUILD-INFO.txt and CHANGELOG.md changed. GPU_PAYLOAD_SUMS_SHA256 in Tools/make-dmg.sh follows.
The keeper checks the power object right before the library call, the PowerPlay object is dropped at GPU teardown, and callCwdde refuses when the sleep or wake watcher did not route. None of them reproduces the panic; each keeps the invariant next to the pointer instead of relying on a flag elsewhere.
Rebuilt with Tools/build-gpu-assets.sh (same settings and SOURCE_DATE_EPOCH 1795608000). Against the previous package only GPUSensors.kext, BUILD-INFO.txt and CHANGELOG.md changed. GPU_PAYLOAD_SUMS_SHA256 follows.
The keeper called PEM_CWDDEPM_QueryPMLogData from the kext's own worker through the power management object the driver had used. The driver can clear that object while the call runs: two panics on 2026-11-27 came from PECI_UnlockPowerPlayOnly reading pem[4] as NULL after the lock succeeded, and no check made before the call can see a clear in the middle of it. The kext no longer calls into the library at all: sampleNow, keeperStep, their counters and the Keeper and KeeperState properties are gone, and the object is no longer stored. The hook that copies what the driver reads is unchanged, and 0.9.2's other fixes stay.
The kext no longer asks the driver library for a PMLog sample itself, so the fan watchdog has to be fed from the driver path. While the controller holds a fan curve, an OD8 state or a raised power limit it now reads the accelerator PerformanceStatistics once a second, which is the read that makes the driver sample; with nothing held the app keeps its present rate and does no extra reads.
checkedReleases is now 080, 081, 090 and 093: 0.9.1 and 0.9.2 are gone (both panicked the Mac on 2026-11-27 and neither was published), and the release this app carries is a constant next to the set. A loaded kext older than the package the app ships, or outside that set, now turns GPU control off in the page and in the service, with one short warning where GPU control lives: auto-update replaces the app but not the GPU package, so this happens to anyone who only updates the app. The warning is translated into every language the app has.
added 3 commits
November 27, 2026 04:08
The check had no state for a removal: uninstall deleted the install record and the kext kept running, so a check in the same boot reported it as installed, and the row fell back to whatever it said before the remove. sensors.sh now writes a removal record for the boot session and its check reports it as "pending": the row says removed, goes away after the restart, and drops the Remove button. The recheck after an action also kept the window at "checking" for good, which left the pre-action row on screen with its buttons disabled until a manual check. It now restores the phase the action finished in.
…t version tryRemembered and the reask filter sent values without checking the loaded GPUSensors build. Both now go through GPUControlKextGate: an outdated build gets nothing and the remembered setting is dropped until the next launch; a build that has not reported its version yet keeps the remembered setting waiting. The buttons and loadProfile also refuse while the version is unknown. backToStartUp and closeChanges stay ungated on purpose: giving a hold back is not a change.
Rebuilt with Tools/build-gpu-assets.sh (VCNVT_LEGACY_DECODERS=1, VCNVT_JPEG_DECODER=1, SOURCE_DATE_EPOCH=1795608000). Against the previous package only GPUSensors.kext, install/sensors.sh, sensors/README.md, BUILD-INFO.txt and CHANGELOG.md changed; same file list. GPU_PAYLOAD_SUMS_SHA256 follows.
- MPEG-2, MPEG-4 and VC-1: end_session resets ramping and dropped; the sleep rebuild still sets ramping right after it. - AV1 and VP9: a CreateContexts failure in the rebuild closes the session on the teardown queue, like the success path, never on the decode thread. - Fan section: the zero-RPM refusal note clears when a new read would let the same state go out. - sensors.sh uninstall: say what check misses when the record write fails. - GPUSensors: holdsAny comments say what is true (nothing calls it).
encoder.sh keeps the EFI-unmount trap next to the staging one and takes only diskNsM or auto for --efi; undo.sh skips the encoder step when OpenCore booted from a non-EFI partition instead of taking another EFI; the ACL checks also see entries with extended attributes; the 'done before it' list names every part; kext_uninstall drops the install record only after its last abort.
The teardown block keeps its own reference to the log; MPEG-2, MPEG-4 and VC-1 stop after 600 dropped frames with no intra picture after a sleep, like AV1 and VP9; the drop-later log line says the real reason; AV1 refuses a reference of another bit depth, like VP9.
A refused AV1 sequence header leaves the stored one as it was; a VP9 frame whose profile does not match the inherited bit depth is refused.
make-dmg.sh detaches only a disk image mounted at the volume path; build.sh and build-gpu-assets.sh take the producer's SIGPIPE status out of the pipeline.
A trap list set inside do_install/do_uninstall stopped at its first function call when an exit unwound through the function, so the staged package copy stayed in /private/tmp on every failed or interrupted run.
- Selector 15 copied CpuVid untouched: a lower VID asked for more core voltage than the firmware ever programs. It is now clamped to the firmware P0 VID, read once before the first write (undervolt still possible, and stock can be restored). - On wake, ITE register 0x29 is fed the real package temperature right away instead of on the next sensor tick. - A fan left in manual mode by a client that hangs without dying now gets the same 85 C guard the curve fans have, on every sensor tick.
routeFunction returned the trampoline after the jump was written, so a CPU entering the hook before gOrg was assigned called a null pointer. Lilu's routeMultiple stores the original first.
writePstate caps VID by the lowest VID among the firmware's enabled P-states and refuses the write when none can be read. The manual fan guard reads the chip's live mode and duty before deciding. The scheduler treats a route Lilu reports with its error code set as failed.
…og falls back to the default vcn_teardown carries why into the block that logs after the close, so a session dropped after a sleep is no longer called stuck or lost. os_log_create is checked in vcnlegacy, AV1 and VP9; the default log is never retained or released.
The test stub resolves symbols from a table and lets a test set what routeMultiple returns, whether it writes the original pointer and which error it leaves. hook_test runs ccdInstall on the three layouts: installed, route refused, original left null, and error set after a route that wrote the original.
…at in the P-state setup pmRyzen_init_PState leaves a P1 the firmware disabled alone, never makes P1 faster than P0 (the 0x10 floor could), and computes the FID and the step thresholds in integers. When P1 was not rewritten, set_PState never writes MSR_PSTATE_CTL, whatever limit the app sets later. The scheduler's mode 2 clears the original's processor hint when it returns another pset, as mode 1 does.
install.sh traps INT, TERM and HUP like encoder.sh and efikext.zsh: the EXIT trap alone does not run when the shell is killed by a signal, and efi_find_opencore mounts partitions to look inside them.
…p while the fan guard polls getKextGPUCount reads the count as a scalar output through safeIOConnectCallMethod. Selector 51 reserves eight scalar outputs on both paths. While the poll timer that carries the manual-fan thermal guard runs, the app holds a userInitiatedAllowingIdleSystemSleep activity so App Nap cannot coalesce it; it ends when the poll stops.
…last package (host tests only)
…fused uninstall, the removal record The old 'record after uninstall' check expected no record, but since 25514b2 sensors.sh uninstall writes an action=remove record on purpose.
The value joins the queue from the main actor before the call suspends, so writes reach the kext in the order asked. willWrite runs before the value leaves, so a lift asked for while a cap is in flight still goes out. stop() waits up to 750 ms for the lift; past that, clientClose lifts it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes on top of 1.90.0 (kexts stay at 3.42.0).
Not run on the card yet: the sleep behaviour, the PMLog keeper and the patched VP9 bundle (the 4x/2x numbers are from the installed 0.3.7).
Commits added since 15277bb (release/1.90.1 as it was):