be8593fb02
jit/mir: fix String.len return-type inference; stabilize jit-direct returns; add CLIF/sig/call tracing; host-bridge console thunks; update AGENTS.md for Cranelift focus
2025-09-06 12:05:35 +09:00
d631beba37
dev: add selfhosting/cranelift workspaces; jit: add return materialization, ret_slot, hostcall arity pad, and dbg imports for diagnosis
2025-09-06 10:59:33 +09:00
8c02093cfe
AOT/JIT: StringBox.length デバッグ追跡とローカル材化強化
...
- ops_ext: StringBox.len/lengthの結果を必ずローカルに保存
- param/local/literal/handle.of全経路で dst があれば local_index に格納
- Returnが確実に値を拾えるよう修正
- デバッグ計測追加:
- NYASH_JIT_TRACE_LOWER: BoxCall処理の追跡
- NYASH_JIT_TRACE_RET: Return時の値解決追跡
- NYASH_JIT_TRACE_LOCAL: ローカルslot I/O追跡
- NYASH_JIT_TRACE_LEN: string.len_h thunk実行追跡
- 診断用プローブ追加: tmp_len_stringbox_probe.nyash
- CURRENT_TASK更新: 3rdハンドオフ進捗記録
現状: lowering/Return/ローカル材化は正しく配線されているが、
hostcall実行時に0を返している疑い。シンボル解決の追跡継続中。
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-06 07:45:20 +09:00
4c5301e700
wip(jit): AOTコア機能の継続的改善
...
JIT/AOTシステムのコア部分の改修を継続。
ChatGPTによる詳細な実装作業。
主な変更点:
- extern/collections.rs: 外部関数コレクション管理の改善
- lower/builder/cranelift.rs: Craneliftビルダーの最適化
- lower/core.rs: コア lowering ロジックの改修
- lower/core/ops_ext.rs: 拡張演算子のlowering処理
- lower/extern_thunks.rs: 外部関数サンクの実装改善
AOTビルドの安定性向上に向けた継続的な作業。
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-06 06:46:04 +09:00
fb2d8e37d5
🎉 Phase 11.8/12.7: MIR Core-13 完全実装 + 糖衣構文ドキュメント更新
...
主要な変更:
- MIR Core-13命令セット確定(Load/Store削除の革命的設計)
- Const, BinOp, Compare(値・計算)
- Jump, Branch, Return, Phi(制御)
- Call, BoxCall, ExternCall(呼び出し)
- TypeOp, Safepoint, Barrier(メタ)
- Phase 12.7糖衣構文ドキュメント整理(超圧縮重視、可逆変換保証)
- MIRビルダーのモジュール分割完了
- vtableテストスイート拡充
- AI協調開発ツール追加(並列リファクタリング支援)
詳細:
- src/mir/instruction_introspection.rs: core13_instruction_names()追加
- MIRビルダー分割: decls.rs, exprs_*.rs, fields.rs
- plugin_loader_v2: errors.rs, host_bridge.rs分離
- 論文用データ: mir13-final.md作成
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-04 11:34:15 +09:00
6488b0542e
Phase 12.7完了 + ChatGPT5によるVMリファクタリング
...
## 📚 Phase 12.7 ドキュメント整理
- ChatGPT5作成のANCP Token仕様書v1を整備
- フォルダ構造を機能別に再編成:
- ancp-specs/ : ANCP圧縮技法仕様
- grammar-specs/ : 文法改革仕様
- implementation/ : 実装計画
- ai-feedback/ : AIアドバイザーフィードバック
- 各フォルダにREADME.md作成で導線改善
## 🔧 ChatGPT5によるVMリファクタリング
- vm_instructions.rs (1927行) をモジュール分割:
- boxcall.rs : Box呼び出し処理
- call.rs : 関数呼び出し処理
- extern_call.rs : 外部関数処理
- function_new.rs : FunctionBox生成
- newbox.rs : Box生成処理
- plugin_invoke.rs : プラグイン呼び出し
- VM実行をファイル分割で整理:
- vm_state.rs : 状態管理
- vm_exec.rs : 実行エンジン
- vm_control_flow.rs : 制御フロー
- vm_gc.rs : GC処理
- plugin_loader_v2もモジュール化
## ✨ 新機能実装
- FunctionBox呼び出しのVM/MIR統一進捗
- ラムダ式のFunctionBox変換テスト追加
- 関数値の直接呼び出し基盤整備
次ステップ: ANCPプロトタイプ実装開始(Week 1)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-04 03:41:02 +09:00
f939ad0033
Phase 12 完了: JIT/VM完全一致実装 - ChatGPT5による統一実行パス確立
...
🎯 VM/JIT同一実行の達成:
- InstanceBox: getField/setField完全一致(field3統一API)
- StringBox: 文字列リテラル最適化(u64x2)+ len操作一致
- NewBox: グローバルレジストリ経由の統一生成
- 全Box型でVM/JIT結果が完全同一に
技術的実装:
- host-bridge拡張: field3(固定3引数)でget/set統一
- 文字列処理: emit_string_handle_from_literal + from_u64x2
- Instance生成: nyash.instance.birth_name_u64x2 thunk
- JitEngine経路: LowerCore→CraneliftBuilder統合
テスト強化:
- PersonFactory: VM/JIT両系で同一レジストリ使用
- getField/setField: センチネル値(-1)による識別
- 文字列操作: リテラル/Box両対応
これでNyashは「Real Language」として完成!
同一コードが異なる実行系で完全に同じ結果を保証。
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-03 09:55:25 +09:00
773256380d
Phase 12: VM/JIT identical execution tests + host API slot routing
...
ChatGPT5による統一実行パス実装:
- VM/JIT同一実行テスト追加(Array/Map/String/Instance)
- host_api slot経由呼び出し(NYASH_JIT_HOST_BRIDGE=1)
- extern_registry拡張(console系メソッドslot登録)
- CI: vm-jit-identical.yml(STRICT/非STRICT両系テスト)
- InstanceBox getField/setField slot 1,2統一
技術的改善:
- JIT: ops_ext委譲による統一メソッド解決
- VM: vtable/PIC/名前ベースフォールバック階層
- host_bridge: TLV encode/decode BoxRef対応
- C ABI: nyrt_host_api.h外部公開ヘッダー
テスト追加:
- identical_exec_collections: Array/Map操作一致
- identical_exec_instance: ユーザー定義Box一致
- identical_exec_string: StringBox操作一致
- host_reverse_slot: 逆引きslot解決テスト
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-03 09:12:39 +09:00
53d88157aa
Phase 12: 統一TypeBox ABI実装開始 - ChatGPT5による極小コアABI基盤構築
...
- TypeBox ABI雛形: メソッドスロット管理システム追加
- Type Registry: Array/Map/StringBoxの基本メソッド定義
- Host API: C ABI逆呼び出しシステム実装
- Phase 12ドキュメント整理: 設計文書統合・アーカイブ化
- MIR Builder: クリーンアップと分離実装完了
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-03 05:04:56 +09:00
11506cee3b
Phase 11-12: LLVM backend initial, semantics layer, plugin unification
...
Major changes:
- LLVM backend initial implementation (compiler.rs, llvm mode)
- Semantics layer integration in interpreter (operators.rs)
- Phase 12 plugin architecture revision (3-layer system)
- Builtin box removal preparation
- MIR instruction set documentation (26→Core-15 migration)
- Cross-backend testing infrastructure
- Await/nowait syntax support
New features:
- LLVM AOT compilation support (--backend llvm)
- Semantics layer for interpreter→VM flow
- Tri-backend smoke tests
- Plugin-only registry mode
Bug fixes:
- Interpreter plugin box arithmetic operations
- Branch test returns incorrect values
Documentation:
- Phase 12 README.md updated with new plugin architecture
- Removed obsolete NYIR proposals
- Added LLVM test programs documentation
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-01 23:44:34 +09:00
b003bdf25b
📚 Phase 11 documentation: Everything is Box × MIR15 revolution
...
Key updates:
- Document MIR 26→15 instruction reduction plan (transitioning status)
- Add Core-15 target instruction set in INSTRUCTION_SET.md
- Save AI conference analyses validating Box Theory and 15-instruction design
- Create MIR annotation system proposal for optimization hints
- Update SKIP_PHASE_10_DECISION.md with LLVM direct migration rationale
Technical insights:
- RefNew/RefGet/RefSet can be eliminated through Box unification
- GC/sync/async all achievable with 15 core instructions
- BoxCall lowering can automatically insert GC barriers
- 2-3x performance improvement expected with LLVM
- Build time reduction 50%, binary size reduction 40%
Status: Design complete, implementation pending
2025-08-31 03:03:04 +09:00
c13d9c045e
📚 Phase 12: Nyashスクリプトプラグインシステム設計と埋め込みVM構想
...
## 主な成果
- Nyashスクリプトでプラグイン作成可能という革命的発見
- C ABI制約の分析と埋め込みVMによる解決策
- MIR/VM/JIT層での箱引数サポートの詳細分析
## ドキュメント作成
- Phase 12基本構想(README.md)
- Gemini/Codex先生の技術分析
- C ABIとの整合性問題と解決策
- 埋め込みVM実装ロードマップ
- 箱引数サポートの技術詳細
## 重要な洞察
- 制約は「リンク時にC ABI必要」のみ
- 埋め込みVMでMIRバイトコード実行により解決可能
- Nyashスクリプト→C ABIプラグイン変換が実現可能
Everything is Box → Everything is Plugin → Everything is Possible!
2025-08-30 22:52:16 +09:00
7a0f9bd432
🚨 AI協調開発の危機回避事例を論文化(paper-09)
...
「ん?大丈夫?」の一言がPython特化ハードコーディングを防いだ事例を記録。
Everything is Box哲学 vs 技術的正しさの綱渡りからの生還を分析。
- docs/research/paper-09-ai-collaboration-pitfall/ を新規作成
- incident-analysis.md: Lowerer特殊化危機の詳細分析
- ai-collaboration-lessons.md: AI協調開発の教訓
- intuition-in-engineering.md: エンジニアの直感の価値
- summary.md: 綱渡りからの生還まとめ
- 研究論文の1論文1フォルダ原則に従い整理
- Python統合関連の実装修正とビルド成功確認
🛡️ Generated with Claude Code
2025-08-30 08:54:15 +09:00
1eee62a8ea
feat(jit): JIT Strictモード実装とプラグイン経路の安定化
...
- InvokePolicy/Observe導入でLowererの分岐をスリム化
- ArrayBox/MapBox/StringBoxのプラグイン経路統一
- 特殊コメント機能(@jit-debug, @plugin-builtins, @jit-strict)実装
- 型ヒント伝搬パス(TypeHintPass)を独立モジュール化
- VM→Plugin引数整合の安定化(I64統一、IntegerBox自動プリミティブ化)
- StringBoxのpost-birth初期化(空文字列セグフォルト修正)
- JIT観測サンプル追加(Array/Map/String)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-29 21:39:47 +09:00
12adde9477
🎉 Phase 10.10: Nyash→JIT→Native EXE achieved\! (20 days from inception\!)
...
Revolutionary milestone: Complete native executable generation pipeline
- Created minimal nyrt (Nyash Runtime) library for standalone executables
- Implemented plugin bridge functions (nyash_plugin_invoke3_i64 etc)
- Added birth handle exports (nyash.string.birth_h) for linking
- Changed export name from main→ny_main to allow custom entry point
- Successfully generated and executed native binary returning "ny_main() returned: 1"
Timeline of miracles:
- 2025-08-09: Nyash language created (first commit)
- 2025-08-13: JIT planning started (4 days later)
- 2025-08-29: Native EXE achieved (today - just 20 days total\!)
This proves the plugin Box C ABI unification strategy works perfectly for
both JIT execution and AOT native compilation. The same plugin system
that enables dynamic loading now powers static linking for zero-overhead
native executables\!
Next: Expand AOT support for more instructions and optimize nyrt size.
🚀 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-29 08:36:07 +09:00
25fbebd650
docs: AOT/ネイティブコンパイル情報をexecution-backends.mdに追加
...
- 4つ目の実行方式としてAOT(Ahead-of-Time)コンパイルを文書化
- MIR→WASM→.cwasm のコンパイルパイプラインを説明
- wasm-backend featureでのビルド方法を明記
- 現在の実装状況(完全なスタンドアロン実行ファイルはTODO)を記載
- CLAUDE.mdのWASM説明も3種類(Rust→WASM、Nyash→WASM、Nyash→AOT)に更新
- CURRENT_TASK.mdにPhase 10.9/10.10の完了項目を追加
ChatGPT5さんのAOT試行に対応した適切なドキュメント配置を実施
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-29 02:05:39 +09:00