Commit Graph
4 Commits
Author SHA1 Message Date
debpalash 86213beb54 perf(asr): cache probe verdicts per run, re-check failures, match import errors (#3924)
- Keep verdicts process-wide so a re-imported core.import_probe does not
  re-spawn children (suites purge core.* between tests).
- Re-check a failed import after 60 s, so a fix made while the app runs is
  seen without a restart, as the in-process import did.
- Raise the same ModuleNotFoundError text import would for a missing package.
- Child writes its verdict to fd 1 directly.
- Fix test stubs for pipeline_error(device)/availability_status signatures.
2026-11-09 22:49:04 +05:30
debpalash 54b0a3748c wip(asr): prove ASR imports in a child instead of the API process (#3924)
Unfinished: 5 failures in tests/backend/api/test_engines_route_shape.py and
test_subprocess_backend.py to triage (possibly load-related), and no
before/after RSS yet.
2026-11-09 22:16:08 +05:30
debpalash 2e30b1bdf3 test: isolate ASR selection and GGUF build stubs from the host (#3549)
ASR selection tests pinned only some hardware predicates, so on an Apple
Silicon or Windows ROCm host `_auto_detect` answered from the real MPS or
HIP state. A shared `neutral_asr_host` fixture now starts every predicate
False (including the lazily imported Windows HIP checks, patched on the
canonical module) and releases the warm transcription engine around the
test; the whisper.cpp fixture and the auto-detect suites use it.

The GGUF build tests wrote CRLF stubs and a Windows-form PATH under Git
Bash, so the real git/cmake could run. A shared harness writes LF files,
sets PATH inside Bash and refuses to start the script unless each
declared tool resolves to its stub.

Inspired by #3549 by @Pates2004.
2026-11-09 17:31:57 +05:30
ea3b565f9c fix(asr): fall back instead of crashing when CTranslate2's .so won't load (#692) (#699)
On hardened kernels / newer glibc (e.g. WSL2 glibc 2.43) CTranslate2's shared
object is rejected at load with 'libctranslate2…cannot enable executable stack'
— an OSError, not ImportError. The WhisperX/faster-whisper is_available() probes
only caught ImportError, so the OSError escaped and crashed the ASR/dub
preflight ('ASR backend initialization failed: …').

- Both probes now also catch the non-ImportError load failure and REPORT
  (False, 'failed to load …') instead of raising — a probe must never raise.
- _auto_detect() routes every probe through a never-raising _probe_available()
  so no exploding probe can crash engine selection; it falls through to
  pytorch-whisper (transformers, no CTranslate2), which works on CUDA/CPU.

Regression tests cover the raising probe, the .so-load OSError surfacing as
unavailable, and auto-detect falling back to pytorch-whisper.

Co-authored-by: mergetest <test@local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 00:04:54 +05:30