Repository navigation
calls_out: tcl switch arm bodies and scheme let binders (Closes #5909) - #6864
Conversation
…t_rewrite (Part of #5909) A same-length, per-language rewrite hook runs before calls_out scans a block. Tcl: each switch arm label is blanked and a braced body is put on its own line (`;` as a line break), so `x { doX }` reaches doX and the label is no call. The call-scan shield no longer reads tcl's `--` as a comment (`switch -- $v {`). Scheme: every let-family binder (named-let first, second+ bindings, let-values formals, do) is blanked, replacing the fixed-width lookbehinds. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
PR #6864 @ a854ab7: 4 failed check(s) == call-graph-accuracy-audit (failure) -- real == shard 1 (1669449 LOC) (failure) -- real == shard 3 (1667394 LOC) (failure) -- real == shard 4 (1666524 LOC) (failure) -- real |
|
No description provided. |
, re-bless 4 DOOM goldens after #6899 (#6908) * Refresh the call-graph accuracy baseline for c, cpp, tcl after #6864/#6870/#6881 Per-commit runs on the pinned crucible (v1.7.0) attribute every drop: - #6864 (tcl switch arms): tcl recall 71.2 -> 69.3 - #6870 (dead preprocessor branches): c recall 99.3 -> 96.4, cpp recall 99.0 -> 97.6; the new misses are calls behind toggles never defined in the tree (Py_GIL_DISABLED, Py_REF_DEBUG, MZ_USE_JIT, MICROPY_GC_SPLIT_HEAP) that tree-sitter still counts - #6881 (macro bodies expanded at the use site): c precision 99.4 -> 97.4, cpp 98.2 -> 97.8; tree-sitter cannot see calls inside macro bodies None of the three refreshed the baseline, so the gate failed on every engine PR since. Only c, cpp and tcl change; other languages untouched. Part of #6770 Co-Authored-By: Claude Opus 5.5 <[email protected]> * DOOM-rosetta: re-bless odamex, gzdoom, fastdoom, srb2 after #6899 #6899 merged with these four goldens drifted (its own DOOM-rosetta run 40715491522 failed on them). Only summary.callgraph_unscored moves, plus callgraph_precision in the fourth decimal on three ports: odamex precision 0.983 -> 0.9829, unscored 576 -> 578 gzdoom precision 0.9662 -> 0.9663, unscored 3894 -> 3889 fastdoom precision 0.9993 -> 0.9997, unscored 87 -> 86 srb2 unscored 2531 -> 2530 No expected_fails change. A local check on main reproduced CI's drift exactly. Part of #6266 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes #5909
Checklist: done [c:973abada]
Checklist: done [c:34e2c553]
What
A same-length per-language
_calls_out_rewritehook (documented insignal_contracts.py) runs beforecalls_outscans a block, at both scan sites (the unit scan and the nested-unit rescan). Both gaps need balanced-brace / balanced-paren context a regex cannot carry._expose_switch_armsfinds eachswitch [opts] [--] subject {arms}(or inline arm list), blanks every arm label, and moves a braced body onto its own line with;as a line break, sox { doX }reachesdoXand the label stops reading as a call. Also: the call-scan shield treated tcl's--option terminator as a comment, which ate the arm list's{inswitch -- $v {(tcl now shares the shell branch:#only)._blank_let_bindersblanks every binder oflet,let*,letrec,letrec*,fluid-let,do(named-let first binding, second+ bindings, bare-name inits) and the formals oflet-values/let*-values; the init expressions stay. Replaces the fixed-width lookbehinds.Class / Sibling gaps
Class: a name written in a binding/label position that the line-start /
(call regex reads as a call, or a body it cannot see. Members covered here: tcl switch arms (one-line, multi-line, quoted / braced /$varlabels,-fallthrough,default, option forms-exact/-glob/--, inline unbraced list, nested switch); scheme binders of all six let-family forms plus let-values. Tests:test_calls_out_rewrite_5909.py(every form parametrized, plus negatives: a call outside a let/switch is kept).Sibling gaps:
a "doX") or a bare-word body is not exposed beyond the existing single-word case; not needed by the checklist.switch(withLock $m { doX }) still misses its body; needs a command-argument model, different mechanism (issue's wording; not in the two checklist lines).define-values,receive,case-lambdaformals, and Racket[ ]bindings are not blanked (different binder shapes;[is not matched by the family pattern anyway).Golden drift (attributed)
tcl: 64 entries in macports (labels such as
bzr,default,standard,setleavecalls_out_to; bodies gained). scheme: 139 (binders such asx,f,move2leave). Everything else (scope_check) is Z-score / PageRank / network-rollup float drift from those call-edge changes, no non-tcl/scheme calls changed. Blessed viagolden-lock.sh crucible_check.py --update --yes.File-cap exception:
docs/signal_contracts.mdis generated (tests/signal_contract_audit.py --render, header says do not edit by hand) from the one-linesignal_contracts.pyedit; the 5 hand-written files aredetector.py,signal_contracts.py,scheme.py,tcl.pyand the test.Gates
pr_gates --fast9/9,--ratchets9 pass / 0 skipped; pre-PR guard tests + time ratchet clean; tcl/scheme/core_engine tests green.translatorextra not installed: det tests were not part of this run.🤖 Generated with Claude Code