GateCheck: Executable Semantic Contracts for Silent Failures in Learned Gates and Attention Components
Neural attention and gating code can train and preserve tensor shapes while silently ignoring a mask, option, branch, or gradient path. We present GateCheck, executable semantic contracts for component dynamics, forward effect, gradient connectivity, batch independence, protected-input invariance, and declared-option influence. GateBench-v2 contains 63 semantic-mutant configurations and 33 valid controls evaluated through 17,280 executions. The full suite detects every controlled mutant and flags no controls (exact 95% intervals: recall 0.943–1.00; specificity 0.894–1.00), whereas runtime/shape checks detect 9.5%. Matched PyTorch and JAX implementations yield identical decisions for five definitions. A public-patch pilot contributes five buggy/fixed micro-replay pairs: every buggy replay violates its prespecified contract and every fixed replay passes, although these reductions are not full historical environments and the exact interval is wide (0.478–1.00). Retrospective verification by two external engineers identifies nine unanimous inclusion candidates in a frozen 35-change pool; four remain unexecuted. A patient-grouped brain-tumor study proves that singleton softmax creates an identity gate with zero parameter gradient. Repairs restore mechanism but do not establish a clean Dice benefit on 35 held-out patients. GateCheck supports pre-training software-integrity checks; passing contracts does not establish model quality or universal defect detection.
Authors
- Siddhant Agarwal (ORCID: https://orcid.org/0000-0002-0840-2114)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-01
- DOI
- https://doi.org/10.5281/zenodo.24723299
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- preprint