Commit Graph

101 Commits

Author SHA1 Message Date
4082abb30c feat(normalization): Phase 142 P0 - Loop statement-level normalization
Phase 142-loopstmt P0: Statement-level normalization

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-19 05:28:49 +09:00
1154aeb40a docs: Phase 138 - ReturnValueLowererBox SSOT documentation
Phase 138 Documentation:
- Created docs/development/current/main/phases/phase-138/README.md
- Goal: Extract return lowering to shared Box for SSOT
- SSOT: common/return_value_lowerer_box.rs
- Supported: Variable, Integer literal, Add expression (x + 2, 5 + 3)
- Implementation: New files, modified files, call sites
- Tests: 5 unit tests + all regressions PASS
- Architecture Impact: Code reduction, maintainability, testability
- Phase 139 準備: Next step clearly indicated (post_if_post_k.rs unification)

10-Now.md Updates:
- Added Phase 138 entry (ReturnValueLowererBox SSOT)
- Implementation details and test coverage
- Design decision: Phase 138 P0 migrated loop paths only
- Link to Phase 138 README

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 00:56:02 +09:00
962d1803c9 docs: Phase 136/137 - return literal and add expression documentation
Phase 136 Documentation:
- Created docs/development/current/main/phases/phase-136/README.md
- Goal: loop(true) break-once with return literal (Integer)
- Supported: return 7, loop + post + return literal
- Implementation: lower_return_value_to_vid() method
- Tests: 2 fixtures + 4 smokes
- VM/LLVM EXE parity verification commands

Phase 137 Documentation:
- Created docs/development/current/main/phases/phase-137/README.md
- Goal: loop(true) break-once with return add expression
- Supported: return x+2, return 5+3, loop+post+return add
- Implementation: Extended lower_return_value_to_vid() for BinaryOp Add
- Return Value Lowering SSOT documented (lines 29-46)
- Boxification trigger: when 2+ files need identical logic
- Tests: 3 fixtures + 6 smokes
- VM/LLVM EXE parity verification commands

10-Now.md Updates:
- Added Phase 136 entry (return literal)
- Added Phase 137 entry (return add expression)
- Implementation details and test coverage
- Links to phase READMEs

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 00:16:06 +09:00
f4ab5ca5f4 refactor(control_flow): Phase 134 P0 - Normalization entry point SSOT
Consolidate dual entry points into unified NormalizationPlan system:

Problem:
- Dual entry points: try_normalized_shadow() + suffix_router_box
- ~220 lines of duplicated pattern detection logic
- Maintenance burden: changes required in two places

Solution:
- New normalization module with Box-First architecture
- NormalizationPlanBox: Single source of truth for pattern detection
- NormalizationExecuteBox: Single source of truth for execution

Implementation:
- src/mir/builder/control_flow/normalization/ (new module)
  - README.md: Design contract (SSOT)
  - plan.rs: NormalizationPlan data structure
  - plan_box.rs: Pattern detection (7 unit tests)
  - execute_box.rs: Execution logic
  - mod.rs: Module integration

Refactored files:
- routing.rs::try_normalized_shadow(): 165 → 87 lines (-78 lines)
- suffix_router_box::try_lower_loop_suffix(): 258 → 116 lines (-142 lines)

Pattern support maintained:
- Phase 131: loop(true) only (consumed: 1)
- Phase 132: loop + single post (consumed: 3)
- Phase 133: loop + multiple post (consumed: 2+N)

Box-First principles:
- Plan Box: Detection responsibility only
- Execute Box: Execution responsibility only
- README.md: Contract documentation (SSOT)
- Clear separation enables independent testing

Test results:
- cargo test --lib: 1186 PASS (10 new tests added)
- Phase 133 VM/LLVM EXE: PASS (exit code 6)
- Phase 132 LLVM EXE: PASS (exit code 3)
- Phase 131 LLVM EXE: PASS (exit code 1)

