Commit Graph

250 Commits

Author SHA1 Message Date
5bcaa14b52 Phase 9.75-B: Convert StreamBox from Arc<Mutex> to RwLock, progress on DebugBox
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 23:59:11 +00:00
ffa09b17fb Phase 9.75-B: Convert ArrayBox, MapBox, BufferBox from Arc<Mutex> to RwLock
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 23:48:21 +00:00
e0f0a658e6 docs: Phase 9.75 Box設計根本革命 - SocketBox Arc<Mutex>責務一元化
 Phase 9.75実装計画追加:
- copilot_issues.txtにPhase 9.75追加(Phase 9.7と9.8の間)
- Arc<Mutex>二重化問題の根本解決計画
- 段階的実装戦略(Phase A-D)定義

📚 Box設計ドキュメント完全体系化:
- docs/説明書/reference/box-design/ 新設
- everything-is-box.md: 核心哲学の完全解説
- memory-management.md: Arc<Mutex>設計・fini/weak参照
- delegation-system.md: 完全明示デリゲーション仕様
- box-types-catalog.md: 全Box型の完全カタログ
- ffi-abi-specification.md: FFI/ABI仕様(移動済み)

🔧 実装ノート完備:
- current-issues.md: 現在進行中の設計課題
- socket-box-problem.md: Arc<Mutex>二重化問題詳細分析
- phase-9-75-redesign.md: 実装計画詳細

👥 Copilot実装ガイド作成:
- phase9_75_socketbox_arc_mutex_redesign.md
- SocketBox優先対応の具体的実装手順
- 完全テストスイート設計
- 段階的実装戦略(Step 1-5)

📋 CURRENT_TASK.md更新:
- Box設計ドキュメント完成記録
- Phase 9.75準備完了状況

🎯 効果:
- Everything is Box哲学の体系的文書化
- SocketBox問題解決の明確な道筋
- Copilot協調実装の準備完了
- 新規開発者オンボーディング改善

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-15 07:47:09 +09:00
d9825b2657 fix: resolve arithmetic operations after Copilot merge
- Fix try_add/try_sub/try_mul/try_div method call errors
- Use helper functions instead of trait methods to avoid circular dependencies
- All arithmetic operations now working: +, -, *, /, string concat, string repeat
- Add comprehensive arithmetic test file
- Build successful with 0 errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 23:50:29 +09:00
10d7055ef5 Merge pull request #85 from moe-charm/copilot/fix-84
🚀 Fix Compilation Errors - Restore Build System with Trait-Based Arithmetic Operations
2025-08-14 23:47:07 +09:00
70502f4fcd Final fix: Implement local operator functions to resolve compilation errors completely
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 14:40:27 +00:00
f12020a029 Partial fix: Implement DynamicMul/DynamicDiv traits, resolve circular dependencies - library builds successfully
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 14:16:10 +00:00
e1649d6b1d docs(refactoring): create Issue #84 for refactoring project completion
🚀 Issue #84 - Complete Refactoring Project
- 緊急問題: PR #83リファクタリング後の14コンパイルエラー修正必須
- 算術トレイト実装不足: try_add, try_sub, try_mul, try_div メソッド欠如
- 残りステージ依頼: parser/interpreter/mir分割 (Stages 3-5)

 現在の成果確認:
- main.rs: 1,490行 → 62行 (24倍削減完了)
- CLI/Runner分離: 完璧実装済み
- Box分離フレームワーク: 基盤構築済み

📋 要求作業:
1. コンパイルエラー即座修正 (DynamicAdd/Sub/Mul/Div トレイト実装)
2. Stages 3-5継続実行 (parser/interpreter/mir → 目標4-7倍削減)
3. 全テスト通過・アーキテクチャ保持

