Key updates:
- Document MIR 26→15 instruction reduction plan (transitioning status)
- Add Core-15 target instruction set in INSTRUCTION_SET.md
- Save AI conference analyses validating Box Theory and 15-instruction design
- Create MIR annotation system proposal for optimization hints
- Update SKIP_PHASE_10_DECISION.md with LLVM direct migration rationale
Technical insights:
- RefNew/RefGet/RefSet can be eliminated through Box unification
- GC/sync/async all achievable with 15 core instructions
- BoxCall lowering can automatically insert GC barriers
- 2-3x performance improvement expected with LLVM
- Build time reduction 50%, binary size reduction 40%
Status: Design complete, implementation pending
主な修正:
- MirInstruction::PluginInvokeのパターンマッチ追加
- ChatGPT5による変更に対応
- 58個の警告(未使用import)は意図的(ビルトインBox削除中)
ビルド成功!Everything is Plugin革命進行中 🚀🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- emit_type_check/emit_cast -> TypeOp(Check/Cast)
- emit_weak_new/emit_weak_load -> WeakRef(New/Load)
- emit_barrier_read/write -> Barrier(Read/Write)
This removes cfg gating in builder for unified ops; Optimizer still has
legacy normalization as a safety net. All tests green (177).
- Add MIR26 doc≡code sync test (tests/mir_instruction_set_sync.rs)
- Quiet snapshots; filter plugin/net logs; golden all green
- Delegate VM phi selection to LoopExecutor (borrow-safe)
- ResultBox migration: remove legacy box_trait::ResultBox paths
- VM BoxRef arithmetic fallbacks via toString().parse::<i64>()
- Bridge BoxCall(InstanceBox) to Class.method/arity in VM
- Fix Effects purity (READ -> readonly, not pure)
- Mark Catch as CONTROL to prevent DCE; Try/Catch test green
- Add env-gated debug logs (effects, verifier, mir-printer, trycatch, ref, bin)
- Update CURRENT_TASK with progress and next steps
- Add early TypeOp lowering in build_expression for method-style is()/as()
- Add early TypeOp lowering in build_expression for function-style isType()/asType()
- Add special handling in build_print_statement for print(isType/asType(...))
- Fix MIR optimizer borrow checker issues and remove obsolete BoxFieldLoad
- Extract string literal helper supports both direct literals and StringBox wrappers
- Note: isType call generation still has issues (undefined SSA value in print)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed me ValueId inconsistency in static box methods
- Previously, each me reference generated a new const __me__ ValueId
- Now caches the first me ValueId in variable_map for reuse
- This ensures RefSet and RefGet operate on the same object
- ArrayBox get/set/push now working correctly in VM mode
- Test results: 1, 42, 3 (as expected)
🔧 Technical Details:
- build_me_expression() now stores fallback ValueId in variable_map
- Subsequent me references reuse the same ValueId
- VM BoxCall debug logs confirm ArrayBox methods dispatch correctly
Co-Authored-By: ChatGPT5
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix MIR builder to correctly return phi values in if-else statements
- Add extract_assigned_var helper to handle Program blocks
- Update variable mapping after phi node creation
- Fixes 'Value %14 not set' error in e2e_vm_http_client_error_result
- Fix HTTP plugin error handling for connection failures
- Return error string instead of handle on tcp_ok=false
- Enable proper ResultBox(Err) creation for failed connections
- Now r.isOk() correctly returns false for connection errors
- Add VM fallback for toString() on any Box type
- Ensures error messages can be displayed even without specific implementation
- All e2e_vm_http_client_error_result tests now pass
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Eliminate static_mut_refs warnings by using once_cell::sync::Lazy
- Make FileMode enum public to fix private_interfaces warning
- Reduce warnings from 6 to 3
- Prepare for Rust 2024 edition compatibility
- Fix NyashParser import path in vm.rs tests
- Improve BoxCall fallback logic for plugin/builtin methods
- Add proper function existence checks before lowering to Call
This ensures plugin Box methods correctly fall back to BoxCall
when the corresponding user-defined function doesn't exist.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed infinite loop issue in VM by addressing phi node caching problem.
The phi node was caching the initial value and returning it for all
subsequent iterations, preventing loop variable updates.
Changes:
- Created vm_phi.rs module to separate loop execution logic (similar to mir/loop_builder.rs)
- Disabled phi node caching to ensure correct value selection each iteration
- Added LoopExecutor to track block transitions and handle phi nodes properly
- Fixed VM to correctly track previous_block for phi input selection
The VM now correctly executes SSA-form loops with proper variable updates:
- Loop counter increments correctly
- Phi nodes select the right input based on control flow
- Test case now completes successfully (i=1,2,3,4)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added Store instruction generation in build_assignment()
- This partially addresses the VM infinite loop issue
- However, the loop still uses old values (%0) instead of updated values
- Need to implement proper SSA phi nodes for loop variables
The root cause: MIR generation doesn't properly track variable updates
in loops. Current SSA implementation lacks phi nodes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix MIR builder to handle built-in Box types (IntegerBox, StringBox, etc.) specially
- Generate MIR with actual constant values instead of ref_new instructions
- Enhance LLVM mock compiler with MIR interpreter foundation
- Add value storage HashMap for future MIR instruction interpretation
This enables proper MIR generation where 'new IntegerBox(42)' becomes '%0 = const 42'
instead of '%0 = ref_new "IntegerBox"'. This is essential for future LLVM code generation.
Example MIR improvement:
Before:
%1 = const "IntegerBox"
%0 = ref_new %1
After:
%0 = const 42
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Phase 5.3 of MIR 35→26 reduction project:
- Replace RefNew with NewBox in MIR builder
- Remove unnecessary Const generation for box types
- Process arguments properly for NewBox instruction
- StringBox special handling maintained with NewBox
Frontend now generates only 26-instruction set compliant MIR.
Build successful with expected deprecation warnings.
Phase 4-3c-3 Complete: WASM host functions now correctly output string content
## Changes:
- Fixed MIR builder to handle StringBox with string literal arguments
- Special case for to generate proper string constants
- Removed debug output after successful verification
- WASM now correctly outputs "Hello MIR!" instead of "StringBox"
## Test Results:
- MIR generation: ✅ Generates correctly
- WASM compilation: ✅ String data correctly placed at offset 4096
- WASM execution: ✅ Outputs "Hello MIR\!" as expected
## Technical Details:
- Modified build_new_expression() to detect StringBox with literal arguments
- Generates Const instruction with actual string content
- Host function reads StringBox memory layout correctly
This completes the WASM string output functionality for Phase 4.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>