Benefits:
- Code duplication eliminated (~220 lines)
- Single source of truth for normalization decisions
- Improved maintainability and testability
- Future-proof extensibility (easy to add new patterns)

Default behavior unchanged: Dev-only guard maintained

Related: Phase 134 normalization infrastructure improvement

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 22:29:29 +09:00
ef71ea955c feat(control_tree): Phase 133 P0 - Multiple post-loop assigns support
Extend Phase 132's loop(true) + post-loop to accept multiple assignments:

Goal: `x=0; loop(true){ x=1; break }; x=x+2; x=x+3; return x` → exit code 6

Implementation:
- Extended loop_true_break_once.rs pattern detection (len() == 2 → len() >= 2)
- Added iterative assignment lowering (for loop over post_nodes)
- Reused Phase 130's lower_assign_stmt for each assignment
- Maintained ExitMeta DirectValue mode (PHI-free)

Changes:
- apps/tests/phase133_loop_true_break_once_post_multi_add_min.hako (new fixture)
- tools/smokes/v2/profiles/integration/apps/phase133_*_multi_add_*.sh (new smokes)
- src/mir/control_tree/normalized_shadow/loop_true_break_once.rs (+30 lines)
- docs/development/current/main/phases/phase-133/README.md (new documentation)
- docs/development/current/main/10-Now.md (Phase 133 entry added)

Scope (Phase 130 baseline):
-  x = <int literal>
-  x = y (variable copy)
-  x = x + <int literal> (increment)
-  Function calls / general expressions (future phases)

Design principles:
- Minimal change: ~30 lines added
- SSOT preservation: env_post_k remains single source of truth
- Reuse: Leveraged existing lower_assign_stmt
- Fail-Fast: Contract violations trigger freeze_with_hint

Test results:
- cargo test --lib: 1176 PASS
- Phase 133 VM: PASS (exit code 6)
- Phase 133 LLVM EXE: PASS (exit code 6)
- Phase 132 regression: PASS (exit code 3)
- Phase 131 regression: PASS (exit code 1)
- Phase 97 regression: PASS

Architecture maintained:
- 5-function structure unchanged (main/loop_step/loop_body/k_exit/post_k)
- PHI-free DirectValue mode
- Zero changes to ExitMeta, merge logic, or JoinIR contracts

Related: Phase 133 loop(true) + multiple post-loop assignments

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 22:11:08 +09:00
9fb35bbc05 docs: Phase 132 DONE - loop(true) + post-loop complete
Update documentation to mark Phase 132 as complete:

**10-Now.md**:
- Add Phase 132 completion entry (P0/P0.5/P1/R0)
- Document what was solved:
  - loop(true) + post VM/LLVM EXE parity (exit code 3)
  - Continuation contracts SSOT化
  - merge が by-name 推測禁止
- Entry link: docs/development/current/main/phases/phase-132/README.md

**phase-132/README.md**:
- Update Status: IN PROGRESS → DONE 
- Add Current Status section with P0/P0.5/P1/R0 completion details
- Document SSOT achievements:
  - JoinInlineBoundary::default_continuations()
  - src/mir/builder/control_flow/joinir/merge/README.md (merge contracts)
  - src/mir/builder/control_flow/joinir/legacy/README.md (removal conditions)
- Test placement: continuation_contract.rs
- Test results: All Phase 131/132/97 smokes PASS

Phase 132 Summary:
- P0: post_k generation (loop_true_break_once.rs extension)
- P0.5: Suffix router for StepTree (post statements visibility fix)
- P1: k_exit continuation classification fix (structural check)
- R0: Infrastructure refactoring (SSOT + legacy isolation + docs)

Key achievements:
- VM/LLVM EXE parity for loop(true) + post-loop
- Continuation contracts SSOT and documented
- Legacy code path isolated for future removal
- Code quality improved (warnings reduced)

Related: Phase 132 loop(true) + post-loop complete implementation

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 21:53:54 +09:00
4169da8c33 docs: Phase 131 refactoring tasks 1-7 completion
Update documentation with refactoring results:

