Commit Graph

382 Commits

Author SHA1 Message Date
b3b01def24 phase29ai(p13): memoize planner call in single_planner 2025-12-29 10:27:00 +09:00
253b4225e8 phase29ai(p12): expose loopbodylocal facts via LoopFacts 2025-12-29 10:20:15 +09:00
678c2c1d14 phase29ai(p12): add loopbodylocal facts ssot 2025-12-29 10:07:55 +09:00
b78564c02d phase29ai: remove unused facts re-exports 2025-12-29 10:01:59 +09:00
0cf6749b4a phase29ai(p11): planner-first pattern2 break subset 2025-12-29 09:55:00 +09:00
4d26133d6a phase29ai(p10): move pattern2 extractor into plan layer 2025-12-29 09:44:04 +09:00
9abc726394 phase29ai(p9): planner-first pattern7 split-scan subset 2025-12-29 09:17:53 +09:00
82b0a87599 phase29ai(p8): try planner before legacy pattern6 2025-12-29 08:55:17 +09:00
c7697edde1 phase29ai(p7): planner returns DomainPlan (no hardcoded names) 2025-12-29 08:39:33 +09:00
2abcd8e32b phase29ai(p6): move pattern6/7 extractors into plan layer 2025-12-29 08:18:09 +09:00
5ba68da9a0 phase29ai(p5): route JoinIR plan extraction via single_planner 2025-12-29 08:04:00 +09:00
a17a7d7852 phase29ai(p4): first LoopFacts + scan_with_init candidate 2025-12-29 07:40:57 +09:00
3fb5c1a544 phase29ai(p3): typed Freeze + candidate-set planner boundary 2025-12-29 07:26:08 +09:00
c9456646c6 phase29ai(p0): add facts->planner skeleton 2025-12-29 06:59:50 +09:00
62efdb631f phase29ag(p1): remap via boundary.join_inputs 2025-12-29 06:28:43 +09:00
873c535d4f phase29ag(p0): use BoundaryCarrierLayout in coordinator remap 2025-12-29 06:14:58 +09:00
7d2967cfbf phase29af(p4): layout consistency fail-fast 2025-12-29 05:59:01 +09:00
bd4937d89d phase29af(p2+p3): regression entrypoint + carrier layout ssot 2025-12-29 05:44:59 +09:00
9bc9454726 phase29af(p1): add boundary hygiene contract checks 2025-12-29 05:27:14 +09:00
19f2c6b7f6 phase29af(p0): pattern2 boundary hygiene ssot 2025-12-29 05:12:15 +09:00
cf95afbd83 fix(joinir/merge): stabilize Pattern2 entry remap 2025-12-29 03:58:45 +09:00
11adec0abd fix(joinir/merge): prevent header PHI init clobber on latch preds 2025-12-29 02:36:15 +09:00
dd8c2709bd fix(joinir): stabilize phase1883 latch/entry preds 2025-12-28 23:39:51 +09:00
1e1679f361 phase29ac(p1): normalize pattern6 reverse scan and flip smoke to PASS 2025-12-28 16:54:01 +09:00
209b04d808 docs(phase29ab): closeout P1-P9 2025-12-28 16:36:15 +09:00
b52788b3f6 phase29ab(p6): freeze pattern6 scan-with-init near-miss with fixture+smoke 2025-12-28 15:38:19 +09:00
bea2a8d9bb phase29ab(p5): freeze pattern7 split-scan near-miss with fixture+smoke 2025-12-28 14:32:19 +09:00
10e6a15552 refactor: unify string helpers and pattern2 derived slot 2025-12-28 13:22:02 +09:00
84e1cd7c7b phase29ab(p3): fix PromoteDecision contract and add negative smokes 2025-12-28 10:57:55 +09:00
280a5a8187 docs+api: finalize phase29ab P3 contract and update examples 2025-12-28 10:57:48 +09:00
bf9c5105c3 phase29ab(p2): add seg trim fixture+smoke and docs 2025-12-28 09:03:56 +09:00
3bd0c817be phase29ab(p1): pattern2 carrier binding policy + loopbodylocal fixture 2025-12-28 07:19:03 +09:00
ca91be349d Refactor JoinIR lowerers and boundary 2025-12-28 03:52:52 +09:00
0269fc2ed4 Reduce build warnings 2025-12-28 01:34:46 +09:00
7ab042ca91 refactor: split large modules into submodules 2025-12-27 21:43:37 +09:00
f654dd316d Reduce unused warnings in tests and helpers 2025-12-27 17:49:42 +09:00
0d6229d5a2 Stabilize joinir tests and env guards 2025-12-27 17:41:30 +09:00
d9a1513991 docs(joinir): Phase 287 P8 - Add rewriter README/guard 2025-12-27 13:56:44 +09:00
5e7434c6d4 refactor(joinir): Phase 287 P7 - Remove unused rewriter box scaffolding 2025-12-27 13:37:57 +09:00
f225e27007 refactor(joinir): Phase 287 P6 - Remove scan stage (2-stage pipeline) 2025-12-27 13:25:15 +09:00
ce2b4b97e5 refactor(joinir): Tighten plan stage helper visibility 2025-12-27 13:18:54 +09:00
8774bf2fde refactor(joinir): Phase 287 P5 - Stages facade re-export 2025-12-27 13:14:45 +09:00
3c52ba954e refactor(joinir): Phase 287 P4 - Modularize plan stage (facade) 2025-12-27 12:48:33 +09:00
3224d83a7b refactor(joinir): Phase 287 P3 - Split instruction_rewriter into stages 2025-12-27 12:17:34 +09:00
fe895e8838 refactor(joinir): Phase 287 P2 - Modularize contract_checks (facade pattern)
- contract_checks.rs (846行) を facade 化
- 6モジュールへ分割(1 module = 1 contract):
  - terminator_targets.rs (208行) - Branch/Jump検証
  - exit_bindings.rs (35行) - exit_bindings ↔ exit_phis
  - carrier_inputs.rs (145行) - carrier_inputs完全性
  - boundary_creation.rs (160行) - B1/C2不変条件
  - entry_params.rs (317行) - Entry param一貫性
  - mod.rs (30行) - Facade
