Skip to content

feat(format): garbage-oracle-v1 + gemm-backward-tiled-v1 6-gate PARTIAL discharge#1404

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

feat(format): garbage-oracle-v1 + gemm-backward-tiled-v1 6-gate PARTIAL discharge#1404
noahgift wants to merge 2 commits into
mainfrom
feat/go-gembw-001-006-partial-discharge

Conversation

@noahgift
Copy link
Copy Markdown
Contributor

@noahgift noahgift commented May 2, 2026

Summary

Bundles two sister contracts:

  • garbage-oracle-v1 (FALSIFY-GO-001..004): no false positives, LAYOUT-002 detection, control chars, empty=garbage
  • gemm-backward-tiled-v1 (FALSIFY-GEMM_BACKWARD_TILED_V1_001..002): gradient correctness ε, transpose involution

27 unit tests including 5-bad / 5-good string sweep on classify_garbage.
Algorithm-level coverage advances by 6 gates; runtime ship % unchanged.

Gates bound

Gate ID Rule
GO-001 Valid output not flagged (no false positives)
GO-002 Column-major garbage IS flagged (LAYOUT-002 catch)
GO-003 Control chars (except \n, \t, \r) flagged
GO-004 Empty/whitespace-only flagged
GEMM-BW-001 ‖dW_tiled - dW_naive‖ < 1e-4 * ‖dW_naive‖
GEMM-BW-002 A^T^T == A bit-exact

Reference helper

classify_garbage(text) — pure-Rust deterministic predicate (empty / control chars / replacement char).

Five Whys

See commit message — captures \n/\t/\r allowance, relative tolerance for GEMM-BW-001, and shared classifier rationale.

Test plan

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

🤖 Generated with Claude Code

…AL discharge

Bundles two sister contracts:

garbage-oracle-v1 (FALSIFY-GO-001..004):
- GO-001: valid English/code output not flagged (no false positives)
- GO-002: column-major garbage IS flagged (LAYOUT-002 catch)
- GO-003: control characters (except \\n, \\t, \\r) flagged
- GO-004: empty/whitespace-only output flagged

gemm-backward-tiled-v1 (FALSIFY-GEMM_BACKWARD_TILED_V1_001..002):
- GEMM-BW-001: ‖dW_tiled - dW_naive‖ < 1e-4 * ‖dW_naive‖
- GEMM-BW-002: A^T^T == A bit-exact (transpose involution)

## Five Whys

1. Why bundle these two contracts? Both peripheral, span the
   output-quality + backward-pass coverage band; one verdict module
   captures both without provenance pin overhead.
2. Why does this block ship? Coverage % cannot move while these
   peripheral contracts are unbound at PARTIAL_ALGORITHM_LEVEL.
3. Why ship a `classify_garbage()` reference helper? GO-001/003/004
   all share the same underlying decision rule (control chars,
   replacement chars, empty/whitespace). Pinning the predicate
   in-module prevents future drift between the verdict-test
   classifier and the actual GarbageOracle implementation.
4. Why allow `\n`, `\t`, `\r` but flag other control chars? Per
   the contract: code/text legitimately contains those whitespace
   chars. Other control chars (NUL, ETX, EOT, etc.) indicate
   encoding corruption — the regression class is "tokenizer
   produced raw bytes that survived UTF-8 decoding."
5. Why relative tolerance for GEMM-BW-001 (not absolute)? Backward
   GEMM accumulates over batch × hidden dimensions; the absolute
   error grows with `‖dW‖`. Relative tolerance `< ε * ‖dW_naive‖`
   captures the right invariant: "tile-mode error is a fixed
   fraction of signal magnitude," catching regressions like
   "tiled lost a full block's worth of contribution" while
   tolerating numerical-rounding drift.

Adds 27 unit tests including a 5-bad / 5-good string sweep on
classify_garbage. Realistic-healthy walks the canonical clean
output + correct backward; pre-fix walks 6 simultaneous regressions.

No runtime % shift; algorithm-level coverage advances by 6 gates.
@noahgift noahgift force-pushed the feat/go-gembw-001-006-partial-discharge branch from 5def1b8 to cee18fa Compare May 11, 2026 15:11
@noahgift noahgift enabled auto-merge (squash) May 11, 2026 15:11
@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