You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ports Layer 9 from Harper's internal fork into the open-source mono
file. L9 addresses the kernel-panic class that lives below the SIGABRT
handler — no Python signal handler can fire because the machine has
already rebooted by the time userspace sees anything. The only defence
left is to avoid the panic trigger in the first place.
metal_guard.py:
- CadenceGuard / CadenceViolation / require_cadence_clear — refuse
back-to-back loads of the same model within a configurable window
(default 180 s). Persisted to ~/.cache/metal-guard/cadence.json so
the mark survives subprocess spawn and kernel panic.
- parse_panic_reports / ingest_panics_jsonl — scan
/Library/Logs/DiagnosticReports/*.panic (+ Retired/) and dedupe-
append into ~/.cache/metal-guard/panics.jsonl.
- CircuitBreaker / MLXCooldownActive — refuse new workers after
≥ 2 panics in the trailing 1 h (state persisted so the cooldown
outlives the current process).
- detect_panic_signature + _KERNEL_PANIC_SIGNATURES — classify a
panic log into prepare_count_underflow / pending_memory_set /
ctxstore_timeout / metal_oom.
- kv_cache_clear_on_pressure — ready-made on_pressure callback for
start_kv_cache_monitor.
- MetalGuard.detect_hardware() now also returns gpu_driver_version
(IOGPUFamily kext — mlx#3186 forensic context).
tests/test_l9_*.py: 31 new tests (cadence 8, breaker 9, ingest 8,
signature 6). Full suite: 157 passed (126 existing + 31 new).
README overhaul: collapsed the v0.3–v0.7 per-version narrative
sections into a single L1–L9 + R-series feature list with one-line
API descriptions and tables. History and rationale now live in
CHANGELOG only. New "Limitations" section makes the userspace-only
scope of MetalGuard explicit — it lowers panic rate and contains
blast radius but cannot fix the kext bug itself. All three language
versions (en / zh-TW / ja) updated. README length: 914 → 340 lines.
0 commit comments