phase29ao(p6): gate direct skeleton on valuejoin presence (unconnected)
This commit is contained in:
@ -18,8 +18,8 @@ Scope: Repo root の旧リンク互換。現行の入口は `docs/development/cu
|
||||
**CorePlan migration 道筋 SSOT**
|
||||
`docs/development/current/main/design/coreplan-migration-roadmap-ssot.md` が移行タスクの Done 判定の入口。
|
||||
|
||||
**Next implementation (Phase 29ao P6)**
|
||||
`docs/development/current/main/phases/phase-29ao/P6-VALUEJOIN-PRESENCE-GATE-INSTRUCTIONS.md`
|
||||
**Next implementation (Phase 29ao P7)**
|
||||
`docs/development/current/main/phases/phase-29ao/README.md`
|
||||
|
||||
**2025-12-29: Phase 29am P0 COMPLETE (CorePlan If/Exit lowerer/verifier)**
|
||||
CorePlan の If/Exit を lowerer/verifier で扱えるようにして、CorePlan 移行の土台を作った。
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
## Current Focus: Phase 29ao(CorePlan composition)
|
||||
|
||||
Next: Phase 29ao P6(ValueJoin presence → CorePlan/Frag)
|
||||
Next: Phase 29ao P7(ValueJoin wire → CorePlan/Frag)
|
||||
運用ルール: integration filter で phase143_* は回さない(JoinIR 回帰は phase29ae pack のみ)
|
||||
運用ルール: phase286_pattern9_* は legacy pack (SKIP) を使う
|
||||
移行道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md`
|
||||
@ -37,6 +37,11 @@ Next: Phase 29ao P6(ValueJoin presence → CorePlan/Frag)
|
||||
- 変更: `src/mir/builder/control_flow/plan/normalizer/skeleton_loop.rs` / `src/mir/builder/control_flow/plan/composer/mod.rs` / `docs/development/current/main/phases/phase-29ao/README.md` / `docs/development/current/main/10-Now.md` / `docs/development/current/main/30-Backlog.md` / `CURRENT_TASK.md`
|
||||
- 検証: `cargo build --release` / `./tools/smokes/v2/run.sh --profile quick` / `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
|
||||
|
||||
**2025-12-30: Phase 29ao P6 完了** ✅
|
||||
- 目的: `value_join_needed` が立つケースは direct skeleton を採用しない(安全ゲート)
|
||||
- 変更: `src/mir/builder/control_flow/plan/normalizer/skeleton_loop.rs` / `src/mir/builder/control_flow/plan/composer/mod.rs` / `docs/development/current/main/phases/phase-29ao/README.md` / `docs/development/current/main/10-Now.md` / `docs/development/current/main/30-Backlog.md` / `CURRENT_TASK.md`
|
||||
- 検証: `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 P15 完了** ✅
|
||||
- 目的: P0–P14 の成果を closeout 形式でまとめ、次フェーズ(Phase 29ao)入口を固定
|
||||
- 変更: `docs/development/current/main/phases/phase-29an/README.md` / `docs/development/current/main/10-Now.md` / `docs/development/current/main/30-Backlog.md` / `CURRENT_TASK.md`
|
||||
|
||||
@ -15,7 +15,7 @@ Related:
|
||||
|
||||
- **Phase 29ao(active): CorePlan composition from Skeleton/Feature**
|
||||
- 入口: `docs/development/current/main/phases/phase-29ao/README.md`
|
||||
- 状況: P0/P1/P2/P3/P4/P5 ✅ 完了 / Next: P6
|
||||
- 状況: P0/P1/P2/P3/P4/P5/P6 ✅ 完了 / Next: P7
|
||||
|
||||
- **Phase 29af(✅ COMPLETE): Boundary hygiene / regression entrypoint / carrier layout SSOT**
|
||||
- 入口: `docs/development/current/main/phases/phase-29af/README.md`
|
||||
|
||||
@ -48,7 +48,11 @@ Gate(SSOT):
|
||||
- 指示書: `docs/development/current/main/phases/phase-29ao/P5-CLEANUP-PRESENCE-WIRE-INSTRUCTIONS.md`
|
||||
- ねらい: `cleanup_kinds_present` を ExitKind 語彙として `Frag.exits` に投影(未配線のまま語彙だけ固定)
|
||||
|
||||
## P6: ValueJoin presence の安全ゲート(未接続・仕様不変)✅
|
||||
|
||||
- 指示書: `docs/development/current/main/phases/phase-29ao/P6-VALUEJOIN-PRESENCE-GATE-INSTRUCTIONS.md`
|
||||
- ねらい: `value_join_needed` が立つケースは direct skeleton を採用しない(fallback維持)
|
||||
|
||||
## Next(planned)
|
||||
|
||||
- P6: ValueJoin presence(direct skeleton の安全ゲート、未接続・仕様不変)
|
||||
- 指示書: `docs/development/current/main/phases/phase-29ao/P6-VALUEJOIN-PRESENCE-GATE-INSTRUCTIONS.md`
|
||||
- P7: ValueJoin presence を post-phi SSOT に沿って wire(局所 verify から)
|
||||
|
||||
@ -72,7 +72,7 @@ mod tests {
|
||||
use crate::ast::{ASTNode, BinaryOperator, LiteralValue, Span};
|
||||
use crate::mir::builder::control_flow::plan::facts::feature_facts::{
|
||||
CleanupFacts, CleanupKindFacts, ExitKindFacts, ExitMapFacts, ExitUsageFacts,
|
||||
LoopFeatureFacts,
|
||||
LoopFeatureFacts, ValueJoinFacts,
|
||||
};
|
||||
use crate::mir::builder::control_flow::plan::facts::loop_facts::LoopFacts;
|
||||
use crate::mir::builder::control_flow::plan::facts::pattern1_simplewhile_facts::Pattern1SimpleWhileFacts;
|
||||
@ -623,4 +623,60 @@ mod tests {
|
||||
assert_eq!(exits.len(), 1);
|
||||
assert!(exits[0].target.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn composer_direct_returns_none_when_valuejoin_needed() {
|
||||
let pattern1 = Pattern1SimpleWhileFacts {
|
||||
loop_var: "i".to_string(),
|
||||
condition: ASTNode::BinaryOp {
|
||||
operator: BinaryOperator::Less,
|
||||
left: Box::new(v("i")),
|
||||
right: Box::new(lit_int(3)),
|
||||
span: Span::unknown(),
|
||||
},
|
||||
loop_increment: ASTNode::BinaryOp {
|
||||
operator: BinaryOperator::Add,
|
||||
left: Box::new(v("i")),
|
||||
right: Box::new(lit_int(1)),
|
||||
span: Span::unknown(),
|
||||
},
|
||||
};
|
||||
let facts = LoopFacts {
|
||||
condition_shape: ConditionShape::Unknown,
|
||||
step_shape: StepShape::Unknown,
|
||||
skeleton: SkeletonFacts {
|
||||
kind: SkeletonKind::Loop,
|
||||
},
|
||||
features: LoopFeatureFacts {
|
||||
exit_usage: ExitUsageFacts::default(),
|
||||
exit_map: None,
|
||||
value_join: Some(ValueJoinFacts { needed: true }),
|
||||
cleanup: None,
|
||||
},
|
||||
scan_with_init: None,
|
||||
split_scan: None,
|
||||
pattern1_simplewhile: Some(pattern1),
|
||||
pattern3_ifphi: None,
|
||||
pattern4_continue: None,
|
||||
pattern5_infinite_early_exit: None,
|
||||
pattern8_bool_predicate_scan: None,
|
||||
pattern9_accum_const_loop: None,
|
||||
pattern2_break: None,
|
||||
pattern2_loopbodylocal: None,
|
||||
};
|
||||
let canonical = canonicalize_loop_facts(facts);
|
||||
let condition = canonical
|
||||
.facts
|
||||
.pattern1_simplewhile
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.condition
|
||||
.clone();
|
||||
let ctx = LoopPatternContext::new(&condition, &[], "composer_test", false, false);
|
||||
let mut builder = MirBuilder::new();
|
||||
let plan =
|
||||
try_compose_core_plan_direct(&mut builder, &canonical, &ctx)
|
||||
.expect("Ok");
|
||||
assert!(plan.is_none());
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,6 +20,9 @@ impl super::PlanNormalizer {
|
||||
facts: &CanonicalLoopFacts,
|
||||
_ctx: &LoopPatternContext,
|
||||
) -> Result<Option<CorePlan>, String> {
|
||||
if facts.value_join_needed {
|
||||
return Ok(None);
|
||||
}
|
||||
if !matches!(facts.skeleton_kind, SkeletonKind::Loop) {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user