2025-12-11 00:21:29 +09:00
|
|
|
|
# JoinIR / Selfhost INDEX(読み始めガイド)
|
|
|
|
|
|
|
|
|
|
|
|
Status: Active
|
|
|
|
|
|
Scope: JoinIR と Selfhost(Stage‑B/Stage‑1/Stage‑3)に関する「最初に読むべき現役ドキュメント」だけを集約した入口。
|
|
|
|
|
|
|
|
|
|
|
|
このファイルは、JoinIR と Selfhost ラインの主戦場をすばやく把握するためのインデックスだよ。
|
|
|
|
|
|
歴史メモや詳細な Phase 文書に飛ぶ前に、まずここに載っている現役ドキュメントから辿っていくことを想定しているよ。
|
|
|
|
|
|
|
2025-12-14 18:27:24 +09:00
|
|
|
|
docs の置き場所(SSOT/Phase/調査ログの分離ルール)は、先にこれを読むと迷子になりにくいよ。
|
|
|
|
|
|
|
|
|
|
|
|
- `docs/development/current/main/DOCS_LAYOUT.md`
|
|
|
|
|
|
|
2025-12-11 00:21:29 +09:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 1. まず全体像だけ掴みたいとき
|
|
|
|
|
|
|
|
|
|
|
|
- JoinIR 全体像(SSOT)
|
|
|
|
|
|
- `docs/development/current/main/joinir-architecture-overview.md`
|
|
|
|
|
|
- Selfhost / Stage‑B〜3 の代表フロー
|
|
|
|
|
|
- `docs/development/current/main/selfhost_stage3_expected_flow.md`
|
|
|
|
|
|
- 「いまどこまで進んでいるか」の現状サマリ
|
|
|
|
|
|
- `docs/development/current/main/10-Now.md`
|
|
|
|
|
|
- 「JoinIR / Loop / If ライン」
|
|
|
|
|
|
- 「JsonParser / Selfhost depth‑2 ライン」
|
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-11 00:21:29 +09:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 2. JoinIR をこれから触る人向け
|
|
|
|
|
|
|
|
|
|
|
|
JoinIR の箱構造と責務、ループ/if の lowering パターンを把握したいときの読み順だよ。
|
|
|
|
|
|
|
|
|
|
|
|
1. JoinIR の基本設計(SSOT)
|
|
|
|
|
|
- `docs/development/current/main/joinir-architecture-overview.md`
|
|
|
|
|
|
2. ループパターン空間とパターン番号の意味
|
|
|
|
|
|
- `docs/development/current/main/loop_pattern_space.md`
|
|
|
|
|
|
3. Boundary / ExitLine / Carrier の具体パターン
|
|
|
|
|
|
- `docs/development/current/main/joinir-boundary-builder-pattern.md`
|
2025-12-14 18:55:05 +09:00
|
|
|
|
4. JoinIR 設計地図(現役の地図)
|
|
|
|
|
|
- `docs/development/current/main/design/joinir-design-map.md`
|
2025-12-16 04:37:47 +09:00
|
|
|
|
5. Loop Canonicalizer(設計 SSOT)
|
|
|
|
|
|
- `docs/development/current/main/design/loop-canonicalizer.md`
|
2025-12-16 05:38:18 +09:00
|
|
|
|
- 実装(Phase 137-2): `src/mir/loop_canonicalizer/mod.rs`
|
2025-12-16 23:30:39 +09:00
|
|
|
|
6. Phase 93: ConditionOnly Derived Slot(Trim / body-local)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-93/README.md`
|
2025-12-17 00:59:33 +09:00
|
|
|
|
7. Phase 94: P5b “完全E2E”(escape skip / derived)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-94/README.md`
|
2025-12-17 01:01:16 +09:00
|
|
|
|
8. Phase 95: MiniJsonLoader escape ループ(Phase 94 基盤の横展開)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-95/README.md`
|
2025-12-17 01:25:06 +09:00
|
|
|
|
9. Phase 96: Trim policy 着手 + next_non_ws ループ
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-96/README.md`
|
2025-12-17 02:26:42 +09:00
|
|
|
|
10. Phase 97: MiniJsonLoader LLVM EXE parity(next_non_ws / escape)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-97/README.md`
|
2025-12-17 04:14:26 +09:00
|
|
|
|
11. Phase 98: Plugin loader fail-fast + LLVM parity持続化
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-98/README.md`
|
2025-12-17 05:03:07 +09:00
|
|
|
|
12. Phase 100: Pinned Read‑Only Captures(設計メモ)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-100/README.md`
|
2025-12-17 16:57:15 +09:00
|
|
|
|
13. Phase 102: real-app read_quoted loop regression(VM + LLVM EXE)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-102/README.md`
|
2025-12-17 17:39:12 +09:00
|
|
|
|
14. Phase 103: if-only regression baseline(VM + LLVM EXE / plan)
|
|
|
|
|
|
- `docs/development/current/main/phases/phase-103/README.md`
|
2025-12-16 04:37:47 +09:00
|
|
|
|
6. MIR Builder(Context 分割の入口)
|
|
|
|
|
|
- `src/mir/builder/README.md`
|
|
|
|
|
|
7. Scope/BindingId(shadowing・束縛同一性の段階移行)
|
2025-12-13 17:26:15 +09:00
|
|
|
|
- `docs/development/current/main/phase73-scope-manager-design.md`
|
|
|
|
|
|
- `docs/development/current/main/PHASE_74_SUMMARY.md`
|
|
|
|
|
|
- `docs/development/current/main/PHASE_75_SUMMARY.md`
|
|
|
|
|
|
- `docs/development/current/main/PHASE_77_EXECUTIVE_SUMMARY.md`
|
|
|
|
|
|
- `docs/development/current/main/phase78-bindingid-promoted-carriers.md`
|
|
|
|
|
|
- `docs/development/current/main/phase80-bindingid-p3p4-plan.md`(P3/P4 への配線計画)
|
2025-12-13 18:46:07 +09:00
|
|
|
|
- `docs/development/current/main/phase81-pattern2-exitline-contract.md`(promoted carriers の ExitLine 契約検証)
|
2025-12-16 04:37:47 +09:00
|
|
|
|
8. Boxification feedback(Phase 78–85 の振り返りと Phase 86 推奨)
|
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-16 04:37:47 +09:00
|
|
|
|
9. Phase 86: Carrier Init Builder + Error Tags ✅
|
2025-12-13 22:37:56 +09:00
|
|
|
|
- **Status**: COMPLETE (2025-12-13)
|
|
|
|
|
|
- **Modules**:
|
|
|
|
|
|
- `src/mir/builder/control_flow/joinir/merge/carrier_init_builder.rs` (+8 tests)
|
|
|
|
|
|
- `src/mir/join_ir/lowering/error_tags.rs` (+5 tests)
|
|
|
|
|
|
- **Achievements**: SSOT 確立(CarrierInit → ValueId 生成統一、エラータグ中央化、DebugOutputBox 完全移行)
|
|
|
|
|
|
- **Impact**: 987/987 tests PASS, +13 unit tests, Single Responsibility validated
|
2025-12-16 04:37:47 +09:00
|
|
|
|
10. Phase 87: LLVM Exe Line SSOT ✅
|
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
|
|
|
|
- **Status**: COMPLETE (2025-12-13)
|
|
|
|
|
|
- **SSOT**: `tools/build_llvm.sh` - Single pipeline for .hako → executable
|
|
|
|
|
|
- **Deliverables**:
|
|
|
|
|
|
- Design doc: `phase87-selfhost-llvm-exe-line.md` (full troubleshooting + advanced usage)
|
|
|
|
|
|
- Minimal fixture: `apps/tests/phase87_llvm_exe_min.hako` (exit code 42)
|
|
|
|
|
|
- Integration smoke: `tools/smokes/v2/profiles/integration/apps/phase87_llvm_exe_min.sh` (SKIP if no LLVM)
|
|
|
|
|
|
- **Policy**: No script duplication, integration smoke only (not quick), graceful SKIP
|
|
|
|
|
|
- **Impact**: Standard procedure established, prerequisites documented
|
2025-12-16 04:37:47 +09:00
|
|
|
|
11. 代表的な Phase 文書(現役ラインとの接点だけ絞ったもの)
|
2025-12-11 00:21:29 +09:00
|
|
|
|
- `docs/development/current/main/phase33-16-INDEX.md`
|
|
|
|
|
|
- `docs/development/current/main/phase33-17-joinir-modularization-analysis.md`
|
|
|
|
|
|
- `docs/development/current/main/phase183-selfhost-depth2-joinir-status.md`
|
2025-12-16 04:37:47 +09:00
|
|
|
|
12. Phase 86–90(Loop frontends)の要約(1枚)
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- `docs/development/current/main/phase86-90-loop-frontends-summary.md`
|
2025-12-11 00:21:29 +09:00
|
|
|
|
|
|
|
|
|
|
Phase 文書は歴史や検証ログも含むので、「JoinIR の現役設計を確認した上で、必要なときだけ掘る」という前提で読んでね。
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 3. Selfhost(Stage‑B / Stage‑1 / Stage‑3)を触る人向け
|
|
|
|
|
|
|
|
|
|
|
|
自己ホストコンパイラのフローや実行手順、Ny Executor ラインの計画を押さえたいときの読み順だよ。
|
|
|
|
|
|
|
|
|
|
|
|
1. Selfhost 全体フロー(Stage‑B / Stage‑1 / Stage‑3 と JSON v0)
|
|
|
|
|
|
- `docs/development/current/main/selfhost_stage3_expected_flow.md`
|
|
|
|
|
|
2. 実行手順・クイックスタート
|
|
|
|
|
|
- `docs/development/selfhosting/quickstart.md`
|
|
|
|
|
|
- `docs/development/testing/selfhost_exe_stageb_quick_guide.md`
|
|
|
|
|
|
3. Ny Executor(Ny で MIR(JSON v0) を実行)のロードマップ
|
|
|
|
|
|
- `docs/development/roadmap/selfhosting-ny-executor.md`
|
|
|
|
|
|
4. Stage‑3 / depth‑2 関連で「現役」として参照する Phase 文書
|
|
|
|
|
|
- `docs/development/current/main/phase150_selfhost_stage3_depth1_baseline.md`
|
|
|
|
|
|
- `docs/development/current/main/phase150_selfhost_stage3_depth1_results.md`
|
|
|
|
|
|
- `docs/development/current/main/phase183-selfhost-depth2-joinir-status.md`
|
|
|
|
|
|
- `docs/development/current/main/phase120_selfhost_stable_paths.md`
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 4. 迷ったときの読み分けガイド
|
|
|
|
|
|
|
|
|
|
|
|
- JoinIR の箱や契約で迷っているとき
|
|
|
|
|
|
- → 2章の 1〜3 をこの順番で読む。
|
|
|
|
|
|
- Selfhost のビルド / 実行フローで迷っているとき
|
|
|
|
|
|
- → 3章の 1〜3 をこの順番で読む。
|
2025-12-14 05:24:31 +09:00
|
|
|
|
- VM backend の Box 解決(ConsoleBox / plugin / builtin)で迷っているとき
|
|
|
|
|
|
- → `docs/development/current/main/phase131-2-box-resolution-map.md`(経路図)
|
|
|
|
|
|
- → `docs/development/current/main/phase131-2-summary.md`(要点)
|
2025-12-14 05:55:21 +09:00
|
|
|
|
- LLVM(Python llvmlite)lowering の不具合切り分けで迷っているとき
|
|
|
|
|
|
- → `docs/development/current/main/phase131-3-llvm-lowering-inventory.md`(再現ケース表 + 根本原因候補)
|
2025-12-14 09:47:23 +09:00
|
|
|
|
- → `docs/development/current/main/phase131-11-case-c-summary.md`(Case C: `loop(true)` + break/continue の本命計画)
|
|
|
|
|
|
- → `docs/development/current/main/case-c-infinite-loop-analysis.md`(Case C: 詳細調査ログ)
|
2025-12-14 09:19:00 +09:00
|
|
|
|
- → `docs/development/current/main/phase131-5-taglink-fix-summary.md`(TAG-LINK: symbol 名の修正ログ)
|
|
|
|
|
|
- → `docs/development/current/main/phase131-6-ssa-dominance-diagnosis.md`(TAG-RUN の初期診断ログ・歴史)
|
2025-12-14 05:55:21 +09:00
|
|
|
|
- → `docs/development/current/main/phase87-selfhost-llvm-exe-line.md`(実行パイプラインのSSOT)
|
2025-12-11 00:21:29 +09:00
|
|
|
|
- 「この Phase 文書は現役か?」で迷ったとき
|
|
|
|
|
|
- → まず `docs/development/current/main/10-Now.md` と
|
|
|
|
|
|
`docs/development/current/main/30-Backlog.md` を確認し、そこで名前が挙がっている Phase 文書を優先して読んでね。
|