docs(phase29an): add p13 cleanup facts scaffold
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
## Current Focus: Phase 29an(Skeleton/Feature Facts)
|
||||
|
||||
Next: Phase 29an P12(Canonical ExitMap projections)
|
||||
Next: Phase 29an P13(Cleanup facts scaffold)
|
||||
運用ルール: integration filter で phase143_* は回さない(JoinIR 回帰は phase29ae pack のみ)
|
||||
運用ルール: phase286_pattern9_* は legacy pack (SKIP) を使う
|
||||
移行道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md`
|
||||
@ -27,6 +27,11 @@ Next: Phase 29an P12(Canonical ExitMap projections)
|
||||
- 変更: `src/mir/builder/control_flow/plan/facts/feature_facts.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 29an P12 完了** ✅
|
||||
- 目的: CanonicalLoopFacts に exitmap presence(exit_kinds_present)を投影(挙動不変)
|
||||
- 変更: `src/mir/builder/control_flow/plan/normalize/canonicalize.rs` / `src/mir/builder/control_flow/plan/planner/build.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 29an P7 完了** ✅
|
||||
- 目的: CanonicalLoopFacts に skeleton/exit_usage の projection を追加(挙動不変)
|
||||
- 変更: `src/mir/builder/control_flow/plan/normalize/canonicalize.rs` / `src/mir/builder/control_flow/plan/planner/build.rs`
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
---
|
||||
Status: Active
|
||||
Scope: code(仕様不変、cleanup語彙の足場)
|
||||
Related:
|
||||
- docs/development/current/main/phases/phase-29an/README.md
|
||||
- docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md
|
||||
- docs/development/current/main/phases/phase-29ae/README.md
|
||||
---
|
||||
|
||||
# Phase 29an P13: CleanupFacts の語彙足場(型 + canonical projection、未接続)
|
||||
|
||||
Date: 2025-12-29
|
||||
Status: Ready for execution
|
||||
Scope: cleanup を Feature として合成するための語彙を先に用意する(未接続、仕様不変)
|
||||
|
||||
## Objective
|
||||
|
||||
- `CleanupFacts` を “ExitKind 単位の cleanup がある/ない” の語彙として追加する
|
||||
- `CanonicalLoopFacts` に projection を追加し、planner/合成が深掘りしない入口を作る
|
||||
|
||||
## Non-goals
|
||||
|
||||
- cleanup の対応付け(どの値を release する等)を実装しない
|
||||
- exit のブロック/CFG対応付けを実装しない
|
||||
- 既存ルーティング/候補集合/順序/ログ/エラー文字列の変更
|
||||
- 新しい Freeze 発火(gate を壊さない)
|
||||
|
||||
## Implementation
|
||||
|
||||
### Step 1: Facts語彙に CleanupKind/CleanupFacts を追加(未接続)
|
||||
|
||||
Update:
|
||||
- `src/mir/builder/control_flow/plan/facts/feature_facts.rs`
|
||||
|
||||
Add:
|
||||
- `enum CleanupKindFacts { Return, Break, Continue }`
|
||||
- `struct CleanupFacts { kinds_present: std::collections::BTreeSet<CleanupKindFacts> }`
|
||||
|
||||
Wire (still conservative):
|
||||
- `LoopFeatureFacts.cleanup: Option<CleanupFacts>` は既定 `None` のまま(P13は解析しない)
|
||||
|
||||
### Step 2: Canonical projection を追加(入口整備)
|
||||
|
||||
Update:
|
||||
- `src/mir/builder/control_flow/plan/normalize/canonicalize.rs`
|
||||
|
||||
Add:
|
||||
- `pub cleanup_kinds_present: std::collections::BTreeSet<CleanupKindFacts>`
|
||||
|
||||
Populate:
|
||||
- `facts.features.cleanup.as_ref().map(|c| c.kinds_present.clone()).unwrap_or_default()`
|
||||
|
||||
### Step 3: unit tests(型/既定値固定)
|
||||
|
||||
Add tests:
|
||||
- cleanup が None のとき `cleanup_kinds_present` は empty
|
||||
- `canonicalize_loop_facts` が `cleanup_kinds_present` を必ず生成する(projectionの存在固定)
|
||||
|
||||
### Step 4: planner 側の debug-only 整合(任意・最小)
|
||||
|
||||
Update (optional):
|
||||
- `src/mir/builder/control_flow/plan/planner/build.rs`
|
||||
|
||||
Add debug_assert:
|
||||
- “cleanup があるなら、対応する exit_kind が exit_kinds_present に居る” などの弱い整合(未接続のため基本は空)
|
||||
|
||||
## Verification(required)
|
||||
|
||||
- `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 \"phase29an(p13): add cleanup facts scaffold and projections\"`
|
||||
|
||||
@ -109,6 +109,10 @@ Status: ✅ COMPLETE(実装コミット: `8caa09768`)
|
||||
- 指示書: `docs/development/current/main/phases/phase-29an/P12-CANONICAL-EXITMAP-PROJECTIONS-INSTRUCTIONS.md`
|
||||
- ねらい: ExitMapFacts を normalize 側で投影して、planner/合成が深掘りせず参照できる足場を作る(仕様不変)
|
||||
|
||||
Status: ✅ COMPLETE(実装コミット: `fa5a891bd`)
|
||||
|
||||
## Next(planned)
|
||||
|
||||
- P13: cleanup/value_join の足場(型・projection・verifier だけ)を追加
|
||||
- P13: CleanupFacts の語彙足場(型 + canonical projection、未接続)
|
||||
- 指示書: `docs/development/current/main/phases/phase-29an/P13-CLEANUP-VOCAB-SCAFFOLD-INSTRUCTIONS.md`
|
||||
- P14: ValueJoin の語彙足場(型 + projection + verifier SSOT)を追加(未接続)
|
||||
|
||||
Reference in New Issue
Block a user