Skip to content

test: parameterize Phase 2 closure tests cross-engine (PR4 of 5)#393

Merged
danieljohnmorris merged 3 commits into
mainfrom
feature/phase2-pr4-test-infra
May 18, 2026
Merged

test: parameterize Phase 2 closure tests cross-engine (PR4 of 5)#393
danieljohnmorris merged 3 commits into
mainfrom
feature/phase2-pr4-test-infra

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

Phase 2 PR4 of 5. After #384 (VM closure support), #385 (Cranelift closure parity), and #387 (HOF native closure dispatch) all merged, the existing inline-lambda regression suite still ran exclusively on the tree walker. This PR parameterises the suite over tree, VM, and Cranelift so VM and JIT regressions get caught at the same surface the tree walker does.

No production code changes. Test infrastructure only.

What's in the diff

Commit 1 - test: parameterize inline lambda regression suite over engines

  • tests/regression_inline_lambda.rs: split run_ok into a run_engine primitive plus two callers, run_all (default, iterates tree + VM + Cranelift) and run_tree_only (escape hatch with required justification).
  • 13 of the 21 tests flip directly to run_all (map / flt / fld and grouped-expression / no-regression coverage).
  • 8 tests that exercise srt closure dispatch stay tree-only with a TODO PR3c follow-up comment pointing at feature: srt/grp/uniqby off tree-bridge (Phase 2 PR3c) #391 as the unblock. PR3c is in flight; once it lands the flip is a one-line swap.

Commit 2 - test: generalize closure capture coverage to all engines

Examples skip cleanup

Grep of examples/engine-skip: shows 12 hits. None of them are stale relative to this PR:

  • closure-bind.ilo, uniqby.ilo, srt-by-key.ilo, grp-basics.ilo, sort-by-key.ilo - all gated on srt/grp/uniqby tree-bridge, waiting on feature: srt/grp/uniqby off tree-bridge (Phase 2 PR3c) #391.
  • match-in-loop.ilo, list-ops.ilo, strings.ilo, data.ilo, builtins-as-hof.ilo - unrelated to closure capture.

No examples were edited in this PR. Once #391 merges, a follow-up sweep can drop the relevant skips.

Test plan

  • cargo test --release --features cranelift --test regression_inline_lambda - 21 / 21 pass
  • cargo test --release --features cranelift --test coverage_vm_mod - all pass including the 2 generalised closure tests
  • cargo test --release --features cranelift full suite - all green
  • cargo fmt --check
  • cargo clippy --release --features cranelift --tests -- -D warnings

Follow-ups

  • When feature: srt/grp/uniqby off tree-bridge (Phase 2 PR3c) #391 merges, swap the 8 run_tree_only calls in regression_inline_lambda.rs to run_all and drop the TODO comments.
  • Same trigger lets closure-bind.ilo / srt-by-key.ilo / uniqby.ilo / grp-basics.ilo / sort-by-key.ilo drop their engine-skip lines.

Refactor regression_inline_lambda.rs from a hard-coded --run-tree
runner into a cross-engine harness. The new run_all helper iterates
over tree, VM, and Cranelift; tests that depend on srt/grp/uniqby
closure dispatch (still tree-bridged on VM/Cranelift until PR3c
#391 lands) call run_tree_only with a TODO marker.

Tests using map/flt/fld closures - 13 of 21 - flip directly to
cross-engine. The remaining 8 srt cases keep tree-only coverage
with a comment pointing at #391 as the unblock.

All 21 tests still pass under cargo test --release --features
cranelift.
closure_capture_flt_tree and closure_capture_map_tree were locked
to --run-tree from the pre-#384 era when VM and Cranelift had no
closure support. With #384 + #385 + #387 merged, both tests run
on every engine; rename to drop the _tree suffix and iterate
ENGINES_ALL inline.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
5148 4 5144 0
View the top 3 failed test(s) by shortest run time
ilo::regression_inline_lambda::closure_capture_single_var_filter
Stack Traces | 0.015s run time
thread 'closure_capture_single_var_filter' (38671) panicked at tests/regression_inline_lambda.rs:51:5:
ilo --run-cranelift failed for `f xs:L n thr:n>L n;flt (x:n>b;>x thr) xs`: stderr=error: unrecognised flag '--run-cranelift'. Use 'ilo --help' for valid flags. To pass it as a literal arg, separate with '--' first.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ilo::regression_inline_lambda::closure_capture_multiple_vars
Stack Traces | 0.016s run time
thread 'closure_capture_multiple_vars' (38667) panicked at tests/regression_inline_lambda.rs:51:5:
ilo --run-cranelift failed for `f xs:L n lo:n hi:n>L n;flt (x:n>b;&(>=x lo) <=x hi) xs`: stderr=error: unrecognised flag '--run-cranelift'. Use 'ilo --help' for valid flags. To pass it as a literal arg, separate with '--' first.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ilo::regression_inline_lambda::closure_capture_in_fld
Stack Traces | 0.018s run time
thread 'closure_capture_in_fld' (38654) panicked at tests/regression_inline_lambda.rs:51:5:
ilo --run-cranelift failed for `f xs:L n weight:n>n;fld (a:n x:n>n;+a *x weight) xs 0`: stderr=error: unrecognised flag '--run-cranelift'. Use 'ilo --help' for valid flags. To pass it as a literal arg, separate with '--' first.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ilo::regression_inline_lambda::closure_capture_in_map
Stack Traces | 0.018s run time
thread 'closure_capture_in_map' (38661) panicked at tests/regression_inline_lambda.rs:51:5:
ilo --run-cranelift failed for `f xs:L n bump:n>L n;map (x:n>n;+x bump) xs`: stderr=error: unrecognised flag '--run-cranelift'. Use 'ilo --help' for valid flags. To pass it as a literal arg, separate with '--' first.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant