Skip to content

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

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

GtrujilloTS wants to merge 2 commits 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 select 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.
    • Explicitly selected rendering backends continue to be respected.

@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: Repository: webadderallorg/Recordly/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d7173163-c56a-495b-92ae-d0b028de41ed

📥 Commits

Reviewing files that changed from the base of the PR and between 6b59f8c and 5893e79.

📒 Files selected for processing (2)
  • src/lib/exporter/backendPolicy.ts
  • src/lib/exporter/modernFrameRenderer.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • 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

🚥 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
Title check ✅ Passed The title clearly summarizes the primary change: Linux now prefers WebGL over WebGPU for Lightning exports.
Description check ✅ Passed The description explains the change, motivation, change type, testing steps, and checklist status. It is complete and aligned with the pull request objectives.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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