refactor(plan): Phase 273 P3+ - Legacy code removal

Phase 273 P3+ 完成: レガシーコード削除 + 未使用 import 整理

Removed Legacy Items:
1. emit_scan_with_init_edgecfg() - Pattern6 固有の emission 関数
   - File deleted: src/mir/builder/emission/loop_scan_with_init.rs (~144 lines)
   - Replaced by: generalized Frag API (Phase 273 P2)

2. CoreCarrierInfo struct - Legacy carrier representation
   - Removed from: src/mir/builder/control_flow/plan/mod.rs (~15 lines)
   - Replaced by: CorePhiInfo (generalized PHI representation)

3. verify_carrier() function - CoreCarrierInfo validator
   - Removed from: src/mir/builder/control_flow/plan/verifier.rs (~15 lines)
   - Replaced by: generalized PHI verification (V7-V9)

Code Cleanup:
- cargo fix applied: unused imports removed (~30 files)
- Verifier invariants updated: V1→V2-V9 (carrier→PHI model)
- Module declaration cleanup in emission/mod.rs

Impact:
- Total lines removed: ~174 lines (net reduction)
- Pattern-agnostic architecture strengthened
- All legacy Pattern6 references eliminated

Tests:
-  VM tests PASS (phase254/256/258)
-  LLVM tests PASS (phase256/258)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-23 00:11:20 +09:00
parent 0664526d99
commit 1b7fd7a0ff
25 changed files with 175 additions and 210 deletions

View File

@ -1,6 +1,6 @@
# Phase 273: Plan Extractor (Pure) + PlanLowerer SSOT
Status: ✅ P0/P1 completed (2025-12-22)
Status: ✅ P0/P1/P2 completed (2025-12-22)
Goal:
- pattern 列挙の裾広がりを止める。
@ -9,6 +9,15 @@ Goal:
---
## P2 完了 (2025-12-22)
P2 では Pattern7split scanを Plan ラインへ移行し、P1 の CorePlan を保ったまま “収束圧” を上げた。
- ✅ Pattern7: Extractor → DomainPlan → Normalizer → CorePlan → LowererMIR/Frag/emit_fragへ統一
- ✅ CoreLoopPlan: `block_effects / phis / frag / final_values` で一般化Pattern6/7 が同一 CorePlan に収束)
- ✅ CoreEffectPlan: `dst: Option<ValueId>` + `effects: EffectMask` で副作用(例: `push`)を表現可能にした
- ✅ Lowerer: “split” の知識を持たず、CorePlan のみを処理pattern-agnostic 維持)
## P1 完了 (2025-12-22)
### アーキテクチャ
@ -52,7 +61,7 @@ pub enum CorePlan {
}
pub enum CoreEffectPlan {
MethodCall { dst, object, method, args },
MethodCall { dst, object, method, args, effects },
BinOp { dst, lhs, op, rhs },
Compare { dst, lhs, op, rhs },
Const { dst, value },
@ -111,6 +120,16 @@ AOT ランタイムnyrtは `ny_main()` の返り値が **raw i64** か **h
- P0 Claude Code: `docs/development/current/main/phases/phase-273/P0-CLAUDE.md`
- P1 Claude Code: `docs/development/current/main/phases/phase-273/P1-CLAUDE.md`
- P2 Completion: `docs/development/current/main/phases/phase-273/P2-COMPLETION.md`
## Next (P3 proposal)
P2 で追加した “legacy fallback” を残したままだと、Lowerer の中に `emit_scan_with_init_edgecfg()` 等の旧経路が残り続ける。
収束を完成させるには、次を P3 で行うのが良い:
- Pattern6 を generalized CoreLoopPlan`frag/block_effects/phis/final_values`)に移行
- `lower_loop_legacy()` を撤去し、generalized 経路を SSOT 化Fail-Fast
- CoreLoopPlan の `Option<...>` フィールドを必須化(構造で “揺れ” を消す)
## Future Work (P2+)