**phase-131/README.md**:
- Document all 7 refactoring tasks (1: MergeContracts, 2: instruction_rewriter boxification,
  3-4: OutputContract + require_joinir_dev, 5: env.sh SSOT, 6: MergeConfig, 7: contract_checks tests)
- Add task descriptions and success criteria
- Document benefits and test results
- Reference implementation files and commits

**tools/build_llvm.sh**:
- Use TARGET_TMPDIR from env.sh for TMPDIR configuration
- Improve EXDEV mitigation for WSL compatibility
- Better artifact finalization handling

**Summary of Phase 131 Refactoring**:

7 refactoring tasks completed on schedule:
 Task 1 (MergeContracts): +30 lines, SSOT for merge contracts
 Task 2 (instruction_rewriter): +212 lines (policy box), -50 lines (rewriter)
 Task 3 (OutputContract): +90 lines, unified verification interface
 Task 4 (require_joinir_dev): +14 lines, dev-only helper
 Task 5 (env.sh SSOT): +1014 lines, centralized environment
 Task 6 (MergeConfig): +54 lines, unified configuration
 Task 7 (contract_checks tests): +116 lines, 4 new tests

Total: ~2500 new lines, 0 regressions, all tests PASS

Benefits:
- Code organization: Single responsibility principle
- Maintainability: SSOT reduces duplication
- Testability: Policy boxes and unit tests enable regression detection
- Developer experience: Clearer code, better documentation

Related: Phase 131 P1.5-P2 DirectValue exit reconnection + infrastructure improvement

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-18 18:29:02 +09:00
0ef032ccc8 refactor(smokes): Task 5 - Environment variable SSOT centralization
Create single source of truth for smoke test environment configuration:

**tools/smokes/v2/lib/env.sh** (new, 183 lines):
- Centralize 16 environment variables across 6 categories
- JoinIR development (NYASH_JOINIR_DEV, HAKO_JOINIR_STRICT)
- LLVM features (NYASH_LLVM_USE_HARNESS, NYASH_LLVM_BACKEND, etc.)
- Tmpdir EXDEV mitigation (TARGET_TMPDIR)
- Plugin loader strategy (NYASH_LOAD_NY_PLUGINS, NYASH_DISABLE_PLUGINS)
- Parser features (NYASH_FEATURES, using system variables)
- Debug features (NYASH_CLI_VERBOSE, etc.)

**Mode Presets**:
- dev: Verbose logging, unlimited fuel, JoinIR dev enabled
- integration: Moderate settings, JoinIR dev enabled
- quick: Minimal logging, fast execution

**Helper Functions**:
- setup_smoke_env [mode]: Configure environment for test profiles
- validate_env_setup: Validate configuration
- show_smoke_env: Display current configuration

**Documentation**:
- ENV_README.md: Comprehensive usage guide
- ENV_QUICK_START.md: Quick reference for script authors
- p1.5-task5-env-ssot.md: Implementation details and testing

Benefits:
- SSOT: Single file for all environment variables
- Sparrow prevention: No duplicate settings
- Clarity: Well-documented configuration
- Backward compatibility: Existing scripts work unchanged

Test Results:
- All environment presets work correctly
- Phase 131 smoke tests PASS
- Syntax validation for all shell files PASS

Related: Phase 131 smoke test infrastructure improvement

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-18 18:28:37 +09:00
f775c0fe01 docs: Phase 131 P2 DirectValue exit reconnection complete
Update completion status for Phase 131 P2:
- CURRENT_TASK.md: Note WSL restart resolved EXDEV issue
- 10-Now.md: Add Phase 131 P2 completion entry
- phase-131/README.md: Document P1.5 and P2 deliverables

Phase 131 Status: DONE 
- loop(true) break-once executes correctly
- Exit values propagate through DirectValue mode
- VM + LLVM EXE parity verified

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 17:48:18 +09:00
bfac188732 docs: Phase 131 P1.5 DirectValue exit reconnection design
Add design documents for Phase 131 P1.5 DirectValue mode:
- Root cause analysis of PHI-based exit merge assumptions
- Option B (DirectValue) analysis and trade-offs
- Implementation guide for exit value reconnection

