You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: fuzz testing data processing operators against a reference
#9747
The Aggregate AVERAGE bug (#9740) was discovered by comparing our workflow result with the SQL average of the same data. It had existed for several releases without being caught by our tests, as the workflow ran successfully and returned a seemingly reasonable result.
This raises the question of whether other operators also produce results that differ from what users expect. The correctness of our basic operators is fundamental, and incorrect results are easy to miss when workflows complete without errors.
Proposed Approach
I think it is worth introducing fuzz testing, where we generate random input data, run it through an operator, and compare the results against a reference. We should also consider controlling how rows are distributed across workers rather than relying on the engine's default partitioning. The Aggregate AVERAGE bug only occurs with uneven partition sizes, and the default partitioning is nearly even, so random input data alone might not reliably catch it.
We could start with operators that have well-defined output semantics, such as Aggregate, Filter, Projection, Sort, Limit, Distinct, joins, and set operators.
A few things to consider:
Reference implementation: Compare results against SQL or pandas to verify operator correctness, and compare single-worker and multi-worker execution to identify distributed execution issues.
Execution configurations: Vary the number of workers, partition sizes (including uneven and empty partitions), and input order.
Testing scope: Should we test individual operators, workflows through the full engine, or both?
Test data coverage: Include edge cases such as null values, empty datasets, duplicate rows, and different data types.
Result comparison: Account for row ordering, floating-point precision, and null handling. Document any intentional differences from the reference.
Reproducibility and automation: Save random seeds and execution configurations to reproduce failures, add regression tests, and consider integrating these tests into CI.
Thanks @xuang7, +1. Our workflow-to-Python verification (#6072) compares each operator's engine output against its exported pandas script, but only with one worker, since a script has no workers to match. So it would not catch bugs like #9740, and the 1-worker vs N-worker engine comparison you propose is the right tool for those. Two things you could reuse: our shared fixture already covers nulls, empty tables and unusual column names, and we learned the comparison must check types, not just values, because pandas type inference once hid "6" vs "6.0" from us for months.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Motivation
The Aggregate AVERAGE bug (#9740) was discovered by comparing our workflow result with the SQL average of the same data. It had existed for several releases without being caught by our tests, as the workflow ran successfully and returned a seemingly reasonable result.
This raises the question of whether other operators also produce results that differ from what users expect. The correctness of our basic operators is fundamental, and incorrect results are easy to miss when workflows complete without errors.
Proposed Approach
I think it is worth introducing fuzz testing, where we generate random input data, run it through an operator, and compare the results against a reference. We should also consider controlling how rows are distributed across workers rather than relying on the engine's default partitioning. The Aggregate AVERAGE bug only occurs with uneven partition sizes, and the default partitioning is nearly even, so random input data alone might not reliably catch it.
We could start with operators that have well-defined output semantics, such as Aggregate, Filter, Projection, Sort, Limit, Distinct, joins, and set operators.
A few things to consider:
Thoughts and suggestions are welcome. Thanks!
All reactions