You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dead C preprocessor branches (#if 0) are counted at file and function level; the macro shield only serves brace matching #2814
Found while moving the proximity weights out of the recorded counts (#2813, roadmap Phase 2).
What the test claimed
tests/core_engine/test_detector.py::test_detector_c_macro_dead_branch_shield asserted that a strcpy inside a dead preprocessor branch is "scrubbed by the preprocessor shield before the regex engine even sees it" (high_risk_execution == 0).
What actually happens
The recorded count was 0 only because the strncpy in the #else branch, 500 chars away in the same function, tallied one mitigated_danger and the Silencer Region subtracted it from the count in place. With the count raw (#2813) the truth is visible:
_build_brace_safe_stream's macro shield (the #if 1 / #if 0 policy stack, #1720) only produces the brace-safe stream used to find function boundaries. Neither coding_analysis()'s file-level counts nor _calculate_block_metrics' per-function hit_vector read that stream, so a statically dead #if 0 branch is counted exactly like live code, at both levels.
Why it matters
This is a stream-contract question (gitgalaxy/standards/signal_contracts.py STREAM_CONTRACT): does a rule see text the compiler never compiles? Today's answer is yes and it is written down nowhere. Either the stream contract states it (and the test pins it as such), or the dead branch is blanked in the code stream for the C family before counting. Not decided here; the test now pins the current behaviour and points at this issue.
Activity
feat(core): recorded signal counts are raw counts; proximity weights …
test(crucible): regen golden masters for dead-branch blanking + adver…
fix(core): blank statically-dead C preprocessor branches before count…