Files
hakorune/docs/development/current/main/phases/phase-273/P2-COMPLETION.md
tomoaki 1b7fd7a0ff 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>
2025-12-23 00:11:20 +09:00

1.4 KiB
Raw Blame History

Phase 273 P2 Completion (2025-12-22)

P2 Goal:

  • Pattern7split scanを Plan ラインDomainPlan→CorePlan→Lowererへ移行し、Lowerer の “pattern知識” を増やさない。

Delivered

  • CoreEffectPlan: 副作用対応

    • MethodCalldst: Option<ValueId> を持てる(push 等の void-return 対応)
    • effects: EffectMask を CorePlan から指定できるPURE ではない呼び出しを明示)
  • CoreLoopPlan: 一般化Pattern6/7 の収束点)

    • block_effects: Vec<(BasicBlockId, Vec<CoreEffectPlan>)>
    • phis: Vec<CorePhiInfo>
    • frag: Fragterminator SSOT: emit_frag()
    • final_values: Vec<(String, ValueId)>variable_map 更新の SSOT
  • Pattern7: Plan ライン移行

    • Extractor は purebuilder を触らない)
    • Normalizer が split 固有のブロック構造/PHI/Frag を決定SSOT
    • Lowerer は CorePlan を吐くだけpattern-agnostic

Regression / Validation

  • VM:
    • tools/smokes/v2/profiles/integration/apps/phase256_p0_split_vm.sh PASSPattern7
    • tools/smokes/v2/profiles/integration/apps/phase258_p0_index_of_string_vm.sh PASSPattern6

Notes

  • P2 は “generalized 経路” と “legacy fallback” を共存させた(移行中の安全策)。
  • 次の P3 で Pattern6 も generalized 経路へ移し、legacy fallback を撤去すると収束が完成する。