Diagnostic Tooling Improvements
7 sections
Overview
Reduce debugging churn when tracking down hard AOT/LLVM/ARC/AIMS issues by fixing broken tools, enhancing existing scripts with missing diagnostic layers, creating new bisection tooling, expanding fixture coverage, and integrating diagnostic hints into the test harness. Sourced from a dual-source TPR review (Codex + Gemini, 15 findings, 6 thematic clusters) with architectural consensus from a subsequent /tp-help consultation.
Completed
7 sections
Remove aims-compare + Create debug-release-compare
Replace dead aims-compare.sh (uses non-existent --features aims) with a new debug-release-compare.sh that catches FastISel-only bugs
Enhance diagnose-aot.sh
Add codegen-audit, ARC IR dump, debug+release dual-build, and ORI_VERIFY_ARC to the primary AOT diagnostic tool
Enhance dual-exec-debug.sh
Auto-dump ARC IR and run codegen-audit on mismatch, export ORI_BIN for child script consistency, add ARC dump to build-failure branch, bridge the gap between 'these differ' and 'here is why'
Block-level RC Stats
Create a new rc_histogram pass separate from rc_balance.rs that counts ALL RC ops (alloc/inc/dec/free/cow) per basic block, emit typed JSON via serde, and update rc-stats.sh to consume it — with migration safety net comparing awk totals to JSON totals before awk removal
AIMS Pass Bisection
Create bisect-passes.sh that automatically identifies which AIMS pipeline phase introduced an RC imbalance or structural change
Expand Fixtures + Self-Test
Add 13+ new diagnostic fixtures covering the code patterns that cause the most AOT/AIMS debugging churn, update self-test.sh to exercise them with feature-specific assertions, and establish a fixture categorization system
Integration + Polish
Wire diagnostic hints into test-all.sh, fix ir-dump.sh DRIFT, add check-debug-flags.sh to CI, and update all documentation