From 70fe0da549fb813ae985c064f6a6f0524d117a25 Mon Sep 17 00:00:00 2001 From: nyash-codex Date: Thu, 18 Dec 2025 01:58:56 +0900 Subject: [PATCH] docs: Phase 113 if-only partial assign parity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create phases/phase-113/README.md (background, fixed pattern, verification) - Update 10-Now.md with Phase 113 completion - Update 01-JoinIR-Selfhost-INDEX.md with Phase 113 entry 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../current/main/01-JoinIR-Selfhost-INDEX.md | 25 ++++++++++++------- docs/development/current/main/10-Now.md | 7 ++++++ .../current/main/phases/phase-113/README.md | 24 ++++++++++++++++++ 3 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 docs/development/current/main/phases/phase-113/README.md diff --git a/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md b/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md index fefc6dc9..3e432b9b 100644 --- a/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md +++ b/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md @@ -40,6 +40,7 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握 - `docs/development/current/main/joinir-boundary-builder-pattern.md` 4. JoinIR 設計地図(現役の地図) - `docs/development/current/main/design/joinir-design-map.md` + - ControlTree / StepTree(構造SSOT): `docs/development/current/main/design/control-tree.md` 5. Loop Canonicalizer(設計 SSOT) - `docs/development/current/main/design/loop-canonicalizer.md` - 実装(Phase 137-2): `src/mir/loop_canonicalizer/mod.rs` @@ -61,13 +62,19 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握 - `docs/development/current/main/phases/phase-102/README.md` 14. Phase 103: if-only regression baseline(VM + LLVM EXE / plan) - `docs/development/current/main/phases/phase-103/README.md` -15. Phase 104: loop(true) break-only digits(VM + LLVM EXE) +15. Phase 113: if-only partial assign parity(片側代入の保持 merge) + - `docs/development/current/main/phases/phase-113/README.md` +16. Phase 104: loop(true) break-only digits(VM + LLVM EXE) - `docs/development/current/main/phases/phase-104/README.md` -16. Phase 107: json_cur find_balanced_* depth scan(VM + LLVM EXE) +17. Phase 107: json_cur find_balanced_* depth scan(VM + LLVM EXE) - `docs/development/current/main/phases/phase-107/README.md` -6. MIR Builder(Context 分割の入口) +18. Phase 108: Pattern2 policy router SSOT(入口の薄さを固定) + - `docs/development/current/main/phases/phase-108/README.md` +19. Phase 109: error_tags hints SSOT(Fail-Fast + hint の語彙固定) + - `docs/development/current/main/phases/phase-109/README.md` +20. MIR Builder(Context 分割の入口) - `src/mir/builder/README.md` -7. Scope/BindingId(shadowing・束縛同一性の段階移行) +21. Scope/BindingId(shadowing・束縛同一性の段階移行) - `docs/development/current/main/phase73-scope-manager-design.md` - `docs/development/current/main/PHASE_74_SUMMARY.md` - `docs/development/current/main/PHASE_75_SUMMARY.md` @@ -75,16 +82,16 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握 - `docs/development/current/main/phase78-bindingid-promoted-carriers.md` - `docs/development/current/main/phase80-bindingid-p3p4-plan.md`(P3/P4 への配線計画) - `docs/development/current/main/phase81-pattern2-exitline-contract.md`(promoted carriers の ExitLine 契約検証) -8. Boxification feedback(Phase 78–85 の振り返りと Phase 86 推奨) +22. Boxification feedback(Phase 78–85 の振り返りと Phase 86 推奨) - `docs/development/current/main/phase78-85-boxification-feedback.md` -9. Phase 86: Carrier Init Builder + Error Tags ✅ +23. Phase 86: Carrier Init Builder + Error Tags ✅ - **Status**: COMPLETE (2025-12-13) - **Modules**: - `src/mir/builder/control_flow/joinir/merge/carrier_init_builder.rs` (+8 tests) - `src/mir/join_ir/lowering/error_tags.rs` (+5 tests) - **Achievements**: SSOT 確立(CarrierInit → ValueId 生成統一、エラータグ中央化、DebugOutputBox 完全移行) - **Impact**: 987/987 tests PASS, +13 unit tests, Single Responsibility validated -10. Phase 87: LLVM Exe Line SSOT ✅ +24. Phase 87: LLVM Exe Line SSOT ✅ - **Status**: COMPLETE (2025-12-13) - **SSOT**: `tools/build_llvm.sh` - Single pipeline for .hako → executable - **Deliverables**: @@ -93,11 +100,11 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握 - Integration smoke: `tools/smokes/v2/profiles/integration/apps/phase87_llvm_exe_min.sh` (SKIP if no LLVM) - **Policy**: No script duplication, integration smoke only (not quick), graceful SKIP - **Impact**: Standard procedure established, prerequisites documented -11. 代表的な Phase 文書(現役ラインとの接点だけ絞ったもの) +24. 代表的な Phase 文書(現役ラインとの接点だけ絞ったもの) - `docs/development/current/main/phase33-16-INDEX.md` - `docs/development/current/main/phase33-17-joinir-modularization-analysis.md` - `docs/development/current/main/phase183-selfhost-depth2-joinir-status.md` -12. Phase 86–90(Loop frontends)の要約(1枚) +25. Phase 86–90(Loop frontends)の要約(1枚) - `docs/development/current/main/phase86-90-loop-frontends-summary.md` Phase 文書は歴史や検証ログも含むので、「JoinIR の現役設計を確認した上で、必要なときだけ掘る」という前提で読んでね。 diff --git a/docs/development/current/main/10-Now.md b/docs/development/current/main/10-Now.md index bee2e272..e17a474f 100644 --- a/docs/development/current/main/10-Now.md +++ b/docs/development/current/main/10-Now.md @@ -1,5 +1,12 @@ # Self Current Task — Now (main) +## 2025-12-18:Phase 113 完了 ✅ + +**Phase 113: if-only partial assign parity** +- if-only(else なし)の片側代入で「保持 merge」パターンを VM/LLVM で固定 +- Fixture: phase113_if_only_partial_assign_min.hako +- Smoke: VM + LLVM EXE parity 検証済み + ## 2025-12-18:Phase 112 完了 ✅ **Phase 112: StepTree Capability Guard (strict-only)** diff --git a/docs/development/current/main/phases/phase-113/README.md b/docs/development/current/main/phases/phase-113/README.md new file mode 100644 index 00000000..de108c20 --- /dev/null +++ b/docs/development/current/main/phases/phase-113/README.md @@ -0,0 +1,24 @@ +# Phase 113: if-only partial assign parity + +## Background + +if-only (no else) で片側だけ代入がある場合、else 側では変数の元の値を「保持」する必要がある。 +これは PHI ノードの incoming として、else 側に元の ValueId を渡す「保持 merge」パターン。 + +## What is Fixed + +- `x=1; if flag==1 { x=2 } print(x)` パターン +- flag=0 のとき x は 1 のまま(else 側の暗黙保持) +- flag=1 のとき x は 2 に更新 + +## Verification + +```bash +# VM +bash tools/smokes/v2/profiles/integration/apps/phase113_if_only_partial_assign_vm.sh + +# LLVM EXE +bash tools/smokes/v2/profiles/integration/apps/phase113_if_only_partial_assign_llvm_exe.sh +``` + +Expected output: `1\n2`