- Total: 846 → 895行(+49行モジュール境界オーバーヘッド)
- 意味論不変: エラータグ/ヒント文すべて保存
- Fail-Fast遵守: silent fallback追加なし
- 検証: Build 0 errors / Pattern6 RC=9 / quick 154/154 PASS

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 11:05:40 +09:00
de1cd1fea0 refactor(joinir): Phase 287 P1 - Modularize ast_feature_extractor (facade pattern)
Extracted pattern recognizers from ast_feature_extractor.rs (1,148 lines) into
specialized modules under pattern_recognizers/ directory.

**Structure**:
- ast_feature_extractor.rs: Facade (135 lines, re-exports)
- pattern_recognizers/: 8 modules (1,126 lines total)
  - continue_break.rs: continue/break/return detection
  - infinite_loop.rs: loop(true) detection
  - if_else_phi.rs: if-else PHI pattern detection
  - carrier_count.rs: carrier variable counting
  - parse_number.rs: parse_number pattern (+ read_digits)
  - parse_string.rs: parse_string pattern (+ continue pattern)
  - skip_whitespace.rs: skip_whitespace pattern

**Contract**:
- Semantic invariance: All existing APIs preserved via re-exports
- No routing changes, no detection spec changes
- Public API unchanged (facade pattern)

**Verification**:
- Build: 0 errors, 0 warnings
- Pattern6: RC:9 (maintained)
- Smoke tests: 154/154 PASS

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 10:42:17 +09:00
e51777b448 refactor(joinir): Phase 287 P0.6 - Final mod.rs cleanup
Add comprehensive modularization summary comment documenting the
complete Phase 287 P0 refactoring journey.

Changes:
- MOD: merge/mod.rs: Add modularization summary (19 lines)
- Final size: 1,053 lines (was 1,555 in Phase 286)
- Total reduction: -502 lines (-32%)

