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

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

GateCheck: Executable Semantic Contracts for Silent Failures in Learned Gates and Attention Components

Siddhant Agarwal
Zenodo (CERN European Organization for Nuclear Research)
Software Testing and Debugging Techniques
preprint

GateCheck: Executable Semantic Contracts for Silent Failures in Learned Gates and Attention Components

Siddhant Agarwal
preprint en

Abstract

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.

Zenodo (CERN European Organization for Nuclear Research)
Software Testing and Debugging Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon