Files
hakorune/src/tests/mod.rs

47 lines
1.5 KiB
Rust
Raw Normal View History

feat(joinir): Phase 34-7.5 helpers + Phase 34-8 Break/Continue implementation Phase 34-7.5: Code organization improvements - Added type conversion helpers (as_cont/as_func) in join_ir/mod.rs - Enhanced docstrings for JoinCall/JoinJump with usage examples - Improved error messages in join_ir_vm_bridge.rs JoinIrFrontendTestRunner box implementation - Created src/tests/helpers/joinir_frontend.rs (119 lines) - Reduced test code by 83% (70 lines → 12 lines per test) - 26% overall reduction in test file (284 → 209 lines) Phase 34-8: Break/Continue pattern implementation - Extended ast_lowerer.rs (+630 lines) - lower_loop_break_pattern(): Break as Jump (early return) - lower_loop_continue_pattern(): Continue as Select + Call - Added Bool literal support in extract_value() - Created 2 fixtures: loop_frontend_{break,continue}.program.json - Added 2 A/B tests (all 6 Phase 34 tests PASS) Technical achievements: - Break = Jump (early return pattern) - Continue = Select + Call (NOT Jump) - critical discovery - 3-function structure sufficient (no k_continue needed) - SSA-style re-assignment with natural var_map updates Test results: ✅ joinir_frontend_if_select_simple_ab_test ✅ joinir_frontend_if_select_local_ab_test ✅ joinir_frontend_json_shape_read_value_ab_test ✅ joinir_frontend_loop_simple_ab_test ✅ joinir_frontend_loop_break_ab_test ✅ joinir_frontend_loop_continue_ab_test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 01:02:49 +09:00
mod helpers;
#[cfg(feature = "aot-plan-import")]
pub mod aot_plan_import;
pub mod box_tests;
pub mod core13_smoke_array;
pub mod exec_parity;
// Legacy PHI-off flow shape tests (pre-JoinIR). Disable by default.
#[cfg(feature = "legacy-tests")]
pub mod flow;
pub mod functionbox_call_tests;
pub mod host_reverse_slot;
// Legacy PHI-off if/merge shape tests (pre-JoinIR). Disable by default.
#[cfg(feature = "legacy-tests")]
pub mod if_no_phi;
pub mod if_return_exec;
// Legacy StringUtils VM parity smoke (pre-JoinIR). Disable by default.
#[cfg(feature = "legacy-tests")]
pub mod json_lint_stringutils_min_vm; // Phase 21.7++: using StringUtils alias resolution fix
pub mod llvm_bitops_test;
pub mod macro_tests;
pub mod mir;
pub mod namingbox_static_method_id; // Phase 21.7++ Phase 1: StaticMethodId structure tests
pub mod nyash_abi_basic;
pub mod parser;
feat(joinir): Phase 61-2 If-in-loop JoinIR dry-run検証インフラ実装 ## 実装内容 ### 61-2.1: dry-runフラグ追加 - `src/config/env.rs`: joinir_if_in_loop_dryrun_enabled() 追加 (+11行) - `HAKO_JOINIR_IF_IN_LOOP_DRYRUN=1` でdry-runモード有効化 ### 61-2.2: loop_builder.rs dry-run統合 - `src/mir/loop_builder.rs`: JoinIR PhiSpec計算とA/B比較実装 (+47行) - JoinInst取得時にPhiSpec保存、PhiBuilderBox実行後に比較 ### 61-2.3: PhiSpec計算ロジック実装 - `src/mir/join_ir/lowering/if_phi_spec.rs`: 新規作成 (+203行) - PhiSpec構造体(header_phis/exit_phis) - compute_phi_spec_from_joinir(): JoinInstからPHI仕様計算 - extract_phi_spec_from_builder(): PhiBuilderBox結果抽出 - compare_and_log_phi_specs(): A/B比較とログ出力 - BTreeMap/BTreeSet使用(決定的イテレーション保証) ### 61-2.4: A/B比較テスト実装 - `src/tests/phase61_if_in_loop_dryrun.rs`: 新規作成 (+49行) - phase61_2_dry_run_flag_available: フラグ動作確認 - phase61_2_phi_spec_creation: PhiSpec構造体テスト - テスト結果: ✅ 2/2 PASS ## テスト結果 - Phase 61-2新規テスト: ✅ 2/2 PASS - 既存loopformテスト: ✅ 14/14 PASS(退行なし) - ビルド: ✅ 成功(エラー0件) ## コード変更量 +312行(env.rs: +11, if_phi_spec.rs: +203, loop_builder.rs: +47, tests: +49, その他: +2) ## 技術的成果 1. PhiSpec構造体完成(JoinIR/PhiBuilderBox統一表現) 2. dry-run検証インフラ(本番動作に影響なし) 3. BTreeMap統一(Option C知見活用) ## 次のステップ(Phase 61-3) - dry-run → 本番経路への昇格 - PhiBuilderBox If側メソッド削除(-226行) - JoinIR経路のみでif-in-loop PHI生成 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 12:26:02 +09:00
pub mod phase61_if_in_loop_dryrun; // Phase 61-2: If-in-loop JoinIR dry-run tests
pub mod phase67_generic_type_resolver; // Phase 67: P3-C GenericTypeResolver tests
pub mod plugin_hygiene;
pub mod policy_mutdeny;
pub mod refcell_assignment_test;
// Stage1 CLI SSA smoke (pre-JoinIR expectations). Disable by default.
#[cfg(feature = "legacy-tests")]
pub mod stage1_cli_entry_ssa_smoke;
pub mod sugar;
pub mod typebox_tlv_diff;
pub mod vm;
pub mod vtable;
// Phase 34-2: JoinIR Frontend (AST→JoinIR) and related components
pub mod joinir;
// Phase 40-3: array_ext.filter A/B test
pub mod phase40_array_ext_filter_test;
// Phase 256 P1.5: Select instruction minimal test
pub mod phase256_select_minimal_test;