Repository navigation
r.sim.water: remove flaky parallel comparison from test_nodxdy - #7520
Conversation
The parallel (nprocs=2) check in test_nodxdy compared depth cell-wise against a reference. Because r.sim.water is stochastic and thread scheduling changes the random walker update order (and results also vary by CPU and compiler), that comparison was flaky and intermittently failed CI on unrelated PRs. Remove that parallel cell-wise assertion (the deterministic serial check stays) and add a synthetic-data pytest that checks scheduling-independent properties for both serial and parallel runs: non-negative depth, every cell has a value, water is present, and more water accumulates downhill. Approach approved in OSGeo#7506.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the r.sim.water test strategy to avoid brittle pixel-perfect comparisons for parallel runs by introducing a property-based pytest test and removing the old parallelized reference-compare check.
Changes:
- Removed the previous parallelized
dxdytest and related temp map name from the legacy testsuite. - Added a new pytest test which validates physical invariants (non-negative depth, downhill accumulation) for both serial and parallel runs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| raster/r.sim/r.sim.water/testsuite/test_r_sim_water.py | Removes the old parallel nprocs=2 depth comparison and an associated temp raster name. |
| raster/r.sim/r.sim.water/tests/r_sim_water_test.py | Adds a new property-based pytest covering both nprocs=1 and nprocs=2 runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the review. A few clarifications:
Happy to adjust any of these if you would rather I do. |
petrasovaa
left a comment
There was a problem hiding this comment.
Hi, @wenzeslaus has been working on a comprehensive set of tests similar to this one and so I would suggest to only keep the removal of the flaky test in the PR.
|
Thanks Anna, that makes sense. I have narrowed this to only remove the flaky parallel comparison (the nprocs=2 block whose per-cell depths depend on walker scheduling and the RNG). I dropped the new pytest so it does not overlap with the comprehensive tests @wenzeslaus is working on. Ready for another look whenever you have time. |
…#7520) The parallel (nprocs=2) check in test_nodxdy compared depth cell-wise against a reference. Because r.sim.water is stochastic and thread scheduling changes the random walker update order (and results also vary by CPU and compiler), that comparison was flaky and intermittently failed CI on unrelated PRs.
Removes the flaky parallel (
nprocs=2) comparison fromtest_nodxdyin the r.sim.water gunittest. The per-cell depth values from a parallel run depend on walker scheduling and the RNG, soassertRastersEqualagainst a serial reference fails intermittently in CI (#7506). The deterministic serial cell-wise check is kept.Per review, broader pytest coverage is left to the comprehensive r.sim.water tests @wenzeslaus is working on, so this PR is now scoped to just the flaky test removal.
Fixes #7506.