Repository navigation
Conversation
Apply one shared ScreenCaptureKit pixel-integrity policy to both one-shot and persistent single-window capture paths so transparent shadow margins cannot flatten into black JPEG or HEVC pixels. Fixes BasedHardware#11207 Failure-Class: FC-transparent-capture-flattened-without-backing
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Thanks @aryanorastar — well-scoped fix for #11207, and sharing one policy across both capture sinks is the right shape. File by file:
Two things before merge:
Leaving for human maintainer review: the stored-frame verification needs someone with the TCC-authorized app bundle. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
The scope hint named desktop/macos/Desktop/Sources/VideoChunkEncoder.swift, which does not exist; the encoder lives under Rewind/Core/. Failure-class prepare matches hints with fnmatch, so the hint could never fire — the class would stay unsuggested on exactly the future encoder change it was written to catch. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Pushed 8bfb6b3 — cubic's scope-hint path was right, and the root-cause question deserves more than a re-run, so I traced both of #11207's candidates in code first. Hint fix. On root cause. I could not run a capture — same TCC gate — but both mechanisms #11207 names are decidable from the source, and one of them is now ruled out: The encoder canvas is not it. context.draw(image, in: CGRect(x: 0, y: 0, width: width, height: height))That is the full canvas rect with no aspect preservation, so a frame whose aspect no longer matches the chunk is stretched, not padded. The 20% "Point-derived size" alone is not it either. What that leaves actually supports this PR, though it credits a different line than the description does. Before the fix, the captured surface is the window plus its shadow framing. That region is both transparent — flattened to black by the JPEG/HEVC sinks, the mechanism this PR names — and larger than This makes the manual check discriminating rather than just before/after. The SDK header defines
That is inference from the header wording plus the sources, not a capture, so it is a prediction the physical test can falsify rather than a claim that it holds. On CI: agreed the two red checks are |
kodjima33
left a comment
There was a problem hiding this comment.
Desktop bug fix (owner-override fast lane): Rewind single-window captures leaked shadow/transparency into opaque JPEG/HEVC sinks producing black bands (#11207), confirmed distinct from prior chrome-layout fix and still present on main. Trusted contributor aryanorastar, small scoped diff, tests added.
What changed and why
Fixes #11207.
Rewind's single-window capture paths allowed ScreenCaptureKit's transparent shadow/framing pixels to reach opaque JPEG and HEVC sinks, where those pixels were flattened into the wide black band stored on disk. This PR adds one shared pixel-integrity policy for both the one-shot screenshot path and the persistent window stream: exclude single-window shadows and ask ScreenCaptureKit to back any remaining transparency with opaque white before encoding.
This follows ScreenCaptureKit's documented contracts for
ignoreShadowsSingleWindowandshouldBeOpaque.Product invariants affected
none
How it was verified
xcrun swift test --package-path Desktop --filter 'ScreenCaptureDimensionsTests|WindowCaptureStreamPolicyTests|WindowCaptureFrameSinkTests|ScreenCaptureWebPTests'— 25 tests passed, 0 failures../scripts/swift-format-wrapper.sh lint Desktop/Sources/ScreenCaptureService.swift Desktop/Sources/WindowCaptureStreamEngine.swift Desktop/Tests/ScreenCaptureDimensionsTests.swift— changed Swift files passed the pinned formatter../scripts/swiftlint-wrapper.sh lint— 1,633 files linted, 0 violations.python3 scripts/check_desktop_test_quality.py— test-quality ratchet passed.make preflight— repository PR contracts passed.A full named-bundle capture comparison is tracked as the final manual proof because macOS Screen Recording permission is TCC-gated per bundle identity.
Tests
ScreenCaptureDimensionsTests.testSingleWindowCaptureConfigurationProducesOpaqueContentWithoutShadowFramingconstructs the real productionSCStreamConfiguration, applies the shared policy, and verifies that shadow framing is excluded and the output is opaque. The same helper is called by both one-shot and persistent capture engines.Failure class (fixes)
Failure-Class: new
Failure-class transition narrative (only when needed)
Violated contract: capture pixels that may contain alpha cannot cross into opaque persistence formats without an explicit backing policy; otherwise transparent framing becomes stored black content.
Canonical guard: both single-window capture engines now call one shared ScreenCaptureKit configuration primitive that excludes shadow framing and requests opaque backing, with a behavioral regression test against the real configuration object.
Evidence: issue #11207 measured the corruption inside the stored image rather than in presentation layout, and the production paths persist those capture frames into JPEG/HEVC formats that cannot preserve alpha. The new
FC-transparent-capture-flattened-without-backingregistry entry records this boundary for future capture sinks.