Files
Lumotia/docs/issues/runtime-capabilities-accelerators.md
Jake 26c7307607
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
agent: lumotia-rebrand — docs, scripts, root config, residuals
Phase 9 of the rebrand cascade. Sweep covers everything the Phase 8
frontend pass deliberately skipped: docs/, root markdown, scripts,
Cargo.toml descriptions, code comments that survived earlier
word-boundary sed, plus a handful of identifiers caught on the final
verify pass.

transcription-app changes:
- README.md, HANDOVER.md, KNOWN-ISSUES.md, run.sh — magnotia/Magnotia
  -> lumotia/Lumotia.
- docs/ — sweep across all subdirs except docs/handovers/ (preserved
  as immutable audit trail). Includes architecture-map references
  to magnotia_core::*, magnotia_storage::*, etc. now pointing at
  lumotia_*; dev-setup.md tracing output examples (lumotia_startup
  target); brief/ + superpowers/ + issues/ + whisper-ecosystem/ +
  audit/.
- Cargo.toml descriptions on 9 crates (core, audio, cloud-providers,
  hotkey, llm, mcp, plus referenced others).
- crates/core/src/{error,hardware,recommendation,paths}.rs +
  crates/audio/src/wav.rs + crates/llm/src/model_manager.rs +
  crates/cloud-providers/src/keystore.rs + crates/mcp/src/lib.rs —
  doc comments and a model-manager user-agent string.
- Caught on final pass: BroadcastChannel("magnotia_task_sync") -> ...
  ("lumotia_task_sync"); magnotia_locale i18n localStorage key
  renamed + migration shim added; CSS keyframe names
  magnotiaPulse / magnotiaBar / magnotiaFade renamed in the design-
  system kit; magnotia_viewer_item / magnotia_viewer_mode handoff
  keys renamed in HistoryPage + viewer/+page.svelte; src/assets/
  wordmark.svg text.
- src-tauri/src/lib.rs comment cleanup ("magnotia era" was sed'd
  to "lumotia era" earlier — restored).

Preserved (intentional):
- crates/core/src/paths.rs — keeps "magnotia" / "Magnotia" / ".magnotia"
  legacy detection strings in legacy_and_target_paths() so the
  migration shim can still find user data from the magnotia era.
- src/lib/stores/{page,focusTimer}.svelte.ts + src/lib/i18n/index.ts
  — migration call sites reference the legacy magnotia keys
  deliberately.
- docs/handovers/ — historical audit trail.

cargo build --workspace passes. npm run check: 0 errors / 0 warnings
(3958 files). cargo test --workspace: 339 pass / 0 fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:38:03 +01:00

2.8 KiB

RB-07 MAJOR: get_runtime_capabilities advertises wrong accelerators

Severity: MAJOR Path: src-tauri/src/commands/models.rs:435-489 Source: 2026-04-22 code review Labels: release-blocker, major, ui-integrity Status: RESOLVED (2026-04-22)

Resolution

Added a pure compose_accelerators(whisper_enabled, loader_available, target) -> Vec<String> helper. It always emits "cpu" first and appends "metal" (macOS) or "vulkan" (Linux/Windows) only when whisper is compiled in and vulkan_loader_available() resolves the platform's loader shim.

supported_accelerators() reads cfg!(feature = "whisper"), runs the live loader probe, and delegates to the helper. get_runtime_capabilities calls supported_accelerators() in place of the hard-coded vec!["cpu", "vulkan"]. Whisper's supports_gpu is now cfg!(feature = "whisper") — false on whisper-disabled builds.

Five regression tests in commands::models::tests cover:

  • cpu_only_when_whisper_disabled (both targets)
  • cpu_only_when_loader_missing (both targets)
  • macos_with_loader_advertises_metal
  • non_macos_with_loader_advertises_vulkan
  • cpu_is_always_first_entry (contract the frontend relies on)

Both cargo test -p lumotia --lib and cargo test -p lumotia --lib --no-default-features pass the new suite; both cargo build -p lumotia and cargo build -p lumotia --no-default-features compile clean.

Runtime GUI verification on a real macOS box is still on the ship-gate checklist — the detection logic is correct in code; Metal-loader resolution on hardware is not something we can unit-test from a Linux CI.

Problem

The IPC response hard-codes accelerators = ["cpu", "vulkan"] and supports_gpu = true for Whisper, even when:

  • detect_active_compute_device would report metal on macOS (via MoltenVK).
  • The binary was compiled without the whisper feature — in which case Whisper supports_gpu is meaningless because there is no Whisper backend at all.

The frontend uses this response to render Settings toggles (GPU selection, active-device badge, feature availability). Wrong values mean wrong UI states on exactly the builds this function is meant to describe.

Acceptance

  • accelerators is derived from actual build configuration and runtime probe, not hard-coded.
  • On macOS, accelerators includes "metal" when the Metal loader resolves.
  • On whisper-disabled builds, Whisper entries advertise supports_gpu = false (or the engine is omitted from the response entirely).
  • Regression tests cover each platform variant via cfg-gated test cases.

Fix scope

Medium. The detection helpers already exist (detect_active_compute_device, vulkan_loader_available); this is about wiring their output into the RuntimeCapabilities struct honestly.

Dependencies

  • None — standalone fix.