feat(llvm): Phase 132-P2 - Dict ctx removal (FunctionLowerContext SSOT completion)
Completed SSOT unification for FunctionLowerContext by removing the manual dict ctx creation and assignment in function_lower.py. Changes: - Removed builder.ctx = dict(...) creation (18 lines, lines 313-330) - Removed builder.resolver.ctx assignment (no longer needed) - Confirmed instruction_lower.py uses context=owner.context throughout - Added phase132_multifunc_isolation_min.hako test for multi-function isolation - Extended phase132_exit_phi_parity.sh with Case C (Rust VM context test) Testing: - Phase 132 smoke test: All 3 cases PASS - Phase 87 LLVM exe test: PASS (Result: 42) - STRICT mode: PASS - No regressions: Behavior identical before/after (RC:6 maintained) Impact: - Reduced manual context management complexity - FunctionLowerContext now sole source of truth (SSOT) - Per-function state properly isolated, no cross-function collisions - Cleaner architecture: context parameter passed explicitly vs manual dict 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
29
apps/tests/phase132_multifunc_isolation_min.hako
Normal file
29
apps/tests/phase132_multifunc_isolation_min.hako
Normal file
@ -0,0 +1,29 @@
|
||||
// Phase 132-P2: Multi-function context isolation test
|
||||
// Tests that FunctionLowerContext properly isolates per-function state
|
||||
//
|
||||
// This creates two separate methods with independent loops to verify
|
||||
// that each function's context is cleaned up between calls.
|
||||
|
||||
static box Main {
|
||||
helper1(n) {
|
||||
local i = 0
|
||||
loop(i < n) {
|
||||
i = i + 1
|
||||
}
|
||||
return i
|
||||
}
|
||||
|
||||
helper2(n) {
|
||||
local j = 0
|
||||
loop(j < n) {
|
||||
j = j + 1
|
||||
}
|
||||
return j
|
||||
}
|
||||
|
||||
main() {
|
||||
local a = helper1(2)
|
||||
local b = helper2(3)
|
||||
return a + b
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user