docs(phase-286): P2.2 完了 + P2.3 準備中の進捗記載

更新内容:
- Phase 286 README に P2.2  COMPLETE セクション追加
  - extractor helper化(extract_loop_increment_plan 統一)の内容
  - router helper化(lower_via_plan() 追加)の内容
  - 削減行数(~65行)と検証結果(quick 154 PASS, PoC 両方 PASS)

- 10-Now.md の Current Focus を Phase 286 P2.3 に更新
  - P2/P2.1/P2.2 の完了を時系列記載
  - Pattern9 (AccumConstLoop) を次の PoC 対象に決定

- CURRENT_TASK.md の Handoff(現状)を更新
  - P2.2 COMPLETE の記載(hygiene 内容 + 成果)
  - P2.3 準備中(Pattern9 PoC 準備)の1段落を追加

- pattern2-deferred.md 新規作成
  - Pattern2 の複雑性(break値再接続)を説明
  - 再開条件(after_bb PHI + compose::loop_ + Break wiring)を明文化
  - Phase 286 P2.2 として後続タスク化

関連 issues: Phase 286 JoinIR Line Absorption

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-26 02:03:34 +09:00
parent a824346e30
commit 6656098c95
4 changed files with 112 additions and 21 deletions

View File

@ -1,21 +1,29 @@
# Self Current Task — Now (main)
## Current Focus (next)
## Current Focus: Phase 286 P2.3 (Next PoC Target Selection)
**2025-12-25: Phase 288.1 完了**
- REPL session persistence + auto-display 実装完了
- AST rewrite 方式__repl.get/set ExternCall
- 154/154 smoke tests PASSfile mode 不変)
- 詳細: `docs/development/current/main/phases/phase-288/README.md`
Pattern1 → Plan/Frag SSOT 化まで完了。次は Pattern9 (AccumConstLoop) を Plan化 PoC の対象に決定。
**次の候補**:
1. **Phase 288.2+** (REPL UX improvements): Multi-line input, syntax highlighting, history
**2025-12-26: Phase 286 P2 完了**
- Pattern4 (Loop with Continue) → Plan/Frag SSOT 化 PoC 成功
- phi_bindings 導入で PHI dst 参照を正しく解決
- Integration test PASS (output: 6), quick smoke 154/154 PASS
**2025-12-26: Phase 286 P2.1 完了**
- Pattern1 (SimpleWhile) → Plan/Frag SSOT 化 PoC 成功
- Integration test PASS (return: 3), quick smoke 154/154 PASS
- Plan line routing: `route=plan strategy=extract pattern=Pattern1_SimpleWhile`
**2025-12-26: Phase 286 P2.2 完了**
- extractor helper化: `extract_loop_increment_plan``common_helpers.rs` に統一(重複排除 ~25行
- router helper化: `lower_via_plan()` 追加で Pattern6/7/4/1 の boilerplate 削減(~40行
- quick smoke 154/154 PASS 維持、Pattern1/4 PoC 両方 PASS
**次のステップ**:
1. **Phase 286 P2.3** (current): Pattern9 (AccumConstLoop) Plan化 PoC 準備
- 橋渡しパターン、粒度小さい → 次に Pattern8 へ
2. **Phase 284** (design-first): Return as ExitKind SSOT
- 入口: `docs/development/current/main/phases/phase-284/README.md`
- 手順: `docs/development/current/main/phases/phase-284/P0-INSTRUCTIONS.md`
3. **JoinIR/slot improvements**: Phase 285/286 継続
- Phase 285: Box lifecycle SSOT
- Phase 286: JoinIR line absorption
3. **Phase 288.2+** (REPL UX improvements): Multi-line input, syntax highlighting, history
## Recently Completed

View File

@ -1,6 +1,6 @@
# Phase 286: JoinIR Line AbsorptionJoinIR→CorePlan/Frag 収束)
Status: In Progress (P0, P1, P3, 286C-2 COMPLETE; P2 pending)
Status: In Progress (P0, P1, P2, P3, 286C-2 COMPLETE)
## Goal
@ -88,10 +88,64 @@ Phase 286 では JoinIR line を “第2の lowerer” として放置せず、*
- **エラーメッセージ改善**: `verify_boundary_contract_at_creation()``context: &str` パラメータ追加
- **docs反映**: SSOTドキュメントに脚注形式で数値記載、新API使用の明記
### P2PoC
### P2PoC✅ COMPLETE (2025-12-26)
- 代表 1 パターン(例: Pattern4を "JoinIR 生成 → CorePlan/Frag" に変換する PoC
- 目的: merge を通さずに `emit_frag()` 経由で終端が生成できることの証明
**完了内容**:
- **Pattern4 (Loop with Continue) を Plan/Frag SSOT に移行**
- DomainPlan::Pattern4Continue 追加
- PlanNormalizer::normalize_pattern4_continue() 実装phi_bindings によるAST抽出ベース
- Router integrationPlan line routing → legacy fallback
**成果物**:
- `apps/tests/phase286_pattern4_frag_poc.hako` (最小fixture: single continue)
- `tools/smokes/v2/profiles/integration/apps/phase286_pattern4_frag_poc.sh` (integration smoke)
- `src/mir/builder/control_flow/plan/mod.rs` (Pattern4ContinuePlan struct追加)
- `src/mir/builder/control_flow/joinir/patterns/extractors/pattern4.rs` (extract_pattern4_plan追加)
- `src/mir/builder/control_flow/joinir/patterns/router.rs` (Plan routing追加)
- `src/mir/builder/control_flow/plan/normalizer.rs` (normalize_pattern4_continue + phi_bindings)
**重要な設計決定**:
- **phi_bindings**: lower_*_ast関数でPHI dstを優先参照variable_mapの初期値ではなく
- **2-step branching + header PHI merge**: NO Select instructionCoreEffectPlanにない
- **carrier passthrough**: Add 0 不要、carrier_current をそのままPHI入力に渡す
**検証結果**:
- Integration test: phase286_pattern4_frag_poc.sh PASS (output: 6)
- Regression test: quick smoke 154 PASS, 0 FAILED
**Pattern2 調査結果(別タスク化)**:
- break経路の値再接続が複雑after_bbにPHI必要
- 詳細: [pattern2-deferred.md](./pattern2-deferred.md)
### P2.1PoC✅ COMPLETE (2025-12-26)
**完了内容**:
- **Pattern1 (SimpleWhile) を Plan/Frag SSOT に移行**
- DomainPlan::Pattern1SimpleWhile 追加
- PlanNormalizer::normalize_pattern1_simple_while() 実装phi_bindings によるPHI dst優先参照
- Router integrationPlan line routing → legacy fallback
**検証結果**:
- Integration test: `phase286_pattern1_frag_poc` PASS (return: 3)
- Regression test: quick smoke 154 PASS, 0 FAILED
### P2.2 (hygiene: extractor重複排除 + router小整理) ✅ COMPLETE (2025-12-26)
**完了内容**:
- **extractor helper化**: `extract_loop_increment_plan``common_helpers.rs` に統一
- Pattern1/Pattern4 が呼ぶだけに変更(重複排除 ~25行
- **router helper化**: `lower_via_plan()` を追加し Pattern6/7/4/1 で共用
- 3行パターンnormalize→verify→lowerを1関数に集約ボイラープレート削減 ~40行
**成果物**:
- `src/mir/builder/control_flow/joinir/patterns/extractors/common_helpers.rs` (変更)
- `src/mir/builder/control_flow/joinir/patterns/extractors/pattern1.rs` (変更)
- `src/mir/builder/control_flow/joinir/patterns/extractors/pattern4.rs` (変更)
- `src/mir/builder/control_flow/joinir/patterns/router.rs` (変更)
**検証結果**:
- Regression test: quick smoke 154 PASS
- Pattern1 PoC: PASS, Pattern4 PoC: PASS
### P3 (error context enrichment) ✅ COMPLETE (2025-12-25)
@ -145,4 +199,3 @@ Phase 286 では JoinIR line を “第2の lowerer” として放置せず、*
- 2本の lowering が “設計として” どこで 1 本に収束するかが明文化されている
- Phase 284Return/ Phase 285GCと矛盾しない

View File

@ -0,0 +1,27 @@
# Pattern2 (Loop with Break) - Deferred to Future Phase
**Date**: 2025-12-26
**Status**: Investigation complete, implementation deferred
## Summary
Pattern2 requires complex value reconnection at the exit point:
- break経路ではcarrier更新が実行されない
- after_bbにPHI必要header経路 vs break経路の値選択
- compose::loop_との統合、ExitKind::Break配線が必要
Pattern4 (Loop with Continue) PoC成功後の別タスクとして実装予定。
## 再開条件
以下が揃った時に **Phase 286 P2.3** として Pattern2 Plan化を再開
1. after_bb PHI 生成ロジックの設計完了
2. compose::loop_ との統合方針決定
3. ExitKind::Break wiring の実装
→ 条件が揃ったら Phase 286 P2.3 にエスカレート
## Reference
- [joinir-architecture-overview.md](../../joinir-architecture-overview.md) - Pattern2の制約記載
- [Phase 286 README](./README.md) - Phase全体の進捗