115 lines
6.2 KiB
Markdown
115 lines
6.2 KiB
Markdown
# Current Task
|
||
|
||
このファイルは「いま何に集中しているか」と「次にやり得る候補」だけを書く軽量ビューだよ。
|
||
詳細は `docs/development/current/main/` 以下の各 Phase 文書と、JoinIR の SSOT である
|
||
`docs/development/current/main/joinir-architecture-overview.md` を参照してね。
|
||
|
||
最終更新: 2025-12-16
|
||
|
||
過去ログ(肥大化した旧 CURRENT_TASK)はここに退避したよ:
|
||
- `docs/development/current/main/CURRENT_TASK_ARCHIVE_2025-12-13.md`
|
||
|
||
---
|
||
|
||
## 今の状態(Phase 74–90 まで到達)
|
||
|
||
- 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 まで整備済み。
|
||
- **LLVM exe line SSOT 確立**: `tools/build_llvm.sh` を使用した .hako → executable パイプライン標準化完了。
|
||
- **LLVM AOT(Python llvmlite)ループ復旧**: `apps/tests/loop_min_while.hako` が EMIT/LINK/RUN まで到達(Phase 131-3..10)。
|
||
- 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 を根治。
|
||
- JoinIR/Boundary: exit 値を境界に明示的に渡す
|
||
- LLVM Python: PHI を落とす/上書きする経路を除去(PHI SSOT を保護)
|
||
- JoinIR merge: exit PHI dst の allocator を function-level に統一(ValueId 衝突を排除)
|
||
- debug-only: Exit PHI collision を早期検出する verifier を追加(LLVM 実行時に壊れる前に Fail-Fast)
|
||
- **Phase 133 完了**: Promoted carrier の `join_id` 解決(Trim)を SSOT に寄せて根治(smoke は compile-only)。
|
||
- **Phase 134 完了**: Plugin loader best-effort loading(決定的順序 + failure 集約 + 継続)を導入。
|
||
- **Phase 135 完了**: ConditionLoweringBox allocator SSOT(P0: 根治修正 + P1: contract_checks Fail-Fast 強化)。
|
||
- **Phase 136 完了**: MirBuilder Context SSOT 化(+ ValueId allocator 掃討)。
|
||
- **Phase 137-141 完了**: Loop Canonicalizer(前処理 SSOT)を実装・箱化・型安全化・統合・ドキュメントまで完了(既定挙動は不変)。
|
||
- **Phase 88 完了**: continue + 可変ステップ(i=i+const 差分)を dev-only fixture で固定、StepCalculator Box 抽出。
|
||
- **Phase 89 完了**: P0(ContinueReturn detector)+ P1(lowering 実装)完了。
|
||
- **Phase 90 完了**: ParseStringComposite + `Null` literal + ContinueReturn(同一値の複数 return-if)を dev-only fixture で固定。
|
||
- `cargo test --release --lib` は PASS を維持(993 passed、退行なし)。
|
||
|
||
参照:
|
||
- `docs/development/current/main/10-Now.md`
|
||
- `docs/development/current/main/phase86-90-loop-frontends-summary.md`
|
||
- `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`
|
||
- `docs/development/current/main/phase87-selfhost-llvm-exe-line.md`
|
||
- `docs/development/current/main/phase131-2-box-resolution-map.md`
|
||
- `docs/development/current/main/phase131-3-llvm-lowering-inventory.md`
|
||
- `docs/development/current/main/phase131-5-taglink-fix-summary.md`
|
||
- `docs/development/current/main/phases/phase-132/README.md`
|
||
- `docs/development/current/main/investigations/phase132-llvm-exit-phi-wrong-result.md`
|
||
- `docs/development/current/main/investigations/phase132-case-c-llvm-exe.md`
|
||
|
||
---
|
||
|
||
## 次の指示書(優先順位)
|
||
|
||
### P0: Canonicalizer の適用範囲拡大(実ループ 1 本)
|
||
|
||
**状態**: ✅ Phase 137-141 完了、次は “適用対象を増やす” 段階
|
||
|
||
**目的**: canonicalizer を「実アプリ由来ループ」に 1 本ずつ適用し、認識→decision→strict parity を増やして coverage を広げる(既定挙動は不変、dev-only)。
|
||
|
||
SSOT:
|
||
- `docs/development/current/main/design/loop-canonicalizer.md`
|
||
実装:
|
||
- `src/mir/loop_canonicalizer/mod.rs`
|
||
(SSOT入口)
|
||
- `src/mir/builder/control_flow/joinir/routing.rs`(`choose_pattern_kind`)
|
||
|
||
**次に触るSSOT**:
|
||
- Loop系の設計: `docs/development/current/main/joinir-architecture-overview.md`
|
||
|
||
注意:
|
||
- 既定挙動は変えない(dev-only で観測→段階投入)
|
||
- 新しい環境変数は増やさない(`joinir_dev_enabled()` の範囲で観測する)
|
||
|
||
### P1: JoinIR / Selfhost depth-2 の前進(実装可能 - Phase 91 候補)
|
||
|
||
**状態**: ✅ 実装可能
|
||
|
||
目的:
|
||
- JsonParserBox の残り複合ループを JoinIR 対応する。
|
||
- または selfhost .hako コンパイラの他部分(Lexer/ASTBuilder 等)で JoinIR 適用範囲を拡大する。
|
||
|
||
**次に触るSSOT**:
|
||
- Loop系: `docs/development/current/main/joinir-architecture-overview.md`
|
||
- VM Box系: `docs/development/current/main/phase131-2-box-resolution-map.md`
|
||
|
||
やること(設計→実装の順):
|
||
1. 候補ループの抽出(JsonParserBox or Lexer/ASTBuilder)
|
||
2. Pattern 判定(Pattern 1-4 のいずれか、または新 Pattern 提案)
|
||
3. JoinIR lowering 実装 + E2E テスト
|
||
|
||
受け入れ基準:
|
||
- 代表ケースが 1 コマンドで再現可能(CI は増やさない、quick を重くしない)。
|
||
|
||
### P2: Ownership/Relay runtime 対応の再開(Phase 92 候補)
|
||
|
||
目的:
|
||
- multihop/merge relay を “runtime でも” 受理できるところまで契約を伸ばす(Fail-Fast の段階解除)。
|
||
|
||
受け入れ基準:
|
||
- dev-only 既定OFF のまま、既存ラインを壊さない。
|
||
|
||
### Done: Phase 86–90(Loop frontends)
|
||
|
||
- まとめ(SSOT): `docs/development/current/main/phase86-90-loop-frontends-summary.md`
|
||
- MirBuilder の入口(Context 分割): `src/mir/builder/README.md` + `docs/development/current/main/01-JoinIR-Selfhost-INDEX.md`
|
||
|
||
---
|
||
|
||
## すぐ走らせる確認コマンド
|
||
|
||
- `cargo test --release --lib`
|
||
- `NYASH_JOINIR_NORMALIZED_DEV_RUN=1 cargo test --features normalized_dev --test normalized_joinir_min -- --nocapture`
|