docs(phase29am): mark p0 done; add p1 seq flatten instructions

This commit is contained in:
2025-12-29 16:49:05 +09:00
parent 2dbc4b5968
commit 3c76d8eabf
5 changed files with 77 additions and 2 deletions

View File

@ -2,11 +2,16 @@
## Current Focus: Phase 29amCorePlan Step-A implementation
Next: Phase 29am P0CorePlan::If/CorePlan::Exit lowerer/verifier
Next: Phase 29am P1Loop body Seq flatten
運用ルール: integration filter で phase143_* は回さないJoinIR 回帰は phase29ae pack のみ)
運用ルール: phase286_pattern9_* は legacy pack (SKIP) を使う
移行道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md`
**2025-12-29: Phase 29am P0 完了**
- 目的: CorePlan の If/Exit を lowerer/verifier で扱えるようにして、CorePlan 移行の土台を作る(仕様不変)
- 変更: `src/mir/builder/control_flow/plan/lowerer.rs` / `src/mir/builder/control_flow/plan/verifier.rs`
- 検証: `cargo build --release` / `./tools/smokes/v2/run.sh --profile quick` / `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
**2025-12-29: Phase 29al P3 完了**
- 目的: cleanup を ExitKind と effect の契約として固定(仕様不変)
- SSOT: `docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md`

View File

@ -37,7 +37,8 @@ Related:
- **Phase 29amcandidate: CorePlan Step-A implementation (lowerer/verifier)**
- 入口: `docs/development/current/main/phases/phase-29am/README.md`
- Next: P0CorePlan::If/CorePlan::Exit lowerer/verifier
- 状況: P0 ✅ 完了
- Next: P1Loop body Seq flatten
- Gate: `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
- **Phase 29aicandidate: Plan/Frag single-plannerFacts SSOT**

View File

@ -0,0 +1,61 @@
---
Status: Active
Scope: code仕様不変、CorePlan互換性の拡張
Related:
- docs/development/current/main/phases/phase-29am/README.md
- docs/development/current/main/design/coreplan-migration-roadmap-ssot.md
- docs/development/current/main/design/post-phi-final-form-ssot.md
---
# Phase 29am P1: CoreLoopPlan body supports Seq-of-effects (flatten)
Date: 2025-12-29
Status: Ready for execution
Scope: `CoreLoopPlan.body` の “Effect-only” 制約を維持したまま、`Seq([Effect...])` を flatten して emit できるようにする
## Why
現状:
- `lower_loop_generalized()``loop_plan.body``CorePlan::Effect` しか許可していない
- しかし Normalizer/Composer の合成都合で `Seq([Effect...])` が自然に出る(将来の Skeleton+Feature 合成で顕在化しやすい)
ここを先に受理しておくと、CorePlan 合成の自由度が上がる一方で、CFG/Frag を壊さないbranch/exit は body_bb では扱わない)。
## Non-goals
- `CorePlan::If``loop_plan.body` に入れるbranch は Frag が SSOT
- `CorePlan::Exit``loop_plan.body` に入れるexit は ExitMap/Frag が SSOT
- 既存のルーティング/観測/エラー文字列の変更
## Implementation
### Step 1: lowerer で Seq-of-effects を flatten
Target:
- `src/mir/builder/control_flow/plan/lowerer.rs`
Change:
- `lower_loop_generalized()` の body_bb special handling を拡張する
- 許可する形:
- `CorePlan::Effect(_)`
- `CorePlan::Seq([CorePlan::Effect(_), ...])`(入れ子 Seq は再帰 flatten
- それ以外If/Exit/Loopは従来通り error挙動不変
### Step 2: unit tests
Target:
- `src/mir/builder/control_flow/plan/lowerer.rs` の tests
Add:
- `CoreLoopPlan.body``Seq([Effect...])` を入れて PASS
## Verification
- `cargo build --release`
- `./tools/smokes/v2/run.sh --profile quick`
- `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
## Commit
- `git add -A && git commit -m "phase29am(p1): flatten seq-of-effects in core loop body"`

View File

@ -20,3 +20,8 @@ SSOT 道筋: `docs/development/current/main/design/coreplan-migration-roadmap-ss
- ねらい: 既存のルーティング/観測を変えずに、CorePlan 側の “未対応エラー” を減らす(仕様不変)
- Gate: `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
## P1: Allow Seq-of-effects in CoreLoopPlan body (flatten)
- 指示書: `docs/development/current/main/phases/phase-29am/P1-CORELOOP-BODY-SEQ-FLATTEN-INSTRUCTIONS.md`
- ねらい: ループ body_bb では “Effect だけ” を前提にしつつ、`Seq([Effect...])` を安全に flatten して emit できるようにする
- 非目的: `If/Exit` を body_bb に入れる(これは Frag/ExitMap 側の語彙で表現する)