2025-12-16 23:30:39 +09:00
|
|
|
|
# CURRENT_TASK (moved)
|
2025-12-04 14:19:48 +09:00
|
|
|
|
|
2025-12-16 23:30:39 +09:00
|
|
|
|
Status: SSOT
|
|
|
|
|
|
Scope: Repo root の旧リンク互換。現行の入口は `docs/development/current/main/10-Now.md`。
|
2025-12-04 10:52:10 +09:00
|
|
|
|
|
2025-12-16 23:30:39 +09:00
|
|
|
|
- Now: `docs/development/current/main/10-Now.md`
|
|
|
|
|
|
- Backlog: `docs/development/current/main/30-Backlog.md`
|
2025-12-18 17:48:18 +09:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2025-12-19 05:28:49 +09:00
|
|
|
|
## Handoff (current)
|
|
|
|
|
|
|
|
|
|
|
|
### 状況(SSOT)
|
|
|
|
|
|
|
2025-12-29 13:44:53 +09:00
|
|
|
|
**JoinIR 回帰 SSOT**
|
2025-12-29 14:18:31 +09:00
|
|
|
|
`./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh` が唯一の integration gate。phase143_* は対象外(legacy pack で隔離)。phase286_pattern9_* は legacy pack (SKIP) で運用。
|
2025-12-29 13:44:53 +09:00
|
|
|
|
|
2025-12-29 16:25:34 +09:00
|
|
|
|
**CorePlan migration 道筋 SSOT**
|
|
|
|
|
|
`docs/development/current/main/design/coreplan-migration-roadmap-ssot.md` が移行タスクの Done 判定の入口。
|
|
|
|
|
|
|
2025-12-30 10:34:31 +09:00
|
|
|
|
**Next implementation (Phase 29ao P25)**
|
2025-12-30 10:50:21 +09:00
|
|
|
|
- 目的: Pattern5(Infinite Early-Exit)を strict/dev で Facts→CorePlan に寄せ、DomainPlan 経路との差分を Fail-Fast で検知する(既定挙動は不変)
|
|
|
|
|
|
- 指示書: `docs/development/current/main/phases/phase-29ao/P25-STRICT-ADOPT-PATTERN5-INFINITE-EARLY-EXIT-FROM-FACTS-INSTRUCTIONS.md`
|
2025-12-30 10:15:23 +09:00
|
|
|
|
|
2025-12-30 10:34:31 +09:00
|
|
|
|
**2025-12-30: Phase 29ao P24 COMPLETE (Pattern7 strict/dev adopt from facts)**
|
|
|
|
|
|
Pattern7(SplitScan)を strict/dev で Facts→CorePlan に寄せ、DomainPlan 経路との差分を Fail-Fast で検知できるようにした。
|
|
|
|
|
|
|
2025-12-30 10:15:23 +09:00
|
|
|
|
**2025-12-30: Phase 29ao P23 COMPLETE (Pattern3 strict/dev adopt from facts)**
|
|
|
|
|
|
Pattern3(If‑Phi)を strict/dev で Facts→CorePlan に寄せ、DomainPlan 経路との差分を Fail-Fast で検知できるようにした。
|
2025-12-30 09:58:25 +09:00
|
|
|
|
|
|
|
|
|
|
**2025-12-30: Phase 29ao P22 COMPLETE (Pattern1 CoreLoop dedup)**
|
|
|
|
|
|
Pattern1 の CoreLoop 構築を SSOT で 1 箇所に統一し、DomainPlan/Facts の二重化を解消した。
|
2025-12-30 09:38:27 +09:00
|
|
|
|
|
|
|
|
|
|
**2025-12-30: Phase 29ao P21 COMPLETE (Pattern1 subset step-only gate)**
|
|
|
|
|
|
Pattern1 subset を body=step のみに引き締め、strict/dev shadow adopt の誤マッチを遮断した。
|
2025-12-30 09:20:24 +09:00
|
|
|
|
|
|
|
|
|
|
**2025-12-30: Phase 29ao P20 COMPLETE (CoreLoop ExitMap composition SSOT)**
|
|
|
|
|
|
CoreLoop の ExitMap/Cleanup/ValueJoin 合成規約を SSOT 化し、合成境界と Fail-Fast ルールを固定した(docs-only)。
|
2025-12-29 16:31:29 +09:00
|
|
|
|
|
2025-12-29 16:49:05 +09:00
|
|
|
|
**2025-12-29: Phase 29am P0 COMPLETE (CorePlan If/Exit lowerer/verifier)**
|
|
|
|
|
|
CorePlan の If/Exit を lowerer/verifier で扱えるようにして、CorePlan 移行の土台を作った。
|
|
|
|
|
|
|
2025-12-30 07:32:57 +09:00
|
|
|
|
**2025-12-30: Phase 29ao P12 COMPLETE (Pattern7 SplitScan step join via block_params)**
|
|
|
|
|
|
Pattern7 SplitScan の step join を `Frag.block_params + EdgeArgs` で表現し、CorePhiInfo の step PHI を撤去した。
|
|
|
|
|
|
|
2025-12-30 09:00:12 +09:00
|
|
|
|
**2025-12-30: Phase 29ao P18 COMPLETE (single_planner outcome plumbing)**
|
|
|
|
|
|
single_planner が planner outcome を返す SSOT に寄せ、router の二重 planner 実行を撤去した。
|
|
|
|
|
|
|
2025-12-30 08:52:21 +09:00
|
|
|
|
**2025-12-30: Phase 29ao P17 COMPLETE (Pattern1 strict/dev shadow adopt)**
|
|
|
|
|
|
strict/dev のみ Facts→CorePlan(skeleton) を採用し、既定経路は維持した。
|
|
|
|
|
|
|
2025-12-30 08:09:40 +09:00
|
|
|
|
**2025-12-30: Phase 29ao P14 COMPLETE (Pattern2 Break exit join via block_params)**
|
|
|
|
|
|
Pattern2 Break の after join を `Frag.block_params + EdgeArgs` で表現し、CorePhiInfo の after PHI を撤去した。
|
|
|
|
|
|
|
2025-12-30 08:31:00 +09:00
|
|
|
|
**2025-12-30: Phase 29ao P16 COMPLETE (Pattern5 Break exit join via block_params)**
|
|
|
|
|
|
Pattern5 Infinite Early-Exit の after join を `Frag.block_params + EdgeArgs` で表現し、CorePhiInfo の exit PHI を撤去した。
|
|
|
|
|
|
|
2025-12-29 16:56:26 +09:00
|
|
|
|
**2025-12-29: Phase 29am P1 COMPLETE (CoreLoopPlan.body Seq flatten)**
|
|
|
|
|
|
CoreLoopPlan.body の `Seq([Effect...])` を再帰で flatten して emit できるようにした(Effect-only制約は維持)。
|
|
|
|
|
|
|
2025-12-29 17:05:50 +09:00
|
|
|
|
**2025-12-29: Phase 29am P2 COMPLETE (Verifier: Loop.body Effect-only)**
|
|
|
|
|
|
Loop.body に If/Exit/Loop が混入したら PlanVerifier で fail-fast([V12])。Seq-of-effects は許可。
|
|
|
|
|
|
|
2025-12-29 17:20:41 +09:00
|
|
|
|
**2025-12-29: Phase 29am P3 COMPLETE (Exit alignment: “Exit is last” rule)**
|
|
|
|
|
|
CorePlan 内の Exit の乱用を抑制し、Frag/ExitMap と整合する表現へ寄せた([V11])。
|
|
|
|
|
|
|
2025-12-29 14:34:34 +09:00
|
|
|
|
**PlanRuleOrder SSOT**
|
2025-12-29 14:41:56 +09:00
|
|
|
|
single_planner の順序/名前 SSOT は `src/mir/builder/control_flow/plan/single_planner/rule_order.rs` に固定。PlannerContext で Pattern1 facts の抑制を開始し、残りの guard/filter は段階移行。
|
2025-12-29 14:34:34 +09:00
|
|
|
|
|
2025-12-29 13:44:53 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P6 COMPLETE (JoinIR regression gate SSOT)**
|
|
|
|
|
|
JoinIR 回帰の integration gate を phase29ae pack に固定し、phase143_* を legacy pack で隔離。
|
|
|
|
|
|
|
2025-12-29 13:57:26 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P7 COMPLETE (Pattern8 planner-first)**
|
|
|
|
|
|
Pattern8 BoolPredicateScan の Facts→Planner-first を導入し、single_planner の extractor 依存を縮小。
|
|
|
|
|
|
|
2025-12-29 14:34:34 +09:00
|
|
|
|
**2025-12-29: Phase 29ak P0 COMPLETE (PlanRuleOrder + PlannerContext plumbing)**
|
|
|
|
|
|
PlanRuleOrder を SSOT 化し、PlannerContext を配線(未使用)。single_planner の手書きテーブルを撤去。
|
|
|
|
|
|
|
2025-12-29 14:41:56 +09:00
|
|
|
|
**2025-12-29: Phase 29ak P1 COMPLETE (Pattern1 facts guard via planner)**
|
|
|
|
|
|
Pattern1 以外のループで pattern1_simplewhile facts 抽出を抑制。single_planner 側の guard は安全策として維持。
|
2025-12-29 14:49:48 +09:00
|
|
|
|
|
|
|
|
|
|
**2025-12-29: Phase 29ak P2 COMPLETE (Pattern8 static box filter via planner)**
|
|
|
|
|
|
static box では Pattern8 facts 抽出を抑制。single_planner 側の filter は安全策として維持。
|
2025-12-29 14:41:56 +09:00
|
|
|
|
|
2025-12-29 15:00:51 +09:00
|
|
|
|
**2025-12-29: Phase 29ak P3 COMPLETE (remove Pattern8 filter in single_planner)**
|
|
|
|
|
|
Pattern8 static box filter を single_planner から撤去し、planner/facts 側 SSOT に一本化。
|
|
|
|
|
|
|
2025-12-29 15:10:08 +09:00
|
|
|
|
**2025-12-29: Phase 29ak P4 COMPLETE (remove Pattern1 guard in single_planner)**
|
|
|
|
|
|
Pattern1 guard を single_planner から撤去し、planner/facts 側 SSOT と fallback 抑制に統一。
|
|
|
|
|
|
|
2025-12-29 15:50:57 +09:00
|
|
|
|
**2025-12-29: Phase 29ak P5 COMPLETE (planner candidate ctx gate)**
|
|
|
|
|
|
Pattern1/8 の候補抑制を planner 側に集約し、single_planner の Pattern1 抑制を撤去。
|
|
|
|
|
|
|
2025-12-29 16:01:26 +09:00
|
|
|
|
**2025-12-29: Phase 29al P0 COMPLETE (Skeleton/Feature model SSOT, docs-only)**
|
|
|
|
|
|
CorePlan を骨格→特徴→合成で説明する SSOT を追加し、Freeze taxonomy に unstructured を追加。
|
|
|
|
|
|
|
2025-12-29 16:06:14 +09:00
|
|
|
|
**2025-12-29: Phase 29al P1 COMPLETE (post-phi final form SSOT, docs-only)**
|
|
|
|
|
|
join 値(PHI相当)の最終表現(layout/mapping/pred分類/verify)を 1 枚 SSOT として固定。
|
|
|
|
|
|
|
2025-12-29 16:16:53 +09:00
|
|
|
|
**2025-12-29: Phase 29al P2 COMPLETE (effect classification SSOT, docs-only)**
|
|
|
|
|
|
effect 分類(Pure/Mut/Io/Control)と “許される変形” の最小法典を SSOT 化。
|
|
|
|
|
|
|
2025-12-29 16:21:13 +09:00
|
|
|
|
**2025-12-29: Phase 29al P3 COMPLETE (exitkind/cleanup/effect contract SSOT, docs-only)**
|
|
|
|
|
|
cleanup を ExitKind 語彙として扱い、Control/Io を跨いだ移動や DCE 消去の事故を防ぐ境界を SSOT 化。
|
|
|
|
|
|
|
2025-12-29 14:26:25 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P10 COMPLETE (single_planner unified shape)**
|
|
|
|
|
|
single_planner を全パターンで planner-first → extractor フォールバックの共通形に統一(挙動不変)。
|
|
|
|
|
|
|
2025-12-29 14:18:31 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P9 COMPLETE (phase286 pattern9 legacy isolation)**
|
|
|
|
|
|
phase286_pattern9_frag_poc を legacy pack (SKIP) に隔離し、JoinIR 回帰 SSOT を phase29ae pack に固定。
|
|
|
|
|
|
|
2025-12-29 14:08:53 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P8 COMPLETE (Pattern9 planner-first)**
|
|
|
|
|
|
Pattern9 AccumConstLoop の Facts→Planner-first を導入し、single_planner の extractor 依存を縮小。
|
|
|
|
|
|
|
2025-12-29 11:37:31 +09:00
|
|
|
|
**2025-12-29: Phase 29ai P15 COMPLETE (Pattern2 promotion hint observe)**
|
|
|
|
|
|
strict/dev 時のみ `[plan/pattern2/promotion_hint:{TrimSeg|DigitPos}]` を観測できるようにし、次は promotion hint の Plan/Frag 吸収残作業(P16候補)。
|
|
|
|
|
|
|
2025-12-29 12:17:57 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P0 COMPLETE (PlannerOutcome observability SSOT)**
|
|
|
|
|
|
planner outcome(facts+plan)を SSOT 化し、single_planner の観測が planner facts のみに依存するように統一。
|
|
|
|
|
|
|
2025-12-29 12:39:15 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P1 COMPLETE (Remove legacy_rules)**
|
|
|
|
|
|
single_planner の legacy_rules を撤去し、Pattern1/3/4/5/8/9 の抽出を plan/extractors に統一。
|
|
|
|
|
|
|
2025-12-29 12:54:32 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P2 COMPLETE (Pattern1 planner-first)**
|
|
|
|
|
|
chosen_rule を撤去し、Pattern1 SimpleWhile の Facts→Planner-first を導入(仕様不変)。
|
|
|
|
|
|
|
2025-12-29 13:06:17 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P3 COMPLETE (Pattern3 planner-first)**
|
|
|
|
|
|
Pattern3 If-Phi の Facts→Planner-first を導入し、single_planner の extractor 依存を縮小。
|
|
|
|
|
|
|
2025-12-29 13:22:55 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P4 COMPLETE (Pattern4 planner-first)**
|
|
|
|
|
|
Pattern4 Continue の Facts→Planner-first を導入し、single_planner の extractor 依存を縮小。
|
|
|
|
|
|
|
2025-12-29 13:39:30 +09:00
|
|
|
|
**2025-12-29: Phase 29aj P5 COMPLETE (Pattern5 planner-first)**
|
|
|
|
|
|
Pattern5 Infinite Early Exit の Facts→Planner-first を導入し、single_planner の extractor 依存を縮小。
|
|
|
|
|
|
|
2025-12-27 09:39:29 +09:00
|
|
|
|
**2025-12-27: Phase 188.3 / Phase 287 P2 COMPLETE (Pattern6 nested loop: merge/latch fixes)**
|
|
|
|
|
|
Pattern6(1-level nested loop)の JoinIR→bridge→merge 経路で発生していた `undefined ValueId` と `vm step budget exceeded`(無限ループ)を解消。`apps/tests/phase1883_nested_minimal.hako` が RC=9 を返し、quick 154 PASS を維持。
|
|
|
|
|
|
|
|
|
|
|
|
- SSOT(mergeの契約):
|
|
|
|
|
|
- latch_incoming を記録してよいのは `TailCallKind::BackEdge` のみ(LoopEntry は上書き禁止)
|
2025-12-29 05:12:15 +09:00
|
|
|
|
- entry-like 判定は “JoinIR MAIN のみ” を対象にする(block-id 推測はしない): `src/mir/builder/control_flow/joinir/merge/contract_checks/entry_like_policy.rs`
|
2025-12-27 09:39:29 +09:00
|
|
|
|
- latch 二重設定は `debug_assert!` で fail-fast(回帰検知)
|
|
|
|
|
|
- 変更箇所:
|
|
|
|
|
|
- `src/mir/builder/control_flow/joinir/merge/instruction_rewriter.rs`
|
|
|
|
|
|
- `src/mir/builder/control_flow/joinir/merge/loop_header_phi_info.rs`
|
|
|
|
|
|
- 検証(DONE):
|
|
|
|
|
|
- [x] 再現とPHI確認(Pattern6)
|
|
|
|
|
|
- [x] latch記録条件を修正(BackEdgeのみ)
|
|
|
|
|
|
- [x] デバッグ出力を撤去(恒常出力なし)
|
|
|
|
|
|
- [x] quick/fixtureで検証(quick 154 PASS / fixture RC=9)
|
|
|
|
|
|
- [x] docsを締めて次の指示書を用意(refactor挟み込み用)
|
|
|
|
|
|
|
2025-12-26 02:03:34 +09:00
|
|
|
|
**2025-12-26: Phase 286 P2.2 COMPLETE (Hygiene: extractor重複排除 + router小整理)**
|
|
|
|
|
|
Pattern1/Pattern4 の Plan/Frag PoC 完了後、extractor の `extract_loop_increment_plan` を `common_helpers.rs` に統一、router の 3行パターン(normalize→verify→lower)を `lower_via_plan()` ヘルパーで共通化。~65行削減、quick 154 PASS 維持。
|
|
|
|
|
|
|
2025-12-26 02:38:09 +09:00
|
|
|
|
**2025-12-26: Phase 286 P2.3 COMPLETE (Pattern9 AccumConstLoop Plan化 PoC)**
|
|
|
|
|
|
Pattern9 (AccumConstLoop) を Plan/Frag SSOT に移行完了。PHI 2本(loop_var, acc_var)、const/var 両方 OK。Pattern9 は Pattern1 より先にチェック(より具体的なパターン)。quick 154 PASS 維持。
|
2025-12-25 23:05:20 +09:00
|
|
|
|
|
2025-12-19 05:28:49 +09:00
|
|
|
|
- 現行の入口: `docs/development/current/main/10-Now.md`
|
2025-12-26 02:03:34 +09:00
|
|
|
|
- Phase 286 詳細: `docs/development/current/main/phases/phase-286/README.md`
|
2025-12-19 05:28:49 +09:00
|
|
|
|
- 次の候補: `docs/development/current/main/30-Backlog.md`
|
2025-12-20 20:05:11 +09:00
|
|
|
|
- Design goal: `docs/development/current/main/design/join-explicit-cfg-construction.md`
|
2025-12-19 05:28:49 +09:00
|
|
|
|
|
|
|
|
|
|
### 直近の道筋(JoinIR / Normalized)
|
|
|
|
|
|
|
feat(anf): Phase 146/147 - Loop/If Condition ANF with Compare support
## Phase 146 P0: ANF Routing SSOT Unified
**Goal**: Unify ANF routing in `lower_expr_with_scope()` L54-84, remove legacy lowering
**Changes**:
- expr_lowerer_box.rs: Added scope check (PureOnly → skip ANF, WithImpure → try ANF)
- post_if_post_k.rs: Removed legacy inline lowering (L271-285), added `lower_condition_legacy()` helper
- contract.rs: Already had `CondLoweringFailed` out-of-scope reason
**Test Results**: ✅ Phase 146 P0 smoke (exit 7), 0 regressions
## Phase 146 P1: Compare Operator Support
**Goal**: Enable ANF for condition expressions with Compare operators
**Changes**:
- joinir_dev.rs: Added `anf_allow_pure_enabled()` (HAKO_ANF_ALLOW_PURE=1)
- expr_lowerer_box.rs: PureOnly scope ANF support (L56-66)
- execute_box.rs: Compare operator support (+122 lines)
- `execute_compare_hoist()`, `execute_compare_recursive()`, `ast_compare_to_joinir()`
- Extended `normalize_and_lower()` for Compare
**Test Results**: ✅ Phase 146 P1 smoke (exit 7 with flags), 0 regressions
## Phase 147 P0: Recursive Comparison ANF
**Goal**: Extend recursive ANF to Compare operators
**Changes**:
- contract.rs: Added `AnfParentKind::Compare` variant
- plan_box.rs: Compare case in BinaryOp routing (L68-79, L134-139)
- Distinguishes Compare vs arithmetic BinaryOp
**Benefits**: Enables recursive ANF for comparisons
- `s.length() == 3` → `t = s.length(); if (t == 3)` ✅
- `s1.length() < s2.length()` → `t1 = s1.length(); t2 = s2.length(); if (t1 < t2)` ✅
## Implementation Summary
**Files Modified** (9 files, +253 lines, -25 lines = +228 net):
1. src/config/env/joinir_dev.rs (+28 lines)
2. src/mir/control_tree/normalized_shadow/anf/contract.rs (+2 lines)
3. src/mir/control_tree/normalized_shadow/anf/execute_box.rs (+122 lines)
4. src/mir/control_tree/normalized_shadow/anf/plan_box.rs (+18 lines)
5. src/mir/control_tree/normalized_shadow/common/expr_lowerer_box.rs (+18 lines, -0 lines)
6. src/mir/control_tree/normalized_shadow/post_if_post_k.rs (+44 lines, -25 lines)
7. CURRENT_TASK.md
8. docs/development/current/main/10-Now.md
9. docs/development/current/main/30-Backlog.md
**Files Created** (7 files):
- apps/tests/phase146_p0_if_cond_unified_min.hako
- apps/tests/phase146_p1_if_cond_intrinsic_min.hako
- tools/smokes/.../phase146_p0_if_cond_unified_vm.sh
- tools/smokes/.../phase146_p0_if_cond_unified_llvm_exe.sh
- tools/smokes/.../phase146_p1_if_cond_intrinsic_vm.sh
- tools/smokes/.../phase146_p1_if_cond_intrinsic_llvm_exe.sh
- docs/development/current/main/phases/phase-146/README.md
**Acceptance Criteria**: ✅ All met
- cargo build --release: PASS (0 errors, 0 warnings)
- Phase 145 regressions: PASS (exit 12, 18, 5)
- Phase 146 P0: PASS (exit 7)
- Phase 146 P1: PASS (exit 7 with HAKO_ANF_ALLOW_PURE=1)
**Architecture**:
- SSOT: ANF routing only in `lower_expr_with_scope()` L54-84
- Box-First: Phase 145 `anf/` module extended
- Legacy removed: post_if_post_k.rs unified with SSOT
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 17:03:56 +09:00
|
|
|
|
### 設計方針メモ(SSOT候補)
|
|
|
|
|
|
|
|
|
|
|
|
- ExprLowererBox(式SSOT)
|
|
|
|
|
|
- 役割: `AST(expr)` → `(prelude: Vec<Inst>, value: ValueId)`(ANF含む)
|
|
|
|
|
|
- pure/impure/whitelist/strict の契約を集約(入口SSOT)
|
|
|
|
|
|
- ConditionLowererBox(条件→分岐SSOT)
|
|
|
|
|
|
- 役割: `AST(cond)` → `BranchPlan`(短絡なら分岐語彙で組む)
|
|
|
|
|
|
- 評価順は ExprLowererBox に委譲(ANFで順序固定)
|
|
|
|
|
|
- `&&/||` は制御として扱い、式で無理しない
|
|
|
|
|
|
- ControlLowererBox(制御SSOT)
|
|
|
|
|
|
- 役割: `StepNode/ControlTree` → JoinIR(継続 + env)
|
|
|
|
|
|
- `if/loop` はここ、条件の中身は ConditionLowererBox に委譲
|
|
|
|
|
|
|
2025-12-19 05:28:49 +09:00
|
|
|
|
- Phase 139: if-only `post_k` の return lowering を `ReturnValueLowererBox` に統一(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-139/README.md`
|
|
|
|
|
|
- Phase 140: `NormalizedExprLowererBox` 初版(pure expression のみ)(DONE)
|
|
|
|
|
|
- SSOT: `docs/development/current/main/design/normalized-expr-lowering.md`
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-140/README.md`
|
|
|
|
|
|
- Phase 141 P0: impure 拡張点(contract)を SSOT 化(Call/MethodCall はまだ out-of-scope)(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-141/README.md`
|
|
|
|
|
|
- Phase 141 P1: “既知 intrinsic だけ” を許可して段階投入(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-141/README.md`
|
|
|
|
|
|
- Phase 141 P1.5: known intrinsic registry + available_inputs 3-source merge + diagnostics(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-141/README.md`
|
|
|
|
|
|
- Phase 142-loopstmt P0: 正規化単位を statement(loop 1個)へ寄せる(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-142-loopstmt/README.md`
|
2025-12-19 08:36:45 +09:00
|
|
|
|
- Phase 142-loopstmt P1: LLVM EXE smoke(同 fixture)を追加(DONE)
|
2025-12-19 05:28:49 +09:00
|
|
|
|
- `docs/development/current/main/phases/phase-142-loopstmt/README.md`
|
|
|
|
|
|
- Phase 141 P2+: Call/MethodCall(effects + typing)を分離して段階投入
|
|
|
|
|
|
- Historical context: `docs/development/current/main/investigations/joinir-generalization-study.md`
|
2025-12-19 08:36:45 +09:00
|
|
|
|
- Phase 143-loopvocab P0/P1: loop 内 if/break/continue の語彙追加(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-143-loopvocab/README.md`
|
2025-12-19 16:19:49 +09:00
|
|
|
|
- Phase 143-loopvocab P2: else 対称化(B-C / C-B)(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-143-loopvocab/README.md`
|
|
|
|
|
|
- Phase 145-anf P0/P1/P2: ANF(impure hoist + 再帰的線形化)(DONE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-145-anf/README.md`
|
feat(anf): Phase 146/147 - Loop/If Condition ANF with Compare support
## Phase 146 P0: ANF Routing SSOT Unified
**Goal**: Unify ANF routing in `lower_expr_with_scope()` L54-84, remove legacy lowering
**Changes**:
- expr_lowerer_box.rs: Added scope check (PureOnly → skip ANF, WithImpure → try ANF)
- post_if_post_k.rs: Removed legacy inline lowering (L271-285), added `lower_condition_legacy()` helper
- contract.rs: Already had `CondLoweringFailed` out-of-scope reason
**Test Results**: ✅ Phase 146 P0 smoke (exit 7), 0 regressions
## Phase 146 P1: Compare Operator Support
**Goal**: Enable ANF for condition expressions with Compare operators
**Changes**:
- joinir_dev.rs: Added `anf_allow_pure_enabled()` (HAKO_ANF_ALLOW_PURE=1)
- expr_lowerer_box.rs: PureOnly scope ANF support (L56-66)
- execute_box.rs: Compare operator support (+122 lines)
- `execute_compare_hoist()`, `execute_compare_recursive()`, `ast_compare_to_joinir()`
- Extended `normalize_and_lower()` for Compare
**Test Results**: ✅ Phase 146 P1 smoke (exit 7 with flags), 0 regressions
## Phase 147 P0: Recursive Comparison ANF
**Goal**: Extend recursive ANF to Compare operators
**Changes**:
- contract.rs: Added `AnfParentKind::Compare` variant
- plan_box.rs: Compare case in BinaryOp routing (L68-79, L134-139)
- Distinguishes Compare vs arithmetic BinaryOp
**Benefits**: Enables recursive ANF for comparisons
- `s.length() == 3` → `t = s.length(); if (t == 3)` ✅
- `s1.length() < s2.length()` → `t1 = s1.length(); t2 = s2.length(); if (t1 < t2)` ✅
## Implementation Summary
**Files Modified** (9 files, +253 lines, -25 lines = +228 net):
1. src/config/env/joinir_dev.rs (+28 lines)
2. src/mir/control_tree/normalized_shadow/anf/contract.rs (+2 lines)
3. src/mir/control_tree/normalized_shadow/anf/execute_box.rs (+122 lines)
4. src/mir/control_tree/normalized_shadow/anf/plan_box.rs (+18 lines)
5. src/mir/control_tree/normalized_shadow/common/expr_lowerer_box.rs (+18 lines, -0 lines)
6. src/mir/control_tree/normalized_shadow/post_if_post_k.rs (+44 lines, -25 lines)
7. CURRENT_TASK.md
8. docs/development/current/main/10-Now.md
9. docs/development/current/main/30-Backlog.md
**Files Created** (7 files):
- apps/tests/phase146_p0_if_cond_unified_min.hako
- apps/tests/phase146_p1_if_cond_intrinsic_min.hako
- tools/smokes/.../phase146_p0_if_cond_unified_vm.sh
- tools/smokes/.../phase146_p0_if_cond_unified_llvm_exe.sh
- tools/smokes/.../phase146_p1_if_cond_intrinsic_vm.sh
- tools/smokes/.../phase146_p1_if_cond_intrinsic_llvm_exe.sh
- docs/development/current/main/phases/phase-146/README.md
**Acceptance Criteria**: ✅ All met
- cargo build --release: PASS (0 errors, 0 warnings)
- Phase 145 regressions: PASS (exit 12, 18, 5)
- Phase 146 P0: PASS (exit 7)
- Phase 146 P1: PASS (exit 7 with HAKO_ANF_ALLOW_PURE=1)
**Architecture**:
- SSOT: ANF routing only in `lower_expr_with_scope()` L54-84
- Box-First: Phase 145 `anf/` module extended
- Legacy removed: post_if_post_k.rs unified with SSOT
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 17:03:56 +09:00
|
|
|
|
- Phase 146(in progress): Loop/If 条件式へ ANF を横展開(順序固定と診断)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-146/README.md`
|
2025-12-19 05:28:49 +09:00
|
|
|
|
|
|
|
|
|
|
## Resolved (historical)
|
|
|
|
|
|
|
|
|
|
|
|
### WSL EXDEV / cargo build failure (resolved)
|
|
|
|
|
|
|
|
|
|
|
|
- 2025-12-18: `Invalid cross-device link (os error 18)` により `cargo build` が失敗する事象があったが、`wsl --shutdown` 再起動後に復旧。
|
|
|
|
|
|
- 再発時のワークアラウンド: `tools/build_llvm.sh` は EXDEV を避けるため `TMPDIR` を `target/...` 配下へ寄せる。
|