Finish the diagnostic repair: a crash is not a numeric mismatch - #2190
Merged
Conversation
…ismatch #2187 fixed six t27c gen-* calls in one file. An AST re-scan found 12 more: t27c gen-* in another call shape 3 sites the previous regex matched only the single-line form running the built binary 8 sites .stdout with no exit-code check The second class is the interesting one. A crash arrives as a short or empty result list and surfaces as a NUMERIC MISMATCH between targets -- the most alarming reading the harness can produce, and the wrong one. A program that died on signal 11 did not disagree about arithmetic. _run_bin joins _build and _gen, reporting the exit code and the signal number when negative. All ten _gen/_run_bin call sites now guard None, so a failure ends cleanly instead of raising TypeError on None.split(). Verified by planting a fault rather than by reading: before FAIL: C backend failed to build/run after C target: cc exited 1 mod.h:18:34: error: use of undeclared identifier 'hm' All three tools still exit 0 on a clean tree. Left deliberately: check_withdrawn_live.py:80 (git ls-files, has a try/except fallback) and verify_emit_bitexact.py:127 (vvp), the latter worth a follow-up. Self-critical: this is the second partial repair in a row. #2187's regex matched one call shape and I reported the pattern as fixed without re-scanning. The AST scan is the check now, and it runs before the claim. Closes #2189 Refs #2187 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2187 fixed the six
t27c gen-*calls inverify_igla_race.py. An AST re-scan shows the repair was partial — 12 sites remained, in two classes:1.
t27c gen-*with a different call shape (3 sites) —verify_multitarget.py,verify_trainer_c.py. The previous regex only matched the single-line form, so these were silently skipped.2. Running the built binary (8 sites) —
cb,rb,peb,perb,cbin,rbin,b.subprocess.run([...]).stdoutwith no exit-code check means a crash arrives as a short or empty result list, which then surfaces as a NUMERIC MISMATCH between targets. That is the most alarming reading available and the wrong one: a program that died on signal 11 did not disagree about arithmetic.Fix:
_run_bin(cmd, what)alongside the existing_buildand_gen, reporting the exit code and the signal number when negative. All ten_gen/_run_bincall sites now guardNoneso a failure ends cleanly instead of raisingTypeErroronNone.split().Verified by planting a fault, not by reading:
All three tools still exit 0 on a clean tree.
Remaining, deliberately:
check_withdrawn_live.py:80(git ls-files, already has a try/except fallback) andverify_emit_bitexact.py:127(vvp) — the latter is worth a follow-up.Self-critical: this is the second partial repair in a row. #2187's regex matched one call shape and I reported the pattern as fixed without re-scanning. The AST scan is now the check, and it runs before the claim.
Refs #2187, #2185
Closes #2189
🤖 Generated with Claude Code