Skip to content

fix(export): gate packaged cuda audio fallback#559

Merged
meiiie merged 1 commit into
mainfrom
fix/cuda-packaged-audio-gate
May 22, 2026
Merged

fix(export): gate packaged cuda audio fallback#559
meiiie merged 1 commit into
mainfrom
fix/cuda-packaged-audio-gate

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented May 22, 2026

Summary

  • Use the packaged CUDA auto-candidate active state, not just the enabled state, when allowing validated audio fallback candidates.
  • Keep explicit CUDA audio guarded unless RECORDLY_NVIDIA_CUDA_FORCE_VIDEO_ONLY or the explicit audio override is set.
  • Add regression coverage for packaged app + explicit CUDA + copy-source audio.

Why

This is a small #504 follow-up. In packaged builds, the auto-candidate path can safely try CUDA with shared mux fallback, but explicit CUDA should not inherit that audio bypass merely because the app is packaged. This keeps packaged .exe behavior narrower and less likely to accept an unsafe CUDA audio route.

This PR intentionally avoids the broader #504 route planner and CUDA compositor changes.

Verification

  • npm test -- electron/ipc/export/native-video.test.ts
  • npx tsc --noEmit
  • npx biome check --formatter-enabled=false electron/ipc/export/native-video.ts electron/ipc/export/native-video.test.ts
  • git diff --check

Summary by CodeRabbit

  • Tests

    • Added test coverage for experimental NVIDIA CUDA export functionality across different platform and environment configurations.
  • Bug Fixes

    • Improved handling of NVIDIA CUDA audio export validation logic to correctly distinguish between enabled and active states.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

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: aa06cde6-9c75-4733-9c6b-c2905095d99f

📥 Commits

Reviewing files that changed from the base of the PR and between fb4e2d9 and e540615.

📒 Files selected for processing (2)
  • electron/ipc/export/native-video.test.ts
  • electron/ipc/export/native-video.ts

📝 Walkthrough

Walkthrough

This PR refactors NVIDIA CUDA auto-candidate state handling by distinguishing between "enabled" and "active" flags. The implementation adjusts the env-disabled early return and audio fallback validation logic accordingly. A new test case verifies the updated behavior when CUDA export is enabled in packaged mode.

Changes

NVIDIA CUDA Auto-Candidate State Distinction

Layer / File(s) Summary
Auto-candidate state refinement
electron/ipc/export/native-video.ts
Separated packagedAutoCandidateEnabled from packagedAutoCandidateActive. The enabled flag gates the env-disabled early return, while the active flag gates audio fallback validation alongside the force-video-only setting.
Test coverage for packaged auto-candidate
electron/ipc/export/native-video.test.ts
New test case for getExperimentalNvidiaCudaExportSkipReason with packaged mode and CUDA enabled, clearing bypass environment variables, and asserting platform-dependent skip reasons with proper cleanup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

Checked

🐰 Two flags dance in the NVIDIA light—
one enabled, one active and bright,
the state machine hops left, then right,
with copy-source audio in sight,
and tests to prove the logic's tight!

🚥 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 accurately reflects the main change: gating packaged CUDA audio fallback by differentiating between enabled and active states.
Description check ✅ Passed The description provides a clear summary, rationale, and verification steps, though it lacks some template sections like screenshots/videos and detailed testing guide.
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/cuda-packaged-audio-gate

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 merged commit 81e4739 into main May 22, 2026
3 checks passed
@meiiie meiiie deleted the fix/cuda-packaged-audio-gate branch May 22, 2026 12:58
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