refactor(joinir): unify boundary join_inputs SSOT (pattern4/6/7)

Apply Phase 256.8 SSOT fix to Pattern4/6/7:
- Use join_module.entry.params.clone() instead of hardcoded ValueIds
- Add fail-fast validation for params count mismatch
- Remove ValueId(0), ValueId(PARAM_MIN + k) patterns
- Clean up unused PARAM_MIN imports

This prevents entry_param_mismatch errors structurally and maintains
consistency with Pattern2/3.

Changes:
- pattern4_with_continue.rs: Lines 442-476 (SSOT extraction + validation)
- pattern6_scan_with_init.rs: Lines 447-471 (SSOT extraction + validation)
- pattern7_split_scan.rs: Lines 495-526 (SSOT extraction + validation)

All patterns now use the same SSOT principle:
1. Extract entry function (priority: join_module.entry → fallback "main")
2. Use params as SSOT: join_inputs = entry_func.params.clone()
3. Build host_inputs in expected order (pattern-specific)
4. Fail-fast validation: join_inputs.len() == host_inputs.len()

Verification:
- cargo build --release:  PASS (no PARAM_MIN warnings)
- Quick profile:  First FAIL still json_lint_vm (baseline maintained)
- Pattern6 smoke:  PASS (index_of test)
- Pattern7 smoke: Pre-existing phi pred mismatch (not introduced by SSOT)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-20 20:05:11 +09:00
parent 4439d64da3
commit edc7355937
20 changed files with 966 additions and 180 deletions

View File

@ -45,12 +45,14 @@
- Pattern6/index_of が VM/LLVM で PASS
- `loop_invariants` を導入して ConditionOnly 誤用を根治
## 2025-12-19Phase 256StringUtils.split/2 可変 step ループ)🔜
## 2025-12-19Phase 256StringUtils.split/2 可変 step ループ)
- Phase 256 README: `docs/development/current/main/phases/phase-256/README.md`
- Current first FAIL: `json_lint_vm`Pattern2 break cond: `this.is_whitespace(...)` needs `current_static_box_name`
- 状況:
- `MirInstruction::Select` の導入は完了、Pattern6index_ofは PASS 維持。
- Status:
- `StringUtils.split/2` は VM `--verify` / integration smoke まで PASS
- `--profile quick` の最初の FAIL は Phase 257`StringUtils.last_index_of/2`)へ移動
- 設計SSOT: `docs/development/current/main/design/join-explicit-cfg-construction.md`
- 直近の主要fix:
- `ValueId(57)` undefined は根治(原因は `const_1` 未初期化)。
- SSA undef`%49/%67`)は P1.7 で根治continuation 関数名の SSOT 不一致)。
- P1.8で ExitLine/jump_args の余剰許容と関数名マッピングを整流。
@ -59,6 +61,13 @@
- P1.11で ExitArgsCollector の expr_result slot 判定を明確化し、split が `--verify` / integration smoke まで PASS。
- P1.5-DBG: boundary entry params の契約チェックを追加VM実行前 fail-fast
- P1.6: 契約チェックの薄い集約 `run_all_pipeline_checks()` を導入pipeline の責務を縮退)。
- P1.13: Pattern2 boundary entry params を `join_module.entry.params` SSOT へ寄せたValueId 推測生成の撤去)。
## 2025-12-20Phase 257last_index_of early return loop🔜
- Phase 257 README: `docs/development/current/main/phases/phase-257/README.md`
- Goal: `StringUtils.last_index_of/2` を JoinIR で受理し、`--profile quick` を緑に戻す
- Investigation最小再現/論点): `docs/development/current/main/investigations/phase-257-last-index-of-loop-shape.md`
## 2025-12-19Phase 254index_of loop pattern✅ 完了Blocked by Phase 255