Skip to content

Add memory guard to erosion dask paths#1121

Merged
brendancol merged 4 commits intomasterfrom
issue-erosion
Mar 31, 2026
Merged

Add memory guard to erosion dask paths#1121
brendancol merged 4 commits intomasterfrom
issue-erosion

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

  • Add _check_erosion_memory that estimates ~3x working set and raises MemoryError before .compute() when the full grid won't fit in available RAM

Context

Found during performance sweep (#1120). Particle erosion is inherently global — particles traverse random paths across the full grid. Can't be chunked. The docstring already documents this, but the code had no guard to prevent the OS OOM killer from stepping in on oversized inputs.

Test plan

  • All 15 existing erosion tests pass (verified)

Parallel subagent triage + ralph-loop workflow for auditing all
xrspatial modules for performance bottlenecks, OOM risk under
30TB dask workloads, and backend-specific anti-patterns.
7 tasks covering command scaffold, module scoring, parallel subagent
dispatch, report merging, ralph-loop generation, and smoke tests.
Particle erosion is inherently global and cannot be chunked. Add
_check_erosion_memory that estimates ~3x working set (input + brush
scratch + output) and raises MemoryError before .compute() when
the array won't fit in available RAM.
@github-actions github-actions bot added the performance PR touches performance-sensitive code label Mar 31, 2026
@brendancol brendancol merged commit 8efb6d0 into master Mar 31, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant