feat(plan): Phase 282 P5 - Pattern3 ExtractionBased Migration & Classification

- Pattern3 extraction logic separated to extractors/pattern3.rs
- ExtractionBased strategy: pure functions, Fail-Fast, SSOT
- Pattern classification restored (AST-based pattern detection)
- Pattern1 extractor migrated (extractors/pattern1.rs)
- Documentation: phase-282 README updated, joinir-architecture updated

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-23 08:13:47 +09:00
parent c3fb3c5833
commit 32ccccd272
7 changed files with 608 additions and 28 deletions

View File

@ -58,8 +58,9 @@ CFG構築は以下に収束させる
- ❌ 禁止: CFG 分岐(`if pattern == 6 then ...`)、アーキテクチャ SSOTFrag composition が SSOT
**Detection 戦略**(簡潔版、詳細は P2+ で補完):
- **ExtractionBased**Pattern6,7,8: extract() 成功 → matchSSOT 単一)
- **StructureBased**Pattern1-5,9: ctx.pattern_kind チェックlegacy、2 つの SSOT
- **ExtractionBased**Pattern6/7/8/9: extract() 成功 → matchSSOT 単一)
- 注: Pattern8/9 は JoinIR table 経由でも、can_lower 内部で extract を使って判定しているpattern_kind 依存ではない
- **StructureBased**(主に Pattern1-5: ctx.pattern_kind などの事前分類を使うlegacy、SSOT が二重になりやすい)
**SSOT 参照**:
- Frag composition: `src/mir/builder/control_flow/edgecfg/api/compose.rs`
@ -108,7 +109,7 @@ extract_scan_with_init_plan() → Ok(None) for unsupported cases
5. **Emission**: emit_frag()terminator SSOT
**JoinIR table の責務**Phase 194+ table-driven:
1. **Detection**: can_lower()structure-based、ctx.pattern_kind
1. **Detection**: can_lower()pattern により structure-based / extraction-based が混在
2. **Extraction**: cf_loop 抽出
3. **収束先**: Frag composition → emit_frag内部パイプライン詳細は最小化
@ -126,4 +127,3 @@ extract_scan_with_init_plan() → Ok(None) for unsupported cases
- router の責務が docs で SSOT 化されている
- router の変更が「extractor配線」のみになっているCFG構築の詳細を持たない
- 既存の VM/LLVM smokes に退行がない