Skip to content

test(gpu): pin the win32-only fallback invariant the macOS Graphite fix relies on - #10646

Merged
nwparker merged 1 commit into
mainfrom
graphite-followup
Jul 26, 2026
Merged

nwparker merged 1 commit into
mainfrom
graphite-followup

Conversation

@nwparker

@nwparker nwparker commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up hardening for #10643. No production behavior change — one comment and one test.

Why

#10643 put the macOS disable-skia-graphite fix inside enableMainProcessGpuFeatures(). That function is skipped entirely when GPU crash fallback is active:

maybeApplyGpuFallbackForThisLaunch()
if (!gpuFallbackActiveThisLaunch) {
  enableMainProcessGpuFeatures()
}

This is correct today only because GPU fallback is win32-only. But that invariant is implicit and spread across two files and three redundant layers. If fallback were ever extended to macOS, Macs would silently lose the Graphite fix — the exact machines it targets — with no test failing.

Two independent adversarial reviews of #10643 flagged this same latent coupling as the one worthwhile follow-up.

What changed

  1. Comment at the call site (configure-process.ts) — states the coupling explicitly. This follows existing convention in the same function: IntensiveWakeUpThrottling already documents this identical hazard.
  2. Test for darwin (gpu-fallback-marker.test.ts) — the suite already pinned linux, but not darwin, so the platform relevant to the Graphite fix was uncovered.

Proof the test is real

I mutation-tested it rather than trusting a green run. Disabling all three platform layers in readActiveGpuFallbackMarker fails it:

× clears an active marker outside Windows
× clears an active marker on macOS so the Graphite fix is never skipped
  Tests  2 failed | 6 passed (8)

Worth noting: knocking out any single layer does not fail it, because the layers are genuinely redundant — marker.platform is written as 'win32', so the marker.platform !== environment.platform check independently catches a darwin read. That redundancy is defense in depth working as intended, and the test correctly pins the composed behavior rather than one line.

Verification

  • src/main/startup/ suite: 163/163 pass (22 files)
  • oxlint: clean
  • typecheck:node: clean

Risk

None to runtime behavior — the only non-test change is a comment. No perf or security surface is touched.

Made with Orca 🐋

…ix relies on

enableMainProcessGpuFeatures() is skipped while GPU fallback is active, and that
function now carries the macOS disable-skia-graphite fix (#10643). Today that is
safe only because GPU fallback is win32-only. Cover darwin explicitly and note the
coupling at the call site so extending fallback past Windows cannot silently strip
the fix from the Macs it targets.

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2feb0222-2881-4dba-a033-77f3e7f95d41

📥 Commits

Reviewing files that changed from the base of the PR and between 2e64677 and 5d25df8.

📒 Files selected for processing (2)
  • src/main/startup/configure-process.ts
  • src/main/startup/gpu-fallback-marker.test.ts

📝 Walkthrough

Walkthrough

Added explanatory comments to the macOS-specific GPU feature configuration path. Added a Vitest case that writes a GPU fallback marker, calls readActiveGpuFallbackMarker with platform: 'darwin', verifies a null result, and confirms the marker file is removed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, but it doesn't follow the required template sections for Screenshots, Testing checklist, AI Review Report, Security Audit, or Notes. Reformat the PR body to match the template and add the missing sections, including screenshots/no visual change, testing checklist, review report, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the PR's main change: hardening the GPU fallback invariant with a Darwin regression test and comment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit bc2bdfc into main Jul 26, 2026
3 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 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.

1 participant