feat(mir): Phase 84-2 CopyTypePropagator for Copy chain type propagation
- Add CopyTypePropagator box (ChatGPT Pro design) for fixed-point Copy instruction type propagation - Integrate into lifecycle.rs before return type inference - Case D reduced from 12 to 9 (25% reduction) Implementation: - src/mir/phi_core/copy_type_propagator.rs: New box with fixed-point loop - src/mir/phi_core/mod.rs: Add module export - src/mir/builder/lifecycle.rs: Call propagator before return inference Test results: - Baseline: 494 passed, 33 failed (was 489/34) - Case D: 9 remaining (from 12) - Unit tests: 4/4 passed Remaining 9 Case D breakdown: - GroupA: Loop Edge Copy (7 cases) - PHI incoming needs Copy trace - GroupB: Multi-level PHI (2 cases) - Recursive PHI resolution needed Phase 84-3 will address GroupA with Edge Copy tracing in GenericTypeResolver. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
120
docs/development/current/main/phase84-2-test-list.md
Normal file
120
docs/development/current/main/phase84-2-test-list.md
Normal file
@ -0,0 +1,120 @@
|
||||
# Phase 84-2: Case D 残り 9件クイックリファレンス
|
||||
|
||||
## 一覧表
|
||||
|
||||
| # | Group | テスト名 | ValueId | ファイル | 行番号 |
|
||||
|---|-------|---------|---------|---------|-------|
|
||||
| 1 | C | `test_lowering_await_expression` | 2 | `src/mir/mod.rs` | 363 |
|
||||
| 2 | A | `loop_with_continue_and_break_edge_copy_merge` | 56 | `src/tests/loop_continue_break_no_phi_tests.rs` | 21 |
|
||||
| 3 | A | `nested_loop_with_multi_continue_break_edge_copy_merge` | 135 | `src/tests/loop_nested_no_phi_tests.rs` | 21 |
|
||||
| 4 | A | `loop_inner_if_multilevel_edge_copy` | 74 | `src/tests/loop_nested_no_phi_tests.rs` | 224 |
|
||||
| 5 | A | `loop_break_and_early_return_edge_copy` | 40 | `src/tests/loop_return_no_phi_tests.rs` | 22 |
|
||||
| 6 | A | `vm_exec_break_inside_if` | 27 | `src/tests/mir_ctrlflow_break_continue.rs` | 47 |
|
||||
| 7 | A | `loop_if_three_level_merge_edge_copy` | 75 | `src/tests/loop_return_no_phi_tests.rs` | 194 |
|
||||
| 8 | B | `mir_stage1_cli_emit_program_min_exec_hits_type_error` | 7 | `src/tests/mir_stage1_cli_emit_program_min.rs` | 97 |
|
||||
| 9 | B | `mir_stage1_cli_emit_program_min_compiles_and_verifies` | 7 | `src/tests/mir_stage1_cli_emit_program_min.rs` | 71 |
|
||||
|
||||
## グループ詳細
|
||||
|
||||
### GroupA: Loop 制御フロー PHI(7件)
|
||||
|
||||
**共通パターン**: Loop + continue/break
|
||||
|
||||
**テスト実行**:
|
||||
```bash
|
||||
# 個別テスト
|
||||
cargo test --release --lib loop_with_continue_and_break_edge_copy_merge
|
||||
|
||||
# GroupA 全体
|
||||
cargo test --release --lib loop_continue_break
|
||||
cargo test --release --lib loop_nested
|
||||
cargo test --release --lib loop_return
|
||||
cargo test --release --lib vm_exec_break
|
||||
```
|
||||
|
||||
**期待される解決策**: Edge Copy 追跡 PHI 型推論
|
||||
|
||||
### GroupB: 多段 PHI 型推論(2件)
|
||||
|
||||
**共通パターン**: static box + 複数 return 経路
|
||||
|
||||
**テスト実行**:
|
||||
```bash
|
||||
# GroupB 全体
|
||||
cargo test --release --lib mir_stage1_cli_emit_program_min
|
||||
```
|
||||
|
||||
**期待される解決策**: 再帰的 PHI 型推論
|
||||
|
||||
### GroupC: await 特殊パターン(1件)
|
||||
|
||||
**パターン**: await 式の MIR lowering
|
||||
|
||||
**テスト実行**:
|
||||
```bash
|
||||
cargo test --release --lib test_lowering_await_expression
|
||||
```
|
||||
|
||||
**期待される解決策**: await 特殊ケース処理(暫定)
|
||||
|
||||
## 実行コマンド集
|
||||
|
||||
### 全 Case D 確認
|
||||
|
||||
```bash
|
||||
NYASH_PHI_FALLBACK_DISABLED=1 cargo test --release --lib 2>&1 | grep -B5 "Case D"
|
||||
```
|
||||
|
||||
### ValueId 一覧取得
|
||||
|
||||
```bash
|
||||
NYASH_PHI_FALLBACK_DISABLED=1 cargo test --release --lib 2>&1 | grep "ValueId:" | sort | uniq
|
||||
```
|
||||
|
||||
### グループ別実行
|
||||
|
||||
```bash
|
||||
# GroupA のみ
|
||||
cargo test --release --lib loop_ mir_ctrlflow_break
|
||||
|
||||
# GroupB のみ
|
||||
cargo test --release --lib mir_stage1_cli
|
||||
|
||||
# GroupC のみ
|
||||
cargo test --release --lib test_lowering_await
|
||||
```
|
||||
|
||||
## デバッグ用環境変数
|
||||
|
||||
```bash
|
||||
# MIR ダンプ
|
||||
NYASH_DUMP_MIR=1 cargo test --release --lib <test_name>
|
||||
|
||||
# 詳細ログ
|
||||
RUST_LOG=debug cargo test --release --lib <test_name>
|
||||
|
||||
# バックトレース
|
||||
RUST_BACKTRACE=1 cargo test --release --lib <test_name>
|
||||
```
|
||||
|
||||
## 次のステップ
|
||||
|
||||
1. **Phase 84-3**: GroupA の 7件を解決
|
||||
- `GenericTypeResolver::resolve_from_phi_with_copy_trace()` 実装
|
||||
- Edge Copy 追跡ロジック追加
|
||||
- 期待: 9件 → 2件
|
||||
|
||||
2. **Phase 84-4**: GroupB の 2件を解決
|
||||
- `GenericTypeResolver::resolve_from_phi_recursive()` 実装
|
||||
- 再帰的 PHI 型推論
|
||||
- 期待: 2件 → 1件
|
||||
|
||||
3. **Phase 84-5**: GroupC の 1件を解決
|
||||
- await 特殊ケース追加
|
||||
- 期待: 1件 → 0件
|
||||
|
||||
## 参考資料
|
||||
|
||||
- [詳細調査](./phase84-2-case-d-investigation.md)
|
||||
- [サマリー](./phase84-2-summary.md)
|
||||
- [CopyTypePropagator 実装](../../../src/mir/phi_core/copy_type_propagator.rs)
|
||||
Reference in New Issue
Block a user