GPU/MPS-First Guards (Decision Memo)

Overview

AspectDetails
PurposeRecord the guard design decisions enabling large-model execution.
AudienceContributors and reviewers of guard measurement contracts.
ScopeSpectral + RMT guard contracts, accelerator-first design.
Source of truthGuard 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

  1. Single evidence mode: one canonical contract for each guard.
  2. Spectral contract: track σ̂_max and degeneracy proxies (stable-rank drift, row/col norm collapse).
  3. RMT contract: activation edge-risk score normalized by MP edge.
  4. 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_hash and rmt.measurement_contract_hash in reports.