docs: restore docs/private/roadmap from 7b4908f9 (Phase 20.31)

This commit is contained in:
nyash-codex
2025-10-31 18:00:10 +09:00
parent 1d49e24bf0
commit 8fd3a2b509
433 changed files with 108935 additions and 0 deletions

View File

@ -0,0 +1,7 @@
- [x] ny-llvmc harness: JSON→IR→obj/exe path wired for AOT canaries正例3本 PASS
- [x] libhakorune_runtime.a minimalconsole/time/mem/string/array配置検出target/release
- [x] link: AOT build script produces EXEtools/hakorune/aot_build.sh
- [x] canaries: return/binop/if build+runrc/出力整合)
- [x] negative: extern-missingPASS/ div0ハーネス仕様によりビルド失敗許容へ
- [x] docs: AOT pipelineguides/aot-build.md、runtime specspecs/runtime-min-api.md
- [ ] CLI thin delegator任意; dev only; Rust凍結を維持

View File

@ -0,0 +1,28 @@
# Phase20.30 — Claude Handoff Spec (AOT BringUp)
Scope
- Implement a dev AOT pipeline: MIR(JSON v0) → LLVM IR → object → EXE using nyllvmc harness.
- Ship a minimal static runtime lib and a small build script; keep Rust frozen (no new semantics).
Tasks
- Harness
- Add a thin driver to call nyllvmc with JSON input and produce IR/object.
- Numeric returns map to rc; print last numeric line.
- Runtime
- Provide/point to `libhakorune_runtime.a` with console/time/mem/string/array minimal.
- Ensure symbol names are documented and stable.
- Build script
- `tools/hakorune/aot_build.sh`: emit JSON via lang, compile with nyllvmc, link runtime → EXE.
- Env: `HAKO_AOT_RUNTIME_PATH`, `HAKO_AOT_LD_FLAGS` (dev only).
- Canaries
- Build and run `return 7`, `1+2*3`, and simple `if`.
- Negative: div0; missing extern → stable tag.
- Docs
- Usage and constraints; no changes to default behavior.
Nongoals
- Dynamic plugin matrix; performance work; new VM semantics in Rust.
Acceptance
- AOT canaries pass locally via script; PR includes docs and minimal scaffolding only.

View File

@ -0,0 +1,57 @@
# Phase20.30 — Execution Plan (AOT BringUp)
Milestones
1) AOT toolchain path (harnessfirst)
- Choose nyllvmc harness for IR/object emission (no new Rust semantics).
- Contract: JSON v0 in, single main function out; numeric return maps to rc.
2) Runtime static lib (minimal)
- Provide `libhakorune_runtime.a` (C) with: console.{log|warn|error}, time.now_ms, mem.{alloc|free|name}, String helpers, Array minimal (size/get/set/pop), Map stub or pluginonly guard.
- Document headers and ABI entrypoints; keep symbols stable.
3) Link step + wrapper
- Script `tools/hakorune/aot_build.sh` (dev) to: emit JSON → nyllvmc → link runtime → produce EXE.
- Env toggles: HAKO_AOT_RUNTIME_PATH, HAKO_AOT_LD_FLAGS (dev only).
4) Canaries
- AOT return/binop/if build+run; rc parityreturn/binop=7, if=1
- Negative: extern-missingビルド失敗 or 実行非0 を PASS とする), div by zeroビルド失敗 or 実行非0 を PASS とする)
5) Docs + CLI glue (optional)
- Document AOT workflow and constraints; add `--aot` thin CLI delegator that shells out to script (dev only) without adding Rust semantics.
Success criteria
- Endtoend: hakorunefrozen builds hakorunenew (hello AOT) and tiny programs run.
- Rust freeze honored (no new runtime semantics implemented in Rust).
---
# RustFreeze + Hako Engine BringUp (P0/P1)
Objective
- 減速無しで「脱Rust」を段階導入。既存のRust実行層は凍結し、Hakorune側エンジンCore/VMを優先経路として増強する。
Scope今回
- P02週間: エンジン選択トグルと GateC の既定化(ドキュメント)
- Runner に `--engine {rust|hakorune}` / `HAKO_VM_ENGINE=hakorune` を追加既定OFF
- quick/integration-core の optin カナリアで Hako エンジンを観測FailFast 厳守)。
- GateC(JSON→Core) を quick で第一候補として“明文化”。README/Smokes に記載。
- P13〜4週間: JSON 処理の Hako 側への薄移管
- 既存の `lang/src/vm/core/json_v0_reader.hako` を GateB/C 境界で共通 reader として再利用。
- 最小 emitterconst/ret/binopを Hako 側に追加し、Rust emit と optin で並行運用。
- SSOT生成は現行 `tools/hakorune/gen_ssot.sh` を継続失敗時は現行fallback
- P1'(並行 1週間: I/O Bridge の最小CABI
- print/read_all など最小APIのみconsole/time/fsはゲートで制御
- Gate: `HAKO_KNI_{TIME|FS}=1` が無い場合は FailFast。
Acceptance
- quick/integration-core が両エンジンrust/hakoruneで optin 緑。
- GateC 直行の file/pipe × plugins ON/OFF が対称(既存カナリアで担保)。
- AOT 代表return/binop/ifを自走で生成・実行可能既存 canary で担保)。
Notes
- plugin 依存ケースは preflightトグルSMOKES_ENABLE_PLUGINS_CANARY=1で厳密にゲートする。
- 実行意味論の追加は Hako 側のみ。Rust は「橋・ローダ・FailFast」以外は凍結し、差分最小を維持する。

View File

@ -0,0 +1,24 @@
# Phase20.30 — SelfContained AOT Build (Gostyle bootstrap)
Purpose
- Produce a selfcontained Hakorune binary via LLVM AOT so “Hakorune builds Hakorune” becomes practical (Gostyle).
Inscope
- MIR(JSON v0) → LLVM IR → object → EXE (AOT path, harness first).
- Minimal runtime static lib packaging for AOT (string/array/map day1, console, time, mem).
- Dev wrapper/script to drive endtoend: lang emit → AOT → run.
Outofscope
- Full stdlib, dynamic plugin matrix, performance tuning beyond correctness.
Deliverables
- hakorunefrozen (last Rustbuilt) produces hakorunenew via AOT.
- Tiny program AOT canary (return/binop/if) builds and runs (rc/last line parity).
- Docs: AOT pipeline, runtime lib spec, env toggles, known limits.
Refs
- guides/aot-build.md
Risks/Notes
- Runtime surface must be minimal and stable; Map remains pluginonly unless a tiny host path is added for AOT.
- Prefer harness (nyllvmc) for IR/object flow to avoid widening Rust scope (freeze honored).