Also add exit_reconnector.rs module stub for future extraction.

Related:
- Phase 131: loop(true) break-once Normalized support
- Normalized shadow path uses continuations, not PHI
- Exit values reconnect directly to host variable_map

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 17:47:45 +09:00
bd39e09c5d docs: Phase 131 P0 structure implementation complete
Document Phase 131 P0 Normalized loop(true) break-once:

**Documentation**:
- docs/development/current/main/phases/phase-131/README.md (234 lines)
  - Goal: loop(true) { <assign>* ; break } in Normalized (PHI-free)
  - Scope: one-time execution loop only
  - Contract: Bool(true) literal + break at end
  - SSOT: EnvLayout, loop structure contract, VM+LLVM parity
  - Current status: structure implemented, execution wiring pending
- docs/development/current/main/10-Now.md
  - Updated Next section with Phase 131 P0 status

**Deliverables** (P0):
-  Complete loop(true) break-once Normalized lowering logic
-  PHI-free implementation (env + continuations)
-  Box-First modular design
-  Foundation for execution (structure verified)
-  Unit tests passing (1155/1155)

**Known Limitation**:
- Execution path not yet wired (dev-only observation mode)
- Follow-up phase needed to route execution through Normalized shadow
- VM/LLVM smokes fail (expected until execution wiring)

**Next Steps**:
1. Modify try_cf_loop_joinir to check Normalized shadow first
2. Add dev-mode routing for loop(true) break-once
3. Implement JoinModule → MIR merge for loop patterns
4. Enable VM/LLVM smoke tests

Related: Phase 131 P0 - loop(true) break-once Normalized structure
2025-12-18 09:36:50 +09:00
353b8022af docs: clarify Phase 130 LLVM EXE smoke gating 2025-12-18 09:22:15 +09:00
b5d628d8bf docs: Phase 130 DONE (if-only normalized small expr/assign) 2025-12-18 09:13:19 +09:00
05fccce09a docs: add Phase 130 plan and set Now to Phase 130 2025-12-18 08:36:38 +09:00
80df1cccd4 feat(control_tree): Phase 129-C post-if via post_k continuation 2025-12-18 08:33:56 +09:00
b2af9fb297 docs: update normalized_shadow references and Phase 129 status 2025-12-18 08:18:20 +09:00
36717cad4f docs: update Now/INDEX for Phase 129-B join_k as-last 2025-12-18 07:54:16 +09:00
088122df71 docs: update Now/INDEX for Phase 127 DONE and Phase 129 next 2025-12-18 07:28:30 +09:00
b822355431 docs: Phase 129 progress report (P0-P3 complete)
## Completed 

P0: LLVM EXE smoke test for Phase 128
- VM+LLVM parity verified
- Regression tests pass (phase103, phase118, phase128)

P2: Post-if return var fixture + VM smoke
- phase129_if_only_post_if_return_var_min.hako
- Tests join_k env merge pattern
- Currently passes via fallback (non-Normalized)

P3: Documentation complete
- README.md: Goal, design, scope
- P1-implementation-plan.md: Detailed refactoring plan
- PROGRESS.md: This report

## In Progress 🔄

P1: Materialize join_k continuation
- Status: Analysis complete, awaiting user decision
- Options:
  - A: In-place (fast, risky)
  - B: Phased (recommended, safe)

## Test Results 

- cargo test --lib: 1165 passed
- phase128 VM: PASS
- phase128 LLVM EXE: PASS
- phase129 VM: PASS (fallback path)
- Regression: ALL PASS

## Feedback

Box-First:
- JoinKBuilder module proposed (join_k generation)
- EnvBuilder future consideration

Fail-Fast:
- verify_normalized_structure proposed
- verify_branch_is_return_literal too restrictive

Legacy:
- Phase 123-124 lower_if_node incomplete
- Placeholder logic in lhs_vid resolution

