phase29aa(p4): propagate rc state along jump chain to return

This commit is contained in:
2025-12-28 01:56:36 +09:00
parent d70d9e3b89
commit bf7b203586
5 changed files with 193 additions and 37 deletions

View File

@ -1,6 +1,6 @@
# Phase 29aa: RC insertion safety expansionCFG-aware design
Status: P3 Complete (Jump→Return single-predecessor propagation)
Status: P4 Complete (Jump-chain propagation to Return)
Scope: Phase 29z の単一block限定実装から、誤releaseを起こさない形で CFG-aware に拡張するための設計を固める。
Entry:
@ -23,6 +23,7 @@ Progress:
- P1: rc_insertion を RcPlan の Plan→Apply 2-stage へ分離(挙動不変)
- P2: Jump/Branch 終端では cleanup を入れない契約を SSOT 化Fail-Fast guard
- P3: Jump→Return単一 predecessorで state 伝播し ReturnCleanup を成立させるP2維持
- P4: Jump-chain単一 predecessor 直列)で state 伝播し ReturnCleanup を成立させるP2/P3 維持)
P3 SSOT:
- Contract:
@ -37,3 +38,17 @@ P3 SSOT:
- quick 154/154 PASS 維持
- `cargo run --bin rc_insertion_selfcheck --features rc-insertion-minimal` PASS
- 既定OFF維持featureなしは no-op
P4 SSOT:
- Contract:
- cleanup は Return block の BeforeTerminator のみJump/Branch block には入れない)
- Jump-chain単一 predecessor の Jump 直列)のみ state 伝播を許可
- cycleloop検出時は debug_assert! で Fail-Fast、伝播は停止
- Non-goals:
- Branch/PHI/loop/early-exit の cleanup
- multi-predecessor の合流PHI 問題回避)
- Jump block への release 挿入P2維持
- Acceptance:
- quick 154/154 PASS 維持
- `cargo run --bin rc_insertion_selfcheck --features rc-insertion-minimal` PASS
- 既定OFF維持featureなしは no-op