Modularization Summary:
- P0.1: debug_assertions.rs (verification functions)
- P0.2: value_remapper.rs (ValueId remapping helper)
- P0.3: entry_selector.rs (SSOT entry function selection)
- P0.4: header_phi_prebuild.rs (PHI pre-build orchestration)
- P0.5: boundary_logging.rs (consolidated logging)

Remaining in mod.rs (orchestrator only):
- Public API: merge_joinir_mir_blocks()
- Phase 1-6 pipeline coordination
- Phase 3.5: Parameter → PHI dst remapping (complex, kept inline)
- Phase 6: Boundary reconnection and expr_result resolution

SSOT Principles Enforced:
 Entry selection: boundary.loop_header_func_name > continuation_func_ids
 No string-based heuristics ("k_exit" prefix matching eliminated)
 Logging: debug/verbose only (no constant logs in quick profile)
 Reserved ValueIds: PHI dsts protected from conflicts

Verification:
- Build: 0 errors
- Pattern6: RC:9 
- Smoke: 154/154 PASS (verified via quick profile)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 10:27:44 +09:00
91daec104f refactor(joinir): Phase 287 P0.5 - Extract boundary_logging
Extract boundary logging functions to boundary_logging.rs (112 lines).
Consolidates scattered trace.stderr_if() calls into focused functions.

SSOT Principle:
- Only use trace.stderr_if(..., debug/verbose) - NO constant logs
- Prevents noise in quick smoke tests
- Consistent logging format across boundary operations

Changes:
- NEW: merge/boundary_logging.rs (112 lines)
- MOD: merge/mod.rs: 1,027 → ~973 lines (-54 lines)
- Functions:
  - log_boundary_info() - Comprehensive boundary logging (verbose mode)
  - log_merge_complete() - Merge completion summary (debug mode)

Logging Consolidated:
- Boundary join_inputs / host_inputs
- Exit bindings (carrier mappings)
- Condition bindings (if any)
- Carrier info (if present)
- Merge completion summary

Verification:
- Build: 0 errors
- Pattern6: RC:9 
- Smoke: 154/154 PASS (verified via quick profile)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 10:25:21 +09:00
5ee3b62042 refactor(joinir): Phase 287 P0.4 - Extract header_phi_prebuild
Extract header PHI pre-build orchestration to header_phi_prebuild.rs
(~220 lines). This is orchestration logic that coordinates entry
selection, block remapping, carrier extraction, and PHI building.

Changes:
- NEW: merge/header_phi_prebuild.rs (220 lines)
- MOD: merge/mod.rs: 1,233 → ~1,027 lines (-206 lines)
- Function: prebuild_header_phis() - orchestrates PHI pre-build
- Helper: get_default_entry_block() - fallback for no boundary

Orchestration Responsibilities:
- Entry function selection (via entry_selector SSOT)
- Block remapping (loop_header vs merge_entry)
- Carrier extraction from boundary (with exit_bindings filtering)
- LoopHeaderPhiBuilder invocation
- Reserved ValueId collection (PHI dsts + function params)

Verification:
- Build: 0 errors
- Pattern6: RC:9 
- Smoke: 154/154 PASS (verified via quick profile)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 10:21:28 +09:00
fb2ac627da refactor(joinir): Phase 287 P0.3 - Extract entry_selector (SSOT)
Extract entry function selection logic to entry_selector.rs (93 lines).
This enforces SSOT principles for loop header and merge entry selection.

SSOT Strategy:
1. Prefer boundary.loop_header_func_name (explicit specification)
2. Fallback: Exclude MAIN and continuation_func_ids (SSOT, not string matching)
3. Never use "k_exit" prefix heuristics

Changes:
- NEW: merge/entry_selector.rs (43 lines net after extraction)
- MOD: merge/mod.rs: 1,269 → ~1,233 lines (-36 lines)
- Functions:
  - select_loop_step_func_name() (loop header SSOT)
  - select_merge_entry_func() (Pattern 3 if-sum support)
  - get_function() (helper with error handling)

Verification:
- Build: 0 errors
- Pattern6: RC:9 
- Smoke: 154/154 PASS (verified via quick profile)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 10:17:49 +09:00