docs: add Phase 130 plan and set Now to Phase 130

This commit is contained in:
nyash-codex
2025-12-18 08:36:38 +09:00
parent 80df1cccd4
commit 05fccce09a
4 changed files with 106 additions and 14 deletions

View File

@ -96,17 +96,19 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握
- `docs/development/current/main/phases/phase-128/README.md` - `docs/development/current/main/phases/phase-128/README.md`
31. Phase 129: Materialize join_k continuation + LLVM parityP1-C done 31. Phase 129: Materialize join_k continuation + LLVM parityP1-C done
- `docs/development/current/main/phases/phase-129/README.md` - `docs/development/current/main/phases/phase-129/README.md`
32. Phase 104: loop(true) break-only digitsVM + LLVM EXE 32. Phase 130: if-only Normalized small expr/assignPLAN
- `docs/development/current/main/phases/phase-130/README.md`
33. Phase 104: loop(true) break-only digitsVM + LLVM EXE
- `docs/development/current/main/phases/phase-104/README.md` - `docs/development/current/main/phases/phase-104/README.md`
33. Phase 107: json_cur find_balanced_* depth scanVM + LLVM EXE 34. Phase 107: json_cur find_balanced_* depth scanVM + LLVM EXE
- `docs/development/current/main/phases/phase-107/README.md` - `docs/development/current/main/phases/phase-107/README.md`
34. Phase 108: Pattern2 policy router SSOT入口の薄さを固定 35. Phase 108: Pattern2 policy router SSOT入口の薄さを固定
- `docs/development/current/main/phases/phase-108/README.md` - `docs/development/current/main/phases/phase-108/README.md`
35. Phase 109: error_tags hints SSOTFail-Fast + hint の語彙固定) 36. Phase 109: error_tags hints SSOTFail-Fast + hint の語彙固定)
- `docs/development/current/main/phases/phase-109/README.md` - `docs/development/current/main/phases/phase-109/README.md`
36. MIR BuilderContext 分割の入口) 37. MIR BuilderContext 分割の入口)
- `src/mir/builder/README.md` - `src/mir/builder/README.md`
37. Scope/BindingIdshadowing・束縛同一性の段階移行 38. Scope/BindingIdshadowing・束縛同一性の段階移行
- `docs/development/current/main/phase73-scope-manager-design.md` - `docs/development/current/main/phase73-scope-manager-design.md`
- `docs/development/current/main/PHASE_74_SUMMARY.md` - `docs/development/current/main/PHASE_74_SUMMARY.md`
- `docs/development/current/main/PHASE_75_SUMMARY.md` - `docs/development/current/main/PHASE_75_SUMMARY.md`
@ -114,9 +116,9 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握
- `docs/development/current/main/phase78-bindingid-promoted-carriers.md` - `docs/development/current/main/phase78-bindingid-promoted-carriers.md`
- `docs/development/current/main/phase80-bindingid-p3p4-plan.md`P3/P4 への配線計画) - `docs/development/current/main/phase80-bindingid-p3p4-plan.md`P3/P4 への配線計画)
- `docs/development/current/main/phase81-pattern2-exitline-contract.md`promoted carriers の ExitLine 契約検証) - `docs/development/current/main/phase81-pattern2-exitline-contract.md`promoted carriers の ExitLine 契約検証)
31. Boxification feedbackPhase 7885 の振り返りと Phase 86 推奨) 39. Boxification feedbackPhase 7885 の振り返りと Phase 86 推奨)
- `docs/development/current/main/phase78-85-boxification-feedback.md` - `docs/development/current/main/phase78-85-boxification-feedback.md`
32. Phase 86: Carrier Init Builder + Error Tags ✅ 40. Phase 86: Carrier Init Builder + Error Tags ✅
- **Status**: COMPLETE (2025-12-13) - **Status**: COMPLETE (2025-12-13)
- **Modules**: - **Modules**:
- `src/mir/builder/control_flow/joinir/merge/carrier_init_builder.rs` (+8 tests) - `src/mir/builder/control_flow/joinir/merge/carrier_init_builder.rs` (+8 tests)

View File

@ -18,13 +18,12 @@
- Unit tests: 1155/1155 PASS - Unit tests: 1155/1155 PASS
- 入口: `docs/development/current/main/phases/phase-129/README.md` - 入口: `docs/development/current/main/phases/phase-129/README.md`
## Next: Phase 130+Loop patterns / Complex RHS ## Next: Phase 130if-only Normalized small expr/assign
**Phase 130以降の展開** **Phase 130: if-only Normalized “Small Expr/Assign” Expansiondev-only**
- Loop patterns の Normalized lowering - 目的: post_k 内の最小 post-if 計算(`x = x + 3; return x`)を Normalized で通すPHI禁止
- Assign(complex expr) RHS 対応 - 入口: `docs/development/current/main/phases/phase-130/README.md`
- Nested if 対応 - 受け入れ: Phase 130 VM + LLVM EXE smokes + Phase 129/128 回帰が green
- 詳細は Phase 129 README の "Related Phases" 参照
## 2025-12-18Phase 127 完了 ✅ ## 2025-12-18Phase 127 完了 ✅

