2025-09-08 11:35:30 +09:00
|
|
|
|
# Self Current Task — Now (main)
|
|
|
|
|
|
|
2025-12-18 02:32:08 +09:00
|
|
|
|
## 2025-12-18:Phase 115 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 115: if-only call result merge parity**
|
|
|
|
|
|
- if-only で関数呼び出し結果を merge するパターンを VM/LLVM で固定
|
|
|
|
|
|
- Fixture: phase115_if_only_call_merge_min.hako (expected: 2, 3)
|
|
|
|
|
|
- Smoke: VM + LLVM EXE parity 検証済み
|
|
|
|
|
|
- 回帰: Phase 103/113/114 維持確認
|
|
|
|
|
|
- 入口: `docs/development/current/main/phases/phase-115/README.md`
|
|
|
|
|
|
|
2025-12-18 02:18:57 +09:00
|
|
|
|
## 2025-12-18:Phase 114 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 114: if-only return+post parity**
|
|
|
|
|
|
- if-only で early return + post-if statements パターンを VM/LLVM で固定
|
|
|
|
|
|
- Fixture: phase114_if_only_return_then_post_min.hako (expected: 7, 2)
|
|
|
|
|
|
- Smoke: VM + LLVM EXE parity 検証済み
|
|
|
|
|
|
- 回帰: Phase 103/113 維持確認
|
|
|
|
|
|
- 入口: `docs/development/current/main/phases/phase-114/README.md`
|
|
|
|
|
|
|
2025-12-18 01:58:56 +09:00
|
|
|
|
## 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 01:39:06 +09:00
|
|
|
|
## 2025-12-18:Phase 112 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 112: StepTree Capability Guard (strict-only)**
|
|
|
|
|
|
- StepTree の required_caps を strict mode でチェック
|
|
|
|
|
|
- Allowlist: If, NestedIf, Loop, Return, Break, Continue
|
|
|
|
|
|
- Deny (strict): NestedLoop, TryCatch, Throw, Lambda, While, ForRange, Match, Arrow
|
|
|
|
|
|
- Error format: `[joinir/control_tree/cap_missing/<Cap>] <msg> Hint: <hint>`
|
|
|
|
|
|
- Default behavior unchanged (strict=false always Ok)
|
|
|
|
|
|
- 入口: `docs/development/current/main/design/control-tree.md`
|
|
|
|
|
|
- 実装:
|
|
|
|
|
|
- `src/mir/builder/control_flow/joinir/control_tree_capability_guard.rs`
|
|
|
|
|
|
- `src/mir/builder/calls/lowering.rs` (wired into lower_function_body)
|
|
|
|
|
|
|
|
|
|
|
|
## 2025-12-18:Phase 111 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 111: StepTreeContract + StepTreeSignature(dev-only)**
|
|
|
|
|
|
- StepTreeContract を追加(`exits` / `writes` / `required_caps` / `cond_sig`)
|
|
|
|
|
|
- StepTreeSignature を追加(`signature_basis_string()` を安定 hash、Span は含めない)
|
|
|
|
|
|
- dev-only parity を break/continue に加えて return まで拡張
|
|
|
|
|
|
- 入口: `docs/development/current/main/design/control-tree.md`
|
|
|
|
|
|
- 実装: `src/mir/control_tree/step_tree.rs`
|
|
|
|
|
|
|
|
|
|
|
|
## 2025-12-18:Phase 110 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 110: ControlTree / StepTree(構造SSOT・dev-only観測)**
|
|
|
|
|
|
- StepTree の語彙(Block/If/Loop/Stmt)と Feature を pure AST で実装(ValueId/PHI/CFG を混ぜない)
|
|
|
|
|
|
- joinir routing 側で extractor との “分類矛盾” を dev-only で検出(strict のみ Fail-Fast)
|
|
|
|
|
|
- 関数本体の StepTree を dev-only でダンプ(既定挙動不変)
|
|
|
|
|
|
- 入口: `docs/development/current/main/design/control-tree.md`
|
|
|
|
|
|
- 実装:
|
|
|
|
|
|
- `src/mir/control_tree/step_tree.rs`
|
|
|
|
|
|
- `src/mir/builder/calls/lowering.rs`
|
|
|
|
|
|
- `src/mir/builder/control_flow/joinir/routing.rs`
|
|
|
|
|
|
|
2025-12-17 23:45:55 +09:00
|
|
|
|
## 2025-12-17:Phase 109 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 109: error_tags hints SSOT**
|
|
|
|
|
|
- policy/validator エラーを "tag + message + hint" 形式に統一
|
|
|
|
|
|
- freeze_with_hint() API 追加(hint 必須、空なら panic)
|
|
|
|
|
|
- Phase 107/104/100 の代表3箱を hint 対応に移行
|
|
|
|
|
|
- 入口: `docs/development/current/main/phases/phase-109/README.md`
|
|
|
|
|
|
|
2025-12-17 18:29:27 +09:00
|
|
|
|
## 2025-12-17:Phase 104 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 104: loop(true) + break-only digits(read_digits 系)**
|
|
|
|
|
|
- read_digits_from 形の `loop(true)` を Pattern2 で受理(loop var 抽出 + break cond 正規化)
|
|
|
|
|
|
- fixture: `apps/tests/phase104_read_digits_loop_true_min.hako`(expected: `2`, `1`)
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase104_read_digits_vm.sh` / `tools/smokes/v2/profiles/integration/apps/phase104_read_digits_llvm_exe.sh`
|
2025-12-17 21:47:37 +09:00
|
|
|
|
- P2: json_cur 由来の回帰面を追加(fixture+VM/LLVM EXE smoke)
|
2025-12-17 18:29:27 +09:00
|
|
|
|
|
2025-12-17 23:15:57 +09:00
|
|
|
|
## 2025-12-17:Phase 107 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 107: json_cur find_balanced_* depth scan(VM + LLVM EXE parity)**
|
|
|
|
|
|
- depth scan + nested if + return-in-loop を Pattern2 policy で受理(hardcode なし)
|
|
|
|
|
|
- fixture:
|
|
|
|
|
|
- `apps/tests/phase107_find_balanced_array_end_min.hako`(expected: `1`, `3`)
|
|
|
|
|
|
- `apps/tests/phase107_find_balanced_object_end_min.hako`(expected: `1`, `3`)
|
|
|
|
|
|
- smoke(integration):
|
|
|
|
|
|
- VM: `tools/smokes/v2/profiles/integration/apps/phase107_find_balanced_array_end_vm.sh` / `tools/smokes/v2/profiles/integration/apps/phase107_find_balanced_object_end_vm.sh`
|
|
|
|
|
|
- LLVM EXE: `tools/smokes/v2/profiles/integration/apps/phase107_find_balanced_array_end_llvm_exe.sh` / `tools/smokes/v2/profiles/integration/apps/phase107_find_balanced_object_end_llvm_exe.sh`
|
|
|
|
|
|
- 入口: `docs/development/current/main/phases/phase-107/README.md`
|
|
|
|
|
|
|
2025-12-17 23:45:55 +09:00
|
|
|
|
## 2025-12-17:Phase 108 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 108: Pattern2 policy router SSOT(薄い入口の固定)**
|
|
|
|
|
|
- post-loop early return を一般 plan(`cond`/`ret_expr`)として独立し、Pattern2Inputs の依存を解消
|
|
|
|
|
|
- ApplyPolicyStepBox から “直叩き” を撤去し、policy router 1本に集約(入口SSOT)
|
|
|
|
|
|
- 入口: `docs/development/current/main/phases/phase-108/README.md`
|
|
|
|
|
|
|
2025-12-17 17:41:10 +09:00
|
|
|
|
## 2025-12-17:Phase 103 P0 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 103: if-only regression baseline**
|
|
|
|
|
|
- if-only(loop無し)の nested if + merge を fixture 化し、VM/LLVM EXE parity を integration smoke で固定
|
|
|
|
|
|
|
2025-12-17 17:39:12 +09:00
|
|
|
|
## 2025-12-17:Phase 100 P3 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 100 P3: String Accumulator Captures**
|
|
|
|
|
|
- String accumulator(`out = out + ch`)を最小形で固定し、VM/LLVM EXE parity を smoke で検証
|
|
|
|
|
|
- LLVM EXE 側の stringish 伝播(PHI/copy/binop)を修正し、concat の意味論を安定化
|
|
|
|
|
|
|
2025-12-17 06:31:21 +09:00
|
|
|
|
## 2025-12-17:Phase 100 P2 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 100 P2: Mutable Accumulator Captures**
|
|
|
|
|
|
- Mutable accumulator pattern (`out = out + ch`) を Pattern2 carrier で対応
|
|
|
|
|
|
- ScopeManager 委譲により read-only check を回避
|
|
|
|
|
|
- Numeric output validation (count=3) で fixture 固定
|
|
|
|
|
|
- VM/LLVM EXE parity 完了(smoke 追加)
|
|
|
|
|
|
|
2025-12-17 05:43:54 +09:00
|
|
|
|
## 2025-12-17:Phase 100 P1 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 100 P1: Pinned Local Captures**
|
|
|
|
|
|
- CapturedEnv に CapturedKind (Explicit/Pinned) 拡張
|
|
|
|
|
|
- PinnedLocalAnalyzer で loop-outer read-only locals を識別
|
|
|
|
|
|
- Pinned receiver (例: s.substring()) が loop 内で使用可能に
|
|
|
|
|
|
- Fixture/smoke で動作確認済み
|
|
|
|
|
|
|
2025-12-17 04:26:23 +09:00
|
|
|
|
## 2025‑12‑17:Phase 99 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 99: Trim/escape 実コード寄り強化(VM+LLVM EXE)**
|
|
|
|
|
|
- next_non_ws を3ケース固定(`2`, `-1`, `3`)— 改行/CR/Tab混在パターン追加
|
|
|
|
|
|
- escape 末尾バックスラッシュを best-effort として固定(`hello\` そのまま出力)
|
|
|
|
|
|
- VM+LLVM EXE parity 完全対応、integration smoke で検証済み
|
|
|
|
|
|
|
2025-12-17 17:39:12 +09:00
|
|
|
|
関連(設計/実装の入口):
|
|
|
|
|
|
- Phase 100: `docs/development/current/main/phases/phase-100/README.md`
|
2025-12-17 05:03:07 +09:00
|
|
|
|
|
2025-12-15 03:17:31 +09:00
|
|
|
|
## 2025‑12‑15:Phase 132 完了 ✅
|
|
|
|
|
|
|
|
|
|
|
|
**Phase 132: LLVM Exit PHI=0 根治修正 完了!**
|
|
|
|
|
|
- ループ exit PHI が 0 を返す問題を根治解決
|
|
|
|
|
|
- 原因(2層): (1) JoinIR/Boundary が exit 値を境界に渡していない、(2) LLVM Python が PHI を落とす/上書きする
|
|
|
|
|
|
- 修正: Pattern 1 で exit 値を明示的に渡す + `predeclared_ret_phis` 使用 + `builder.vmap` の PHI 保護
|
|
|
|
|
|
- 結果: `/tmp/p1_return_i.hako` が 3 を返す(VM 一致)
|
|
|
|
|
|
- 詳細: `investigations/phase132-llvm-exit-phi-wrong-result.md`
|
|
|
|
|
|
|
2025-12-15 06:00:48 +09:00
|
|
|
|
**追加(Phase 132-P2): Case C の Exit PHI ValueId 衝突を修正**
|
|
|
|
|
|
- 原因: `exit_phi_builder.rs` が module-level allocator を使い、同一関数内で ValueId が衝突し得た
|
|
|
|
|
|
- 修正: `func.next_value_id()`(function-level)へ統一(`bd07b7f4`)
|
|
|
|
|
|
- 結果: `apps/tests/llvm_stage3_loop_only.hako` が LLVM EXE でも `Result: 3`(VM 一致)
|
|
|
|
|
|
- 詳細: `investigations/phase132-case-c-llvm-exe.md`
|
|
|
|
|
|
|
2025-12-15 06:08:19 +09:00
|
|
|
|
**追加(Phase 132-P3): Exit PHI collision の早期検出(debug-only)**
|
|
|
|
|
|
- `verify_exit_phi_no_collision()` を `contract_checks.rs` に追加し、ValueId 衝突を JoinIR merge の段階で Fail-Fast する
|
|
|
|
|
|
|
2025-12-16 04:37:47 +09:00
|
|
|
|
## 2025‑12‑15:Phase 133–136(短報)
|
2025-12-15 18:49:08 +09:00
|
|
|
|
|
|
|
|
|
|
- Phase 133: promoted carrier(Trim)の `join_id` 解決を SSOT に寄せて修正(smoke は compile-only)。
|
|
|
|
|
|
- Phase 134: plugin loader best-effort loading を導入(決定的順序 + failure 集約 + 継続)。
|
|
|
|
|
|
- Phase 135: ConditionLoweringBox が allocator SSOT を無視して ValueId 衝突を起こす問題を根治。
|
|
|
|
|
|
- 詳細: `docs/development/current/main/phases/phase-135/README.md`
|
2025-12-16 04:37:47 +09:00
|
|
|
|
- Phase 136: MirBuilder の Context 分割を完了し、状態の SSOT を Context に一本化。
|
|
|
|
|
|
- 詳細: `docs/development/current/main/phases/phase-136/README.md`
|
2025-12-15 18:49:08 +09:00
|
|
|
|
|
2025-12-16 07:54:33 +09:00
|
|
|
|
## 2025‑12‑16:Phase 137‑141(短報)
|
2025-12-16 05:10:29 +09:00
|
|
|
|
|
2025-12-16 07:54:33 +09:00
|
|
|
|
- Loop Canonicalizer(前処理 SSOT)は Phase 141 まで完了(既定挙動は不変、dev-only 観測/strict parity あり)。
|
2025-12-16 05:10:29 +09:00
|
|
|
|
- 設計 SSOT: `docs/development/current/main/design/loop-canonicalizer.md`
|
2025-12-16 05:38:18 +09:00
|
|
|
|
- 実装: `src/mir/loop_canonicalizer/mod.rs`(+ 観測: `src/mir/builder/control_flow/joinir/routing.rs`)
|
2025-12-16 07:54:33 +09:00
|
|
|
|
- Phase 記録: `docs/development/current/main/phases/phase-137/README.md`
|
2025-12-16 05:10:29 +09:00
|
|
|
|
|
2025-12-16 17:08:15 +09:00
|
|
|
|
## 2025‑12‑16:Phase 92(短報)
|
|
|
|
|
|
|
2025-12-16 23:30:39 +09:00
|
|
|
|
- Phase 92(ConditionalStep / P5b escape の lowering 基盤)は完了。
|
|
|
|
|
|
- 条件付き更新(`ConditionalStep`)のJoinIR表現 + Pattern2 側の委譲(emitter 箱化)
|
|
|
|
|
|
- 条件式での body-local 参照(`ConditionEnv → LoopBodyLocalEnv`)+ 最小E2E smoke 固定
|
|
|
|
|
|
- Phase 記録(SSOT入口): `docs/development/current/main/phases/phase-92/README.md`
|
|
|
|
|
|
- 残: P5b の “完全E2E” は body-local promotion 拡張後(スコープ外で保留)
|
|
|
|
|
|
|
|
|
|
|
|
## 2025‑12‑16:Phase 93(短報)
|
|
|
|
|
|
|
|
|
|
|
|
- Trim の `is_ch_match` など「ConditionOnly(PHIで運ばない派生値)」を Derived Slot として毎イテレーション再計算できるようにした。
|
|
|
|
|
|
- SSOT: `ConditionOnlyRecipe`(運搬禁止)+ `ConditionOnlyEmitter`
|
|
|
|
|
|
- schedule: `body-init → derived → break` を評価順SSOTとして強制
|
|
|
|
|
|
- Phase 記録(入口): `docs/development/current/main/phases/phase-93/README.md`
|
2025-12-16 17:08:15 +09:00
|
|
|
|
|
2025-12-17 00:59:33 +09:00
|
|
|
|
## 2025‑12‑16:Phase 94(短報)
|
|
|
|
|
|
|
|
|
|
|
|
- P5b escape(`ch` 再代入 + `i` の +1/+2)を “derived(Select)” として扱い、VM E2E を固定。
|
|
|
|
|
|
- 新箱: `BodyLocalDerivedEmitter` + 明示ポリシー(strict で理由付き Fail-Fast)
|
|
|
|
|
|
- integration smoke: `tools/smokes/v2/profiles/integration/apps/phase94_p5b_escape_e2e.sh`
|
|
|
|
|
|
- Phase 記録(入口): `docs/development/current/main/phases/phase-94/README.md`
|
|
|
|
|
|
|
2025-12-17 01:01:16 +09:00
|
|
|
|
## 2025‑12‑16:Phase 95(短報)
|
|
|
|
|
|
|
|
|
|
|
|
- MiniJsonLoader の escape ループを Phase 94 基盤で固定(派生 body-local + 条件付き skip)。
|
|
|
|
|
|
- フィクスチャ: `apps/tests/phase95_json_loader_escape_min.hako`
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase95_json_loader_escape_vm.sh`
|
|
|
|
|
|
- Phase 記録(入口): `docs/development/current/main/phases/phase-95/README.md`
|
|
|
|
|
|
|
2025-12-17 01:25:06 +09:00
|
|
|
|
## 2025‑12‑16:Phase 96(短報)
|
|
|
|
|
|
|
|
|
|
|
|
- Trim系 policy 化を開始し、MiniJsonLoader の next_non_ws ループを fixtures/smoke に追加。
|
|
|
|
|
|
- フィクスチャ: `apps/tests/phase96_json_loader_next_non_ws_min.hako`
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase96_json_loader_next_non_ws_vm.sh`
|
|
|
|
|
|
- Phase 記録(入口): `docs/development/current/main/phases/phase-96/README.md`
|
|
|
|
|
|
|
2025-12-17 02:26:42 +09:00
|
|
|
|
## 2025‑12‑16:Phase 97(短報)
|
|
|
|
|
|
|
|
|
|
|
|
- Phase 95/96 の MiniJsonLoader fixture を LLVM EXE ラインでも固定し、JoinIR/Trim の退行検出を強化。
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase97_next_non_ws_llvm_exe.sh`(next_non_ws)
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase97_json_loader_escape_llvm_exe.sh`(escape)
|
|
|
|
|
|
- Phase 記録(入口): `docs/development/current/main/phases/phase-97/README.md`
|
|
|
|
|
|
|
2025-12-17 04:14:26 +09:00
|
|
|
|
## 2025‑12‑17:Phase 98(短報)
|
|
|
|
|
|
|
|
|
|
|
|
- plugin loader に strict fail-fast を導入し(HAKO_JOINIR_STRICT=1)、FileBox/MapBox の LLVM EXE parity を持続可能に。
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase97_next_non_ws_llvm_exe.sh`
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase97_json_loader_escape_llvm_exe.sh`
|
|
|
|
|
|
- Phase 記録(入口): `docs/development/current/main/phases/phase-98/README.md`
|
|
|
|
|
|
|
2025-12-17 16:57:15 +09:00
|
|
|
|
## 2025‑12‑17:Phase 102(短報)
|
|
|
|
|
|
|
|
|
|
|
|
- real-app(MiniJsonLoader.read_quoted_from)の loop を最小抽出し、VM + LLVM EXE で regression を固定(期待: length=4)。
|
|
|
|
|
|
- フィクスチャ: `apps/tests/phase102_realapp_read_quoted_min.hako`
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase102_realapp_read_quoted_vm.sh`
|
|
|
|
|
|
- smoke: `tools/smokes/v2/profiles/integration/apps/phase102_realapp_read_quoted_llvm_exe.sh`
|
|
|
|
|
|
- Phase 記録(入口): `docs/development/current/main/phases/phase-102/README.md`
|
|
|
|
|
|
|
2025-12-14 05:24:31 +09:00
|
|
|
|
## 2025‑12‑14:現状サマリ
|
2025-12-07 01:45:03 +09:00
|
|
|
|
|
2025-12-14 18:27:24 +09:00
|
|
|
|
(補足)docs が増えて迷子になったときの「置き場所ルール(SSOT)」:
|
|
|
|
|
|
|
|
|
|
|
|
- `docs/development/current/main/DOCS_LAYOUT.md`
|
|
|
|
|
|
|
2025-12-07 01:45:03 +09:00
|
|
|
|
### JoinIR / Loop / If ライン
|
|
|
|
|
|
|
|
|
|
|
|
- LoopBuilder は Phase 186‑187 で完全削除済み。**JoinIR が唯一の loop lowering 経路**。
|
|
|
|
|
|
- LoopPattern 系は Pattern1–4 まで実装・本線化済み:
|
|
|
|
|
|
- Pattern1: Simple While
|
|
|
|
|
|
- Pattern2: Loop with Break
|
|
|
|
|
|
- Pattern3: Loop with If‑Else PHI(break/continue なし)
|
|
|
|
|
|
- Pattern4: Loop with Continue(multi‑carrier 対応)
|
|
|
|
|
|
- Exit/Carrier/Boundary ラインは次の箱で SSOT 化:
|
|
|
|
|
|
- `CarrierInfo` / `ExitMeta` / `ExitBindingBuilder`
|
|
|
|
|
|
- `JoinInlineBoundary` + `LoopExitBinding`
|
|
|
|
|
|
- If lowering は IfSelectLowerer/IfMergeLowerer を中心に整理済み。Select/PHI の扱いも Phase 189 系で橋渡し済み。
|
|
|
|
|
|
- 残課題(JoinIR ライン):
|
|
|
|
|
|
- JoinIR→MIR merge の一般化(複雑な Select/PHI パターンの統合)
|
|
|
|
|
|
- JsonParserBox など実アプリ側での長期運用テスト
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- Phase 86–90(Loop frontends)まとめ(1枚):
|
|
|
|
|
|
- `docs/development/current/main/phase86-90-loop-frontends-summary.md`
|
2025-12-13 22:37:56 +09:00
|
|
|
|
|
2025-12-14 05:24:31 +09:00
|
|
|
|
### Phase 86–90: Loop frontends(要約)
|
2025-12-13 22:37:56 +09:00
|
|
|
|
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- Phase 86–90 は “dev-only fixtures + shape guard + fail-fast” で段階的に固定済み。
|
|
|
|
|
|
- 具体の fixture / shape / 未検証は `docs/development/current/main/phase86-90-loop-frontends-summary.md` を SSOT とする。
|
2025-12-14 00:59:58 +09:00
|
|
|
|
|
2025-12-13 17:26:15 +09:00
|
|
|
|
### Scope / BindingId(dev-only の段階移行ライン)
|
|
|
|
|
|
|
|
|
|
|
|
- MIR builder 側で lexical scope / shadowing を実在化し、言語仕様の “local はブロック境界で分離” を SSOT に揃えた。
|
|
|
|
|
|
- JoinIR lowering 側は name-based から BindingId-based へ段階移行中:
|
|
|
|
|
|
- `ScopeManager.lookup_with_binding()` / `ConditionEnv.binding_id_map` を導入し、shadowing を壊さずに解決できる足場を作った。
|
|
|
|
|
|
- promoted carriers(DigitPos/Trim)については `BindingId(original) → BindingId(promoted) → ValueId(join)` の鎖を dev-only で整備中。
|
2025-12-14 00:05:16 +09:00
|
|
|
|
- Phase 86 で `carrier_init_builder` / `error_tags` を SSOT 化し、段階移行ラインの基盤(ValueId 生成とエラー語彙)が確立した。
|
|
|
|
|
|
- これにより、BindingId dual-path の拡張・統合時に「生成」と「表示」の責務が混ざらない構造が固定された。
|
2025-12-13 18:46:07 +09:00
|
|
|
|
- Phase 81 で Pattern2(DigitPos/Trim)の ExitLine 契約(ConditionOnly を exit PHI から除外、LoopState のみを reconnect)を E2E で固定した。
|
2025-12-13 17:26:15 +09:00
|
|
|
|
- 参照:
|
|
|
|
|
|
- `docs/development/current/main/phase73-scope-manager-design.md`
|
|
|
|
|
|
- `docs/development/current/main/phase78-bindingid-promoted-carriers.md`
|
|
|
|
|
|
- `docs/development/current/main/phase80-bindingid-p3p4-plan.md`
|
2025-12-13 18:46:07 +09:00
|
|
|
|
- `docs/development/current/main/phase81-pattern2-exitline-contract.md`
|
docs(joinir): Phase 78-85 Boxification Feedback Report
Comprehensive analysis of boxification patterns effectiveness.
Key Findings:
- Overall: Exceptional success ⭐⭐⭐⭐⭐ (24/25 avg rating)
- Net code reduction: -1,388 lines (Phase 78-79: -530L, Phase 85: -858L)
- 4 new Boxes: PromotedBindingRecorder, Detector/Recorder, BindingMapProvider, DebugOutputBox
- 28 new unit tests, 974/974 PASS maintained
Box Ratings (out of 25):
- PromotedBindingRecorder: 24/25 (67% wiring reduction)
- Detector/Recorder: 24/25 (60% code reduction, SRP)
- BindingMapProvider: 23/25 (80% cfg reduction)
- DebugOutputBox: 21/25 (centralized debug output)
Phase 86 Recommendations:
- GO: Carrier Initialization Builder (HIGH, 2-3h, -100L)
- GO: Remaining DebugOutputBox Migration (QUICK, 30m)
- GO: Error Message Centralization (LOW, 1-2h)
- NO-GO: Detector/Promoter Pipeline (over-abstraction risk)
- NO-GO: ScopeManager Lookup Variants (premature)
Lessons Learned:
- Single Responsibility principle validated
- Testability-first approach successful
- Low migration cost (1-2h per phase)
- Zero production risk (all dev-only/backward-compatible)
Report: phase78-85-boxification-feedback.md (~1,200 lines)
Updated: INDEX, Now, architecture-overview (Phase 85 links)
2025-12-13 21:32:35 +09:00
|
|
|
|
- `docs/development/current/main/phase78-85-boxification-feedback.md`
|
2025-12-13 17:26:15 +09:00
|
|
|
|
|
2025-12-07 01:45:03 +09:00
|
|
|
|
### JsonParser / Selfhost depth‑2 ライン
|
|
|
|
|
|
|
|
|
|
|
|
- `selfhost_build.sh --json` で Program JSON v0 emit は安定。
|
|
|
|
|
|
`.hako` 側から env 経由で JSON を読む最小ループ(`program_read_min.hako`)は動作確認済み。
|
|
|
|
|
|
- JsonParserBox / BundleResolver のループ 21 本のうち:
|
|
|
|
|
|
- 18 本は Pattern1–4 で JoinIR 対応済み(Phase 162–165)。
|
|
|
|
|
|
- `_trim` を含む一部の複合ループは、ValueId 境界や Box 登録など残課題あり。
|
|
|
|
|
|
- BoolExprLowerer / condition_to_joinir で OR/AND/NOT 付き条件式の lowering は実装完了(Phase 168–169)。
|
|
|
|
|
|
- 残課題(JsonParser/selfhost depth‑2):
|
|
|
|
|
|
- JoinIR→MIR ValueId boundary の完全一般化(条件用 ValueId を含める)
|
|
|
|
|
|
- JsonParserBox の using / Box 登録(Rust VM 側での認識)
|
|
|
|
|
|
- Program JSON v0 を JsonParserBox 経由でフル解析する line の仕上げ
|
|
|
|
|
|
|
|
|
|
|
|
### Ring0 / Runtime / CoreServices ライン
|
|
|
|
|
|
|
|
|
|
|
|
- Ring0Context + Ring0Registry で OS API 抽象化レイヤ完成:
|
|
|
|
|
|
- MemApi / IoApi / TimeApi / LogApi / FsApi / ThreadApi
|
|
|
|
|
|
- RuntimeProfile(Default / NoFs) で条件付き必須を制御。
|
|
|
|
|
|
- CoreServices(ring1‑core)として次を実装済み:
|
|
|
|
|
|
- StringService / IntegerService / BoolService
|
|
|
|
|
|
- ArrayService / MapService / ConsoleService
|
|
|
|
|
|
- PluginHost 統合 + UnifiedBoxRegistry からの自動初期化
|
|
|
|
|
|
- FileBox / FileHandleBox ライン:
|
|
|
|
|
|
- Ring0FsFileIo 経由で read / write / append / metadata 完全対応
|
|
|
|
|
|
- Default プロファイルでは必須、NoFs プロファイルでは disabled。
|
|
|
|
|
|
- Logging ライン:
|
|
|
|
|
|
- ConsoleService(user‑facing)
|
|
|
|
|
|
- Ring0.log(internal/dev)
|
|
|
|
|
|
- println!(test 専用)
|
|
|
|
|
|
の 3 層が `logging_policy.md` で整理済み。JoinIR/Loop trace も同ドキュメントに集約。
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- VM backend の Box 解決(UnifiedBoxRegistry / BoxFactoryRegistry)の経路図:
|
|
|
|
|
|
- `docs/development/current/main/phase131-2-box-resolution-map.md`
|
2025-12-14 09:19:00 +09:00
|
|
|
|
- LLVM(Python llvmlite)lowering の棚卸し(Phase 131-3..10):
|
2025-12-14 05:55:21 +09:00
|
|
|
|
- `docs/development/current/main/phase131-3-llvm-lowering-inventory.md`
|
2025-12-15 03:17:31 +09:00
|
|
|
|
- 状態: Case B(Pattern1/loop_min_while)は EMIT/LINK/RUN まで復旧済み。Phase 132 で `return i` の VM/LLVM parity を固定。
|
|
|
|
|
|
- Case C は別途 “Case C docs” を SSOT にして追跡する(状況は更新されるので、この箇所では断定しない)
|
2025-12-14 09:47:23 +09:00
|
|
|
|
- Case C の調査と実装計画:
|
|
|
|
|
|
- `docs/development/current/main/phase131-11-case-c-summary.md`
|
|
|
|
|
|
- `docs/development/current/main/case-c-infinite-loop-analysis.md`
|
2025-12-07 01:45:03 +09:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 2025‑09‑08:旧スナップショット(参考)
|
|
|
|
|
|
|
2025-09-08 11:35:30 +09:00
|
|
|
|
- LLVM 側 P0 完了(BitOps/Array/Echo/Map 緑)。VInvoke(by‑name/by‑id vector) は戻り値マッピングの暫定課題を確認中(Decisions 参照)。
|
|
|
|
|
|
- selfhosting-dev の作業を main に順次取り込み。VM/MIR 基盤は main で先に整える方針。
|
|
|
|
|
|
|
2025-12-07 01:45:03 +09:00
|
|
|
|
直近タスク(当時)
|
2025-09-08 11:35:30 +09:00
|
|
|
|
1) continue/break の lowering(Builder 修正のみで表現)
|
|
|
|
|
|
- ループ文脈スタック {head, exit} を導入。
|
|
|
|
|
|
- continue に遭遇 → head(または latch)へ br を emit し終端。
|
|
|
|
|
|
- break に遭遇 → exit へ br を emit し終端。
|
|
|
|
|
|
- post‑terminated 後に emit しない制御を徹底。
|
|
|
|
|
|
2) ループ CFG の厳密化
|
|
|
|
|
|
- 単一 exit ブロックの徹底。
|
|
|
|
|
|
- Phi はヘッダでキャリー変数を合流(SSA/支配関係が崩れない形)。
|
|
|
|
|
|
3) 検証とスモーク
|
|
|
|
|
|
- Verifier 緑(dominance/SSA)。
|
|
|
|
|
|
- VM のループ代表(単純/ネスト/早期継続・脱出)。
|
|
|
|
|
|
- LLVM/Cranelift EXE に綺麗に降りる(br/phi ベースで問題なし)。
|
|
|
|
|
|
|
|
|
|
|
|
代表コマンド(例)
|
|
|
|
|
|
- ビルド: `cargo build --release`
|
|
|
|
|
|
- LLVM smoke: `LLVM_SYS_180_PREFIX=$(llvm-config-18 --prefix) NYASH_LLVM_BITOPS_SMOKE=1 ./tools/llvm_smoke.sh release`
|
|
|
|
|
|
- VInvoke 調査: `NYASH_LLVM_VINVOKE_TRACE=1 NYASH_LLVM_VINVOKE_SMOKE=1 ./tools/llvm_smoke.sh release`
|