Skip to content

feat(format): arch-constraints-v1 + cooperative-matrix-gemm-v1 6-gate PARTIAL discharge#1394

Closed
noahgift wants to merge 2 commits into
mainfrom
feat/arch-coop-001-006-partial-discharge
Closed

feat(format): arch-constraints-v1 + cooperative-matrix-gemm-v1 6-gate PARTIAL discharge#1394
noahgift wants to merge 2 commits into
mainfrom
feat/arch-coop-001-006-partial-discharge

Conversation

@noahgift
Copy link
Copy Markdown
Contributor

@noahgift noahgift commented May 2, 2026

Summary

Bundles two sister contracts in one verdict module:

  • arch-constraints-v1 (FALSIFY-ARCH-CONSTRAINTS-001..003): family consistency, enum exhaustive, DeepSeek eps regression
  • cooperative-matrix-gemm-v1 (FALSIFY-COOP-001..003): parity, throughput, fallback

24 unit tests. Algorithm-level coverage advances by 6 gates; runtime ship % unchanged.

Gates bound

Gate ID Rule
ARCH-001 model-family yamls match this contract (no drift)
ARCH-002 zero unknown enum values
ARCH-003 DeepSeek eps == 1e-6 exactly (regression guard)
COOP-001 |coop - tiled| < 1e-3 elementwise
COOP-002 coop GFLOPS > 2 × tiled GFLOPS (strict)
COOP-003 Fallback used iff !coop_supported, no crash

Five Whys

See commit message — captures exact-equality for ARCH-003, strict > for COOP-002, and 4-state truth table for COOP-003.

Test plan

  • cargo test -p aprender-core --lib arch_coop — 24 passed
  • PMAT pre-commit gates green
  • CI green

🤖 Generated with Claude Code

… PARTIAL discharge

Bundles two sister contracts in one verdict module:

arch-constraints-v1 (FALSIFY-ARCH-CONSTRAINTS-001..003):
- ARCH-001: model-family yamls match this contract (no drift)
- ARCH-002: no unknown enum values across families
- ARCH-003: DeepSeek eps == 1e-6 (regression guard, was 1e-5)

cooperative-matrix-gemm-v1 (FALSIFY-COOP-001..003):
- COOP-001: |coop - tiled| < 1e-3 elementwise
- COOP-002: coop GFLOPS strictly > 2 × tiled GFLOPS
- COOP-003: fallback path used when coop unavailable, no crash

## Five Whys

1. Why bundle these two contracts? Both peripheral, span the
   per-architecture constraints + cooperative-matrix coverage band;
   one verdict module captures both without duplicate provenance
   pin overhead.
2. Why does this block ship? Coverage % cannot move while these
   peripheral contracts are unbound at PARTIAL_ALGORITHM_LEVEL.
3. Why exact-equality for ARCH-003 (DeepSeek eps)? The regression
   class is "someone reverts to the wrong default 1e-5." Tolerance
   would mask the exact bug the gate exists to catch — the contract
   says "1e-6, not 1e-5" with no float-tolerance window.
4. Why strict `>` for COOP-002 (not `>=`)? Per the contract
   formula: "coop GFLOPS > 2 * tiled GFLOPS." Equality at exactly
   2× is the boundary where coop is doing the same work for the
   same speed (no benefit). Strict `>` catches the regression class
   "coop matches tiled but doesn't beat it."
5. Why a 4-state truth table for COOP-003 (supported × used_coop ×
   used_tiled × crashed)? The spec says fallback applies only when
   coop_supported is false. Modeling all 4 dimensions catches the
   regression class "coop dispatched on unsupported HW → crash"
   AND the inverse "tiled dispatched on supported HW → wasted perf."

Adds 24 unit tests including a 6-bucket throughput-ratio sweep on
COOP-002. Realistic-healthy walks the canonical post-fix state;
pre-fix walks 6 simultaneous regressions across both contracts.

No runtime % shift; algorithm-level coverage advances by 6 gates.
@noahgift noahgift force-pushed the feat/arch-coop-001-006-partial-discharge branch from 0683e1a to d732d34 Compare May 11, 2026 15:26
@noahgift noahgift enabled auto-merge (squash) May 11, 2026 15:26
@noahgift
Copy link
Copy Markdown
Contributor Author

Superseded by #1637 (135-PR squash). The commit content is included verbatim in that PR's diff. Closing now to release runner slots; this PR would have auto-closed when #1637 merges.

@noahgift noahgift closed this May 12, 2026
auto-merge was automatically disabled May 12, 2026 09:20

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant