refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
use crate::mir::MirModule;
|
|
|
|
|
|
|
|
|
|
|
|
/// JoinIR ブリッジの実行範囲を表す enum
|
|
|
|
|
|
///
|
|
|
|
|
|
/// - `Exec`: JoinIR→VM 実行まで対応。意味論を A/B 実証済みのものに限定。
|
|
|
|
|
|
/// - `LowerOnly`: JoinIR lowering / Bridge 構造検証専用。実行は VM Route A にフォールバック。
|
|
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
|
|
|
|
pub enum JoinIrBridgeKind {
|
|
|
|
|
|
/// JoinIR→VM 実行まで対応(skip/trim など、意味論を A/B 実証済み)
|
|
|
|
|
|
Exec,
|
|
|
|
|
|
/// JoinIR lowering / Bridge 構造検証専用(Stage-1/Stage-B など)
|
|
|
|
|
|
LowerOnly,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// JoinIR ブリッジ対象の記述子
|
|
|
|
|
|
///
|
|
|
|
|
|
/// 関数名と実行範囲(Exec/LowerOnly)をペアで管理する。
|
|
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
|
|
|
|
pub struct JoinIrTargetDesc {
|
|
|
|
|
|
/// 対象関数名(MirModule.functions のキー)
|
|
|
|
|
|
pub func_name: &'static str,
|
|
|
|
|
|
/// 実行範囲
|
|
|
|
|
|
pub kind: JoinIrBridgeKind,
|
|
|
|
|
|
/// デフォルト有効化(env フラグなしでも JoinIR 経路に入る)
|
|
|
|
|
|
pub default_enabled: bool,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-02 14:01:44 +09:00
|
|
|
|
/// JoinIR ブリッジ対象テーブル(SSOT)
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
///
|
|
|
|
|
|
/// Phase 32 L-4: 全対象関数を一覧化し、Exec/LowerOnly の区分を明示する。
|
2025-12-02 14:01:44 +09:00
|
|
|
|
/// Phase 82: このテーブルが唯一の SSOT。is_loop_lowered_function() はここから参照。
|
2025-12-04 21:03:44 +09:00
|
|
|
|
/// Phase 182: representative paths 対応(3 upgrades - LOOP ONLY)
|
|
|
|
|
|
///
|
|
|
|
|
|
/// **重要**: このテーブルは LOOP lowering 専用です。
|
|
|
|
|
|
/// If lowering の関数を追加すると、is_loop_lowered_function() で除外され、
|
|
|
|
|
|
/// if-lowering が機能しなくなります。If 関数は is_joinir_if_toplevel_target() で管理。
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
///
|
|
|
|
|
|
/// | 関数 | Kind | デフォルト有効 | 備考 |
|
|
|
|
|
|
/// |-----|------|---------------|------|
|
|
|
|
|
|
/// | Main.skip/1 | Exec | No | PHI canary のため env 必須 |
|
|
|
|
|
|
/// | FuncScannerBox.trim/1 | Exec | Yes | A/B 実証済み、事実上本線 |
|
2025-12-02 14:01:44 +09:00
|
|
|
|
/// | FuncScannerBox.append_defs/2 | Exec | No | Phase 82 SSOT統一で追加 |
|
2025-12-04 21:03:44 +09:00
|
|
|
|
/// | Stage1UsingResolverBox.resolve_for_source/5 | Exec | Yes | Phase 182: LowerOnly→Exec 昇格 |
|
|
|
|
|
|
/// | StageBBodyExtractorBox.build_body_src/2 | Exec | Yes | Phase 182: LowerOnly→Exec 昇格 |
|
|
|
|
|
|
/// | StageBFuncScannerBox.scan_all_boxes/1 | Exec | Yes | Phase 182: LowerOnly→Exec 昇格 |
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Phase 181/182 設計ドキュメント:
|
|
|
|
|
|
/// - docs/private/roadmap2/phases/phase-181/joinir-targets-mapping.md
|
|
|
|
|
|
/// - docs/private/roadmap2/phases/phase-181/representative-paths-finalized.md
|
|
|
|
|
|
/// - docs/private/roadmap2/phases/phase-182/FINDINGS.md (Phase 182 実装時発見事項)
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
pub const JOINIR_TARGETS: &[JoinIrTargetDesc] = &[
|
2025-12-02 14:01:44 +09:00
|
|
|
|
// Loop Exec(実行対応)
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
JoinIrTargetDesc {
|
|
|
|
|
|
func_name: "Main.skip/1",
|
|
|
|
|
|
kind: JoinIrBridgeKind::Exec,
|
|
|
|
|
|
default_enabled: false, // PHI canary のため env 必須
|
|
|
|
|
|
},
|
|
|
|
|
|
JoinIrTargetDesc {
|
|
|
|
|
|
func_name: "FuncScannerBox.trim/1",
|
|
|
|
|
|
kind: JoinIrBridgeKind::Exec,
|
|
|
|
|
|
default_enabled: true, // A/B 実証済み、事実上本線
|
|
|
|
|
|
},
|
2025-12-02 14:01:44 +09:00
|
|
|
|
JoinIrTargetDesc {
|
|
|
|
|
|
func_name: "FuncScannerBox.append_defs/2",
|
|
|
|
|
|
kind: JoinIrBridgeKind::Exec,
|
|
|
|
|
|
default_enabled: false,
|
|
|
|
|
|
},
|
2025-12-04 21:03:44 +09:00
|
|
|
|
// Phase 182 昇格: Stage-1/Stage-B infrastructure (LowerOnly → Exec)
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
JoinIrTargetDesc {
|
|
|
|
|
|
func_name: "Stage1UsingResolverBox.resolve_for_source/5",
|
2025-12-04 21:03:44 +09:00
|
|
|
|
kind: JoinIrBridgeKind::Exec, // Phase 182: LowerOnly から昇格
|
|
|
|
|
|
default_enabled: true,
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
},
|
|
|
|
|
|
JoinIrTargetDesc {
|
|
|
|
|
|
func_name: "StageBBodyExtractorBox.build_body_src/2",
|
2025-12-04 21:03:44 +09:00
|
|
|
|
kind: JoinIrBridgeKind::Exec, // Phase 182: LowerOnly から昇格
|
|
|
|
|
|
default_enabled: true,
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
},
|
|
|
|
|
|
JoinIrTargetDesc {
|
|
|
|
|
|
func_name: "StageBFuncScannerBox.scan_all_boxes/1",
|
2025-12-04 21:03:44 +09:00
|
|
|
|
kind: JoinIrBridgeKind::Exec, // Phase 182: LowerOnly から昇格
|
|
|
|
|
|
default_enabled: true,
|
refactor(tests): Reorganize test files into module directories
- Split join_ir_vm_bridge_dispatch.rs into module directory
- Reorganize test files into categorical directories:
- exec_parity/, flow/, if_no_phi/, joinir/, macro_tests/
- mir/, parser/, sugar/, vm/, vtable/
- Fix compilation errors after refactoring:
- BinaryOperator::LessThan → Less, Mod → Modulo
- Add VM re-export in backend::vm module
- Fix BinaryOp import to use public API
- Add callee: None for MirInstruction::Call
- Fix VMValue type mismatch with proper downcast
- Resolve borrow checker issues in vtable tests
- Mark 2 tests using internal APIs as #[ignore]
JoinIR tests: 50 passed, 0 failed, 20 ignored
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 18:28:20 +09:00
|
|
|
|
},
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
/// Phase 32 L-4: テーブルから対象関数を探す
|
|
|
|
|
|
pub(crate) fn find_joinir_target(module: &MirModule) -> Option<&'static JoinIrTargetDesc> {
|
|
|
|
|
|
JOINIR_TARGETS
|
|
|
|
|
|
.iter()
|
|
|
|
|
|
.find(|target| module.functions.contains_key(target.func_name))
|
|
|
|
|
|
}
|