docs(joinir): Phase 47 - Normalized P3 (If-Sum) design
Complete design for extending Normalized JoinIR to Pattern3 (if-sum) loops, reusing 90% of existing P2 infrastructure. Key insight: P3 already uses P2's Structured JoinIR foundation (Phase 220 ConditionEnv integration), so Normalized extension is straightforward. Design documents: - phase47-norm-p3-design.md: Complete P3 Normalized design - Infrastructure reuse analysis (ConditionEnv, CarrierInfo, ExitLine) - Representative loops identified (phase212_if_sum_min primary target) - StepScheduleBox extension (IfCond, ThenUpdates, ElseUpdates) - JpInst reuse (If instruction already exists) - Implementation strategy (dev-only → canonical) - File impact estimate (~365 lines, pure additive) - phase47-test-files-inventory.md: P3 test file catalog - 3 P3 test files analyzed - phase212_if_sum_min.hako: Single carrier (PRIMARY) - phase217_if_sum_multi_min.hako: Multi-carrier (sum + count) - phase218_json_if_sum_min.hako: Variable accumulation (sum + i) Architecture: - Unified Normalized for P1/P2/P3 (same pipeline) - Conditional updates only difference vs P2 - No P2 code changes needed (pure additive) Benefits: - 90% infrastructure reuse from P2 - Proven incremental rollout (dev → canonical) - Clear path to P4 (continue pattern) Implementation roadmap: - Phase 47-A: Minimal sum_count (dev-only) - Phase 47-B: array_filter (body-local + method calls) - Phase 47-C: Canonical promotion Updates: - joinir-architecture-overview.md: Added Phase 47 section - CURRENT_TASK.md: Updated Phase 47 entry (Design Complete) Status: Design phase complete, ready for implementation
This commit is contained in:
@ -1358,3 +1358,25 @@ JsonParser _skip_whitespace / _atoi / _parse_number が**すべて canonical Nor
|
||||
- `normalized_joinir_min.rs`: canonical set 検証テスト追加
|
||||
|
||||
**テスト**: 937/937 PASS
|
||||
|
||||
### 3.24 Phase 47-NORM-P3 – Normalized P3 (If-Sum) Support 🏗️ DESIGN (2025-12-12)
|
||||
|
||||
**設計詳細**: [phase47-norm-p3-design.md](./phase47-norm-p3-design.md)
|
||||
|
||||
Pattern3 (if-sum) ループを Normalized JoinIR に対応させる。P2 と同じ ConditionEnv/CarrierInfo/ExitLine インフラを再利用。
|
||||
|
||||
**Phase 220 基盤**: P3 if-sum は Phase 220 で ConditionEnv 統合済み(既に P2 と同じ Structured JoinIR foundation を持つ)
|
||||
|
||||
**Key difference**: P3 は **conditional carrier updates**(if 内でのみキャリア更新)vs P2 の unconditional updates before break
|
||||
|
||||
**Phase 47-A**: Minimal sum_count (dev-only Normalized)
|
||||
- ✅ EnvLayout: P2 と同じ構造(carrier フィールド)
|
||||
- ✅ StepScheduleBox: `IfCond`, `ThenUpdates`, `ElseUpdates` ステップ追加
|
||||
- ✅ JpInst: 既存の `If` 命令を再利用
|
||||
- 🎯 Test: `phase212_if_sum_min.hako` → Normalized→MIR(direct) 検証
|
||||
|
||||
**Phase 47-B**: array_filter (dev-only, body-local + method calls)
|
||||
|
||||
**Phase 47-C**: Canonical promotion (P3 minimal → canonical)
|
||||
|
||||
**スコープ外**: P4 (continue) 対応(NORM-P4 フェーズで実施)、Complex P3 patterns(後続フェーズ)
|
||||
|
||||
Reference in New Issue
Block a user