GPU/MPS-First Guard Measurement Contracts

Plain language: Accelerator-friendly guard measurements are acceptable only when their estimator settings, sampling policy, and measurement-contract hashes are recorded so later verification can replay the same contract.

Overview

AspectDetails
PurposeDefine the maintained measurement-contract expectations for accelerator-friendly spectral and RMT guards.
AudienceContributors, maintainers, and reviewers of guard evidence.
Contract scopeSpectral + RMT guard contracts on CUDA/MPS-capable and CPU fallback paths.
Source of truthGuard implementations in src/invarlock/guards/*.py.

Claim

Spectral and RMT guard evidence must remain reproducible without requiring full matrix decompositions on large models. The runtime therefore records bounded iterative estimator settings, sampling policy, and measurement-contract hashes for the guard evidence that invarlock verify later checks.

For operational guard usage, see Guards.

Concepts

  • Accelerator-first: guard math runs on CUDA/MPS-capable paths without full SVD.
  • Bounded approximation: iterative estimators and deterministic sampling replace exact decompositions for large tensors.
  • Measurement contracts: estimator + sampling policy must be recorded in reports.

Runtime Contract

Guard reports must preserve enough information for later verification:

  • Spectral evidence records the estimator family, bounded iteration budget, degeneracy proxies, and measurement-contract hash.
  • RMT evidence records activation edge-risk scoring, sampling policy, estimator budget, and measurement-contract hash.
  • CI/Release verification rejects missing measurement-contract hashes for evaluated Spectral/RMT guard evidence and requires the resolved-policy measurement contract to match the baseline evidence contract.

Contract Details

  1. Single evidence mode: one canonical contract for each guard.
  2. Spectral contract: track σ^max\hat{\sigma}_{\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, hash, baseline hash, and match flag.

Non-goals

  • Full-spectrum or exact SVD computations.
  • Accepting reports missing measurement contracts in CI/Release assurance paths.

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.
  • Baseline comparison appears under spectral.baseline_measurement_contract_hash, rmt.baseline_measurement_contract_hash, and *.measurement_contract_match.
  • Resolved-policy contracts appear under resolved_policy.spectral.measurement_contract and resolved_policy.rmt.measurement_contract.