2025-12-04 14:19:48 +09:00
|
|
|
|
# Current Task
|
|
|
|
|
|
|
2025-12-10 01:40:18 +09:00
|
|
|
|
このファイルは「いま何に集中しているか」と「次にやり得る候補」だけを書く軽量ビューだよ。
|
2025-12-13 22:21:04 +09:00
|
|
|
|
詳細は `docs/development/current/main/` 以下の各 Phase 文書と、JoinIR の SSOT である
|
|
|
|
|
|
`docs/development/current/main/joinir-architecture-overview.md` を参照してね。
|
2025-12-04 10:52:10 +09:00
|
|
|
|
|
2025-12-16 07:54:33 +09:00
|
|
|
|
最終更新: 2025-12-16
|
2025-12-11 13:13:08 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
過去ログ(肥大化した旧 CURRENT_TASK)はここに退避したよ:
|
|
|
|
|
|
- `docs/development/current/main/CURRENT_TASK_ARCHIVE_2025-12-13.md`
|
2025-12-04 12:06:34 +09:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
2025-12-14 05:24:31 +09:00
|
|
|
|
## 今の状態(Phase 74–90 まで到達)
|
2025-12-10 01:40:18 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
- Scope/BindingId の段階移行(dev-only)は Pattern2/3/4 まで配線済み(dual-path 維持)。
|
|
|
|
|
|
- Pattern2 の promoted carriers(DigitPos/Trim)について ExitLine 契約(ConditionOnly を exit PHI から除外)を E2E で固定済み。
|
|
|
|
|
|
- debug flag SSOT / DebugOutputBox 移行 / error tags 集約 / carrier init builder まで整備済み。
|
feat(llvm): Phase 87 - LLVM exe line SSOT + integration smoke
Established single pipeline for .hako → executable generation.
SSOT: tools/build_llvm.sh
- Standard procedure: build_llvm.sh input.hako -o output_exe
- Prerequisites: llvm-config-18, llvmlite, LLVM features enabled
- Pipeline: .hako → MIR → LLVM IR → .o → executable
New files:
- docs: phase87-selfhost-llvm-exe-line.md (SSOT procedure doc)
* Full troubleshooting guide (llvm-config, llvmlite, linking)
* Advanced usage (custom output, debugging, performance notes)
* Anti-patterns documentation (no duplication/fragmentation)
- fixture: apps/tests/phase87_llvm_exe_min.hako (5 lines, return 42)
- smoke: integration/apps/phase87_llvm_exe_min.sh
* Exit code verification (stdout-independent testing)
* SKIP if LLVM unavailable (graceful degradation)
* Integration profile only (not in quick)
- index: 10-Now.md, 01-JoinIR-Selfhost-INDEX.md (Phase 87 entries)
- task: CURRENT_TASK.md (Phase 74-87 status update)
Integration smoke: demonstrates full pipeline
- Build: .hako → .o → exe (successful ✅)
- Runtime: Ring0 initialization issue (known limitation, out of scope)
Quick profile: unchanged (integration only, per policy)
Policy: No duplicate build paths, SSOT maintained
987/987 tests PASS (production stable)
2025-12-13 22:51:13 +09:00
|
|
|
|
- **LLVM exe line SSOT 確立**: `tools/build_llvm.sh` を使用した .hako → executable パイプライン標準化完了。
|
2025-12-14 09:19:00 +09:00
|
|
|
|
- **LLVM AOT(Python llvmlite)ループ復旧**: `apps/tests/loop_min_while.hako` が EMIT/LINK/RUN まで到達(Phase 131-3..10)。
|
2025-12-15 06:00:48 +09:00
|
|
|
|
- Case C(`loop(true)` + break/continue)は Phase 131-11 で Pattern/shape guard を整備し、Phase 132-P2 で LLVM EXE まで parity(`Result: 3`)を確認。
|
|
|
|
|
|
- **Phase 132 完了**: ループ exit 値(exit PHI / boundary)の VM/LLVM parity を根治。
|
2025-12-15 03:17:31 +09:00
|
|
|
|
- JoinIR/Boundary: exit 値を境界に明示的に渡す
|
|
|
|
|
|
- LLVM Python: PHI を落とす/上書きする経路を除去(PHI SSOT を保護)
|
2025-12-15 06:00:48 +09:00
|
|
|
|
- JoinIR merge: exit PHI dst の allocator を function-level に統一(ValueId 衝突を排除)
|
2025-12-15 06:08:19 +09:00
|
|
|
|
- debug-only: Exit PHI collision を早期検出する verifier を追加(LLVM 実行時に壊れる前に Fail-Fast)
|
2025-12-15 18:49:08 +09:00
|
|
|
|
- **Phase 133 完了**: Promoted carrier の `join_id` 解決(Trim)を SSOT に寄せて根治(smoke は compile-only)。
|
|
|
|
|
|
- **Phase 134 完了**: Plugin loader best-effort loading(決定的順序 + failure 集約 + 継続)を導入。
|
2025-12-15 19:37:30 +09:00
|
|
|
|
- **Phase 135 完了**: ConditionLoweringBox allocator SSOT(P0: 根治修正 + P1: contract_checks Fail-Fast 強化)。
|
2025-12-16 04:37:47 +09:00
|
|
|
|
- **Phase 136 完了**: MirBuilder Context SSOT 化(+ ValueId allocator 掃討)。
|
2025-12-16 07:54:33 +09:00
|
|
|
|
- **Phase 137-141 完了**: Loop Canonicalizer(前処理 SSOT)を実装・箱化・型安全化・統合・ドキュメントまで完了(既定挙動は不変)。
|
2025-12-16 17:08:15 +09:00
|
|
|
|
- **Phase 91 完了**: P5b escape(recognition + parity)まで完了。
|
|
|
|
|
|
- **Phase 92 進行中**: P5b escape の lowering(ConditionalStep emitter 箱化まで完了)。
|
2025-12-14 02:31:39 +09:00
|
|
|
|
- **Phase 88 完了**: continue + 可変ステップ(i=i+const 差分)を dev-only fixture で固定、StepCalculator Box 抽出。
|
|
|
|
|
|
- **Phase 89 完了**: P0(ContinueReturn detector)+ P1(lowering 実装)完了。
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- **Phase 90 完了**: ParseStringComposite + `Null` literal + ContinueReturn(同一値の複数 return-if)を dev-only fixture で固定。
|
2025-12-14 02:31:39 +09:00
|
|
|
|
- `cargo test --release --lib` は PASS を維持(993 passed、退行なし)。
|
2025-12-04 12:06:34 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
参照:
|
|
|
|
|
|
- `docs/development/current/main/10-Now.md`
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- `docs/development/current/main/phase86-90-loop-frontends-summary.md`
|
2025-12-13 22:21:04 +09:00
|
|
|
|
- `docs/development/current/main/phase73-scope-manager-design.md`
|
|
|
|
|
|
- `docs/development/current/main/phase80-bindingid-p3p4-plan.md`
|
|
|
|
|
|
- `docs/development/current/main/phase81-pattern2-exitline-contract.md`
|
|
|
|
|
|
- `docs/development/current/main/phase78-85-boxification-feedback.md`
|
feat(llvm): Phase 87 - LLVM exe line SSOT + integration smoke
Established single pipeline for .hako → executable generation.
SSOT: tools/build_llvm.sh
- Standard procedure: build_llvm.sh input.hako -o output_exe
- Prerequisites: llvm-config-18, llvmlite, LLVM features enabled
- Pipeline: .hako → MIR → LLVM IR → .o → executable
New files:
- docs: phase87-selfhost-llvm-exe-line.md (SSOT procedure doc)
* Full troubleshooting guide (llvm-config, llvmlite, linking)
* Advanced usage (custom output, debugging, performance notes)
* Anti-patterns documentation (no duplication/fragmentation)
- fixture: apps/tests/phase87_llvm_exe_min.hako (5 lines, return 42)
- smoke: integration/apps/phase87_llvm_exe_min.sh
* Exit code verification (stdout-independent testing)
* SKIP if LLVM unavailable (graceful degradation)
* Integration profile only (not in quick)
- index: 10-Now.md, 01-JoinIR-Selfhost-INDEX.md (Phase 87 entries)
- task: CURRENT_TASK.md (Phase 74-87 status update)
Integration smoke: demonstrates full pipeline
- Build: .hako → .o → exe (successful ✅)
- Runtime: Ring0 initialization issue (known limitation, out of scope)
Quick profile: unchanged (integration only, per policy)
Policy: No duplicate build paths, SSOT maintained
987/987 tests PASS (production stable)
2025-12-13 22:51:13 +09:00
|
|
|
|
- `docs/development/current/main/phase87-selfhost-llvm-exe-line.md`
|
2025-12-14 05:55:21 +09:00
|
|
|
|
- `docs/development/current/main/phase131-2-box-resolution-map.md`
|
|
|
|
|
|
- `docs/development/current/main/phase131-3-llvm-lowering-inventory.md`
|
2025-12-14 09:19:00 +09:00
|
|
|
|
- `docs/development/current/main/phase131-5-taglink-fix-summary.md`
|
2025-12-15 03:17:31 +09:00
|
|
|
|
- `docs/development/current/main/phases/phase-132/README.md`
|
|
|
|
|
|
- `docs/development/current/main/investigations/phase132-llvm-exit-phi-wrong-result.md`
|
2025-12-15 06:00:48 +09:00
|
|
|
|
- `docs/development/current/main/investigations/phase132-case-c-llvm-exe.md`
|
2025-12-12 04:19:06 +09:00
|
|
|
|
|
2025-12-04 12:06:34 +09:00
|
|
|
|
---
|
2025-12-05 16:00:31 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
## 次の指示書(優先順位)
|
2025-12-05 16:00:31 +09:00
|
|
|
|
|
2025-12-16 17:08:15 +09:00
|
|
|
|
### P0: Phase 92 P2(P5b E2E を 1 本通す)
|
2025-12-14 05:24:31 +09:00
|
|
|
|
|
2025-12-16 17:08:15 +09:00
|
|
|
|
**状態**: ✅ P1 完了、P2 へ
|
2025-12-14 05:27:39 +09:00
|
|
|
|
|
2025-12-16 17:08:15 +09:00
|
|
|
|
**目的**: `ConditionalStep` を Pattern2 lowering で実際に使い、`test_pattern5b_escape_minimal.hako` を E2E(まずは VM)で通す。
|
2025-12-14 05:27:39 +09:00
|
|
|
|
|
2025-12-16 04:37:47 +09:00
|
|
|
|
SSOT:
|
|
|
|
|
|
- `docs/development/current/main/design/loop-canonicalizer.md`
|
2025-12-16 05:38:18 +09:00
|
|
|
|
実装:
|
2025-12-16 05:10:29 +09:00
|
|
|
|
- `src/mir/loop_canonicalizer/mod.rs`
|
2025-12-16 07:54:33 +09:00
|
|
|
|
(SSOT入口)
|
|
|
|
|
|
- `src/mir/builder/control_flow/joinir/routing.rs`(`choose_pattern_kind`)
|
2025-12-16 17:08:15 +09:00
|
|
|
|
Phase 記録:
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-92/README.md`
|
2025-12-16 04:37:47 +09:00
|
|
|
|
|
|
|
|
|
|
**次に触るSSOT**:
|
2025-12-14 05:27:39 +09:00
|
|
|
|
- Loop系の設計: `docs/development/current/main/joinir-architecture-overview.md`
|
2025-12-14 05:24:31 +09:00
|
|
|
|
|
|
|
|
|
|
注意:
|
2025-12-16 05:10:29 +09:00
|
|
|
|
- 既定挙動は変えない(dev-only で観測→段階投入)
|
|
|
|
|
|
- 新しい環境変数は増やさない(`joinir_dev_enabled()` の範囲で観測する)
|
2025-12-14 05:24:31 +09:00
|
|
|
|
|
2025-12-16 14:22:55 +09:00
|
|
|
|
### P1: JoinIR / Selfhost depth-2 の前進(Phase 91 - 設計完了)
|
2025-12-14 05:27:39 +09:00
|
|
|
|
|
2025-12-16 14:22:55 +09:00
|
|
|
|
**状態**: ✅ **Phase 91 計画完了** → 次は実装フェーズ
|
2025-12-13 06:14:00 +09:00
|
|
|
|
|
2025-12-16 14:22:55 +09:00
|
|
|
|
**目的**: Selfhost コンパイラの未対応ループを JoinIR 対象に拡大
|
|
|
|
|
|
|
|
|
|
|
|
**成果(Phase 91 Step 1)**:
|
|
|
|
|
|
- ✅ ループ在庫分析: 34ループ across 6ファイル(47% JoinIR対応)
|
|
|
|
|
|
- ✅ Pattern P5b (Escape Handling) デザイン完成
|
|
|
|
|
|
- ✅ テストフィクスチャ作成 (`test_pattern5b_escape_minimal.hako`)
|
|
|
|
|
|
- ✅ Capability 拡張(P5b専用タグ)
|
|
|
|
|
|
|
|
|
|
|
|
**優先順位**:
|
|
|
|
|
|
1. **P5b (Escape Handling)** - `json_loader.hako:30` (8行)
|
|
|
|
|
|
- Effort: 2-3日
|
|
|
|
|
|
- Impact: JSON/CSV パーサー全般を JoinIR 対応可能に
|
|
|
|
|
|
- Status: 設計完了、実装待ち
|
|
|
|
|
|
|
|
|
|
|
|
2. **P5 (Guard-Bounded)** - `mini_vm_core.hako:541` (204行)
|
|
|
|
|
|
- Effort: 1-2週
|
|
|
|
|
|
- Impact: 大規模ループ最適化(guard counter除去)
|
|
|
|
|
|
- Status: 分析完了、設計待ち
|
|
|
|
|
|
|
|
|
|
|
|
3. **P6 (Nested Loops)** - `seam_inspector.hako:76` (7+ levels)
|
|
|
|
|
|
- Effort: 2-3週
|
|
|
|
|
|
- Impact: 深い入れ子対応(将来)
|
|
|
|
|
|
- Status: 候補識別完了
|
2025-12-13 06:14:00 +09:00
|
|
|
|
|
2025-12-14 05:27:39 +09:00
|
|
|
|
**次に触るSSOT**:
|
2025-12-16 14:22:55 +09:00
|
|
|
|
- Phase 91 詳細計画: `docs/development/current/main/phases/phase-91/README.md`
|
|
|
|
|
|
- P5b デザイン: `docs/development/current/main/design/pattern-p5b-escape-design.md`
|
|
|
|
|
|
- Loop Canonicalizer: `docs/development/current/main/design/loop-canonicalizer.md`
|
2025-12-14 05:27:39 +09:00
|
|
|
|
|
2025-12-16 14:22:55 +09:00
|
|
|
|
**Phase 91 Step 2 (次)**: Canonicalizer 実装
|
|
|
|
|
|
1. `detect_escape_pattern()` 関数追加
|
|
|
|
|
|
2. Unit tests (P5b 認識)
|
|
|
|
|
|
3. Parity verification (strict mode)
|
|
|
|
|
|
4. Documentation 更新
|
2025-12-13 03:48:25 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
受け入れ基準:
|
2025-12-16 14:22:55 +09:00
|
|
|
|
- ✅ P5b パターン認識で `decision.chosen == Pattern5bEscape`
|
|
|
|
|
|
- ✅ `missing_caps == []`(すべての capability 充足)
|
|
|
|
|
|
- ✅ `HAKO_JOINIR_STRICT=1` で parity green
|
|
|
|
|
|
- ✅ 既存テスト退行なし
|
2025-12-13 16:20:33 +09:00
|
|
|
|
|
2025-12-16 04:37:47 +09:00
|
|
|
|
### P2: Ownership/Relay runtime 対応の再開(Phase 92 候補)
|
2025-12-13 16:20:33 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
目的:
|
|
|
|
|
|
- multihop/merge relay を “runtime でも” 受理できるところまで契約を伸ばす(Fail-Fast の段階解除)。
|
2025-12-13 03:48:25 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
受け入れ基準:
|
|
|
|
|
|
- dev-only 既定OFF のまま、既存ラインを壊さない。
|
2025-12-05 16:00:31 +09:00
|
|
|
|
|
2025-12-14 05:24:31 +09:00
|
|
|
|
### Done: Phase 86–90(Loop frontends)
|
2025-12-14 00:05:16 +09:00
|
|
|
|
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- まとめ(SSOT): `docs/development/current/main/phase86-90-loop-frontends-summary.md`
|
2025-12-16 04:37:47 +09:00
|
|
|
|
- MirBuilder の入口(Context 分割): `src/mir/builder/README.md` + `docs/development/current/main/01-JoinIR-Selfhost-INDEX.md`
|
2025-12-14 00:05:16 +09:00
|
|
|
|
|
2025-12-05 16:00:31 +09:00
|
|
|
|
---
|
2025-12-07 21:43:08 +09:00
|
|
|
|
|
2025-12-13 22:21:04 +09:00
|
|
|
|
## すぐ走らせる確認コマンド
|
|
|
|
|
|
|
|
|
|
|
|
- `cargo test --release --lib`
|
|
|
|
|
|
- `NYASH_JOINIR_NORMALIZED_DEV_RUN=1 cargo test --features normalized_dev --test normalized_joinir_min -- --nocapture`
|