In the original paper, cells neighbors are determined by a set of non-overlapping pairs of cells that is chosen at each simulation step. We don't do exactly the same, we choose the neighbor of each cell according to the last value on the tape instead:
|
else { neighbor = idx + 1u; } |
The problem is that our currently implementation doesn't guarantee that two different cells won't choose the same cell as neighbor. This is a problem because two parallel threads might write into the same memory cell, leading to unexpected results.
In the original paper, cells neighbors are determined by a set of non-overlapping pairs of cells that is chosen at each simulation step. We don't do exactly the same, we choose the neighbor of each cell according to the last value on the tape instead:
webgpu-self-replicating-programs/src/simulation/index.ts
Line 133 in 5386f08
The problem is that our currently implementation doesn't guarantee that two different cells won't choose the same cell as neighbor. This is a problem because two parallel threads might write into the same memory cell, leading to unexpected results.