Files
hakorune/docs/development/current/main/phases
nyash-codex ef71ea955c feat(control_tree): Phase 133 P0 - Multiple post-loop assigns support
Extend Phase 132's loop(true) + post-loop to accept multiple assignments:

Goal: `x=0; loop(true){ x=1; break }; x=x+2; x=x+3; return x` → exit code 6

Implementation:
- Extended loop_true_break_once.rs pattern detection (len() == 2 → len() >= 2)
- Added iterative assignment lowering (for loop over post_nodes)
- Reused Phase 130's lower_assign_stmt for each assignment
- Maintained ExitMeta DirectValue mode (PHI-free)

Changes:
- apps/tests/phase133_loop_true_break_once_post_multi_add_min.hako (new fixture)
- tools/smokes/v2/profiles/integration/apps/phase133_*_multi_add_*.sh (new smokes)
- src/mir/control_tree/normalized_shadow/loop_true_break_once.rs (+30 lines)
- docs/development/current/main/phases/phase-133/README.md (new documentation)
- docs/development/current/main/10-Now.md (Phase 133 entry added)

Scope (Phase 130 baseline):
-  x = <int literal>
-  x = y (variable copy)
-  x = x + <int literal> (increment)
-  Function calls / general expressions (future phases)

Design principles:
- Minimal change: ~30 lines added
- SSOT preservation: env_post_k remains single source of truth
- Reuse: Leveraged existing lower_assign_stmt
- Fail-Fast: Contract violations trigger freeze_with_hint

Test results:
- cargo test --lib: 1176 PASS
- Phase 133 VM: PASS (exit code 6)
- Phase 133 LLVM EXE: PASS (exit code 6)
- Phase 132 regression: PASS (exit code 3)
- Phase 131 regression: PASS (exit code 1)
- Phase 97 regression: PASS

Architecture maintained:
- 5-function structure unchanged (main/loop_step/loop_body/k_exit/post_k)
- PHI-free DirectValue mode
- Zero changes to ExitMeta, merge logic, or JoinIR contracts

Related: Phase 133 loop(true) + multiple post-loop assignments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 22:11:08 +09:00
..
2025-12-17 04:26:23 +09:00
2025-12-17 04:26:23 +09:00
2025-12-17 04:26:23 +09:00
2025-12-17 23:30:13 +09:00
2025-12-17 23:30:13 +09:00
2025-12-17 23:45:55 +09:00
2025-12-18 02:39:44 +09:00
2025-12-18 02:55:14 +09:00
2025-12-18 05:50:29 +09:00
2025-12-18 06:47:43 +09:00
2025-12-18 02:19:41 +09:00

Phase ドキュメント

このフォルダは、実装フェーズPhase 131, Phase 33 等)ごとの詳細記録を保管します。

現在の Phase

  • Phase 132: Exit Values Parity (VM == LLVM)
  • Phase 133: Promoted carrier join_idTrim修正
  • Phase 134: Plugin loader best-effort loading
  • Phase 135: ConditionLoweringBox allocator SSOTValueId 衝突の根治)
  • Phase 136: MirBuilder Context SSOT 化(+ ValueId allocator 掃討)
  • Phase 137141: Loop Canonicalizer前処理 SSOT導入Phase 137 フォルダに統合して記録)
  • Phase 9192: Selfhost depth2 coverageP5b escape recognition → lowering
  • Phase 94100: P5b escape E2E / Trim policy / pinned + accumulatorVM/LLVM EXE parity
  • Phase 102: real-app read_quoted loop regressionVM + LLVM EXE
  • Phase 103: if-only regression baselineVM + LLVM EXE / plan
  • Phase 113: if-only partial assign parity片側代入の保持 merge
  • Phase 107109: real-app depth-scan / policy router SSOT / error hint SSOT
  • Phase 110112: ControlTree / StepTree構造SSOT, dev-only※設計SSOTは ../design/control-tree.md

Phase フォルダ構成(推奨)

phases/phase-131/
├── README.md                          (Phase 全体概要)
├── 131-03-llvm-lowering-inventory.md (LLVM 部分のテスト・検証)
├── 131-11-case-c-summary.md          (Case C 実装サマリー)
└── phase131-11-case-c-root-cause-analysis.md (根本原因分析)

参照方法

  1. 現在の Phase を知りたい../10-Now.md
  2. 該当 Phase を詳しく知りたい → フォルダを開く
  3. 設計背景を知りたい../design/
  4. 調査ログを見たい../investigations/

Phase 命名規則

  • ファイル名: phase-<N>-<title>/ (例: phase-131/)
  • 文書名: <N>-<NN>-<topic>.md (例: 131-11-case-c-summary.md)
    • Phase 番号で自然にソート可能
    • 同一 Phase 内で段階的に追跡可能

作成ルールSSOT

詳しくは ../DOCS_LAYOUT.md を参照。

  • 置き場所: phases/phase-<N>/ 配下のみ
  • 内容: Phase の実装記録・進捗・チェックリスト・検証結果
  • 避けるべき: 複数 Phase で参照される設計・アーキテクチャ(→ design/ へ)

最終更新: 2025-12-18