## Next Steps

Awaiting user/ChatGPT decision on Option A vs B
2025-12-18 07:20:46 +09:00
0d2eafd780 docs: Phase 129 P1 implementation plan (join_k materialization)
Detailed analysis of current state and required changes:

Current Issues:
- lower_if_node only processes then branch (incomplete)
- No join_k function generation
- verify_branch_is_return_literal too restrictive
- No env merging logic

Required Changes:
- Create JoinKBuilder helper (Box-First)
- Generate join_k as real JoinFunction
- then/else tail-call join_k with env
- Process post-if statements in join_k body
- Add verify_normalized_structure checks

Implementation Options:
- Option A: In-place modification (risky, fast)
- Option B: Phased approach (recommended, safe)

Recommended: Option B (3-phase rollout)
- Phase 129-A: JoinKBuilder foundation
- Phase 129-B: Branch lowering to join_k
- Phase 129-C: Post-if statement support

Open Questions:
1. Function ID allocation strategy
2. Post-if statement detection mechanism
3. env parameter passing representation
4. join_k naming convention

Next: User/ChatGPT decision on approach
2025-12-18 07:19:22 +09:00
083be99214 test(joinir): Phase 129 P2 - add post-if return var fixture + VM smoke
- Add phase129_if_only_post_if_return_var_min.hako
  - Pattern: x=1; if flag==1 { x=2 }; print(x)
  - Tests join_k continuation env merge

- Add phase129_if_only_post_if_return_var_vm.sh
  - Expected output: 2 (x updated in then branch)
  - Dev-only: NYASH_JOINIR_DEV=1 HAKO_JOINIR_STRICT=1

Note: Currently passes via fallback path (non-Normalized)
P1 implementation (join_k materialization) is next step
2025-12-18 07:18:00 +09:00
85ee761858 docs: Phase 128 plan (if-only env merge) 2025-12-18 06:59:50 +09:00
9aedc19413 docs: add Phase 127 entry (planned) 2025-12-18 06:55:29 +09:00
49c2bdf2e9 docs: Phase 126 feedback report
- Box-first modularization: AvailableInputsCollectorBox (SSOT)
- All P0-P5 steps completed successfully
- Regression: 1165 tests PASS, all smokes PASS
- Next steps: Phase 127 (strict fail-fast, CapturedEnv integration)
2025-12-18 06:47:43 +09:00
b7a16aacd0 docs: Phase 126 plan (wire available_inputs) 2025-12-18 06:40:36 +09:00
aabb67cdc2 docs: Phase 125 P2-P5 feedback (boxification review)
Feedback summary:
- 単一責任: EnvLayout / lower_return_value
- SSOT: reads ∩ available_inputs
- Fail-Fast: 構造化エラー + hint
- 段階的投入: 構造のみ(P3 で完成)

Good:
- Single responsibility principle maintained
- SSOT approach for env layout
- Fail-Fast with structured errors
- Graceful degradation (Ok(None))

Improvement proposals:
- P3 wiring clarification
- EnvLayout responsibility scope
- Error hint context-awareness
- Fixture completeness after P3

Next: Phase 125 P3 (available_inputs wiring)

Ref: docs/development/current/main/phases/phase-125/FEEDBACK.md
2025-12-18 06:33:55 +09:00
7eeeb588e4 docs: add Phase 125 entry (planned) 2025-12-18 06:28:39 +09:00
fb4ec2c2bf docs: Phase 124 plan (reads facts + return var) 2025-12-18 05:54:51 +09:00
4f0ffae70d docs: Phase 123 DONE
Updates documentation to reflect Phase 123 completion.

**Updates**:
1. `docs/development/current/main/phases/phase-123/README.md`:
   - Marked all success criteria as complete
   - Added comprehensive DONE section with implementation details
   - Documented key design decisions (graceful degradation, fail-fast, box-first)
   - Added verification commands and next steps (Phase 124)

