# Boid flocking demo freezes after ~ 30 seconds regardless of the number of boids used

**URL:** <https://forum.babylonjs.com/t/boid-flocking-demo-freezes-after-30-seconds-regardless-of-the-number-of-boids-used/40110>\
**Category:** Bugs\
**Tags:** webgpu\
**Created:** [April 22, 2023, 7:36pm UTC](https://forum.babylonjs.com/t/boid-flocking-demo-freezes-after-30-seconds-regardless-of-the-number-of-boids-used/40110 "2023-04-22T19:36:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [April 22, 2023, 7:36pm UTC](https://forum.babylonjs.com/t/boid-flocking-demo-freezes-after-30-seconds-regardless-of-the-number-of-boids-used/40110/1 "2023-04-22T19:36:54Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/?webgpu#3URR7V%23186)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

When I run this playground in Chrome Version 113.0.5672.53 (Official Build) beta (64-bit) Windows,

The boid simulation runs fine for about 30 seconds, but after the boid traffic patterns start to stabilize, the simulation freezes with no errors in console and the page itself is fine (no lag with the mouse or typing in the editor).

Does this happen for anyone else?

When I run the demo from here:

> **[Compute Boids - WebGPU Samples](https://webgpu.github.io/webgpu-samples/samples/computeBoids)**
>
> A GPU compute particle simulation that mimics the flocking behavior of birds. A compute shader updates two ping-pong buffers which store particle data. The data is used to draw instanced particles.

It works just fine even with 150k boids.

More info:  
In the playground, the triangles just stop updating-

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/8/a8408fe0ff701da0c827d68cdfe662d7d1a734a6.png)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [April 22, 2023, 8:01pm UTC](https://forum.babylonjs.com/t/boid-flocking-demo-freezes-after-30-seconds-regardless-of-the-number-of-boids-used/40110/2 "2023-04-22T20:01:34Z")

</div>

I do not reproduce on my side (Chrome Canary 114.0.5727.0 / Windows 11 64 bits): it worked for 4mn without any problem.

Can you try with the latest version of Chrome Canary?

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [April 22, 2023, 8:04pm UTC](https://forum.babylonjs.com/t/boid-flocking-demo-freezes-after-30-seconds-regardless-of-the-number-of-boids-used/40110/3 "2023-04-22T20:04:26Z")

</div>

Installing the nightly build from:

> **[Chrome Canary](https://www.google.com/chrome/canary/thank-you.html?statcb=1&installdataindex=empty&defaultbrowser=0)**
>
> Nightly build for developers

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [April 22, 2023, 8:07pm UTC](https://forum.babylonjs.com/t/boid-flocking-demo-freezes-after-30-seconds-regardless-of-the-number-of-boids-used/40110/4 "2023-04-22T20:07:25Z")

</div>

Yeah… that seems to work fine. I don’t what gives lol.

---

<div class="post-metadata">

**Author:** ![arcman7](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/arcman7/32/20249_2.png) [@arcman7](https://forum.babylonjs.com/u/arcman7)\
**Post date:** [April 22, 2023, 8:29pm UTC](https://forum.babylonjs.com/t/boid-flocking-demo-freezes-after-30-seconds-regardless-of-the-number-of-boids-used/40110/5 "2023-04-22T20:29:30Z")

</div>

I don’t know if this is useful info or not but if I start the playground with the dev console open like so:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/b/8b82bd1a2f6ab0707c71aa63b8973c9ae5f031e5.png)

When it eventually freezes, if I just resize the window by changing the width of the dev console it unfreezes and the boid triangles start updating again as expected. If I don’t start off with console open, the resizing doesn’t affect anything and the triangles remain stuck after about 30 seconds.

I guess we’ll see if this is even an issue once Chrome 113 goes mainstream.
