Files
hakorune/docs/development/current/CURRENT_TASK.md
Moe Charm dd09e81018 feat: Add VM instruction statistics and fix plugin TLV debugging
Major changes:
- Add --vm-stats and --vm-stats-json CLI flags for VM instruction profiling
- Implement instruction counting by opcode type with JSON output support
- Add enhanced TLV debug logging with NYASH_DEBUG_PLUGIN=1 environment variable
- Fix missing fields in CliConfig and ASTNode::BoxDeclaration for test compatibility
- Improve plugin method call error messages with argument count/type details

This enables MIR→VM conversion health checks and supports the Phase 8.6 VM optimization goals.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-23 03:40:17 +09:00

2.4 KiB
Raw Blame History

🎯 CURRENT TASK - 2025年8月23日刷新

直近の完了

  1. ドキュメント再編成の完了(構造刷新)
  2. プラグインBoxFileBox基本実装とインタープリター統合
  3. VM命令カウンタ時間計測のCLI化--vm-stats, --vm-stats-jsonとJSON出力対応

🚧 次にやること(再開方針)

  1. MIR→VMの健全化短期・最優先
  • 現行MIR→VMのマッピング表を作成欠落/冗長/重複を可視化)
  • サンプル/テストをVMで実行し、差分ログ例外系・returns_resultを確認
  • 成果物: docs/reference/architecture/mir-to-vm-mapping.md(暫定)
  1. VM×プラグインシステムのE2E検証短期
  • tests/e2e_plugin_filebox.rs をVMでも通す--features plugins
  • ケース: new/close, open/read/write, copyFrom(handle)、デリゲーション from Parent
  • 成果物: テストグリーン+既知の制約を VM_README.md に明記
  1. 命令セットのダイエット中期目標26命令
  • 実行統計(--vm-stats --vm-stats-json)でホット命令を特定
  • 統合方針(例: TypeCheck/Castの整理、Array/Ref周りの集約、ExternCall→BoxCall移行
  • 段階移行(互換エイリアス→削除)と回帰テスト整備
  • 成果物: 26命令案ドラフト移行計画

▶ 実行コマンド例

計測実行:

nyash --backend vm --vm-stats --vm-stats-json local_tests/test_hello.nyash > vm_stats.json

VM×プラグインE2E:

cargo test -q --features plugins e2e_interpreter_plugin_filebox_close_void
cargo test -q --features plugins e2e_vm_plugin_filebox_close_void

MIRダンプ/検証:

nyash --dump-mir --mir-verbose examples/plugin_box_sample.nyash
nyash --verify examples/plugin_box_sample.nyash

🔭 26命令ターゲットドラフトの方向性

コア(候補): Const / Copy / Load / Store / BinOp / UnaryOp / Compare / Jump / Branch / Phi / Call / BoxCall / NewBox / ArrayGet / ArraySet / RefNew / RefGet / RefSet / WeakNew / WeakLoad / BarrierRead / BarrierWrite / Return / Print or ExternCall(→BoxCall集約) + 2枠例外/await系のどちらか

補助: Debug/Nop/Safepointはビルドモードで有効化命令としては非中核に降格


最終更新: 2025年8月23日MIR/VM再フォーカス、26命令ダイエットへ