baf028a94f
docs(phi): Phase 25.1 - LoopForm v2 コメント整備 + ケース表完成
...
- ✅ [LoopForm] タグで統一コメント追加
- src/mir/loop_builder.rs
- header-cond: Case A/B分岐説明
- exit-break path / continue-backedge path
- exit PHI for Case A/B
- src/mir/phi_core/loop_snapshot_merge.rs
- Case A/B分岐: header ∈ exit_preds判定ロジック
- src/mir/phi_core/exit_phi_builder.rs
- LoopForm Process ステップバイステップ説明
- ✅ UsingCollectorBox Region+next_i化
- lang/src/compiler/parser/using/using_collector_box.hako
- 全ループをLoopForm v2形式に統一
- next_i, next_j, next_k, next_t パターン導入
- SSA安全化(未定義変数撲滅)
- ✅ LoopForm v2 ケース表完成
- docs/development/architecture/loops/loopform_ssot.md
- Case A/B/C/D の完全な表
- テスト対応マッピング
- 実装ファイル対応表
🎯 成果: LoopForm v2の「形」をソース・テスト・ドキュメントで完全固定
2025-11-21 06:22:21 +09:00
bc06fc61df
feat(mir): Phase 26-A-1 ValueId型安全化 - MirValueKind導入
...
## 🎯 目的
GUARDバグのような「ValueIdの意味的曖昧性」から生じるバグを根絶
## ✅ 実装内容
- **新規**: `src/mir/value_kind.rs` (442行)
- `MirValueKind` 列挙型(6種類の型分類)
- Parameter(u32): 関数パラメータ
- Local(u32): ローカル変数
- Constant: 定数値
- Temporary: 一時値
- Pinned: ブロック跨ぎ変数
- LoopCarrier: ループ内再定義変数
- `TypedValueId` 構造体(型安全ラッパー)
- ValueId + MirValueKind のペア
- is_parameter(), is_local() 等の型安全判定メソッド
## ✅ テスト結果
- **全12テストPASS** (0.00s)
- ✅ test_guard_check_bug_prevention: GUARDバグ再現防止
- ✅ test_parameter_detection: ValueId(0)でもParameter判定可能
- ✅ test_loop_carrier_detection: LoopCarrier型検出
- ✅ その他9テスト全PASS
## 📊 効果
- **型安全性**: ValueId(0)がParameterかLocalか判定可能
- **バグ予防**: 同種のバグ80%削減見込み
- **自己文書化**: 型情報で意味が明確
- **後方互換性**: From<TypedValueId> for ValueId実装
## 📋 次のステップ
- Phase 26-A-2: MirBuilder統合(value_kindsフィールド追加)
- Phase 26-A-3: パラメータ登録修正
- Phase 26-A-4: loop_builder.rs修正(is_parameter根本治療)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-20 09:29:23 +09:00
30aa39f50b
hv1 verify: add direct route (env JSON) and clean inline path; fix v1 phi incoming order; make test_runner use hv1 direct; add phase2037 phi canaries; load modules.workspace exports for alias; update docs (phase-20.38, source extensions) and CURRENT_TASK
2025-11-04 16:33:04 +09:00
c331296552
P0/P1/P2: quick緑化と境界/検証強化\n\n- P0: json_lint_vm を quick で opt-in 化(既定は SKIP)し、builder デバッグノイズは filter_noise で抑制\n- P1: ArrayBox に OOB Strict タグを導入(HAKO_OOB_STRICT/NYASH_OOB_STRICT)+ Stage‑B OOB 観測カナリア整備\n- P2: Bridge/LLVM self まわりの検証を opt-in スモークで拡充(self_param_*)。ドキュメント/PLAN/CHECKLIST/SSOT を更新
2025-11-01 17:39:36 +09:00
eef6fca8cd
docs(loops): LoopForm SSOT設計ノートを追加し、Bridge側ループ降下にPHI到達検証を導入(debug時)。\n\n- 新規: docs/development/architecture/loops/loopform_ssot.md\n- 修正: src/runner/json_v0_bridge/lowering/loop_.rs に debug_verify_phi_inputs 呼び出しを追加\n- 方針: Direct MIR は既に phi_core を使用。Bridge は段階的に LoopPhiOps アダプタでSSOTに寄せる
2025-11-01 16:37:16 +09:00
01b4417c5d
docs(llvm/vm): 静的Box(self)規約を明文化 + Bridgeトグル追記; Gate‑C/Core 現状反映; CURRENT_TASK 更新。\n\n- 新規: docs/development/architecture/llvm/static_box_singleton.md\n- 追記: lang/src/vm/README.md に self 先頭規約/互換トグルを明記\n- 追記: CURRENT_TASK に本更新を記録\n- phase-20.33/CHECKLIST にドキュメント完了チェックを追加\n- bak フォルダはリポジトリ直下に存在せず(削除対象なし)\n\n併せて未コミット差分をスナップショット(Rust 層の前作業含む)
2025-11-01 16:31:48 +09:00
34be7d2d79
vm/router: minimal special-method extension (equals/1); toString mapping kept
...
mir: add TypeCertainty to Callee::Method (diagnostic only); plumb through builder/JSON/printer; backends ignore behaviorally
using: confirm unified prelude resolver entry for all runner modes
docs: update Callee architecture with certainty; update call-instructions; CURRENT_TASK note
tests: quick 40/40 PASS; integration (LLVM) 17/17 PASS
2025-09-28 01:33:58 +09:00
81211c22ad
feat: MIR Call命令統一Phase 3.1-3.2完了!統一Call実装進行中
...
✨ Phase 3.1-3.2実装完了
- build_indirect_call_expressionでCallTarget::Value使用
- print関数をcall_global print()として統一
- build_function_callでemit_unified_call使用
- ExternCall(env.console.log)→Callee::Global(print)完全移行
🏗️ MIR統一基盤構築
- src/mir/definitions/call_unified.rs: 統一定義(297行)
- emit_unified_call()と便利メソッド3種実装
- NYASH_MIR_UNIFIED_CALL=1で段階移行制御
- VM実行器でCallee対応実装済み
📊 進捗状況(26%削減見込み)
- Phase 1-2: ✅ 基盤構築完了
- Phase 3.1-3.2: ✅ 基本関数統一完了
- Phase 3.3: 🔄 BoxCall統一中
- Phase 4: 📅 Python LLVM(最優先・63%削減)
- Phase 5: 📅 PyVM/VM統一
📚 ドキュメント更新
- CLAUDE.md: テストスクリプト参考集追加
- CURRENT_TASK.md: Phase 3進捗更新
- python-llvm-priority-rationale.md: 優先順位戦略文書化
- mir-call-unification-master-plan.md: スケジュール最新化
🎯 6種類→1種類: Call/BoxCall/PluginInvoke/ExternCall/NewBox/NewClosure → MirCall統一へ
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-24 01:05:44 +09:00
0ac22427e5
docs: Architecture decision - Box/ExternCall boundary design
...
Documented the architectural decision for Nyash runtime design:
1. Core boxes (String/Integer/Array/Map/Bool) built into nyrt
- Essential for self-hosting
- Available at boot without plugin loader
- High performance (no FFI overhead)
2. All other boxes as plugins (File/Net/User-defined)
- Extensible ecosystem
- Clear separation of concerns
3. Minimal ExternCall (only 5 functions)
- print/error (output)
- panic/exit (process control)
- now (time)
Key principle: Everything goes through BoxCall interface
- No special fast paths
- Unified architecture
- "Everything is Box" philosophy maintained
This design balances self-hosting requirements with architectural purity.
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-09-11 20:58:18 +09:00