docs: Phase 260 P0.3 完了記録 + 既知FAIL SSOT更新
**10-Now.md 更新**: - Phase 260 P0.2/P0.3 完了記録追加(15モジュール、約3941行、53単体テスト) - Current First FAIL を "P0.3完了後" に更新 - 既知FAILに "Phase 260 scope外" を明記 - 期待/実際の詳細追加 - 次アクション: 機能側Phase(Pattern2 LoopBodyLocal promotion)へ **phase-260/README.md 更新**: - Status: P0.3 完了 ✅ - P0.2/P0.3 進捗セクション追加(commit履歴、成果) - モジュール分割の責務一覧(Utilities 7 + Handlers 8) - SSOT維持確認項目(jump_args直参照ゼロ、out_edges()/edge_args_to() SSOT維持、PHI preservation、Phase metadata保持) Phase 260 完全達成: CFG基盤整備完了、今後は機能側Phaseへ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -18,20 +18,40 @@
|
||||
|
||||
## Current First FAIL (SSOT)
|
||||
|
||||
- **After Phase 260 P0.1**: `core_direct_array_oob_set_rc_vm / Stage-B compile / JoinIR Pattern2 LoopBodyLocal(seg)`
|
||||
- **After Phase 260 P0.3**: `core_direct_array_oob_set_rc_vm / Stage-B compile / JoinIR Pattern2 LoopBodyLocal(seg)`
|
||||
|
||||
### Next FAIL Details
|
||||
### FAIL Details (既知・Phase 260 scope外)
|
||||
|
||||
- **Test**: `core_direct_array_oob_set_rc_vm`
|
||||
- **Status**: **既知 / Phase 260 scope外**(JoinIR Pattern2 LoopBodyLocal promotion 未実装)
|
||||
- **Phase**: Stage‑B compile (`stageb_compile_to_json`)
|
||||
- **Error**: `[cf_loop/pattern2] Cannot promote LoopBodyLocal variables ["seg"] ... [pattern2/body_local_slot/contract/not_readonly]`
|
||||
- **Error**: `[cf_loop/pattern2] Cannot promote LoopBodyLocal variables ["seg"]: No promotable pattern detected (tried A-3 Trim, A-4 DigitPos); read-only-slot rejected: [joinir/freeze] [pattern2/body_local_slot/contract/not_readonly] 'seg' must be read-only (assignment detected in loop body)`
|
||||
- **Expected**: Stage-B compile succeeds (bundle_resolver loop compiles)
|
||||
- **Actual**: MIR compilation error (LoopBodyLocal "seg" cannot be promoted - A-3/A-4 patterns not detected)
|
||||
- **Reproduce**:
|
||||
```bash
|
||||
./tools/smokes/v2/run.sh --profile quick
|
||||
# または
|
||||
bash tools/smokes/v2/profiles/quick/core/core_direct_array_oob_set_rc_vm.sh
|
||||
```
|
||||
- **Note**: Pattern2 の LoopBodyLocal promotion(A-3 Trim / A-4 DigitPos)に依存しており、Stage‑B の bundle_resolver 系のループで露出している。
|
||||
- **Root Cause**: Pattern2 の LoopBodyLocal promotion(A-3 Trim / A-4 DigitPos)に依存しており、Stage‑B の bundle_resolver 系のループで露出している。
|
||||
- **Next Action**: **Phase 260 完了**(P0.3まで完了)→ **今後は機能側のPhaseへ**(Pattern2 LoopBodyLocal promotion 機能実装)
|
||||
- **分類**: JoinIR Pattern2 機能拡張(compiler機能側、CFG基盤整備は完了)
|
||||
|
||||
## 2025-12-20:Phase 260 P0/P0.1(edge-args Strangler)🚧
|
||||
## 2025-12-21:Phase 260 P0.2/P0.3(モジュール化大工事)✅
|
||||
|
||||
- **P0.2**: instruction_rewriter モジュール化
|
||||
- Commits: `cbed040a7`, `aa3fdf3c1`, `c2e8099ff`, `84cd653ae`, `875bfee1b`, `666de9d3e`
|
||||
- 抽出: exit_collection, block_allocator, merge_variable_handler, call_generator, handlers/(8ファイル)
|
||||
- **P0.3**: joinir_block_converter モジュール化
|
||||
- Commits: `e7f9adcfe`, `2c01a7335`
|
||||
- Phase 1: terminator_builder, block_finalizer
|
||||
- Phase 2: handlers/(call, jump, conditional_method_call, if_merge, nested_if_merge)
|
||||
- **成果**: 15モジュール、約3941行、53単体テスト全てpass、45/46統合テストpass
|
||||
- **SSOT維持確認**: jump_args直参照ゼロ、out_edges()/edge_args_to() SSOT維持
|
||||
- **詳細**: `docs/development/current/main/phases/phase-260/README.md`
|
||||
|
||||
## 2025-12-20:Phase 260 P0/P0.1(edge-args Strangler)✅
|
||||
|
||||
- P0: MIR terminator の edge-args 併存導入(読む側 SSOT を `out_edges()`/`edge_args_to()` へ寄せた)
|
||||
- P0.1: legacy layout の未設定を禁止(verify fail-fast)+ terminator 直代入を `set_terminator*()` へ寄せた
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# Phase 260: Block-Parameterized CFG(edge-args)段階導入
|
||||
|
||||
Status: In progress
|
||||
Last updated: 2025-12-20
|
||||
Status: P0.3 完了 ✅
|
||||
Last updated: 2025-12-21
|
||||
|
||||
## 進捗(セーブポイント)
|
||||
|
||||
@ -9,6 +9,46 @@ Last updated: 2025-12-20
|
||||
- Commit: `4dfe3349b`
|
||||
- P0.1(hardening): 完了(legacy layout 無し禁止 + DCE/verify の参照点整理)
|
||||
- Commit: `1fe5be347`
|
||||
- P0.2(instruction_rewriter モジュール化): 完了
|
||||
- Commits: `cbed040a7`, `aa3fdf3c1`, `c2e8099ff`, `84cd653ae`, `875bfee1b`, `666de9d3e`
|
||||
- 抽出モジュール: exit_collection, block_allocator, merge_variable_handler, call_generator, handlers/(8ファイル)
|
||||
- P0.3(joinir_block_converter モジュール化): 完了 ✅
|
||||
- Commits: `e7f9adcfe`, `2c01a7335`
|
||||
- Phase 1: terminator_builder, block_finalizer
|
||||
- Phase 2: handlers/(call, jump, conditional_method_call, if_merge, nested_if_merge)
|
||||
- **合計抽出**: 15モジュール、約3941行、53単体テスト全てpass
|
||||
- **統合テスト**: 45/46 pass(既知のPattern2 LoopBodyLocal問題1件のみ)
|
||||
|
||||
## P0.2/P0.3 モジュール分割の責務一覧
|
||||
|
||||
### Utilities(7モジュール)
|
||||
- **block_allocator.rs**: ブロックID割り当て統一(allocate_one/two/three/n)
|
||||
- **merge_variable_handler.rs**: マージコピー生成(emit_merge_copies, MergeBranch)
|
||||
- **call_generator.rs**: Call命令生成統一(emit_call_pair, emit_call_pair_with_spans)
|
||||
- **terminator_builder.rs**: Terminator生成統一(create_branch/jump/return_terminator, emit_branch_and_finalize)
|
||||
- **block_finalizer.rs**: PHI保持ブロック確定(finalize_block, finalize_remaining_instructions)
|
||||
- **exit_collection.rs**: Exit値収集(collect_exit_values, ExitCollectionResult)
|
||||
- **convert.rs**: MirLikeInst変換(convert_mir_like_inst)
|
||||
|
||||
### Handlers(8モジュール)
|
||||
- **handlers/ret.rs**: Return処理
|
||||
- **handlers/method_call.rs**: MethodCall → BoxCall変換
|
||||
- **handlers/field_access.rs**: FieldAccess → BoxCall(getter pattern)
|
||||
- **handlers/new_box.rs**: NewBox命令処理
|
||||
- **handlers/select.rs**: Select命令(直接、展開なし)
|
||||
- **handlers/call.rs**: Call + tail call処理(Phase 131 P2: 安定ValueId、legacy jump_args)
|
||||
- **handlers/jump.rs**: Jump → tail call変換(Phase 256 P1.9: continuation、Phase 246-EX: legacy jump_args)
|
||||
- **handlers/conditional_method_call.rs**: ConditionalMethodCall → if/phi展開(単一変数)
|
||||
- **handlers/if_merge.rs**: IfMerge → if/phi(複数変数)
|
||||
- **handlers/nested_if_merge.rs**: NestedIfMerge → 多段分岐(N+3ブロック、最複雑)
|
||||
|
||||
### SSOT維持の確認項目(Phase 260の契約)
|
||||
|
||||
✅ **jump_args直参照ゼロ維持**: 全モジュールで`BasicBlock.jump_args`への直接参照なし(`out_edges()`/`edge_args_to()`経由のみ)
|
||||
✅ **out_edges()/edge_args_to() SSOT維持**: 読む側APIが単一参照点に統一(Branchを含む複数edge前提)
|
||||
✅ **terminator operand優先**: 新規コードはterminator operandを優先的に使用(legacy jump_argsは併存のみ)
|
||||
✅ **PHI preservation**: block_finalizer.rsでPhase 189 FIX(PHI命令をブロック先頭保持)を維持
|
||||
✅ **Phase metadata保持**: Phase 131 P2(安定ValueId)、Phase 246-EX(legacy jump_args)、Phase 256 P1.9(continuation名前解決)の契約を全て保持
|
||||
|
||||
## 目的(P0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user