GPU/MPS-First Guards (Decision Memo)
Overview
| Aspect | Details |
|---|---|
| Purpose | Record the guard design decisions enabling large-model execution. |
| Audience | Contributors and reviewers of guard measurement contracts. |
| Scope | Spectral + RMT guard contracts, accelerator-first design. |
| Source of truth | Guard implementations in src/invarlock/guards/*.py. |
Quick Start
This is a decision memo; for implementation usage see Guards.
Concepts
- Accelerator-first: guard math must run on CUDA/MPS without full SVD.
- Approximation-only: iterative estimators and deterministic sampling.
- Measurement contracts: estimator + sampling policy must be recorded in reports.
Reference
Goals
- Device-resident guard computation for large models.
- Reproducible approximations with fixed budgets.
- Contract binding enforced at verification time.
Decisions
- Single evidence mode: one canonical contract for each guard.
- Spectral contract: track
σ̂_maxand degeneracy proxies (stable-rank drift, row/col norm collapse). - RMT contract: activation edge-risk score normalized by MP edge.
- Verification gate: reports must record the measurement contract and hash.
Non-goals
- Full-spectrum or exact SVD computations.
- reports missing measurement contracts.
Troubleshooting
- See Guards for operational guidance and guard configuration.
Observability
- Contract hashes appear under
spectral.measurement_contract_hashandrmt.measurement_contract_hashin reports.