chore: Update docs/private submodule (Phase 39 Level 2 preparation)
Phase 39 documentation complete: - Stage-1/Stage-B representative function selection (5 candidates → top 2) - Primary: array_ext.filter (8/10 score, if-in-loop with conditional push) - Secondary: json_cur.read_quoted_from (7/10 score, comprehensive validation) - JoinIR Frontend extension design (AST lowering, MIR lowering, ~120 lines) - if-in-loop AST lowering with variable tracking (~80 lines) - Loop exit PHI generation (~40 lines) - A/B test plan with 5 test fixtures - Deletion criteria refinement (abstract → concrete checklist) - Verification Procedures: 3 procedures defined - Deletion sequence: Phase 40-1 through 40-4 roadmap - Gap analysis (JoinIR Frontend coverage gaps identified) - collect_assigned_vars: 30% coverage (70% gap: if-in-loop variable capture) - compute_modified_names: 50% coverage (50% gap: conservative strategy) - merge_with_reset_at_merge_with: 80% coverage (20% gap: reset semantics) CURRENT_TASK.md updated with Phase 39 completion Zero functional code changes (docs-only phase) Phase 39 complete: Level 2 deletion concrete implementation plan established Total planned deletion: 115 lines (Phase 40) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -126,6 +126,94 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### 1-00l. Phase 39 — If側PHI Level 2削減準備(設計中心、docs-only)(**完了** 2025-11-28)
|
||||||
|
|
||||||
|
**目的**
|
||||||
|
- Phase 37設計 → Phase 40実装の橋渡し
|
||||||
|
- Stage-1/Stage-B代表関数を具体選定し、JoinIR Frontend拡張の具体設計を行う
|
||||||
|
- Level 2削除基準を抽象的基準から検証可能チェックリストに精緻化
|
||||||
|
|
||||||
|
**設計内容**
|
||||||
|
|
||||||
|
**Phase 37成果深堀り**:
|
||||||
|
- コンテキスト詳細分析: if-in-loop vs ループ外if使い分け明確化
|
||||||
|
- JoinIR Frontend coverage: 現在30%(collect_assigned_vars)、50%(compute_modified_names)、80%(merge_with_reset_at_merge_with)
|
||||||
|
- 削減ブロッカー特定: if-in-loop variable capture(70% gap)、conservative strategy migration(50% gap)、reset semantics(20% gap)
|
||||||
|
|
||||||
|
**Stage-1/Stage-B代表関数選定**:
|
||||||
|
- 候補リスト: 5個の関数を評価(array_ext.filter, json_cur.skip_ws, json_cur.read_quoted_from, byte_cursor.find_bytes, test_assert.assert_true)
|
||||||
|
- 評価マトリックス: 実装難易度(1-5点)、削減効果(1-3点)、collect_assigned_vars依存度(0.5-2点)、合計10点満点
|
||||||
|
- 最優先選定: **array_ext.filter**(スコア8/10、if-in-loop with conditional push)
|
||||||
|
- パターン: loop内でif文による配列の条件付き追加(`if fn(v) { out.push(v) }`)
|
||||||
|
- PHI生成: loop exit PHI for `out` variable
|
||||||
|
- collect_assigned_vars直接テスト: HIGH dependency
|
||||||
|
- 次点: **json_cur.read_quoted_from**(スコア7/10、包括的検証用)
|
||||||
|
- パターン: guard if + loop + if-in-loop with break + string accumulation
|
||||||
|
- 用途: 一次実装後の包括的検証(複雑パターン全カバー)
|
||||||
|
|
||||||
|
**JoinIR Frontend拡張設計**:
|
||||||
|
- 追加機能: if-in-loop AST lowering with variable tracking
|
||||||
|
- AST lowering変更:
|
||||||
|
- `extract_if_in_loop_modified_vars()`: loop body内のif文から変更変数抽出(~40行)
|
||||||
|
- `extract_assigned_vars_from_body()`: AST再帰走査で代入変数検出(~40行)
|
||||||
|
- `lower_loop_with_body()` 拡張: 変数追跡metadata付きJoinIR生成
|
||||||
|
- JoinIR命令拡張: 不要(既存Select/Jump/Call/Retで対応可能)
|
||||||
|
- MIR lowering変更: `lower_loop_to_mir()` で loop exit PHI生成(~40行)
|
||||||
|
- 合計追加見込み: ~120行(Phase 40実装時)
|
||||||
|
|
||||||
|
**削除条件精緻化**:
|
||||||
|
- Level 2チェックリスト: 検証可能基準(Prerequisites 5項目、Safety Checks 3項目、Deletion Safe Conditions 4段階)
|
||||||
|
- 検証手順:
|
||||||
|
- Procedure 1: collect_assigned_vars Callsite Analysis(2 callsites表形式分析)
|
||||||
|
- Procedure 2: A/B Test Execution(6 step手順、identical output確認、performance ≤110%)
|
||||||
|
- Procedure 3: Grep-Based Safety Check(deletion前後のgrep検証、undefined symbol確認)
|
||||||
|
- 削除順序: Phase 40-1(collect_assigned_vars 32行)→ 40-2(compute_modified_names 26行 + conservative migration)→ 40-3(merge_with_reset_at_merge_with 27行)→ 40-4(conservative.rs inline 30行)
|
||||||
|
|
||||||
|
**技術的成果**
|
||||||
|
1. **具体的実装計画**: Phase 37抽象設計→Phase 39具体設計→Phase 40実装の橋渡し完成
|
||||||
|
2. **証拠ベース選定**: 3段階評価(候補リスト→評価マトリックス→最優先選定)で最適な代表関数選択
|
||||||
|
3. **検証可能基準**: 抽象的基準("Stage-1/B代表1-2関数成功")→チェックリスト化(具体的Prerequisites/Safety Checks/Procedures)
|
||||||
|
|
||||||
|
**成果物**
|
||||||
|
- ✅ callsite_context_analysis.md: 呼び出しコンテキスト詳細(if-in-loop vs ループ外if、なぜ呼ばれるか、JoinIR代替策)
|
||||||
|
- ✅ gap_analysis.md: JoinIR Frontend未カバー範囲明確化(パターンギャップ3個、機能ギャップ3個、実装見込み180行)
|
||||||
|
- ✅ representative_function_candidates.md: 候補5個→最優先2個選定(Primary: array_ext.filter 8/10点、Secondary: json_cur.read_quoted_from 7/10点)
|
||||||
|
- ✅ joinir_extension_design.md: AST/JoinIR/MIR拡張具体設計(~120行追加見込み、A/B test plan 5 fixtures)
|
||||||
|
- ✅ deletion_criteria_checklist.md: 検証可能削除基準(Prerequisites 5項目、3 Verification Procedures、4-phase deletion safe conditions)
|
||||||
|
- ✅ deletion_sequence_detailed.md: Phase 40-1→40-4詳細手順(各phase毎の8 step手順、rollback plan、expected reduction)
|
||||||
|
|
||||||
|
**Rustコード変更**
|
||||||
|
- **ゼロ**(docs-only、Phase 39完遂)
|
||||||
|
|
||||||
|
**Phase 35-39 累計削減**: 605行(Phase 35: 430行, Phase 38: 90行, Phase 39: 0行(設計のみ))
|
||||||
|
**Phase 40 削減ポテンシャル**: 115行(Level 2、MEDIUM安全度)
|
||||||
|
**Phase 40+ 削減ポテンシャル**: 300行(Level 3、HIGH安全度)
|
||||||
|
|
||||||
|
**次のステップ(Phase 40)**
|
||||||
|
- **Phase 40-1**: collect_assigned_vars削除(32行)
|
||||||
|
- 前提: array_ext.filter JoinIR Frontend実装 + A/B test PASS
|
||||||
|
- 実装: if-in-loop AST lowering (~80行) + loop exit PHI generation (~40行)
|
||||||
|
- 検証: Procedure 1/2/3 完全実行
|
||||||
|
- **Phase 40-2**: compute_modified_names削除(26行)+ conservative migration
|
||||||
|
- 前提: Phase 40-1完了 + JoinIR Verifier conservative analyzer実装
|
||||||
|
- 実装: JoinIrConservativeAnalyzer (~60行)
|
||||||
|
- **Phase 40-3**: merge_with_reset_at_merge_with削除(27行)
|
||||||
|
- 前提: Phase 40-1/2完了 + IfMerge reset semantics実装
|
||||||
|
- **Phase 40-4**: conservative.rs struct inline(30行)
|
||||||
|
- 前提: Phase 40-1/2/3完了 + ConservativeMerge → JoinIrConservativeAnalyzer移行
|
||||||
|
|
||||||
|
**関連ドキュメント**
|
||||||
|
- `docs/private/roadmap2/phases/phase-39-if-phi-level2/README.md` (Phase 39 overview)
|
||||||
|
- `docs/private/roadmap2/phases/phase-39-if-phi-level2/callsite_context_analysis.md` (callsite詳細)
|
||||||
|
- `docs/private/roadmap2/phases/phase-39-if-phi-level2/gap_analysis.md` (未カバー範囲)
|
||||||
|
- `docs/private/roadmap2/phases/phase-39-if-phi-level2/representative_function_candidates.md` (代表関数選定)
|
||||||
|
- `docs/private/roadmap2/phases/phase-39-if-phi-level2/joinir_extension_design.md` (JoinIR拡張設計)
|
||||||
|
- `docs/private/roadmap2/phases/phase-39-if-phi-level2/deletion_criteria_checklist.md` (削除基準)
|
||||||
|
- `docs/private/roadmap2/phases/phase-39-if-phi-level2/deletion_sequence_detailed.md` (Phase 40手順)
|
||||||
|
- `docs/private/roadmap2/phases/phase-30-final-joinir-world/PHI_BOX_INVENTORY.md` (Phase 39完了記録更新)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### 1-00v. Phase 29 L-5.3 — JoinIR generic_case_a との統合 (Phase 1)(**完了** 2025-11-26)
|
### 1-00v. Phase 29 L-5.3 — JoinIR generic_case_a との統合 (Phase 1)(**完了** 2025-11-26)
|
||||||
|
|
||||||
**目的**
|
**目的**
|
||||||
|
|||||||
Submodule docs/private updated: 6cc2682916...ea29632a40
Reference in New Issue
Block a user