docs(phase29an): add p4 loop facts ssot tightening
This commit is contained in:
@ -19,7 +19,7 @@ Scope: Repo root の旧リンク互換。現行の入口は `docs/development/cu
|
||||
`docs/development/current/main/design/coreplan-migration-roadmap-ssot.md` が移行タスクの Done 判定の入口。
|
||||
|
||||
**Next implementation (CorePlan Step-B / Facts SSOT)**
|
||||
`docs/development/current/main/phases/phase-29an/P3-FREEZE-UNSTRUCTURED-TAG-SSOT-INSTRUCTIONS.md`
|
||||
`docs/development/current/main/phases/phase-29an/P4-LOOPFACTS-REQUIRE-SKELETON-FEATURES-INSTRUCTIONS.md`
|
||||
|
||||
**2025-12-29: Phase 29am P0 COMPLETE (CorePlan If/Exit lowerer/verifier)**
|
||||
CorePlan の If/Exit を lowerer/verifier で扱えるようにして、CorePlan 移行の土台を作った。
|
||||
|
||||
@ -2,11 +2,16 @@
|
||||
|
||||
## Current Focus: Phase 29an(Skeleton/Feature Facts)
|
||||
|
||||
Next: Phase 29an P3(Freeze taxonomy: unstructured tag)
|
||||
Next: Phase 29an P4(LoopFacts require skeleton/features)
|
||||
運用ルール: 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 29an P3 完了** ✅
|
||||
- 目的: Freeze taxonomy の `unstructured` タグをコード語彙へ追加(未使用のまま、仕様不変)
|
||||
- 変更: `src/mir/builder/control_flow/plan/planner/freeze.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 P2 完了** ✅
|
||||
- 目的: planner を Skeleton→Feature→CandidateSet の段取りへ整理(候補/順序/挙動は不変)
|
||||
- 変更: `src/mir/builder/control_flow/plan/planner/build.rs`
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
---
|
||||
Status: Active
|
||||
Scope: code(仕様不変、Facts SSOT の引き締め)
|
||||
Related:
|
||||
- docs/development/current/main/phases/phase-29an/README.md
|
||||
- docs/development/current/main/design/coreplan-skeleton-feature-model.md
|
||||
- docs/development/current/main/phases/phase-29ae/README.md
|
||||
---
|
||||
|
||||
# Phase 29an P4: LoopFacts で Skeleton/Feature を必須にする(SSOT引き締め、仕様不変)
|
||||
|
||||
Date: 2025-12-29
|
||||
Status: Ready for execution
|
||||
Scope: Facts の型を “使う側が迷わない” 形に寄せる(挙動不変)
|
||||
|
||||
## Objective
|
||||
|
||||
- `LoopFacts` が `Ok(Some(_))` になった時点で、**Skeleton と Feature は必ず揃っている** という SSOT をコードの型で固定する
|
||||
- P5(Skeleton 一意化 / Feature 合成)に向けて、`Option` 剥がしの散在を防ぐ
|
||||
|
||||
## Non-goals
|
||||
|
||||
- ルーティング順序・観測・エラー文字列の変更
|
||||
- `Ok(None)` の gate を緩める(features/skeleton だけで Some にしない)
|
||||
- 新 env var / 恒常ログ追加
|
||||
|
||||
## Implementation
|
||||
|
||||
### Step 1: LoopFacts のフィールドを必須化
|
||||
|
||||
Update:
|
||||
- `src/mir/builder/control_flow/plan/facts/loop_facts.rs`
|
||||
|
||||
Change:
|
||||
- `pub skeleton: Option<SkeletonFacts>` → `pub skeleton: SkeletonFacts`
|
||||
- `pub features: Option<LoopFeatureFacts>` → `pub features: LoopFeatureFacts`
|
||||
|
||||
Rules:
|
||||
- `has_any == false` のときは従来どおり `Ok(None)`(ここは絶対に変えない)
|
||||
- `has_any == true` のときは必ず skeleton/features を構築する
|
||||
- `try_extract_loop_skeleton_facts(...)` が `None` を返したら `Freeze::bug(...)`(到達してはいけない)
|
||||
|
||||
### Step 2: skeleton/features の構築を “has_any の後” に固定
|
||||
|
||||
`try_build_loop_facts_inner()` 内で:
|
||||
- pattern facts 抽出 → `has_any` 判定 → `skeleton` / `features` 抽出 → `Ok(Some(LoopFacts{...}))`
|
||||
|
||||
### Step 3: planner/build.rs の unit test を機械的に更新
|
||||
|
||||
Update:
|
||||
- `src/mir/builder/control_flow/plan/planner/build.rs`
|
||||
|
||||
`LoopFacts { ... }` のテスト構築に:
|
||||
- `skeleton: SkeletonFacts { kind: SkeletonKind::Loop }`
|
||||
- `features: LoopFeatureFacts::default()`
|
||||
を追加する(既存テストの意図は変えない)。
|
||||
|
||||
### Step 4: “SSOT不変条件” の最小テストを 1 本追加
|
||||
|
||||
Add in `src/mir/builder/control_flow/plan/facts/loop_facts.rs`:
|
||||
- pattern facts が 1 つでも取れた場合、`LoopFacts.skeleton.kind == Loop` が成立する
|
||||
- `LoopFacts.features.exit_usage` がデフォルトでも存在する(`Option` ではないことの固定)
|
||||
|
||||
## 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(p4): require skeleton/features in loop facts"`
|
||||
|
||||
@ -42,7 +42,20 @@ Status: ✅ COMPLETE(実装コミット: `f866badb3`)
|
||||
|
||||
## Next(planned)
|
||||
|
||||
- P3: Freeze taxonomy(`unstructured`)をコード語彙へ追加して SSOT 整合(まずは未使用の足場)
|
||||
- 指示書: `docs/development/current/main/phases/phase-29an/P3-FREEZE-UNSTRUCTURED-TAG-SSOT-INSTRUCTIONS.md`
|
||||
- P4: Skeleton 一意化(0/1/2+ → None/Some/Freeze)を “骨格推論” に限定して SSOT 化
|
||||
- P5: Feature 合成(ExitMap / ValueJoin / Cleanup)を CorePlan 合成へ繋ぐ
|
||||
## P3: Add Freeze tag `unstructured` (taxonomy alignment)
|
||||
|
||||
- 指示書: `docs/development/current/main/phases/phase-29an/P3-FREEZE-UNSTRUCTURED-TAG-SSOT-INSTRUCTIONS.md`
|
||||
- ねらい: taxonomy SSOT とコード語彙を一致(まずは未使用の足場)
|
||||
|
||||
Status: ✅ COMPLETE(実装コミット: `aa8c12bcf`)
|
||||
|
||||
## P4: Require Skeleton/Feature in LoopFacts (type-level SSOT)
|
||||
|
||||
- 指示書: `docs/development/current/main/phases/phase-29an/P4-LOOPFACTS-REQUIRE-SKELETON-FEATURES-INSTRUCTIONS.md`
|
||||
- ねらい: LoopFacts が Some のとき、Skeleton/Feature は必ず揃っている(Option剥がしの散在を止める)
|
||||
- 重要: `Ok(None)` gate は不変
|
||||
|
||||
## Next(planned)
|
||||
|
||||
- P5: Skeleton 一意化(0/1/2+ → None/Some/Freeze)を “骨格推論” に限定して SSOT 化
|
||||
- P6: Feature 合成(ExitMap / ValueJoin / Cleanup)を CorePlan 合成へ繋ぐ
|
||||
|
||||
Reference in New Issue
Block a user