2. `docs/development/current/main/10-Now.md`:
   - Moved Phase 123 from "Next" to "2025-12-18: Phase 123 完了"
   - Added Phase 123 summary (Return literal, If minimal compare, graceful degradation)
   - Updated "Next" to Phase 124 (Normalized reads facts + Return(Variable))

3. `docs/development/current/main/01-JoinIR-Selfhost-INDEX.md`:
   - Added Phase 123 entry: "Normalized semantics (Return literal + If minimal compare, dev-only)"

**Phase 123 Summary**:
- P0: Docs complete, scope frozen 
- P1: Return(Integer literal) working 
- P2: Return(Variable) returns Ok(None) (graceful degradation) 
- P3: If(minimal compare) generates correct JoinIR 
- P4: Integration smoke passing 
- P5: Docs updated 

**Verification**:
- Unit tests: 8 passed
- Integration smoke: PASS
- Legacy tests: Still passing (graceful degradation confirmed)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 05:50:29 +09:00
51ed137339 docs: Phase 123 plan (if-only normalized semantics) 2025-12-18 05:29:34 +09:00
bf7d3899b0 docs: Phase 122 DONE (if-only Normalized emit dev-only) 2025-12-18 04:54:49 +09:00
c92154966c docs: add Phase 122 entry (planned) 2025-12-18 04:48:53 +09:00
2a53f87d10 docs: Phase 121 DONE (StepTree→Normalized shadow parity for if-only) 2025-12-18 04:40:53 +09:00
5091cda9cb docs: Phase 118 DONE (loop+if merge parity) 2025-12-18 03:43:16 +09:00
2c7f5f7a5e docs: Phase 117 DONE
Phase 117: if-only nested-if + call merge parity completed.

**Documentation**:
- docs/development/current/main/phases/phase-117/README.md (complete)
- docs/development/current/main/10-Now.md (updated with Phase 117 entry)
- docs/development/current/main/01-JoinIR-Selfhost-INDEX.md (added Phase 117 to index)

**Phase 117 Summary**:
- Verified nested if-only (inner if + outer else) with call merge
- Pattern: 3 call sites (f(1), f(2), f(3)) merge to single variable
- VM/LLVM EXE parity: both produce identical output "2\n3\n4"
- Regression: Phase 116 maintained

**Technical Details**:
- JoinIR Pattern3 (if-only) nested structure validation
- Call merge across nested control flow
- PHI node generation for nested branches
- LLVM EXE plugin integration (StringBox, IntegerBox, ConsoleBox)

**Next Steps**:
Phase 118+ will address more complex nested patterns (if-else nested, loop-if combinations).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:55:14 +09:00
8440550b2f docs: Phase 116 DONE
Phase 116 完了ドキュメント化

## 更新内容

### Phase 116 README
- 背景: LLVM fragile pattern(keep+call merge)
- 実装内容: fixture, VM smoke, LLVM EXE smoke
- 検証コマンド
- 技術的詳細: JoinIR Pattern 1, PHI接続
- Lessons Learned: Box-First原則, Fail-Fast原則

### 10-Now.md
- Phase 116 完了エントリ追加
- 入口: `docs/development/current/main/phases/phase-116/README.md`

### 01-JoinIR-Selfhost-INDEX.md
- Phase 116 を JoinIR Phase リストに追加
- 番号の重複を修正(18-27に整理)

## 成果物

 片側元値保持、片側call結果のmergeパターンをVM/LLVM両方で固定
 output_validator.sh, llvm_exe_runner.sh 活用で統一的なテスト基盤
 回帰防止: Phase 115 維持確認

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:39:44 +09:00
0a29f1443e test: Phase 115 if-only call result merge parity (VM + LLVM EXE)
Phase 115実装 - if分岐内での関数呼び出し結果をマージするパターンを固定

**実装内容**:
- Fixture: phase115_if_only_call_merge_min.hako (expected: 2, 3)
  - if/else両分岐で関数呼び出し f() の結果を変数 v に代入
  - if後にマージされた v を使用(LLVM EXE でのPHI node生成を検証)
