Files
hakorune/src/mir/builder/observe
nyash-codex 510f4cf523 builder/vm: stabilize json_lint_vm under unified calls
- Fix condition_fn resolution: Value call path + dev safety + stub injection
- VM bridge: handle Method::birth via BoxCall; ArrayBox push/get/length/set direct bridge
- Receiver safety: pin receiver in method_call_handlers to avoid undefined use across blocks
- Local vars: materialize on declaration (use init ValueId; void for uninit)
- Prefer legacy BoxCall for Array/Map/String/user boxes in emit_box_or_plugin_call (stability-first)
- Test runner: update LLVM hint to llvmlite harness (remove LLVM_SYS_180_PREFIX guidance)
- Docs/roadmap: update CURRENT_TASK with unified default-ON + guards

Note: NYASH_DEV_BIRTH_INJECT_BUILTINS=1 can re-enable builtin birth() injection during migration.
2025-09-28 12:19:49 +09:00
..

observe — Builder 観測devonly/既定OFF

目的

  • Builder 内部の決定resolve.try/choose, ssa.phi など)を JSONL で観測する。
  • 環境変数で明示有効化された時のみ動作既定OFF。言語仕様・実行結果は不変。

責務

  • ssa.rs: emit_phi — PHI の決定pred の type/origin、dst の決定)を DebugHub へ emit。
  • resolve.rs: emit_try / emit_choose — メソッド解決の候補/最終選択を emit。

非責務(禁止)

  • MIR 命令の生成/変更は行わない(副作用なし)。
  • 起源付与や型推論は origin 層に限定。

トグルDebugHub 側でガード)

  • NYASH_DEBUG_ENABLE=1
  • NYASH_DEBUG_KINDS=resolve,ssa
  • NYASH_DEBUG_SINK=/path/to/file.jsonl

レイヤールール

  • Allowed: DebugHub emit、Builder の読み取り(関数名/region_id/メタ)。
  • Forbidden: rewrite/origin の機能をここに持ち込まない。