runner: add NyVM wrapper core_bridge (canonicalize/dump) + opt-in wrapper canary; export module in common_util
This commit is contained in:
9
docs/private/roadmap/phases/phase-20.33/CHECKLIST.md
Normal file
9
docs/private/roadmap/phases/phase-20.33/CHECKLIST.md
Normal file
@ -0,0 +1,9 @@
|
||||
# CHECKLIST — Phase 20.33 (Stage‑B)
|
||||
|
||||
- [x] Stage‑B 専用エントリ(`lang/src/compiler/entry/compiler_stageb.hako`)を追加。`--prefer-cfg` を受理。
|
||||
- [x] `ParserBox.parse_program2` → AST JSON を取得(Quiet: 1行)。Stage‑A map parser は空/空白/エスケープに対応。
|
||||
- [x] pipeline_v2 FlowEntry.emit_v0_from_ast で v0 を出力(prefer_cfg=1 既定)。
|
||||
- [x] selfhost canary(return/binop/if/index)を Stage‑B でも PASS(opt‑in `SMOKES_ENABLE_STAGEB=1` で緑)。
|
||||
- [ ] v1→v0 降格(MirJsonV1Adapter)経路を整備(必要箇所のみ)。
|
||||
- [x] tools/smokes/v2/profiles/quick/core/selfhost_* を追加(opt‑in)。配列ネスト/境界ケースを含む。
|
||||
- [x] ドキュメント更新(README/PLAN/CHECKLIST)。
|
||||
33
docs/private/roadmap/phases/phase-20.33/PLAN.md
Normal file
33
docs/private/roadmap/phases/phase-20.33/PLAN.md
Normal file
@ -0,0 +1,33 @@
|
||||
# PLAN — Phase 20.33 (Hakorune コンパイラ Stage‑B)
|
||||
|
||||
## ゴール(概要)
|
||||
- Hako 製コンパイラを Stage‑B に引き上げ、Ny → JSON v0 を実用レベルで安定出力。
|
||||
- 入口を `ParserBox → pipeline_v2(FlowEntry)` に統一し、1 行 JSON(Quiet)契約を維持。
|
||||
- 代表構文(return/binop/compare/if/index/new/boxcall/externcall)を優先対応。
|
||||
|
||||
## フェーズ分割
|
||||
1) 入口統合(Stage‑B ルートの opt‑in 実装)
|
||||
- `lang/src/compiler/entry/compiler_stageb.hako` を追加(既定: Stage‑B emit 専用)。
|
||||
- `ParserBox.parse_program2(src)` → `FlowEntryBox.emit_v0_from_ast(ast_json, prefer_cfg)` → print 1 行 JSON。
|
||||
- フラグ: `--prefer-cfg <N>` で pipeline 選好を切替できるようにする。
|
||||
2) 代表構文の緑化
|
||||
- binop/compare/if/index/new/boxcall/externcall を pipeline_v2 で受理できるよう確認。
|
||||
- Stage‑A canary と同等の selfhost canary を Stage‑B でも PASS。
|
||||
- Stage‑A 側の map parser(空/空白/エスケープ)を強化し、Stage‑B 引受け前の入力を安定化。
|
||||
3) v1→v0 アダプタの橋渡し
|
||||
- MirCall(v1) を出す経路は `MirJsonV1Adapter` で v0 に降格。
|
||||
- JSON 形状の差分を最小化し、Runner/VM と整合を取る。
|
||||
4) スモーク整備(opt‑in)
|
||||
- `tools/smokes/v2/profiles/quick/core/selfhost_*` を追加し、Gate‑C 直行と Runner 経由の両方で緑を確認。
|
||||
- Stage‑B canary (binop/if/index) に配列ネスト・境界ケースを追加。`SMOKES_ENABLE_STAGEB=1` でのみ実行。
|
||||
5) ドキュメント更新
|
||||
- README/PLAN/CHECKLIST を適宜更新。CI 既定は変更せず(既定OFF)。
|
||||
|
||||
## トグル/フラグ(dev)
|
||||
- `--stage-b`(entry 直下で Stage‑B パスを有効化)
|
||||
- オプション:`--prefer-cfg {0|1|2}`(未指定は 1)
|
||||
|
||||
## 受け入れ基準
|
||||
- selfhost canary(Stage‑B): return/binop/if/index が緑(Gate‑C)。
|
||||
- ny-llvmc の最小ケース(return/binop)で v0→EXE 生成が PASS。
|
||||
- 既定 OFF のため、quick/integration の回帰なし。
|
||||
@ -23,11 +23,17 @@
|
||||
- v1 互換: MirCall(v1)→ MirJsonV1Adapter で v0 に降格(当面の橋渡し)
|
||||
|
||||
受け入れ基準
|
||||
- JSON v0 canary(Hako): return/binop/if/index(array/map)緑。
|
||||
- JSON v0 canary(Hako): return/binop/if/index(array/map/whitespace)緑。
|
||||
- Runner(Gate‑C)で v0 を読み VM 実行 → Rust ラインと同じ出力。
|
||||
- ny-llvmc(llvmlite)で v0→EXE 生成が最小ケースで PASS。
|
||||
- 既定 OFF のため quick/integration は回帰なし。
|
||||
|
||||
実装メモ
|
||||
- Stage‑B エントリを `lang/src/compiler/entry/compiler_stageb.hako` として分離。`--source` / `--prefer-cfg {0|1|2}` を受理。
|
||||
- Stage‑A map parser を強化(空/空白/エスケープ対応)。対応済み canary: `index_operator_hako`
|
||||
- Stage‑B canary は `SMOKES_ENABLE_STAGEB=1` で有効化。binop/if/index(ネスト・境界ケース込み)を opt-in で検証可能。
|
||||
- Module 解決: `nyash.toml` に lang/compiler/shared/vm の論理名を追記し、using resolver から参照可能にした。
|
||||
|
||||
マイルストーン
|
||||
1) 入口統一
|
||||
- Main.main → ParserBox.parse → pipeline_v2 → FlowEntry.emit_v0 で 1 行 JSON 出力。
|
||||
|
||||
Reference in New Issue
Block a user