phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
@ -13,16 +13,16 @@ MIR仕様の揺れ・バックエンド差異・最適化バグを**即座検出
|
||||
### **基本原理**
|
||||
```bash
|
||||
# 1. MIR「黄金標準」生成
|
||||
nyash --dump-mir program.nyash > program.golden.mir
|
||||
nyash --dump-mir program.hako > program.golden.mir
|
||||
|
||||
# 2. 実行時MIR比較(回帰検出)
|
||||
nyash --dump-mir program.nyash > program.current.mir
|
||||
nyash --dump-mir program.hako > program.current.mir
|
||||
diff program.golden.mir program.current.mir
|
||||
|
||||
# 3. 全バックエンド出力比較(互換検証)
|
||||
nyash --target interp program.nyash > interp.out
|
||||
nyash --target vm program.nyash > vm.out
|
||||
nyash --target wasm program.nyash > wasm.out
|
||||
nyash --target interp program.hako > interp.out
|
||||
nyash --target vm program.hako > vm.out
|
||||
nyash --target wasm program.hako > wasm.out
|
||||
diff interp.out vm.out && diff vm.out wasm.out
|
||||
```
|
||||
|
||||
@ -141,7 +141,7 @@ fn normalize_value_ids(func: &MirFunction) -> MirFunction {
|
||||
// tests/golden_dump/output_compatibility_tests.rs
|
||||
#[test]
|
||||
fn test_cross_backend_arithmetic_output() {
|
||||
let program = "arithmetic_test.nyash";
|
||||
let program = "arithmetic_test.hako";
|
||||
|
||||
let interp_output = run_backend("interp", program);
|
||||
let vm_output = run_backend("vm", program);
|
||||
@ -155,7 +155,7 @@ fn test_cross_backend_arithmetic_output() {
|
||||
|
||||
#[test]
|
||||
fn test_cross_backend_object_lifecycle() {
|
||||
let program = "object_lifecycle_test.nyash";
|
||||
let program = "object_lifecycle_test.hako";
|
||||
|
||||
let results = run_all_backends(program);
|
||||
|
||||
@ -169,7 +169,7 @@ fn test_cross_backend_object_lifecycle() {
|
||||
|
||||
#[test]
|
||||
fn test_cross_backend_weak_reference_behavior() {
|
||||
let program = "weak_reference_test.nyash";
|
||||
let program = "weak_reference_test.hako";
|
||||
|
||||
let results = run_all_backends(program);
|
||||
|
||||
@ -187,10 +187,10 @@ fn test_cross_backend_weak_reference_behavior() {
|
||||
#[test]
|
||||
fn test_cross_backend_error_handling() {
|
||||
let error_programs = [
|
||||
"null_dereference.nyash",
|
||||
"division_by_zero.nyash",
|
||||
"weak_reference_after_fini.nyash",
|
||||
"infinite_recursion.nyash"
|
||||
"null_dereference.hako",
|
||||
"division_by_zero.hako",
|
||||
"weak_reference_after_fini.hako",
|
||||
"infinite_recursion.hako"
|
||||
];
|
||||
|
||||
for program in &error_programs {
|
||||
@ -212,7 +212,7 @@ fn test_cross_backend_error_handling() {
|
||||
// tests/golden_dump/optimization_tests.rs
|
||||
#[test]
|
||||
fn test_bus_elision_output_equivalence() {
|
||||
let program = "bus_communication_test.nyash";
|
||||
let program = "bus_communication_test.hako";
|
||||
|
||||
let elision_on = run_with_flag(program, "--elide-bus");
|
||||
let elision_off = run_with_flag(program, "--no-elide-bus");
|
||||
@ -224,7 +224,7 @@ fn test_bus_elision_output_equivalence() {
|
||||
|
||||
#[test]
|
||||
fn test_pure_function_optimization_equivalence() {
|
||||
let program = "pure_function_optimization.nyash";
|
||||
let program = "pure_function_optimization.hako";
|
||||
|
||||
let optimized = run_with_flag(program, "--optimize");
|
||||
let reference = run_with_flag(program, "--no-optimize");
|
||||
@ -238,7 +238,7 @@ fn test_pure_function_optimization_equivalence() {
|
||||
|
||||
#[test]
|
||||
fn test_memory_layout_compatibility() {
|
||||
let program = "memory_intensive_test.nyash";
|
||||
let program = "memory_intensive_test.hako";
|
||||
|
||||
let results = run_all_backends(program);
|
||||
|
||||
@ -256,9 +256,9 @@ fn test_memory_layout_compatibility() {
|
||||
#[test]
|
||||
fn test_performance_regression() {
|
||||
let benchmarks = [
|
||||
"arithmetic_heavy.nyash",
|
||||
"object_creation_heavy.nyash",
|
||||
"weak_reference_heavy.nyash"
|
||||
"arithmetic_heavy.hako",
|
||||
"object_creation_heavy.hako",
|
||||
"weak_reference_heavy.hako"
|
||||
];
|
||||
|
||||
for benchmark in &benchmarks {
|
||||
@ -333,8 +333,8 @@ jobs:
|
||||
echo "🏆 Golden Dump更新中..."
|
||||
|
||||
# 1. 現在のMIRを新しい黄金標準として設定
|
||||
for test_file in tests/golden_dump/programs/*.nyash; do
|
||||
program_name=$(basename "$test_file" .nyash)
|
||||
for test_file in tests/golden_dump/programs/*.hako; do
|
||||
program_name=$(basename "$test_file" .hako)
|
||||
echo "更新中: $program_name"
|
||||
|
||||
# MIR golden dump更新
|
||||
|
||||
Reference in New Issue
Block a user