Skip to content

feat(playback): make the Rust streaming engine the default preview path (#53)#189

Merged
appergb merged 1 commit into
mainfrom
feat/rust-engine-default
Jul 4, 2026
Merged

feat(playback): make the Rust streaming engine the default preview path (#53)#189
appergb merged 1 commit into
mainfrom
feat/rust-engine-default

Conversation

@appergb

@appergb appergb commented Jul 4, 2026

Copy link
Copy Markdown
Owner

What

Closes the #53 arc: the continuous Rust streaming engine (decode → wgpu composite → MJPEG + cpal master clock, merged in #170) becomes the shipped default preview path.

  • playback-engine is now a default cargo feature; --no-default-features keeps a minimal build compiling (drops cpal/axum/tokio + playback_* commands, front end falls back to legacy).
  • rustEngineEnabled() flips to default-ON: only the exact localStorage value "0" opts out; unreadable/missing storage resolves to ON.
  • Runtime escape hatch (new safety net): a 2s startup watchdog + spawn-rejection handler trip rustEngineFailed in the store → the same play session falls through to the legacy <video> stack with a toast, the MJPEG overlay unmounts, and the flag resets on the next play. Decision logic is pure and unit-tested.
  • CI: workspace steps compile/test the engine by default; replaced the duplicate feature-gated steps with a --no-default-features clippy.
  • De-flaked the engine-thread integration test (poll for first frame instead of fixed 600ms sleep).

Verification

Local CI parity, all green:

  • cargo fmt --check / cargo clippy --workspace -D warnings / cargo clippy -p opentake-tauri --no-default-features -D warnings
  • cargo test --workspace (incl. GPU+ffmpeg integration tests on this machine)
  • pnpm build + pnpm test (43 files / 437 tests)

Honest caveat: full real-machine visual acceptance (docs/architecture/PLAYBACK-ENGINE.md checklist) hasn't run — computer-use is blocked on this box. The runtime fallback above is the designed mitigation: a machine where the engine can't start degrades to the pre-#53 behavior instead of a black canvas.

…th (#53)

- Cargo: `playback-engine` joins the default feature set; a minimal build
  stays possible via --no-default-features (drops cpal/axum/tokio + the
  playback_* commands).
- Front end: rustEngineEnabled() is default-ON — only the exact localStorage
  value "0" opts back out to the legacy <video> stack.
- Runtime escape hatch: a startup watchdog falls back to the legacy stack
  (with a toast) when playback_start rejects or no playback_frame arrives
  within 2s (covers in-thread GPU-acquire failures that return Ok). The
  fallback resets on every fresh play. Decision logic is pure + unit-tested
  (shouldFallBackToLegacy, shouldUseRustEngine engineFailed arm).
- CI: workspace steps now compile/lint/test the engine by default; the
  duplicate feature-gated steps are replaced by a --no-default-features
  clippy to keep the minimal build compiling.
- Integration test: poll for the first engine frame instead of a fixed
  600ms sleep (flaked under parallel GPU contention).
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