feat(edgecfg): Phase 268-270 savepoint (if_form adoption + Pattern9 minimal loop SSOT)

This commit is contained in:
2025-12-21 23:12:52 +09:00
parent 86a51cad2b
commit df715e909e
18 changed files with 1661 additions and 21 deletions

View File

@ -8,6 +8,24 @@ Related:
## 直近JoinIR/selfhost
- **Phase 270✅ 完了): JoinIR-only minimal loop SSOT**
- `apps/tests/phase270_p0_loop_min_const.hako` + VM smoke で “最小 const loop” を固定exit=3
- Pattern1 は test-only stub のため不適合 → Pattern9AccumConstLoopを橋渡しとして追加
- 詳細: `phases/phase-270/README.md`
- **Phase 269 P1planned: Pattern8 Frag lowerer 実装**
- stub → 実装compose::loop_() + emit_frag()
- MIR terminator 生成確認Branch/Jump/Return
- 既存 Pattern8 から Frag 版へ置換検討
- LLVM smoke test 追加
- 詳細: `phases/phase-269/README.md`
- **Phase 270+planned: Pattern6/7 への Frag 適用**
- Pattern6: Match scanindex_of 系)
- Pattern7: Split scansplit 系)
- 統一的なループ処理パターン確立
- Pattern 分岐削減
- **収束方針SSOT案: Expr/Condition/Control の 3 箱分割**
- ExprLowererBox式SSOT: `AST(expr)``(prelude, value)`ANF含む。pure/impure/whitelist/strict を集約入口SSOT
- ConditionLowererBox条件→分岐SSOT: `AST(cond)``BranchPlan`。評価順は ExprLowererBox に委譲し、`&&/||` は制御語彙で扱う。
@ -154,9 +172,30 @@ Related:
- 1 block = 1 terminatorwire/branch の衝突)を Fail-Fast
- unit tests + `cargo test -p nyash-rust --lib` PASS
- **P1延期**:
- 層を跨がない実適用は候補が抽象化層へ委譲済みのため、Phase 268 で体系的に適用する方針
- "層を跨がない実適用"は候補が抽象化層へ委譲済みのため、Phase 268 で体系的に適用する方針
- **詳細**: `docs/development/current/main/phases/phase-267/README.md`
- **(✅ 完了Phase 268: if_form.rs への Frag 適用 + entry edge-args SSOT化**
- **目的**: EdgeCFG Fragment を層を跨がずに実戦投入し、compose::if_() の edge-args を SSOT 化
- **完了内容P0**:
- emission/branch.rs に emit_conditional_edgecfg() 追加(薄いラッパー)
- if_form.rs を Frag+emit_frag 経由に変更emit_conditional + emit_jump を削除)
- emission 層経由で層が綺麗に保たれる
- **完了内容P1**:
- compose::if_() シグネチャ変更then_entry_args, else_entry_args 追加)
- emission/branch.rs から空 EdgeArgs を渡す
- EdgeCFG テスト更新compose.rs 2箇所、emit.rs 1箇所
- TODO コメント削除完了Phase 267 P2+ TODO 解消)
- **テスト結果**:
- cargo build --release: 成功
- cargo test --lib --release: 1444/1444 PASS
- quick smoke: 45/46 PASS既存状態維持
- **核心原則**:
- emission 層経由で Frag 構築を MirBuilder 層から分離
- SSOT 原則: compose::if_() は edge-args を内部生成しない
- **次**: Phase 269 で Pattern6/7/8 への Frag 適用 + fixture/smoke test
- **詳細**: `docs/development/current/main/phases/phase-268/README.md`
- **real-app loop regression の横展開VM + LLVM EXE**
- ねらい: 実コード由来ループを 1 本ずつ最小抽出して fixture/smoke で固定する(段階投入)。
- 現状: Phase 107find_balanced_array/object / json_cur 由来)まで固定済み。