View File

@ -8,6 +8,10 @@ Related:
## 直近JoinIR/selfhost ## 直近JoinIR/selfhost
- **Phase 130if-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`
- **real-app loop regression の横展開VM + LLVM EXE** - **real-app loop regression の横展開VM + LLVM EXE**
- ねらい: 実コード由来ループを 1 本ずつ最小抽出して fixture/smoke で固定する(段階投入)。 - ねらい: 実コード由来ループを 1 本ずつ最小抽出して fixture/smoke で固定する(段階投入)。
- 現状: Phase 107find_balanced_array/object / json_cur 由来)まで固定済み。 - 現状: Phase 107find_balanced_array/object / json_cur 由来)まで固定済み。

View File

@ -0,0 +1,87 @@
# Phase 130: if-only Normalized “Small Expr/Assign” Expansion (dev-only)
Status: PLAN (P0P3)
Scope: if-only NormalizedStepTree → Normalized shadow pipeline
Related:
- Entry: `docs/development/current/main/10-Now.md`
- Phase 129 (join_k/post_k): `docs/development/current/main/phases/phase-129/README.md`
- ControlTree SSOT: `docs/development/current/main/design/control-tree.md`
## Goal
Increase usefulness of the if-only Normalized path without touching loop lowering yet:
- Enable minimal post-if computation (`x = x + 3`) and returns via env.
- Keep **PHI禁止**: merge via env + continuations only.
- Keep **dev-only** and **既定挙動不変**: unmatched shapes fall back (strict can Fail-Fast for fixtures).
## Non-Goals
- No loops (Loop/Break/Continue still rejected by capability guard).
- No general expression lowering (start with one narrow shape only).
- No new env vars (use existing `joinir_dev_enabled()` / `joinir_strict_enabled()`).
## Work Items (P0P3)
### P0: Fixtures + Smokes (VM + LLVM EXE)
Add a “post-if update then return” fixture that forces post_k to execute and tests env updates:
- New fixture: `apps/tests/phase130_if_only_post_if_add_min.hako`
- Case A: `flag=1` → expected `5`
- Case B: `flag=0` → expected `4`
- Output: `5\n4`
- Smokes (integration):
- `tools/smokes/v2/profiles/integration/apps/phase130_if_only_post_if_add_vm.sh`
- `tools/smokes/v2/profiles/integration/apps/phase130_if_only_post_if_add_llvm_exe.sh`
- Use `output_validator.sh` numeric-line assertion.
- LLVM EXE smoke uses `llvm_exe_runner.sh` + plugin gating.
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)
### P1: Assign(Variable) minimal
Support `x = y` inside post_k (and/or inside branches) for if-only:
- Only local variables (no field/property assign).
- RHS must resolve from env (`writes` or `inputs`).
- strict: unsupported shapes → `freeze_with_hint("phase130/assign/var/unsupported", ...)`.
### P2: Assign(Add) minimal for integers
Support `x = x + <int literal>` (exact shape) in post_k:
- Strictly `Var + IntLiteral` with `lhs_var == dst_var` (no commutation, no general binop).
- Type: integer only (string concat stays out-of-scope; Fail-Fast under strict).
### P3: Verifier tightening (env writes-only discipline)
Add a structural check to ensure env updates only target `writes` fields:
- In Normalized emission, any “env update” must update a field that exists in `EnvLayout.writes`.
- Writing to an `inputs` field is prohibited (strict Fail-Fast).
## Verification
Commands:
```bash
cargo test --lib
# New Phase 130 smokes
bash tools/smokes/v2/profiles/integration/apps/phase130_if_only_post_if_add_vm.sh
bash tools/smokes/v2/profiles/integration/apps/phase130_if_only_post_if_add_llvm_exe.sh
# Regressions (minimum)
bash tools/smokes/v2/profiles/integration/apps/phase129_if_only_post_if_return_var_vm.sh
bash tools/smokes/v2/profiles/integration/apps/phase129_join_k_as_last_vm.sh
bash tools/smokes/v2/profiles/integration/apps/phase128_if_only_partial_assign_normalized_vm.sh
```
## Notes
- 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.