Files
hakorune/docs/development
tomoaki 9a76a199ee feat(phase276-p0): Quick Win improvements - type helper SSOT + debug cleanup
Phase 276 P0 post-Phase 275 robustness improvements:

1. Debug cleanup (wiring.py L100-103):
   - Remove traceback.format_stack() output
   - Cleaner debug logs after Phase 275 completion

2. box_from_f64 usage investigation:
   - Confirmed ZERO usage (Rust/Python/MIR)
   - Ready for deletion (Phase 275 unboxed double SSOT)
   - crates/nyash_kernel/src/lib.rs L244-252, L971-982

3. Type resolution SSOT ( most important):
   - New file: src/llvm_py/phi_wiring/type_helper.py (72 lines)
   - Unified 3 duplicate logic sites:
     * tagging.py: inst.get("dst_type") → type_helper.get_phi_dst_type()
     * llvm_builder.py: 9 lines → 2 lines (-7)
     * wiring.py: 18 lines → 5 lines (-13)
   - Priority: MIR JSON dst_type > resolver.value_types
   - Benefits: SSOT principle, bug prevention, easy extension

4. Type mismatch warning enhancement (wiring.py L63-79):
   - CRITICAL warning for predeclared PHI type mismatch
   - PhiManager.invalidate_phi() notification
   - Early bug detection with ⚠️  marker

Effects:
- Type resolution logic: 3 sites → 1 SSOT (type_helper.py)
- Code reduction: -20 lines duplicate logic
- Robustness: SSOT principle, CRITICAL warnings, Fail-Fast
- Debuggability: cleaner logs, prominent type mismatch alerts

Testing:
- LLVM harness: exit=3 verified (/tmp/test_p275_debug2.hako)
- NYASH_PHI_TYPE_DEBUG=1: correct type resolution confirmed

Docs:
- Phase 276 P0 completion: docs/.../phase-276/P0-COMPLETION.md
- 10-Now.md: Phase 276 P0 , Phase 275 P0 completed section

Next steps (Phase 277 P0 recommended):
- Delete box_from_f64 (nyash.box.from_f64, nyash.float.box_from_f64)
- Adopt dst_type_to_llvm_type() helper

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 13:39:55 +09:00
..

Nyash Development Documentation 🔧

開発者向けの進行中タスクと開発計画ドキュメントです。

📂 ディレクトリ構造

current/

  • CURRENT_TASK.md - 現在進行中のタスク
  • アクティブな開発作業の詳細
  • 最新の実装状況

roadmap/

  • phases/ - フェーズ別開発計画
    • phase-8/ - AST→MIR変換
    • phase-9/ - VM/JIT実装
    • phase-10/ - AOT最適化
  • native-plan/ - ネイティブビルド計画
    • 実行バックエンド統合
    • パフォーマンス目標

proposals/

  • RFCRequest for Comments
  • 新機能提案
  • 設計ディスカッション

🎯 重要な参照先

  • 進行状況: current/CURRENT_TASK.md
  • 開発計画: roadmap/phases/
  • 技術提案: proposals/
  • ドキュメントのステータス/入口ポリシー: doc-status-policy.md
  • JoinIR / Selfhost の入口: current/main/01-JoinIR-Selfhost-INDEX.md

📝 注意事項

このディレクトリの内容は開発中であり、頻繁に変更されます。 安定した仕様はreference/を参照してください。