Commit bb677e5
test(reg-vm): fix stale scalar-param test + add deterministic elision regression guard
Two fixes, both test-only (+ a cfg(test) helper):
1. FIX RED LIB TEST introduced by the elision default-flip (9d38eba):
`lowering_omits_deep_copy_for_scalar_params_only` asserted a read heap param
retains a raw `RegInstr::DeepCopy`, but with elision default-ON the lowerer
neutralizes it to `DeepCopyElided`, so the assertion failed. (It was masked on
the warm main tree by a stale test binary — the known docker cargo clock-skew;
a fresh worktree build is red.) The test's intent is scalar-vs-heap (heap params
carry a copy-isolation marker, scalars don't), so it now accepts either
`DeepCopy | DeepCopyElided` — flag-agnostic, intent preserved.
2. ADD regression guard for the elision win (deterministic, timing-free):
`deepcopy_elision_fires_for_read_only_heap_param` lowers a read-only-heap-param
program and asserts the prologue `DeepCopy` is neutralized to `DeepCopyElided`
under the default; under RSS_VM_ELIDE_DEEPCOPY=0 it asserts the eager copy is
retained. If a future change stops the elision from firing, `DeepCopyElided`
disappears and a raw `DeepCopy` returns → this fails. Chosen over a perf-gate
case because jit_perf_gate measures only the NATIVE metric; this win is
interpreter-side, so timing there wouldn't protect it. Adds
`elide_deepcopy_enabled_for_test()` (cfg(test)) so the test tracks the real gate.
Verified in a FRESH worktree (avoids the stale-binary trap): lib 277/0, main 41/0,
runtime 455/0, differential 33/0, cost-model 1/0, soak 7/0, static 627/0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 9d38eba commit bb677e5
2 files changed
Lines changed: 112 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1852 | 1852 | | |
1853 | 1853 | | |
1854 | 1854 | | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
1855 | 1863 | | |
1856 | 1864 | | |
1857 | 1865 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
555 | 562 | | |
556 | 563 | | |
557 | 564 | | |
| |||
560 | 567 | | |
561 | 568 | | |
562 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
563 | 661 | | |
564 | 662 | | |
565 | 663 | | |
| |||
0 commit comments