🎯 期待効果: Gemini AI戦略的リファクタリング計画100%完成

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 22:47:57 +09:00
d506f02ad8 Merge branch 'main' of github.com-moecharm:moe-charm/nyash 2025-08-14 22:41:39 +09:00
8c42630e69 docs(current-task): update SocketBox analysis with Gemini expert insights
🎯 Gemini専門分析追加:
- 根本問題特定: 「責務の二重化」による二重ロック地獄
- 現在の問題設計: SocketBox内部ロック + インタープリター外部ロック
- 推奨解決策: PlainSocketBox設計(Arc<Mutex>完全除去)

💡 設計哲学転換:
- SocketBox: 純粋データコンテナ(ロック責務完全排除)
- インタープリター: 全オブジェクトロック管理一元化
- 効果: デッドロック根絶・状態整合性保証・デバッグ容易性向上

📋 今後の対応: より詳細な設計検討後、SocketBox根本リファクタリング実施予定

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 22:41:31 +09:00
9f310f8a88 Merge pull request #83 from moe-charm/copilot/fix-82
🚀 Strategic Codebase Refactoring: Reduce File Size Complexity (Stages 1-2 Complete)
2025-08-14 22:40:30 +09:00
86906d0093 Stage 2 Complete: box_trait.rs refactoring (1,456→1,001 lines, 31% reduction)
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 13:37:49 +00:00
71719aba65 Stage 2 Progress: box_trait.rs refactoring (1,456→1,001 lines, 31% reduction)
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 13:32:06 +00:00
7f997ee135 Stage 1 Complete: main.rs refactoring (1,490→62 lines, 24x reduction)
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 13:16:12 +00:00
a3bd1af30a Merge pull request #81 from moe-charm/copilot/fix-80
Fix SocketBox state separation issue - method call clone state loss
2025-08-14 22:13:57 +09:00
51d397a3ab Fix SocketBox state separation issue - method call clone state loss
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 13:10:31 +00:00
b013162a5d Identified clone state sharing issue - different Arc data pointers
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 13:07:45 +00:00
d9ff77fd37 feat(refactoring): create Issue #82 for strategic codebase modularization
🚀 Issue #82 - Nyash Codebase File Size Refactoring
- 問題: 5ファイルが1,100行超えで保守性悪化(main.rs 1,490行が最悪)
- 戦略: Gemini AI専門分析による段階的リファクタリング計画
- 効果: 4x-15x ファイルサイズ削減・開発効率劇的改善

