d7805e5974
feat(joinir): Phase 213-2 Step 2-2 & 2-3 Data structure extensions
...
Extended PatternPipelineContext and CarrierUpdateInfo for Pattern 3 AST-based generalization.
Changes:
1. PatternPipelineContext:
- Added loop_condition: Option<ASTNode>
- Added loop_body: Option<Vec<ASTNode>>
- Added loop_update_summary: Option<LoopUpdateSummary>
- Updated build_pattern_context() for Pattern 3
2. CarrierUpdateInfo:
- Added then_expr: Option<ASTNode>
- Added else_expr: Option<ASTNode>
- Updated analyze_loop_updates() with None defaults
Status: Phase 213-2 Steps 2-2 & 2-3 complete
Next: Create Pattern3IfAnalyzer to extract if statement and populate update summary
2025-12-10 00:01:53 +09:00
8750186e55
chore: Phase 26-H セッション完了 - 全ドキュメント更新
...
Phase 26-H 完了内容:
✅ JoinIR 型定義実装(src/mir/join_ir.rs)
✅ MIR → JoinIR 自動変換実装(lower_min_loop_to_joinir)
✅ 自動変換テスト実装(mir_joinir_min_auto_lowering)
✅ PHI/Loop箱 → JoinIR 移行対応表追加(loopform_ssot.md)
ドキュメント更新:
- Phase 27 JoinIR タスク計画追加
- Phase 26-H タスク完了記録
- 各種 README 更新(進捗反映)
- CURRENT_TASK.md 更新
コミット統計: $(git status --short | wc -l) files changed
次のステップ: Phase 27 一般化 MIR → JoinIR 変換
2025-11-23 05:53:27 +09:00
6856922374
Phase 25.1a: selfhost builder hotfix (fn rename, docs)
2025-11-15 05:42:32 +09:00
864a94d013
feat(phase-21.8+25): Complete imports resolution + Ring0/Ring1 numeric ABI design
...
Phase 21.8 完了 (imports resolution):
- ✅ using nyash.core.numeric.matrix_i64 as MatI64 完全対応
- ✅ hakorune_emit_mir.sh で imports 抽出・MirBuilder に配線
- ✅ MatI64/IntArrayCore の静的参照解決が安定動作
- ✅ matmul_core ベンチ MIR 生成成功 (VM/LLVM 両対応)
Phase 25 設計完了 (Ring0/Ring1 + numeric ABI):
- 🎯 Ring0/Ring1 責務分離を明文化 (Rust Freeze Policy 具体化)
- 🎯 Call/ExternCall 明確な分離設計
- Call: Ring1 Hako 関数 (numeric core 等)
- ExternCall: Ring0 intrinsic (rt_mem_* 等の FFI のみ)
- 🎯 BoxCall → Call 変換方針確定 (AotPrep で実施)
- 🎯 MatI64.mul_naive を NyNumericMatI64.mul_naive に分離
(System Hakorune subset で完全実装済み)
実装:
- ✅ AotPrepNumericCoreBox 診断パス実装 (NYASH_AOT_NUMERIC_CORE=1)
- ✅ numeric ABI ドキュメント整備 (NUMERIC_ABI.md)
- ✅ System Hakorune subset 定義 (system-hakorune-subset.md)
- ✅ IntArrayCore/MatI64 仕様固定 (lang/src/runtime/numeric/README.md)
- ✅ ENV_VARS.md に NYASH_AOT_NUMERIC_CORE トグル追記
今後のタスク:
- BoxCall(MatI64) → Call(NyNumericMatI64) 変換実装 (opt-in)
- IntArrayCore の numeric core 整備
- matmul_core スモークテスト (NYASH_AOT_NUMERIC_CORE=0/1 両対応)
🎉 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-14 20:19:00 +09:00
8214176814
feat(perf): add Phase 21.8 foundation for IntArrayCore/MatI64 numeric boxes
...
Prepare infrastructure for specialized numeric array benchmarking:
- Add IntArrayCore plugin stub (crates/nyash_kernel/src/plugin/intarray.rs)
- Add IntArrayCore/MatI64 box definitions (lang/src/runtime/numeric/)
- Add Phase 21.8 documentation and task tracking
- Update nyash.toml/hako.toml with numeric library configuration
- Extend microbench.sh for matmul_core benchmark case
Next: Resolve Stage-B MirBuilder to recognize MatI64/IntArrayCore as boxes
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-14 15:18:14 +09:00
dda65b94b7
Phase 21.7 normalization: optimization pre-work + bench harness expansion
...
- Add opt-in optimizations (defaults OFF)
- Ret purity verifier: NYASH_VERIFY_RET_PURITY=1
- strlen FAST enhancement for const handles
- FAST_INT gate for same-BB SSA optimization
- length cache for string literals in llvmlite
- Expand bench harness (tools/perf/microbench.sh)
- Add branch/call/stringchain/arraymap/chip8/kilo cases
- Auto-calculate ratio vs C reference
- Document in benchmarks/README.md
- Compiler health improvements
- Unify PHI insertion to insert_phi_at_head()
- Add NYASH_LLVM_SKIP_BUILD=1 for build reuse
- Runtime & safety enhancements
- Clarify Rust/Hako ownership boundaries
- Strengthen receiver localization (LocalSSA/pin/after-PHIs)
- Stop excessive PluginInvoke→BoxCall rewrites
- Update CURRENT_TASK.md, docs, and canaries
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-13 16:40:58 +09:00
52b62c5772
feat(phase21.5): Stage-B parser loop fix + delegate path stabilization
...
## 修正内容
### 1. Stage-B パーサー修正(偶然の回避)
- **ファイル**:
- `lang/src/compiler/parser/expr/parser_expr_box.hako`
- `lang/src/compiler/parser/stmt/parser_control_box.hako`
- **問題**: ネストループで gpos が正しく進まず、loop の cond/body が壊れる
- **回避策**: new 式のメソッドチェーン処理追加で別ループを導入
- **結果**: MIR 生成が変わって VM gpos バグを回避
### 2. delegate パス動作確認
- **テスト**: `/tmp/loop_min.hako` → rc=10 ✅
- **MIR構造**: 正しい PHI/compare/binop を生成
- **チェーン**: hakorune parser → Rust delegate → LLVM EXE 完動
### 3. ドキュメント追加
- `docs/development/analysis/` - delegate 分析
- `docs/development/guides/` - ループテストガイド
- `docs/development/testing/` - Stage-B 検証報告
### 4. カナリーテスト追加
- `tools/smokes/v2/profiles/quick/core/phase2100/` 配下に複数追加
- emit_boxcall_length_canary_vm.sh
- stageb_parser_loop_json_canary_vm.sh
- 他
### 受け入れ基準
- ✅ delegate パス: rc=10 返す
- ✅ FORCE パス: rc=10 返す(既存)
- ✅ MIR 構造: 正しい PHI incoming と compare
- ✅ 既定挙動: 不変(dev トグルのみ)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-11 21:24:51 +09:00
6055d53eff
feat(phase21.5/22.1): MirBuilder JsonFrag refactor + FileBox ring-1 + registry tests
...
Phase 21.5 (AOT/LLVM Optimization Prep)
- FileBox ring-1 (core-ro) provider: priority=-100, always available, no panic path
- src/runner/modes/common_util/provider_registry.rs: CoreRoFileProviderFactory
- Auto-registers at startup, eliminates fallback panic structurally
- StringBox fast path prototypes (length/size optimization)
- Performance benchmarks (C/Python/Hako comparison baseline)
Phase 22.1 (JsonFrag Unification)
- JsonFrag.last_index_of_from() for backward search (VM fallback)
- Replace hand-written lastIndexOf in lower_loop_sum_bc_box.hako
- SentinelExtractorBox for Break/Continue pattern extraction
MirBuilder Refactor (Box → JsonFrag Migration)
- 20+ lower_*_box.hako: Box-heavy → JsonFrag text assembly
- MirBuilderMinBox: lightweight using set for dev env
- Registry-only fast path with [registry:*] tag observation
- pattern_util_box.hako: enhanced pattern matching
Dev Environment & Testing
- Dev toggles: SMOKES_DEV_PREINCLUDE=1 (point-enable), HAKO_MIR_BUILDER_SKIP_LOOPS=1
- phase2160: registry opt-in tests (array/map get/set/push/len) - content verification
- phase2034: rc-dependent → token grep (grep -F based validation)
- run_quick.sh: fast smoke testing harness
- ENV documentation: docs/ENV_VARS.md
Test Results
✅ quick phase2034: ALL GREEN (MirBuilder internal patterns)
✅ registry phase2160: ALL GREEN (array/map get/set/push/len)
✅ rc-dependent tests → content token verification complete
✅ PREINCLUDE policy: default OFF, point-enable only where needed
Technical Notes
- No INCLUDE by default (maintain minimalism)
- FAIL_FAST=0 in Bring-up contexts only (explicit dev toggles)
- Tag-based route observation ([mirbuilder/min:*], [registry:*])
- MIR structure validation (not just rc parity)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-10 19:42:42 +09:00
981ddd890c
Phase 22.1 WIP: SSOT resolver + TLV infrastructure + Hako MIR builder setup
...
Setup infrastructure for Phase 22.1 (TLV C shim & Resolver SSOT):
Core changes:
- Add nyash_tlv, nyash_c_core, nyash_kernel_min_c crates (opt-in)
- Implement SSOT resolver bridge (src/using/ssot_bridge.rs)
- Add HAKO_USING_SSOT=1 / HAKO_USING_SSOT_HAKO=1 env support
- Add HAKO_TLV_SHIM=1 infrastructure (requires --features tlv-shim)
MIR builder improvements:
- Fix using/alias consistency in Hako MIR builder
- Add hako.mir.builder.internal.{prog_scan,pattern_util} to nyash.toml
- Normalize LLVM extern calls: nyash.console.* → nyash_console_*
Smoke tests:
- Add phase2211 tests (using_ssot_hako_parity_canary_vm.sh)
- Add phase2220, phase2230, phase2231 test structure
- Add phase2100 S3 backend selector tests
- Improve test_runner.sh with quiet/timeout controls
Documentation:
- Add docs/ENV_VARS.md (Phase 22.1 env vars reference)
- Add docs/development/runtime/C_CORE_ABI.md
- Update de-rust-roadmap.md with Phase 22.x details
Tools:
- Add tools/hakorune_emit_mir.sh (Hako-first MIR emission wrapper)
- Add tools/tlv_roundtrip_smoke.sh placeholder
- Improve ny_mir_builder.sh with better backend selection
Known issues (to be fixed):
- Parser infinite loop in static method parameter parsing
- Stage-B output contamination with "RC: 0" (needs NYASH_JSON_ONLY=1)
- phase2211/using_ssot_hako_parity_canary_vm.sh fork bomb (needs recursion guard)
Next steps: Fix parser infinite loop + Stage-B quiet mode for green tests
2025-11-09 15:11:18 +09:00
301b1d212a
Phase 21.2 Complete: VM Adapter正規実装 + devブリッジ完全撤去
...
## 🎉 Phase 21.2完全達成
### ✅ 実装完了
- VM static box 永続化(singleton infrastructure)
- devブリッジ完全撤去(adapter_dev.rs削除、by-name dispatch削除)
- .hako正規実装(MirCallV1Handler, AbiAdapterRegistry等)
- text-merge経路完全動作
- 全phase2120 adapter reps PASS(7テスト)
### 🐛 バグ修正
1. strip_local_decl修正
- トップレベルのみlocal削除、メソッド内は保持
- src/runner/modes/common_util/hako.rs:29
2. static box フィールド永続化
- MirInterpreter singleton storage実装
- me parameter binding修正(1:1マッピング)
- getField/setField string→singleton解決
- src/backend/mir_interpreter/{mod,exec,handlers/boxes_object_fields}.rs
3. Map.len alias rc=0修正
- [map/missing]パターン検出でnull扱い(4箇所)
- lang/src/vm/boxes/mir_call_v1_handler.hako:91-93,131-133,151-153,199-201
### 📁 主要変更ファイル
#### Rust(VM Runtime)
- src/backend/mir_interpreter/mod.rs - static box singleton storage
- src/backend/mir_interpreter/exec.rs - parameter binding fix
- src/backend/mir_interpreter/handlers/boxes_object_fields.rs - singleton resolution
- src/backend/mir_interpreter/handlers/calls.rs - dev bridge removal
- src/backend/mir_interpreter/utils/mod.rs - adapter_dev module removal
- src/backend/mir_interpreter/utils/adapter_dev.rs - DELETED (7555 bytes)
- src/runner/modes/vm.rs - static box declaration collection
- src/runner/modes/common_util/hako.rs - strip_local_decl fix
- src/instance_v2.rs - Clone implementation
#### Hako (.hako実装)
- lang/src/vm/boxes/mir_call_v1_handler.hako - [map/missing] detection
- lang/src/vm/boxes/abi_adapter_registry.hako - NEW (adapter registry)
- lang/src/vm/helpers/method_alias_policy.hako - method alias support
#### テスト
- tools/smokes/v2/profiles/quick/core/phase2120/s3_vm_adapter_*.sh - 7 new tests
### 🎯 テスト結果
```
✅ s3_vm_adapter_array_len_canary_vm.sh
✅ s3_vm_adapter_array_len_per_recv_canary_vm.sh
✅ s3_vm_adapter_array_length_alias_canary_vm.sh
✅ s3_vm_adapter_array_size_alias_canary_vm.sh
✅ s3_vm_adapter_map_len_alias_state_canary_vm.sh
✅ s3_vm_adapter_map_length_alias_state_canary_vm.sh
✅ s3_vm_adapter_map_size_struct_canary_vm.sh
```
環境フラグ: HAKO_ABI_ADAPTER=1 HAKO_ABI_ADAPTER_DEV=0
### 🏆 設計品質
- ✅ ハードコード禁止(AGENTS.md 5.1)完全準拠
- ✅ 構造的・一般化設計(特定Box名のif分岐なし)
- ✅ 後方互換性保持(既存コード破壊ゼロ)
- ✅ text-merge経路(.hako依存関係正しくマージ)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-07 19:32:44 +09:00
77d4fd72b3
phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
2025-11-06 15:41:52 +09:00
5e3d9e7ae4
restore(lang/compiler): bring back lang/src/compiler from e917d400; add Hako index canaries and docs; implement Rust-side index operator (Array/Map get/set) with Fail‑Fast diagnostics
...
- restore: lang/src/compiler/** (parser/emit/builder/pipeline_v2) from e917d400
- docs: docs/development/selfhosting/index-operator-hako.md
- smokes(hako): tools/smokes/v2/profiles/quick/core/index_operator_hako.sh (opt-in)
- smokes(vm): adjust index_operator_vm.sh for semicolon gate + stable error text
- rust/parser: allow IndexExpr and assignment LHS=Index; postfix parse LBRACK chain
- rust/builder: lower arr/map index to BoxCall get/set; annotate array/map literals; Fail‑Fast for unsupported types
- CURRENT_TASK: mark Rust side done; add Hako tasks checklist
Note: files disappeared likely due to branch FF to a lineage without lang/src/compiler; no explicit delete commit found. Added anchor checks and suggested CI guard in follow-up.
2025-10-31 20:18:39 +09:00
712b370013
aot(core): EXE path green (return 7); migrate NyRT jit handles → runtime::host_handles; fix mir_call.py indent; workspace excludes for missing plugins; docs(phase-33) status update
2025-10-31 18:30:50 +09:00
f0608e9bb1
feat: Phase 2.4 レガシーアーカイブ整理完了(151MB削減)
...
## 🎉 完了項目
- ✅ plugin_box_legacy.rs削除(7.7KB、参照ゼロ確認済み)
- ✅ REMOVEDコメント整理(encode.rs簡潔化)
- ✅ venv削除(143MB節約、.gitignoreは既存)
- ✅ llvm_legacyスタブ化(8KB、compile_error!による安全化)
## 🏆 成果
- **リポジトリサイズ改善**: 151MB削減
- **コード整理**: レガシーコード安全にアーカイブ
- **プラグインファースト**: StrictPluginFirst継続動作
## ✅ 検証完了
- cargo build --release --features llvm (警告のみ、エラーなし)
- LLVMハーネス実行: print出力正常
- プラグイン動作: StringBox等正常動作
codex先生の戦略に従った安全な段階的削除を実行
Co-Authored-By: codex <noreply@anthropic.com >
2025-09-24 14:13:15 +09:00
f4fe548787
feat: Phase 2.4 NyRT→NyKernel Architecture Revolution 100%完了!
...
ChatGPT5 Pro設計分析による42%コード削減の完全実現:
- crates/nyrt → crates/nyash_kernel 完全移行
- with_legacy_vm_args系統11箇所削除(encode/birth/future/invoke系)
- Plugin-First Architecture統一(VM依存根絶)
- libnyash_kernel.a生成成功(0エラー・0警告)
- LLVM統合更新(build_llvm.sh, ny-llvmc対応)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-24 12:57:33 +09:00