Skip to content

fix(export): keep Windows auto off static layout first#582

Merged
meiiie merged 2 commits into
mainfrom
fix/v130-lightning-auto-route-fallback
May 24, 2026
Merged

fix(export): keep Windows auto off static layout first#582
meiiie merged 2 commits into
mainfrom
fix/v130-lightning-auto-route-fallback

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented May 24, 2026

Description

Keep Windows auto Lightning exports on the streaming native/Breeze route instead of probing native static-layout before the stable path.

Motivation

Issue #581 reports 1.3.0 Windows 10 Lightning exports getting stuck at Prepare. The current Windows auto route probes native static-layout before Breeze/WebCodecs, which can hold the UI in the preparing phase before the stable streaming route gets a chance to run.

Type of Change

Bug fix / stabilization hotfix.

Related Issue(s)

Related to #581.

Changes Made

  • Disabled the Windows auto static-layout-first policy behind an explicit constant.
  • Limited native static-layout attempts to explicit Breeze or experimental NVIDIA CUDA opt-in.
  • Added regression coverage proving default Windows auto starts the streaming native route first.
  • Preserved NVIDIA CUDA opt-in behavior with a separate test that still allows static-layout-first when opted in.

Scope Note

This does not touch native helper binaries, CUDA source, packaged assets, timeline behavior, or the Windows 10 HUD/input issue. It addresses only the Lightning routing suspect from #581.

Testing Guide

  1. On Windows, export a simple MP4 with Lightning / Auto.
  2. Confirm the export leaves Preparing export... and either runs the streaming native path or falls back normally.
  3. If NVIDIA CUDA opt-in is available and enabled, confirm that experimental static-layout routing still appears only through that explicit opt-in.

Checklist

  • Focused hotfix branch from current origin/main
  • Targeted tests updated
  • Typecheck passed
  • Scoped Biome passed
  • No generated binaries included

Local Checks

  • npm test -- src/lib/exporter/backendPolicy.test.ts src/lib/exporter/modernVideoExporter.fallback.test.ts
  • npx tsc --noEmit --pretty false
  • npx biome check --formatter-enabled=false src/lib/exporter/backendPolicy.ts src/lib/exporter/backendPolicy.test.ts src/lib/exporter/modernVideoExporter.ts src/lib/exporter/modernVideoExporter.fallback.test.ts
  • git diff --check (exit 0; Git emitted local LF-to-CRLF warnings only)

Runtime/Repro Evidence

Not run in a packaged Windows build yet. This stays draft until Windows 10/11 packaged Lightning smoke confirms the route no longer stalls at Prepare.

Summary by CodeRabbit

  • New Features

    • Added experimental NVIDIA CUDA acceleration support for video export
  • Improvements

    • Refined Windows auto-export routing to prefer streaming-native exports by default
    • Clarified export route decision logic and fallback reason messages for more consistent behavior
    • Consolidated native-static eligibility and encoder-start decisions for predictable export flow
  • Tests

    • Added and updated tests covering Windows auto routing, native-static vs streaming paths, and fallback behavior

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 083db6b7-aca9-491d-8f27-932d62ba34f7

📥 Commits

Reviewing files that changed from the base of the PR and between 7ba7f70 and 2f010da.

📒 Files selected for processing (1)
  • src/lib/exporter/modernVideoExporter.ts

📝 Walkthrough

Walkthrough

Windows "auto" backend preference now routes to streaming by default; a new feature flag disables native-static-layout priority for that case. ModernVideoExporter centralizes native-static-layout eligibility into a single flag combining Breeze preference or NVIDIA CUDA opt-in, and replaces scattered backend checks with this flag at both probe points. Tests verify Windows auto streams natively without static-layout steps and document CUDA-enabled static scenarios.

Changes

Backend Routing and Native-Static-Layout Gating

Layer / File(s) Summary
Backend policy flag and route decision logic
src/lib/exporter/backendPolicy.ts
WINDOWS_AUTO_STATIC_LAYOUT_FIRST_ENABLED flag gates native-static preference for Windows auto (disabled by default), and fallback reason string updates from "windows-native-static-fallback" to "native-static-layout-not-auto-default".
Route decision test expectations
src/lib/exporter/backendPolicy.test.ts
Windows auto routing now expects breeze-stream selected and native-static-layout rejected, with shouldPreferNativeStaticLayoutBeforeBreeze("win32", "auto") returning false and updated route reason semantics.
Exporter native-static-layout eligibility centralization
src/lib/exporter/modernVideoExporter.ts
New shouldTryNativeStaticLayout flag combines "breeze" preference with experimentalNvidiaCudaExport and prefersNativeStaticLayoutBeforeBreeze, updates shouldDeferNativeEncoderStart to align, and replaces backend-preference checks with the unified flag at both static-layout probe points.
Exporter test coverage for streaming and CUDA paths
src/lib/exporter/modernVideoExporter.fallback.test.ts
New test verifies Windows auto native export takes streaming route (calls tryStartNativeVideoExport, skips static-layout, loads metadata once); existing Windows-auto static test updated to use experimentalNvidiaCudaExport: true flag.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • webadderallorg/Recordly#562: Adds/propagates NVIDIA CUDA opt-in capability detection used as an alternate trigger for native-static-layout attempts.
  • webadderallorg/Recordly#554: Previously changed Windows "auto"/Breeze/native-static route policy that this PR further adjusts.
  • webadderallorg/Recordly#461: Modifies ModernVideoExporter export routing and native/Breeze probe points overlapping this PR's changes.

Suggested labels

Checked

Poem

🐰 Windows now prefers a streaming hop,
CUDA whispers where static pops,
One flag decides which path to chart,
Exports flow swift — a work of art. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 and specifically summarizes the main change: disabling Windows auto routing away from static-layout-first to keep it on the streaming native route.
Description check ✅ Passed The PR description comprehensively covers all template sections including clear description, motivation, type of change, related issues, changes made, testing guide, and a completed checklist.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v130-lightning-auto-route-fallback

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@meiiie meiiie mentioned this pull request May 24, 2026
@meiiie
Copy link
Copy Markdown
Collaborator Author

meiiie commented May 24, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/exporter/modernVideoExporter.ts`:
- Around line 385-391: The two flags are inconsistent: update the computation of
shouldTryNativeStaticLayout to include the same
shouldPreferNativeStaticLayoutBeforeBreeze(runtimePlatform, backendPreference)
check used by shouldDeferNativeEncoderStart so both follow the same conditions;
specifically, in the block where shouldTryNativeStaticLayout is set, add the OR
condition with shouldPreferNativeStaticLayoutBeforeBreeze(runtimePlatform,
backendPreference) (keeping the existing checks against backendPreference ===
"breeze" and this.config.experimentalNvidiaCudaExport === true) so both flags
remain aligned when the feature flag toggles.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 42ea93cf-38f1-4c82-8819-c3c5a8b74261

📥 Commits

Reviewing files that changed from the base of the PR and between 78594eb and 7ba7f70.

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

Comment thread src/lib/exporter/modernVideoExporter.ts Outdated
@meiiie meiiie marked this pull request as ready for review May 24, 2026 12:58
@meiiie meiiie merged commit c51cc50 into main May 24, 2026
1 of 2 checks passed
@meiiie meiiie deleted the fix/v130-lightning-auto-route-fallback branch May 24, 2026 12:59
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