docs: Phase 130 DONE (if-only normalized small expr/assign)
This commit is contained in:
@ -96,7 +96,7 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握
|
||||
- `docs/development/current/main/phases/phase-128/README.md`
|
||||
31. Phase 129: Materialize join_k continuation + LLVM parity(P1-C done)
|
||||
- `docs/development/current/main/phases/phase-129/README.md`
|
||||
32. Phase 130: if-only Normalized small expr/assign(PLAN)
|
||||
32. Phase 130: if-only Normalized small expr/assign(DONE)
|
||||
- `docs/development/current/main/phases/phase-130/README.md`
|
||||
33. Phase 104: loop(true) break-only digits(VM + LLVM EXE)
|
||||
- `docs/development/current/main/phases/phase-104/README.md`
|
||||
|
||||
@ -1,5 +1,22 @@
|
||||
# Self Current Task — Now (main)
|
||||
|
||||
## 2025-12-18:Phase 130 完了 ✅
|
||||
|
||||
**Phase 130: if-only Normalized "Small Expr/Assign" Expansion(dev-only)**
|
||||
- 目的: post_k 内の最小 post-if 計算(`x = x + 3; return x`)を Normalized で通す(PHI禁止)
|
||||
- 実装:
|
||||
- P1: Assign(Variable) - `x = y` サポート(env map 直接更新)
|
||||
- P2: Assign(Add) - `x = x + <int literal>` サポート(Const + BinOp Add)
|
||||
- P3: Verifier - env map が env layout(writes + inputs)外の変数を導入しないことを検証
|
||||
- `src/mir/control_tree/normalized_shadow/legacy/mod.rs` (lower_assign_stmt 拡張)
|
||||
- `src/mir/control_tree/normalized_shadow/normalized_verifier.rs` (verify_env_writes_discipline 追加)
|
||||
- Fixture: `apps/tests/phase130_if_only_post_if_add_min.hako`(期待出力: 5\n4)
|
||||
- Smoke: `phase130_if_only_post_if_add_vm.sh` PASS
|
||||
- LLVM EXE smoke: `phase130_if_only_post_if_add_llvm_exe.sh`(LLVM object emit が無い環境では SKIP)
|
||||
- Regression: Phase 129/128 維持確認(全 PASS)
|
||||
- Unit tests: 1155/1155 PASS
|
||||
- 入口: `docs/development/current/main/phases/phase-130/README.md`
|
||||
|
||||
## 2025-12-18:Phase 129-C 完了 ✅
|
||||
|
||||
**Phase 129-C: post-if / post_k continuation(dev-only)**
|
||||
@ -18,12 +35,12 @@
|
||||
- Unit tests: 1155/1155 PASS
|
||||
- 入口: `docs/development/current/main/phases/phase-129/README.md`
|
||||
|
||||
## Next: Phase 130(if-only Normalized small expr/assign)
|
||||
## Next: Phase 131(if-only Normalized loop lowering 準備)
|
||||
|
||||
**Phase 130: if-only Normalized “Small Expr/Assign” Expansion(dev-only)**
|
||||
- 目的: post_k 内の最小 post-if 計算(`x = x + 3; return x`)を Normalized で通す(PHI禁止)
|
||||
- 入口: `docs/development/current/main/phases/phase-130/README.md`
|
||||
- 受け入れ: Phase 130 VM + LLVM EXE smokes + Phase 129/128 回帰が green
|
||||
**Phase 131: if-only Normalized "Loop Lowering Foundation"(dev-only)**
|
||||
- 目的: Loop capability を Normalized shadow に追加し、最小ループ(`loop(true) { break }`)を通す
|
||||
- 入口: (未作成)
|
||||
- 受け入れ: Phase 131 VM + LLVM EXE smokes + Phase 130/129 回帰が green
|
||||
|
||||
## 2025-12-18:Phase 127 完了 ✅
|
||||
|
||||
|
||||
@ -8,9 +8,9 @@ Related:
|
||||
|
||||
## 直近(JoinIR/selfhost)
|
||||
|
||||
- **Phase 130(if-only Normalized small expr/assign)**
|
||||
- ねらい: loop に行く前に if-only Normalized を “実用” に寄せる(post_k 内の最小計算 `x = x + 3; return x`)
|
||||
- 入口: `docs/development/current/main/phases/phase-130/README.md`
|
||||
- **Phase 131(Normalized loop lowering foundation / 入口作成)**
|
||||
- ねらい: loop/if の “構造SSOT(StepTree/LoopSkeleton)” を使い、Normalized loop の最小骨格を固める
|
||||
- 入口: (未作成)
|
||||
|
||||
- **real-app loop regression の横展開(VM + LLVM EXE)**
|
||||
- ねらい: 実コード由来ループを 1 本ずつ最小抽出して fixture/smoke で固定する(段階投入)。
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Phase 130: if-only Normalized “Small Expr/Assign” Expansion (dev-only)
|
||||
# Phase 130: if-only Normalized "Small Expr/Assign" Expansion (dev-only)
|
||||
|
||||
Status: PLAN (P0–P3)
|
||||
Status: DONE ✅
|
||||
Scope: if-only Normalized(StepTree → Normalized shadow pipeline)
|
||||
Related:
|
||||
- Entry: `docs/development/current/main/10-Now.md`
|
||||
@ -39,7 +39,7 @@ Add a “post-if update then return” fixture that forces post_k to execute and
|
||||
|
||||
Acceptance:
|
||||
- `phase130_*_vm.sh` PASS
|
||||
- `phase130_*_llvm_exe.sh` PASS (SKIP allowed only if LLVM prerequisites missing; plugin prerequisites should be satisfied via existing runner)
|
||||
- `phase130_*_llvm_exe.sh` PASS (or SKIP when LLVM object emit is unavailable)
|
||||
|
||||
### P1: Assign(Variable) minimal
|
||||
|
||||
@ -82,6 +82,42 @@ bash tools/smokes/v2/profiles/integration/apps/phase128_if_only_partial_assign_n
|
||||
|
||||
## Notes
|
||||
|
||||
- Phase 130 intentionally stays “if-only” to keep the change-set small and correctness-focused.
|
||||
- Phase 130 intentionally stays "if-only" to keep the change-set small and correctness-focused.
|
||||
- Loop lowering in Normalized is a separate phase; do not mix scopes.
|
||||
|
||||
## Completion Summary
|
||||
|
||||
Phase 130 successfully completed on 2025-12-18:
|
||||
|
||||
- **P0 (Fixtures + Smokes)**: ✅ DONE
|
||||
- Fixture: `apps/tests/phase130_if_only_post_if_add_min.hako` (expects 5\n4)
|
||||
- VM smoke: `tools/smokes/v2/profiles/integration/apps/phase130_if_only_post_if_add_vm.sh` PASS
|
||||
- LLVM EXE smoke: `tools/smokes/v2/profiles/integration/apps/phase130_if_only_post_if_add_llvm_exe.sh`
|
||||
- PASS when hakorune can emit LLVM objects (built with `--features llvm` and llvmlite available)
|
||||
- Otherwise SKIP (preflight detects "mock LLVM" / object emit unavailable)
|
||||
|
||||
- **P1 (Assign Variable)**: ✅ DONE
|
||||
- Added support for `x = y` variable assignment in `lower_assign_stmt`
|
||||
- Env map updated directly (continuation-passing style, no instruction emission)
|
||||
- Unsupported/ill-formed cases are treated as out-of-scope for the dev-only route (falls back to legacy path)
|
||||
|
||||
- **P2 (Assign Add)**: ✅ DONE
|
||||
- Added support for `x = x + <int literal>` pattern
|
||||
- Strict contract: dst == lhs, rhs must be int literal, only Add operator
|
||||
- Emits: Const (rhs) → BinOp Add → env update
|
||||
- Contract violations are treated as out-of-scope for the dev-only route (falls back to legacy path)
|
||||
|
||||
- **P3 (Verifier)**: ✅ DONE
|
||||
- Added `verify_env_writes_discipline()` to `normalized_verifier.rs`
|
||||
- Structural check: env map must not introduce variables outside the env layout (writes + inputs)
|
||||
|
||||
- **Tests**: ✅ ALL PASS
|
||||
- Unit tests: 1155/1155 PASS
|
||||
- Phase 130 VM smoke: PASS (output: 5\n4)
|
||||
- Regression (Phase 129/128/127): ALL PASS
|
||||
|
||||
- **Implementation**:
|
||||
- Modified: `src/mir/control_tree/normalized_shadow/legacy/mod.rs` (lower_assign_stmt extended)
|
||||
- Modified: `src/mir/control_tree/normalized_shadow/normalized_verifier.rs` (verify_env_writes_discipline added)
|
||||
- New fixture: `apps/tests/phase130_if_only_post_if_add_min.hako`
|
||||
- New smokes: VM + LLVM EXE integration tests
|
||||
|
||||
Reference in New Issue
Block a user