📊 段階的実装計画:
Stage 1: main.rs分割 (1,490→<100行) - CLI/Runner分離
Stage 2: box_trait.rs再編成 (1,456行→boxes/*モジュール配布)
Stage 3-5: parser・interpreter・mir体系的分割

🎯 技術要件:
- Everything is Box哲学維持
- Arc<Mutex>スレッドセーフ設計保持
- 4バックエンド互換性(Interpreter/VM/WASM/AOT)
- 全16種Box型機能保持

 品質保証:
- 機能変更なし(純粋リファクタリング)
- 段階別コンパイル成功必須
- 既存テスト全通過
- Rust慣例的モジュール構成

🤖 Copilot依頼: 段階的進捗報告・アーキテクチャ原則遵守

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 21:48:57 +09:00
56ce5da24d feat(issue): create Issue #80 for SocketBox state separation problem
🚨 Issue #80 - SocketBox State Separation Problem
- Method call clone state loss: bind()で状態設定後、isServer()で異なるCloneを参照し状態失われる
- 根本原因特定済み: メソッド呼び出しごとにSocket IDが変化(17→26→36→51)
- 状態逆流機構の不全: 新Clone内の状態変更が元変数に反映されない

📊 完全再現環境提供:
- test_socket_state_preservation.nyash: 基本的な状態保持失敗再現
- test_socketbox_fix_validation.nyash: 包括的メソッドテスト
- test_other_boxes_working.nyash: 他Box正常動作確認

🔧 Copilot要求事項:
- 根本原因分析: Clone状態同期メカニズムの修正
- 全バグ報告: 些細な問題も含め全発見事項を報告
- 完全検証: 全テストケース通過必須
- Phase 9 HTTPサーバー実装の阻害要因解決

🎯 優先度: HIGH - HTTPサーバー機能に直接影響する状態管理問題

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 21:39:45 +09:00
430a092484 Merge pull request #79 from moe-charm/copilot/fix-78
Fix SocketBox deadlock: Remove double-mutex lock in clone debug code
2025-08-14 21:33:20 +09:00
5ada387c73 Complete SocketBox deadlock fix: Clean up debug logging and add comprehensive tests
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 12:29:38 +00:00
06694296a7 Fix SocketBox deadlock: Remove double-mutex lock in clone debug code
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 12:26:46 +00:00
d04f7606e6 fix: Update to new Issue #78 for SocketBox deadlock investigation
- Previous Issue #76 and PR #77 closed and recreated
- New streamlined issue focusing on core deadlock problem
- Multiple Arc<Mutex> hypothesis as primary investigation target
- Ready for systematic root cause analysis

🔥 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 21:00:14 +09:00
80c911d3c8 🚨 Critical Issue #76: SocketBox Method Call Deadlock Investigation
## 🎯 Problem Identification Complete
- SocketBox method calls (bind, isServer, toString) cause infinite blocking
- Root cause: Method resolution pipeline deadlock before execute_socket_method
- Other Box types (ArrayBox, StringBox, MapBox) work normally
- Arc<Mutex> reference sharing confirmed working (Arc addresses match = true)

## 🔧 Debug Infrastructure Added
- Comprehensive debug logging in socket_box.rs (bind, isServer, clone, toString)
- Method call tracing in http_methods.rs
- Deadlock detection points identified at interpreter expressions.rs:462-464

## 📋 Issue #76 Created for Copilot Investigation
- Systematic root cause analysis requirements (Architecture→Parser→Runtime levels)
- Comprehensive test cases: minimal/comprehensive/comparison scenarios
- Strict prohibition of band-aid fixes - architectural analysis required
- Hypothesis: Multiple Arc<Mutex> combinations causing circular deadlock

## 🧪 Test Suite Added
- test_socket_deadlock_minimal.nyash: Minimal reproduction case
- test_socket_methods_comprehensive.nyash: All methods deadlock verification
- test_other_boxes_working.nyash: Normal Box operation confirmation
- SOCKETBOX_ISSUE_REPRODUCTION.md: Complete reproduction guide

## 📊 Impact Assessment
- Phase 9 HTTP server implementation completely blocked
- SocketBox functionality entirely non-functional
- Critical blocker for production readiness
- Requires immediate systematic investigation

🔥 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 20:55:33 +09:00
7ceaae957a Merge pull request #75 from moe-charm/copilot/fix-74
🔧 Fix SocketBox state preservation in "Everything is Box" design through Arc reference sharing
2025-08-14 20:05:03 +09:00
dcafdad231 Complete implementation with comprehensive tests and documentation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 10:27:00 +00:00
8d513a186f Fix interface compatibility issues with Arc-based reference sharing
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 10:25:41 +00:00
9572d0f321 Implement targeted SocketBox Clone fix for shared mutable state
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 10:14:35 +00:00
654e6692b0 Phase 1-3 implementation: Arc sharing in core data structures
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 10:05:42 +00:00
83d8fecd91 Initial analysis and plan for Arc sharing fix
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 09:55:34 +00:00
7ca298058a Merge pull request #73 from moe-charm/copilot/fix-72
Phase 9.7: Box FFI/ABI + ExternCall Implementation - Universal Library Integration
2025-08-14 18:38:11 +09:00
b8bc41120e Complete Phase 9.7: Box FFI/ABI + ExternCall with working WASM demo
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:59:59 +00:00
2091462441 Implement Phase 9.7: ExternCall instruction and WASM runtime imports
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:56:39 +00:00
9b25330d94 docs: NyIR Core 26命令統一完了 - Universal Exchange Vision基盤確立
## 🌟 主要変更
- NyIR Core: 25命令 → 26命令(ExternCall追加)
- Universal Exchange Vision実現基盤完成
- Everything is Box哲学:外部ライブラリ統一対応

## 📋 完了した統一作業
-  docs/nyir/spec.md: 26命令正式仕様確定
-  docs/nyir/vision_universal_exchange.md: ChatGPT5ビジョン統合
-  docs/予定/native-plan/copilot_issues.txt: 実装計画全面更新
-  Extension戦略再定義: 言語固有機能に限定

## 🎯 26命令完全定義
**Tier-0 (8命令)**: Const, BinOp, Compare, Branch, Jump, Phi, Call, Return
**Tier-1 (13命令)**: NewBox, BoxFieldLoad, BoxFieldStore, BoxCall, **ExternCall**,
                   Safepoint, RefGet, RefSet, WeakNew, WeakLoad, WeakCheck, Send, Recv
**Tier-2 (5命令)**: TailCall, Adopt, Release, MemCopy, AtomicFence

## 🔥 ExternCall革命
外部ライブラリをBox統一APIで利用する革命的機能追加

## 📚 新規ドキュメント
- docs/nyir/: NyIR公開仕様フォルダ新設
- box_ffi_abi.md: Box FFI/ABI完全設計(ChatGPT5)
- phase_9_7実装仕様: GitHub Issue #72準備完了

## 🚀 次期タスク
Phase 9.7: Box FFI/ABI実装(Issue #72)
- MIR ExternCall命令実装
- WASM RuntimeImports統合
- Universal Library Integration実現

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 17:26:04 +09:00
5cebf4c1f7 Merge pull request #71 from moe-charm/copilot/fix-70
Fix SocketBox state consistency bug - isServer() method now works correctly after bind()
2025-08-14 17:18:35 +09:00
d5fae25dc9 Fixed SocketBox state consistency bug - isServer() now works correctly after bind()
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:17:04 +00:00
4548d5acbd SocketBox state sharing partially fixed - isServer works, listener Arc issue remains
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:12:30 +00:00
e3be02db47 Diagnosed Arc sharing issue in SocketBox cloning - complex race condition
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 08:03:48 +00:00
5730d2fa0f Identified root cause of SocketBox bug - local variable clone issue
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 07:51:06 +00:00
1bcd425edb Merge pull request #69 from moe-charm/copilot/fix-68
Fix WASM Jump/Branch instructions and HTTPServer listen() functionality
2025-08-14 16:21:36 +09:00
99858ecfaa Add demo showing Phase 9.51 fixes working together
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 07:16:40 +00:00
85a5ce053d Fix WASM Jump/Branch implementation and HTTPServer listen() functionality
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 07:14:45 +00:00
d1c82cfb28 Merge pull request #67 from moe-charm/copilot/fix-62
🌐 Phase 9.5: Complete HTTP Server Infrastructure for AOT Validation
2025-08-14 15:27:01 +09:00
2d3abcbfc0 Phase 9.5 HTTP Server Infrastructure Complete: Comprehensive demo and testing validation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 06:24:12 +00:00
004b6b7953 Complete HTTP server infrastructure integration and test basic functionality
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 06:20:45 +00:00
212b46825f Implement HTTP server infrastructure: SocketBox, HTTPServerBox, HTTPRequestBox, HTTPResponseBox
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 06:10:52 +00:00
19d4d0632f Initial analysis: Phase 9.5 HTTP Server implementation plan
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 05:59:08 +00:00
f4f0473ccf Merge pull request #66 from moe-charm/copilot/fix-65
Add string constant support to WASM backend
2025-08-14 14:45:16 +09:00
626572a012 Fix WASM import expectations and validate complete implementation
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 05:35:17 +00:00
c1ae84ce61 Implement basic WASM string constant support
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
2025-08-14 05:31:36 +00:00