853cb36800
refactor(joinir): L-1.3 - Rename minimal helpers to Case-A helpers
...
LoopToJoinLowerer API cleanup:
1. Rename methods to reflect their purpose as Case-A helpers:
- lower_minimal_skip_ws_case_a → lower_case_a_for_skip_ws
- lower_minimal_trim_case_a → lower_case_a_for_trim
- lower_minimal_append_defs_case_a → lower_case_a_for_append_defs
- lower_minimal_stage1_case_a → lower_case_a_for_stage1_resolver
2. Update comments to clarify these are thin wrappers over `lower()`
- "Case-A 汎用 lowerer の薄いラッパー"
- Actual logic is centralized in `lower` method
3. Update all 4 call sites:
- skip_ws.rs
- funcscanner_trim.rs
- funcscanner_append_defs.rs
- stage1_using_resolver.rs
Test results: standalone (2/2), JSON snapshot (6/6) PASS
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-26 10:28:03 +09:00
7a29ebd268
refactor(phase31): Connect 4 lowerers to LoopToJoinLowerer
...
Phase 31 Step 2 complete:
- skip_ws.rs: use LoopToJoinLowerer::lower_minimal_skip_ws_case_a()
- funcscanner_trim.rs: use LoopToJoinLowerer::lower_minimal_trim_case_a()
- funcscanner_append_defs.rs: use LoopToJoinLowerer::lower_minimal_append_defs_case_a()
- stage1_using_resolver.rs: use LoopToJoinLowerer::lower_minimal_stage1_case_a()
Eliminates direct generic_case_a calls, routing through unified box.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-26 02:36:43 +09:00
bf3893b2cc
feat(mir): Phase 30 F-3.0.7 LoopScopeShape Case-A minimal routing
...
Add func_name-based routing in LoopScopeShape::from_existing_boxes()
to prepare for MIR-based independent analysis:
- Add is_case_a_minimal_target() helper for 4 Case-A targets
- Add analyze_case_a() method (delegates to legacy, future MIR-based)
- Add from_existing_boxes_legacy() for backward compatibility
- Update from_existing_boxes() with func_name: Option<&str> parameter
- Update 4 production call sites with specific func_name
- Update 6 test cases with None for legacy path
- Update module documentation with routing logic diagram
Tests: 10/10 LoopScopeShape tests PASS, 6/7 JoinIR VM bridge tests PASS
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-26 00:36:41 +09:00
466e636af6
Span trace utilities and runner source hint
2025-11-24 14:17:02 +09:00
b0311e4bd2
feat(joinir): Phase 27.11.1 - skip_ws.rs Shared Builder Pattern 完了
...
## 成果
- **コード削減**: 444行 → 310行 (134行削除、30%削減)
- **重複コード根絶**: handwritten版とMIR版の重複JoinIR生成を統一
- **テスト結果**:
- Baseline (toggle OFF): 380 passed
- MIR-based (toggle ON): 385 passed ✅ (5件改善!)
## 実装内容
1. `lower_skip_ws_handwritten()` → `build_skip_ws_joinir()` にリネーム
- 共通JoinIRビルダー化
2. 新しい thin wrapper `lower_skip_ws_handwritten()` を作成
3. `lower_skip_ws_from_mir()` の重複コード (140行) を削除
- CFGチェック後に `build_skip_ws_joinir()` を呼び出す構造に変更
## 設計パターン
- **Shared Builder Pattern**: funcscanner_trim.rs と同じパターン適用
- **CFG Sanity Checks**: MIR解析は軽量パターンマッチのみ
- **Graceful Degradation**: CFGチェック失敗時は自動フォールバック
Phase 27.11シリーズ 100%完了!
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-24 01:59:48 +09:00
ff9ea58e59
refactor(joinir): Phase 27.10 - CFG sanity checks + dispatcher pattern 共通化
...
- common.rs 新規作成(162行):
- CFG sanity check helpers: ensure_entry_has_succs, has_const_int, has_const_string, has_string_method, has_binop
- Logging helper: log_fallback
- Dispatcher: dispatch_lowering
- skip_ws.rs: CFG checks (-25行) + dispatcher (-2行) = -27行削減
- funcscanner_trim.rs: CFG checks (-25行) + dispatcher (-4行) = -29行削減
- mod.rs: pub mod common 追加
設計原則:
- 軽量パターンマッチング(命令の存在確認のみ)
- Graceful degradation(予期しない構造で即座にfallback)
- DRY原則(重複コード1箇所に集約)
🎉 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-23 22:51:30 +09:00
c1aa3c8c2b
feat(joinir): Phase 27.8-4/5 — skip_ws CFG sanity checks + fallback design
...
- MirQuery API を使用した軽量 CFG チェック実装
- Entry block successors >= 1
- Const(0) 存在確認
- String.length() 存在確認
- 予期しない MIR 構造時の手書き版 fallback 設計
- A/B テスト完了: 手書き版・MIR-based 版両方 PASS ✅
- ドキュメント更新: joinir_coverage.md + IMPLEMENTATION_LOG.md
Phase 27.9 modular refactoring: commit 3d5979c7
Phase 27.8-4/5 verification: CFG checks + docs updates
2025-11-23 18:03:33 +09:00
3d5979c78e
refactor(joinir): Phase 27.9 - Modular separation of join_ir.rs into directory structure
...
Phase 27.9 で join_ir.rs (~1,336行) を以下のモジュール構造に分離:
## 新規ディレクトリ構造:
```
src/mir/join_ir/
├── mod.rs # 型定義・共通ユーティリティ (~330行)
└── lowering/
├── mod.rs # lowering インターフェース
├── min_loop.rs # lower_min_loop_to_joinir (~140行)
├── skip_ws.rs # skip_ws lowering 3関数 (~390行)
└── funcscanner_trim.rs # trim lowering (~480行)
```
## 技術的変更:
- **型定義統一**: JoinFuncId, JoinInst, JoinModule 等を mod.rs に集約
- **lowering 分離**: 3つの lowering 関数を個別モジュールに移動
- **後方互換性**: pub use で lowering 関数を re-export(既存コード影響なし)
- **削除**: src/mir/join_ir.rs (旧単一ファイル)
## テスト結果:
- **385 passed** (+1 from 384)
- **9 failed** (-1 from 10)
- **ビルド成功**: 0 errors, 18 warnings (変化なし)
## 効果:
- **保守性向上**: 1,336行 → 4ファイル(各300-500行)で可読性向上
- **モジュール境界明確化**: 型定義 vs lowering 実装の責務分離
- **将来の拡張容易**: 新 lowering 関数追加が簡単に
Phase 27.8 で実装した MIR 自動解析 lowering の基盤整備完了。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-23 16:49:49 +09:00