Commit aab7be5
fix: MetalRT segfault crashes, missing dylib packaging, and M5+ forward-compatibility (#19)
* refactor: remove all benchmarking code and metrics except TTFA
Remove the entire benchmark subsystem and inline performance metrics
(tok/s, TTFT, prefill, decode, STT ms, TTS ms) while preserving
TTFA (Time To First Audio) tracking throughout the pipeline.
Deleted:
- src/bench/ directory (benchmark.h, benchmark.cpp)
- rcli bench CLI command and all bench arguments
- rcli metalrt bench subcommand
- [B] bench panel and [V] verbose metrics toggle in TUI
- API functions: rcli_benchmark, rcli_run_full_benchmark,
rcli_get_last_llm_perf, rcli_get_last_llm_perf_extended,
rcli_get_last_tts_perf, rcli_get_last_stt_perf
- print_llm_perf, print_tts_perf, print_stt_perf helpers
Preserved:
- TTFA tracking and display in TUI models panel
- rcli_get_context_info (context window gauge)
- Voice bench test (TTFA-only) in test_pipeline.cpp
* fix: MetalRT segfault on M3/M4, missing dylib packaging, null engine fallback
Addresses three distinct crash scenarios from issue #5:
1. MetalRT GPU crash guard now covers verification inference. The crash
guard (SIGSEGV handler + breadcrumb) previously only protected
metalrt_.init() but the actual Metal GPU compute can segfault on
certain M3/M4 hardware. Now a verification generate runs inside the
protected section — if it crashes, the breadcrumb persists and next
launch falls back to llama.cpp. Also removed the unprotected warm-up
call from main.cpp.
2. package.sh now fails if libonnxruntime is missing instead of silently
producing an incomplete tarball. Added a recursive fallback search
path and post-copy validation that checks every @rpath dylib the
binary references is present in lib/.
3. Defensive null checks: when MetalRT verification fails, attempts late
llama.cpp init as fallback. Added null-safety guard in
rcli_process_command MetalRT path. Final validation catches
impossible states (MetalRT flagged active but not initialized).
Closes #5
* fix: future-proof Metal 3.1 chip detection for M5+ support
Switch gpu_supports_metal31() from an allowlist (M3, M4) to a denylist
(M1, M2) so future Apple Silicon generations are automatically supported
without requiring a code change each generation.
---------
Co-authored-by: AmanSwar <aman.swar001@gmail.com>1 parent f9d5266 commit aab7be5
14 files changed
Lines changed: 139 additions & 1980 deletions
File tree
- Formula
- scripts
- src
- api
- bench
- cli
- engines
- pipeline
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
62 | 97 | | |
63 | 98 | | |
64 | 99 | | |
| |||
0 commit comments