docs(plan): Phase 273 P4 - Plan Line SSOT Documentation Finalization

Phase 273 P4 では、Plan ライン(Extractor → Normalizer → Verifier → Lowerer)を
"current operational SSOT" として文書化し、アーキテクチャの収束を明文化した。

## Changes

### router.rs docstring 更新
- "Phase 273 P3: Plan Line is Current SSOT for Pattern6/7" セクション追加
- ルーティング戦略を明示(Plan entry points → legacy table)
- SSOT Entry Points を列挙(Pattern6/7 Normalizer, Pattern1-5 各 Lowerer)

### phase-273/README.md 更新
- P3 completion section 追加(generalized CoreLoopPlan 移行完了)
- P3+ Legacy Removal section 追加(~174 lines 削除記録)
- P4 Proposal section 追加(Documentation Finalization チェックリスト)
- SSOT Documentation Entry Points リスト追加(5 つの SSOT 入口)

### joinir-architecture-overview.md 更新
- Section 2.1.2 "Plan-Based Patterns (Pattern6-7, Phase 273 P3)" 追加
- Plan Extractor, Normalizer, Verifier, Lowerer の Box 構造を文書化
- Plan line vs JoinIR line 比較表追加(収束性・SSOT 特性の対比)
- SSOT characteristics リスト追加(Normalizer SSOT, emit_frag SSOT 等)

## SSOT Entry Points(Phase 273 P3 完了時点)

1. **ルーティング**: `router.rs::route_loop_pattern()` - Pattern6/7 Plan entry points
2. **型定義**: `plan/mod.rs` - DomainPlan/CorePlan 固定語彙
3. **正規化**: `plan/normalizer.rs` - Pattern 固有知識一元管理
4. **検証**: `plan/verifier.rs` - fail-fast 不変条件(V2-V9)
5. **降格**: `plan/lowerer.rs` - Pattern-agnostic MIR emission

## Test

-  VM regression: phase254_p0_index_of_vm.sh (PASS)
-  LLVM regression: phase258_p0_index_of_string_llvm_exe.sh (PASS)

🤖 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-23 00:34:38 +09:00
parent 1b7fd7a0ff
commit 6f1d0df187
3 changed files with 168 additions and 12 deletions

View File

@ -121,17 +121,75 @@ 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`
- P3 Claude Code: `docs/development/current/main/phases/phase-273/P3-CLAUDE.md`
## Next (P3 proposal)
## P3 完了 (2025-12-23)
P2追加した “legacy fallback残したままだと、Lowerer の中に `emit_scan_with_init_edgecfg()` 等の旧経路が残り続ける
収束を完成させるには、次を P3 で行うのが良い:
P3は Pattern6 を generalized CoreLoopPlan に移行し、legacy fallback を撤去して Plan ラインの収束を完成させた
- Pattern6 generalized CoreLoopPlan`frag/block_effects/phis/final_values`移行
- `lower_loop_legacy()` を撤去し、generalized 経路を SSOT 化Fail-Fast
- CoreLoopPlan の `Option<...>` フィールドを必須化(構造で “揺れ” を消す
- Pattern6: generalized CoreLoopPlan`frag/block_effects/phis/final_values`へ完全移行
- ✅ CoreLoopPlan: すべてのフィールドを必須化(`Option` 削除
- ✅ Lowerer: `lower_loop_legacy()` 撤去、CorePlan SSOT 化Fail-Fast
- ✅ PlanLowerer: Pattern 固有参照(`emit_scan_with_init_edgecfg()` 等)を完全削除
- ✅ route_loop_pattern(): Plan ラインを明示的 SSOT として文書化
## Future Work (P2+)
### SSOT Documentation Entry Points
P3 完了により、以下が Plan ライン SSOT の入口となった:
1. **ルーティング SSOT**: `src/mir/builder/control_flow/joinir/patterns/router.rs::route_loop_pattern()`
- Pattern6/7 Plan-based entry pointslines 294-354
- Legacy patterns (1-5, 8-9) LOOP_PATTERNS tablelines 362-368
2. **型定義 SSOT**: `src/mir/builder/control_flow/plan/mod.rs`
- `DomainPlan { ScanWithInit, SplitScan, ... }`
- `CorePlan { Seq, Loop, If, Effect, Exit }`
- `CoreLoopPlan { block_effects, phis, frag, final_values }`
3. **正規化 SSOT**: `src/mir/builder/control_flow/plan/normalizer.rs`
- Pattern 固有知識の一元管理ScanWithInit/SplitScan normalization
4. **検証 SSOT**: `src/mir/builder/control_flow/plan/verifier.rs`
- fail-fast 不変条件チェックV2-V9
5. **降格 SSOT**: `src/mir/builder/control_flow/plan/lowerer.rs`
- Pattern 知識なし、CorePlan のみ処理
- emit_frag() で terminator SSOT
### P3+ Legacy Removal (2025-12-23)
P3 完了後、さらにレガシーコードを削除:
-`emit_scan_with_init_edgecfg()` 関数削除(~144 lines
-`CoreCarrierInfo` 構造体削除(~15 lines
-`verify_carrier()` 関数削除(~15 lines
- ✅ 未使用 import 削除cargo fix、~30 files
**Total lines removed**: ~174 lines (net reduction)
---
## P4 Proposal (Documentation Finalization)
P4 では、アーキテクチャドキュメントを Plan ラインで完全更新し、「現行 SSOT」を明確に標記する
1. **router.rs docstring 更新**
- "Phase 273 P3: Plan Line is Current SSOT for Pattern6/7" 追加
- ルーティング戦略を明示Plan entry points → legacy table
- SSOT Entry Points を列挙
2. **joinir-architecture-overview.md 更新**
- Section 2.1.2 追加Plan-based patterns 専用セクション)
- Section 0 の「target shape」を「current operational shape」に更新
- routing order diagram を Plan entry points 込みで再描画
3. **Phase 273 README.md 更新**
- P3 completion section 追加
- P4 proposal → "Documentation Finalization"
---
## Future Work (P5+)
1. **Pattern7/8/9 DomainPlan 追加**: Split, BoolPredicate 等を DomainPlan に追加
2. **Normalizer 拡張**: 各 DomainPlan → CorePlan 変換