2.1 KiB
§104 — Two silent-skip defects in one scan: match on MASKED text, emit from the ORIGINAL (Phase 29 T53, gather_externs)
family_remap.gather_externs decides which of the exemplar TU's file-scope externs to carry into a
templated sibling. It scanned raw text, which gave it two defects of the §96 class (matching by
TEXT rather than by what the compiler sees):
- A symbol named only in PROSE counted as a reference.
func_80135260's header comment mentions its siblingfunc_80135D20twice, so the scan demanded a declaration for it, found none, and printed "1 referenced symbol(s) have NO file-scope decl … the sibling will not compile" on all 137 members. It was wrong every time — T52 banked 132/132 against that warning. Two tasks read it as a possible cause before it was measured. - A commented-out
externcould be selected as the carried declaration and spliced into the sibling as live code. Not observed in the corpus; closed by construction.
The fix is a two-text discipline, not a smarter regex: MATCH on cdecl._masked text, EMIT by span
from the original. _mask is length-preserving, so offsets index both. A masked declaration is all
blanks — emitting from the mask would splice whitespace, which is why "just mask it" is a bug and
"mask for the search, slice the original" is the fix.
stmts = [(mask[s.start():s.end()], orig[s.start():s.end()]) # (what you search, what you emit)
for s in EXTERN_STMT.finditer(mask)]
hit = next((emit for searchable, emit in stmts if word.search(searchable)), None)
Verified as a no-op on output: 20 (exemplar, sibling) draft pairs across 4 families, old code vs new, 20 identical / 0 differing. The only behavioural change is that a false warning stopped firing.
The law: a warning with a high false-alarm rate is worse than no warning — it trains you to ignore the channel that reports real causes. This one fired on 137/137 and was right 0 times. When a diagnostic disagrees with a measurement, fix the diagnostic in the same session (R30), or the next reader pays the same tax.