Skip to content

feat: parallel rule execution via tokio JoinSet#4

Closed
SpollaL wants to merge 1 commit into
masterfrom
feat/parallel-execution
Closed

feat: parallel rule execution via tokio JoinSet#4
SpollaL wants to merge 1 commit into
masterfrom
feat/parallel-execution

Conversation

@SpollaL
Copy link
Copy Markdown
Owner

@SpollaL SpollaL commented Apr 23, 2026

Summary

  • Replaces the sequential for rule in &rules.rules loop with tokio::task::JoinSet for concurrent rule execution
  • SessionContext wrapped in Arc<SessionContext> — cloned into each spawned task (zero unsafe)
  • Results collected from JoinSet and sorted back to original rule submission order
  • run_rules_parallel() extracted as a public, testable function in runner.rs
  • Rule and Check derive Clone to support move semantics into async tasks
  • Zero CLI change — pure internal improvement; no flags added or removed

Performance impact

With 10–50 rules on a large Parquet file, rules that previously ran sequentially now run concurrently. Wall-clock time approaches the latency of the single slowest rule rather than the sum of all rule latencies.

Test plan

  • All 23 existing runner tests still pass with updated Arc<SessionContext> signature
  • test_parallel_execution_all_pass — 5 rules all pass concurrently
  • test_parallel_execution_with_failure — mix of pass/fail rules, correct results
  • test_parallel_execution_preserves_order — 10 rules submitted; output matches input order, not completion order

🤖 Generated with Claude Code

- Replaces sequential for-loop with tokio::task::JoinSet for concurrent rule execution
- SessionContext wrapped in Arc<SessionContext> and cloned into each spawned task
- Results sorted back to original rule submission order after concurrent completion
- run_rules_parallel() extracted as testable public function in runner.rs
- Rule and Check derive Clone to support move into tasks
- Zero CLI change — pure internal improvement; existing API unchanged
- 3 new parallel-specific tests: all-pass, with-failure, order-preservation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SpollaL
Copy link
Copy Markdown
Owner Author

SpollaL commented Apr 23, 2026

Merged manually into master via rebase (d85f7d6, 3fcf580).

@SpollaL SpollaL closed this Apr 23, 2026
@SpollaL SpollaL deleted the feat/parallel-execution branch April 23, 2026 20:19
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