Diagnostic Tooling Improvements

7 sections

100%
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
Section 1 Complete

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

30/30 tasks
Section 2 Complete

Enhance diagnose-aot.sh

Add codegen-audit, ARC IR dump, debug+release dual-build, and ORI_VERIFY_ARC to the primary AOT diagnostic tool

28/28 tasks
Section 3 Complete

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'

43/43 tasks
Section 4 Complete

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

85/85 tasks
Section 5 Complete

AIMS Pass Bisection

Create bisect-passes.sh that automatically identifies which AIMS pipeline phase introduced an RC imbalance or structural change

67/67 tasks
Section 6 Complete

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

54/54 tasks
Section 7 Complete

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

46/46 tasks