feat(phi): Phase 25.1 - LoopForm v2 テスト・最小再現ケース追加

-  最小再現ケース作成
  - apps/tests/minimal_ssa_skip_ws.hako: 確実に再現する10-30行ケース
  - apps/tests/minimal_ssa_bug*.hako: 段階的簡略化版
  - apps/tests/loopform_*.hako: LoopForm v2 各ケーステスト

-  Rustテストスイート追加
  - src/tests/mir_loopform_conditional_reassign.rs: 4ケース(Case A/B/C/D)
  - src/tests/mir_loopform_complex.rs: 複雑なパターン
  - 全テストPASS確認済み

-  SSAバグ分析ドキュメント
  - docs/development/analysis/minimal_ssa_bug_analysis.md
  - エラー詳細・原因・ワークアラウンド記録

🎯 成果: SSAバグの構造を完全特定、デバッグ準備完了
This commit is contained in:
nyash-codex
2025-11-21 06:21:45 +09:00
parent a7ad456c8c
commit 6865f4acfa
16 changed files with 572 additions and 5 deletions

View File

@ -5,8 +5,8 @@
* Focus: predecessor tracking and PHI input generation for break statements
*/
use crate::parser::NyashParser;
use crate::mir::{MirCompiler, MirVerifier};
use crate::parser::NyashParser;
#[test]
fn test_loopform_exit_phi_single_break() {
@ -33,8 +33,7 @@ static box TestExitPhi {
println!("=== Test: Single break statement ===");
// Parse
let ast = NyashParser::parse_from_string(src)
.expect("parse failed");
let ast = NyashParser::parse_from_string(src).expect("parse failed");
// Compile
let mut mc = MirCompiler::with_options(false);
@ -46,8 +45,12 @@ static box TestExitPhi {
eprintln!("Entry block: {:?}", func.entry_block);
eprintln!("Total blocks: {}", func.blocks.len());
for (bid, block) in &func.blocks {
eprintln!(" Block {:?}: {} instructions, successors={:?}",
bid, block.instructions.len(), block.successors);
eprintln!(
" Block {:?}: {} instructions, successors={:?}",
bid,
block.instructions.len(),
block.successors
);
if *bid == crate::mir::BasicBlockId(10) {
eprintln!(" BB10 instructions:");
for inst in &block.instructions {