Skip to content

Conversation

@SilverSpace505
Copy link
Contributor

This is a sample showing a particle life simulation that runs on WebGPU. It uses spatial partitioning with atomic linked lists / counting sort to achieve larger numbers of particles.

The sample code itself has become quite large (it's around 2000 lines spread across multiple files and folders). So it's probably better as an external sample.

The reason i'm submitting this as a sample is because the simulation itself does use atomic linked lists and counting sort in an applied context to do spatial partitioning allowing for the simulation to avoid n^2 computations improving performance. This property of the sample could potentially make it a useful resource to others looking to develop their own simulations that involve spatial partitioning or particles.

I'm happy to make any changes that may be needed to contribute.
Please let me know whether this sample is appropriate for inclusion.

External sample: https://gpu-life.silverspace.io?sample
Repository: https://github.com/SilverSpace505/gpu-life

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very fun sample! I agree the algorithms involved here seem interesting so they'll be useful learning materials. LGTM but let me add one more reviewer in case there's anything I didn't think of.

@kainino0x kainino0x requested a review from greggman December 12, 2025 22:54
Copy link
Collaborator

@greggman greggman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

@greggman greggman marked this pull request as ready for review December 12, 2025 23:49
@greggman greggman enabled auto-merge (rebase) December 12, 2025 23:50
@greggman greggman merged commit 426b33e into webgpu:main Dec 12, 2025
1 check 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.

3 participants