**Problem**: is_parameter() was too simple, checking only ValueId which changes through copies/PHIs. This caused parameters like 'data' to be misclassified as carriers, leading to incorrect PHI construction. **Solution**: Track original parameter names at function entry. **Changes**: 1. **Added function_param_names field** (builder.rs): - HashSet<String> to track original parameter names - Populated in lower_static_method_as_function() - Cleared and repopulated for each new function 2. **Improved is_parameter()** (loop_builder.rs): - Check name against function_param_names instead of ValueId - More reliable than checking func.params (ValueIds change) - __pin$*$@* variables correctly classified as carriers - Added debug logging with NYASH_LOOPFORM_DEBUG 3. **Enhanced debug output** (loopform_builder.rs): - Show carrier/pinned classification during prepare_structure() - Show variable_map state after emit_header_phis() **Test Results**: - ✅ 'args' correctly identified as parameter (was working) - ✅ 'data' now correctly identified as parameter (was broken) - ✅ __pin variables correctly classified as carriers - ✅ PHI values allocated and variable_map updated correctly - ⚠️ ValueId undefined errors persist (separate issue) **Remaining Issue**: ValueId(10) undefined error suggests PHI visibility problem or VM verification issue. Needs further investigation of emit_phi_at_block_start() or VM executor. **Backward Compatibility**: - Flag OFF: 100% existing behavior preserved (legacy path unchanged) - Feature-flagged with NYASH_LOOPFORM_PHI_V2=1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🗺️ Nyash 予定(ロードマップ・タスク)
📋 現在進行中
🎯 最重要タスク
- 現在のタスク: ../../CURRENT_TASK.md
- Phase 8.3: Box操作WASM実装(Copilot担当)
- Phase 8.4: ネイティブコンパイル実装計画(AI大会議策定済み)
🚀 ネイティブコンパイル計画 (2025-08-14策定)
📊 AI大会議成果
- 🤖 AI大会議記録 - Gemini×codex×Claude技術検討
- 🗺️ ネイティブコンパイルロードマップ - 技術戦略詳細
⚡ 実装フェーズ
- Phase A (2-3週間): AOT WASM → 500倍高速化目標
- Phase B (2-3ヶ月): Cranelift Direct → 600倍高速化目標
- Phase C (6ヶ月+): LLVM Ultimate → 1000倍高速化目標
🤖 Copilot協調管理
📋 Copilot作業管理
- copilot_issues.txt - Copilot様への依頼・課題整理
- 協調戦略: CURRENT_TASK.md内に詳細記載
🎯 フェーズ別課題
- Phase 8課題: native-plan/issues/
- 統合管理: Claude×Copilot マージ競合回避戦略
📊 実装状況追跡
✅ 完了済み (Phase 8.2)
- WASM: 0.17ms (280倍高速化)
- VM: 16.97ms (2.9倍高速化)
- ベンチマークシステム完成
- 3バックエンド統合CLI
🚧 進行中 (Phase 8.3)
- Box操作WASM対応(Copilot実装中)
- RefNew/RefGet/RefSet命令
- メモリレイアウト最適化
🔜 次期予定 (Phase 8.4+)
- AOT WASMネイティブ化
- MIR最適化基盤
- エスケープ解析実装
- MIR/Builder/Optimizer簡略化計画(責務分離・効果正規化・可視化)
📚 関連ドキュメント
📖 技術資料
- 実行バックエンドガイド - 3バックエンド使い分け
- Self‑Hosting / Mini‑VM ロードマップ
- コアコンセプト - Everything is Box哲学
🔄 進捗管理
- 定期更新: 毎週金曜日に進捗反映
- AI会議: 重要決定事項は3AI大会議で検討
- ベンチマーク: 性能回帰チェック自動実行
最終更新: 2025-08-14 - AI大会議によるネイティブコンパイル戦略確定