Fix brightness races, display resource leaks, and DDC/build errors - #4
Merged
Merged
Conversation
Greptile SummaryThis PR improves display-state correctness, resource ownership, DDC communication, and build artifact validation.
Confidence Score: 5/5The PR appears safe to merge, with no accepted new findings or outstanding review issues provided for re-evaluation. The current head is identical to the previous review SHA, so there are no changes since the previous review that introduce a new actionable issue; the full diff also contains no confirmed repository-rule violations.
|
| Filename | Overview |
|---|---|
| MonitorControl/Model/Display.swift | Adds generation-based cancellation, balanced semaphore handling, main-thread ramp steps, and exact software-brightness endpoints. |
| MonitorControl/Support/IntelDDC.swift | Corrects I2C buffer lifetimes, preserves both bytes of DDC words, and closes IOKit ownership leaks. |
| MonitorControl/Support/Arm64DDC.swift | Releases traversed registry entries and temporary path storage while preserving ownership of returned entries. |
| MonitorControl/Support/DisplayManager.swift | Removes permanent retention of closed shade windows and explicitly controls AppKit close behavior. |
| MonitorControl/Support/XDREngine.swift | Stops and rolls back incomplete EDR setup before applying an XDR boost. |
| build/build.sh | Requires successful compilation, an existing bundle, and a valid final signature before reporting success. |
| build/test-build.sh | Adds isolated regression cases for partial builds, successful builds, signing fallback, missing artifacts, and invalid signatures. |
| .github/workflows/ci.yml | Runs build-script failure-handling regression tests in CI. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Brightness request] --> B[Increment request generation]
B --> C{Smooth request?}
C -- No --> D[Apply exact value]
C -- Yes --> E[Queue next main-thread step]
E --> F{Current generation and system active?}
F -- No --> G[Cancel queued ramp]
F -- Yes --> H[Apply bounded step]
H --> I{Target reached?}
I -- No --> E
I -- Yes --> J[Exact endpoint applied]
Reviews (3): Last reviewed commit: "Fix stale brightness ramps and Intel DDC..." | Re-trigger Greptile
Owner
Author
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.
A brightness restore after waking could overwrite newer user input. Repeated display discovery retained resources, Intel DDC replies lost their high bytes, and failed builds could be accepted as usable app bundles.
Validation: 22 XCTest tests passed with no reported runtime warnings, including stale-write, endpoint, cancellation, shade-deallocation, semaphore, and DDC-decoding regressions. All five build-script cases passed; the partial-output case reproduced false success before the fix. A universal Release build using Xcode 27 beta contains x86_64 and arm64 and passes deep, strict codesign verification. GitHub CI passed build/test and universal DMG jobs for c6a41c0.
Physical monitor adjustment and hot-plug behavior were not exercised. The Metal setup failure guard was reviewed and compiled, but that failure was not injected at runtime.