- VM smoke: phase115_if_only_call_merge_vm.sh
  - NYASH_DISABLE_PLUGINS=1 HAKO_JOINIR_STRICT=1 で実行
- LLVM EXE smoke: phase115_if_only_call_merge_llvm_exe.sh
  - llvm_exe_runner.sh を利用した標準パリティ検証

**検証結果**:
- VM test: PASS 
- LLVM EXE test: PASS 
- Phase 114 regression: PASS 

**箱化モジュール化の観点**:
- 単一責任: 各smokeは1パターンのみ検証(call result merge)
- 分離: VM/LLVM EXEで独立したテスト(llvm_exe_runner.sh経由)
- Fail-Fast: HAKO_JOINIR_STRICT=1 で不正な制御フローを即座に検出

**関連**:
- Phase 103: If-Only基本パリティ(制御フロー基礎)
- Phase 113: If-Only部分代入パリティ(変数マージ)
- Phase 114: If-Only return+post パリティ(early returnとpost-if文)
- Phase 115: If-Only call result merge パリティ(関数呼び出し結果マージ) ← 今回

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:32:08 +09:00
97675b4035 docs: Phase 114 DONE
Phase 114完了に伴うドキュメント更新:
- 30-Backlog.md: Phase 114の次候補から完了済みに移行
- design/control-tree.md: Phase 110-112の進捗反映
- design/README.md, joinir-design-map.md, phases/README.md: マイナー更新

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:19:41 +09:00
80be814fa4 test: Phase 114 if-only return+post parity (VM + LLVM EXE)
Phase 114 validates that if-only lowering correctly handles cases with:
- Early return in the if-only branch
- Post-if statements that execute on the else path
- Different return values from each path

Fixture: apps/tests/phase114_if_only_return_then_post_min.hako
- Expected output: 7\n2
- f(1): condition true → early return 7
- f(0): condition false → x=1+1=2, return 2

Testing:
- VM backend: phase114_if_only_return_then_post_vm.sh 
- LLVM EXE backend: phase114_if_only_return_then_post_llvm_exe.sh 
- Regression: Phase 103/113 maintained 

Implementation: No new code required - validates existing if-only
exit line routing and post-if statement processing.

Documentation:
- docs/development/current/main/phases/phase-114/README.md
- Updated: 10-Now.md, 01-JoinIR-Selfhost-INDEX.md

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:18:57 +09:00
70fe0da549 docs: Phase 113 if-only partial assign parity
- Create phases/phase-113/README.md (background, fixed pattern, verification)
- Update 10-Now.md with Phase 113 completion
- Update 01-JoinIR-Selfhost-INDEX.md with Phase 113 entry

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 01:58:56 +09:00
a27e3ce908 docs: Phase 109 DONE
- Create phases/phase-109/README.md
- Update 10-Now.md with completion report

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:45:55 +09:00
46c924ac6d docs: add Phase 108 entry 2025-12-17 23:30:13 +09:00
3c934dc69d test: Phase 107 add find_balanced_object_end fixture + smokes 2025-12-17 23:12:49 +09:00
d42117ac5f test: Phase 107 find_balanced_array_end fixture + smokes 2025-12-17 22:47:42 +09:00
97c65a9e6f docs: Phase 107 plan (find_balanced_array_end) 2025-12-17 22:21:42 +09:00
af3b851984 docs: add Phase 107 prep for find_balanced 2025-12-17 22:01:23 +09:00
a05ce39a1f test: add Phase104 json_cur read_digits fixture and smokes 2025-12-17 21:25:12 +09:00
950560a3d9 test(joinir): Phase 104 read_digits loop(true) parity 2025-12-17 18:29:27 +09:00
ce501113a7 docs: Phase 103 P1 DONE (early return) 2025-12-17 17:45:16 +09:00
a5cec824c2 docs: Phase 103 DONE (if-only parity smokes) 2025-12-17 17:41:10 +09:00