Skip to content

Check the runner-key value itself; exempt input-shape asserts - #154

Merged
tarekziade merged 1 commit into
mainfrom
fix/expectation-check-gaps
Oct 12, 2026
Merged

tarekziade merged 1 commit into
mainfrom
fix/expectation-check-gaps

Conversation

@tarekziade

Copy link
Copy Markdown
Collaborator

Follow-up to #153. That check judged where a value went, not the value itself, so the red-flag PRs would pass it once reshaped onto ("cuda", 8). It also flagged a correct edit on the 2026-10-11 nightly.

  • Converted literals are drift-checked. When a plain literal becomes an Expectations block, the runner value is compared against the literal it replaces. transformers#49243 (pvt_v2) moved 45% and skipped the check.
  • A different count of numbers is a regression. transformers#47698 (dab_detr) went from 5 detections to 3.
  • Degenerate runner text is rejected: a control character (transformers#49244 fuyu, \x04 A bus…) or a stutter (transformers#47983 starcoder2, def hello_world(): hello_world():). This is expectation_guard.degenerate_text, which also feeds the guard's degenerate-value label.
  • A sign flip no longer hides an expectation-only patch. _NUMBER_LITERAL now includes a unary minus. In the guard, #47698's -2.5104 left a stray -, so the patch read as a code change and no expectation rule ran on it in prod.
  • Asserts on the model's input shape are exempt from the runner-key rule, e.g. inputs.input_ids.shape == (2, 422). transformers#49507 (pegasus) was sent back 3 times and published with a wrong ⚠️ warning. The tokenizer doesn't depend on the GPU. The exemption needs an input name plus .shape/len(/.size(, so an output count is still checked.

The exhausted-budget behaviour is unchanged: the PR still opens with the warning.

Checked against the real base/head files of transformers PRs:

case before after
8 red flags (#47698 #47750 #47840 #47983 #48955 #49143 #49243 #49244) 7 rejected, #47698 passed 8 rejected
same bad values reshaped onto ("cuda", 8) (pvt_v2, starcoder2, fuyu, dab_detr) 4 passed 4 rejected
#49507 pegasus rejected passes
4 eligible (#48838 #48882 #48945 #49040) pass pass

make test: 1404 passed.

Ships on deploy (TASK_EXPECTATION_KEY_CHECK still switches it off).

🤖 Generated with Claude Code

Converted literals are drift-checked, a changed count of numbers and
degenerate text (control characters, stutter) are rejected, a sign flip no
longer hides an expectation-only patch, and asserts on the model's input
shape are exempt from the runner-key rule.
@tarekziade
tarekziade merged commit ab511b8 into main Oct 12, 2026
3 checks passed
@tarekziade
tarekziade deleted the fix/expectation-check-gaps branch October 12, 2026 06:39
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