feat(joinir): Phase 202-C Pattern 4 uses JoinValueSpace, unify dual counters
# Summary Pattern 4 (Continue) now uses JoinValueSpace for unified ValueId allocation, eliminating the dual counter system that was prone to ValueId collisions. # Changes - loop_with_continue_minimal.rs: Replace value_counter + join_value_counter with JoinValueSpace - Param region (100+): ConditionEnv variables - Local region (1000+): All intermediate values (Const, BinOp, etc.) - Eliminated manual counter management (value_counter = 0u32, join_value_counter++) - pattern4_with_continue.rs: Create JoinValueSpace and pass to lowerer - Added Phase 202-C documentation explaining the unification # Test Results ✅ cargo test --release --lib continue: 11 passed (3 ignored) ✅ E2E apps/tests/loop_continue_pattern4.hako → 25 (single carrier) ✅ E2E apps/tests/loop_continue_multi_carrier.hako → 100, 10 (multi carrier) # Benefits - No ValueId collision risk (disjoint regions) - Consistent with Pattern 2 architecture (Phase 201) - Simplified allocation logic (no manual counter tracking) - Better maintainability (single source of truth) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -292,8 +292,19 @@ impl MirBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 169: Call Pattern 4 lowerer with condition AST
|
||||
let (join_module, exit_meta) = match lower_loop_with_continue_minimal(scope, condition, self, &carrier_info, &carrier_updates) {
|
||||
// Phase 202-C: Create JoinValueSpace for unified ValueId allocation
|
||||
use crate::mir::join_ir::lowering::join_value_space::JoinValueSpace;
|
||||
let mut join_value_space = JoinValueSpace::new();
|
||||
|
||||
// Phase 169 / Phase 202-C: Call Pattern 4 lowerer with JoinValueSpace
|
||||
let (join_module, exit_meta) = match lower_loop_with_continue_minimal(
|
||||
scope,
|
||||
condition,
|
||||
self,
|
||||
&carrier_info,
|
||||
&carrier_updates,
|
||||
&mut join_value_space,
|
||||
) {
|
||||
Ok(result) => result,
|
||||
Err(e) => {
|
||||
// Phase 195: Use unified trace
|
||||
|
||||
Reference in New Issue
Block a user