Skip to content

FIX:default to WebGL over WebGPU on Linux - #934

Open
GtrujilloTS wants to merge 1 commit into
webadderallorg:mainfrom
GtrujilloTS:fix/linux-webgpu-export-crash
Open

FIX:default to WebGL over WebGPU on Linux#934
GtrujilloTS wants to merge 1 commit into
webadderallorg:mainfrom
GtrujilloTS:fix/linux-webgpu-export-crash

Conversation

@GtrujilloTS

@GtrujilloTS GtrujilloTS commented Sep 12, 2026

Copy link
Copy Markdown

Description

Changes the default render backend order for Lightning exports on Linux so that WebGL is tried before WebGPU, instead of the other way around.

Motivation

On Linux, the WebGPU backend (Dawn/Vulkan) can corrupt GPU resource imports for VideoFrame-backed textures partway through an export. This crashes PixiJS's WebGPU bind group system well after initialization has already succeeded, so the failure isn't caught by existing init-time checks. Defaulting Linux to WebGL avoids this instability until it's resolved upstream, while other platforms keep preferring WebGPU.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

N/A

Screenshots / Video

N/A — this is an internal backend-selection change with no UI impact.

Testing Guide

  1. npm test -- backendPolicy — covers getDefaultLightningRenderBackendOrder, which returns ["webgl", "webgpu"] on Linux and ["webgpu", "webgl"] on other platforms.
  2. On a Linux machine with a WebGPU-capable GPU, start an export and confirm it now runs on the WebGL backend by default (no explicit preferredRenderBackend override) and completes without the mid-export GPU resource crash.
  3. On macOS/Windows, confirm export backend selection is unchanged (WebGPU still preferred when available).

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Summary by CodeRabbit

  • Improvements
    • Updated Lightning export rendering to choose a platform-specific backend order.
    • Linux systems now prioritize WebGL before WebGPU.
    • Windows, macOS, and other platforms continue to prioritize WebGPU before WebGL.
    • Rendering automatically falls back to the next available backend when needed.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 437dbf71-0b68-4e88-85e5-6e391dacd410

📥 Commits

Reviewing files that changed from the base of the PR and between 7512ef1 and 6b59f8c.

📒 Files selected for processing (3)
  • src/lib/exporter/backendPolicy.test.ts
  • src/lib/exporter/backendPolicy.ts
  • src/lib/exporter/modernFrameRenderer.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The exporter adds platform-aware default backend ordering. Linux selects WebGL before WebGPU. Other platforms select WebGPU before WebGL. The renderer applies this order when no explicit backend preference exists.

Changes

Lightning backend order

Layer / File(s) Summary
Backend order policy and tests
src/lib/exporter/backendPolicy.ts, src/lib/exporter/backendPolicy.test.ts
Adds getDefaultLightningRenderBackendOrder. Tests cover Linux, Windows, macOS, and unknown platforms.
Renderer backend selection
src/lib/exporter/modernFrameRenderer.ts
Uses the normalized runtime platform to select the backend order when WebGPU is available and no explicit preference is set.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: webadderall

Merge Risk: ⚪ Minimal · up to 6b59f

The change is narrowly scoped, preserves explicit preferences and non-Linux behavior, and is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: preferring WebGL over WebGPU on Linux.
Description check ✅ Passed The description includes the required sections, explains the Linux-specific issue, identifies the bug-fix type, and provides testing steps for Linux, macOS, and Windows.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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