P1.1: Pattern6 false positive fix (SSOT approach) - can_lower() now calls extract_scan_with_init_parts() for SSOT - index_of_string/2 no longer triggers false positive - Graceful fall-through with Ok(None) P1.2: LoopHeaderPhi CFG-based correction - Step 0: Manual successor update from terminators - CFG-based entry predecessor computation (header_preds - latch) - Multi-entry-pred support (bb0 host + bb10 JoinIR main) - Explicit host_entry_block addition (emit_jump runs after finalize) P1.3: Smoke script validation - phase254_p0_index_of_vm.sh: --verify + VM error detection - phase257 smokes updated Acceptance criteria (all PASS): ✅ phase254_p0_index_of_min.hako verify ✅ phase257_p0_last_index_of_min.hako verify ✅ ./tools/smokes/v2/run.sh --profile quick (no Pattern6 false positive) Technical discovery: - Host entry block (bb0) Jump set in Phase 6 (after finalize) - instruction_rewriter bypasses set_terminator(), skips successor update 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Investigations Folder
This folder contains investigation notes and analysis for debugging sessions.
Active Investigations
Phase 131-12: LLVM Wrong Result (Case C)
Status: ✅ Root cause identified Problem: LLVM backend returns wrong results for loop exit values Root Cause: vmap object identity mismatch between Pass A and Pass C
Key Documents:
- phase131-12-case-c-llvm-wrong-result.md - Initial investigation scope
- phase131-12-p1-vmap-identity-analysis.md - Detailed trace analysis
- phase131-12-p1-trace-summary.md - Executive summary with fix recommendations
Quick Summary:
- Bug: Pass A deletes
_current_vmapbefore Pass C runs - Impact: Terminators use wrong vmap object, missing all Pass A writes
- Fix: Store vmap_cur in deferred_terminators tuple (Option 3)
Next Steps:
- Implement Option 3 fix in block_lower.py
- Add Fail-Fast check in instruction_lower.py
- Verify with NYASH_LLVM_VMAP_TRACE=1
- Run full test suite
Trace Environment Variables
Phase 131-12-P1 Traces
NYASH_LLVM_VMAP_TRACE=1 # Object identity and vmap keys tracing
NYASH_LLVM_USE_HARNESS=1 # Enable llvmlite harness
NYASH_LLVM_DUMP_IR=<path> # Save LLVM IR to file
Investigation Workflow
- Scope - Define problem and test case (phase131-12-case-c-*.md)
- Trace - Add instrumentation and collect data (phase131-12-p1-vmap-identity-*.md)
- Analysis - Identify root cause with evidence (phase131-12-p1-trace-summary.md)
- Fix - Implement solution with validation
- Document - Update investigation notes with results
Archive
Completed investigations are kept for reference and pattern recognition.
JoinIR Generalization Study (Historical)
joinir-generalization-study.md(Phase 131–138 の状況と一般化案の相談用コンテキスト。SSOT は design/ を参照)