Skip to content

Fix Lightning default render backend#670

Open
bet4it wants to merge 1 commit into
webadderallorg:mainfrom
bet4it:fix-lightning-default-render-backend
Open

Fix Lightning default render backend#670
bet4it wants to merge 1 commit into
webadderallorg:mainfrom
bet4it:fix-lightning-default-render-backend

Conversation

@bet4it

@bet4it bet4it commented Jun 9, 2026

Copy link
Copy Markdown

Description

Fix Lightning exports so they use the stable default render backend when no explicit backend is configured.

Motivation

On Linux, Lightning export could select WebGPU automatically when navigator.gpu was available, even though the renderer policy defaults Lightning to WebGL for stability. This could trigger export failures in the WebGPU path. The change makes ModernVideoExporter apply the existing Lightning backend policy by default, while still allowing explicit WebGPU overrides for testing/debugging.

Type of Change

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

Related Issue(s)

Fix #644

Screenshots / Video

N/A

Testing Guide

Run:

npm test -- src/lib/exporter/modernVideoExporter.fallback.test.ts src/lib/exporter/backendPolicy.test.ts

Verified locally: 2 test files passed, 16 tests passed.

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

  • Bug Fixes

    • Improved render backend selection for video exporting when no explicit preference is provided; the exporter now assigns an appropriate default instead of leaving the value undefined.
  • Tests

    • Added test coverage for render backend routing behavior to validate correct configuration handling in both default and explicit preference scenarios.

@coderabbitai

coderabbitai Bot commented Jun 9, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: df80d10c-79d1-452e-b57b-9f87da1539cf

📥 Commits

Reviewing files that changed from the base of the PR and between 52dd842 and 5984f2b.

📒 Files selected for processing (2)
  • src/lib/exporter/modernVideoExporter.fallback.test.ts
  • src/lib/exporter/modernVideoExporter.ts

📝 Walkthrough

Walkthrough

ModernVideoExporter now defaults to webgl as the Lightning render backend when no explicit preferredRenderBackend is provided in the export config, with test coverage validating both default and explicit backend behavior.

Changes

Lightning render backend defaulting

Layer / File(s) Summary
Default backend selection implementation
src/lib/exporter/modernVideoExporter.ts
Import getDefaultLightningRenderBackend and update ModernFrameRenderer initialization to use it when config.preferredRenderBackend is undefined, replacing the previous undefined fallback.
Backend selection test coverage
src/lib/exporter/modernVideoExporter.fallback.test.ts
Add two test cases validating that the exporter defaults preferredRenderBackend to "webgl" when unset and passes through explicit "webgpu" configuration to FrameRenderer.

Possibly related PRs

  • webadderallorg/Recordly#554: Implements the getDefaultLightningRenderBackend policy logic in backendPolicy.ts that this PR imports and uses for render backend selection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 When backends go undefined and exports fail to render,
A humble default choice makes each renderer gender,
WebGL steps in with steady, caring grace,
While tests ensure no undefined sneaks into the race!
Export complete—the Lightning flies again. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix Lightning default render backend' is concise and directly describes the main change in the PR, which adds default render backend selection to ModernVideoExporter.
Description check ✅ Passed The PR description includes all major template sections: Description, Motivation, Type of Change, Related Issue, Testing Guide, and Checklist. All required information is present and complete.
Linked Issues check ✅ Passed The PR implements the core requirement from #644: applying Lightning backend policy defaults to ModernVideoExporter to prevent automatic WebGPU selection on Linux, which was causing export failures.
Out of Scope Changes check ✅ Passed All changes are scope-appropriate: adding default render backend logic to ModernVideoExporter and test cases validating the render-backend routing, directly addressing the #644 bug fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant