Skip to content

fix: add particle spawn limits and bounded snapshot channel#68

Merged
lowhung merged 1 commit into
mainfrom
fix/particle-limits-bounded-channel
Feb 7, 2026
Merged

fix: add particle spawn limits and bounded snapshot channel#68
lowhung merged 1 commit into
mainfrom
fix/particle-limits-bounded-channel

Conversation

@lowhung

@lowhung lowhung commented Feb 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add MAX_PARTICLES_PER_EDGE (50) and MAX_TOTAL_PARTICLES (5000) limits
  • Add MAX_PULSE_RINGS_PER_NODE (3) limit
  • Change snapshot channel from unbounded to bounded (capacity 100) for backpressure

Closes #27

Test plan

  • All tests pass
  • cargo clippy clean
  • cargo fmt clean
  • Verify particle limits work under high load (manual)

@lowhung lowhung force-pushed the fix/particle-limits-bounded-channel branch from cab6db6 to 3ac6129 Compare February 7, 2026 20:39
Prevents unbounded memory growth from particle accumulation (max 50 per
edge, 5000 total) and snapshot queue overflow (bounded to 100).

Closes #27
@lowhung lowhung force-pushed the fix/particle-limits-bounded-channel branch from 3ac6129 to f1ffac6 Compare February 7, 2026 23:37
@lowhung lowhung merged commit 610951f into main Feb 7, 2026
5 checks passed
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.

Add particle spawn limits to prevent memory issues

1 participant