Working but slow

This commit is contained in:
2026-07-06 23:11:42 +02:00
parent 09c1fba8e6
commit f93bcfb8d4
15 changed files with 4443 additions and 4205 deletions
+29
View File
@@ -188,6 +188,35 @@ describe('CA engine runtimes', () => {
expect(stepped.cells).toEqual(cells(5, 5, [[0, 2]]))
})
it('uses simulation rng_seed to choose deterministic Naga heads', () => {
const current = cells(6, 6)
const baseParams = {
caClass: { dimensions: 3, states: 7 },
renderer: { id: 'voxel-3d' },
simulation: {
engineId: 'naga-3d',
ruleId: 'naga-3d',
grid: { size: [6, 6, 6], boundary: 'wrap' },
initialCondition: {
type: 'cells',
cells: [[1, 2, 2, 1], [4, 2, 2, 1]]
}
}
} satisfies SceneParams
const leftSeed = stepCaSimulation(current, settings({
...baseParams,
simulation: { ...baseParams.simulation, rng_seed: 'bar' }
}))
const rightSeed = stepCaSimulation(current, settings({
...baseParams,
simulation: { ...baseParams.simulation, rng_seed: 'alpha' }
}))
expect(leftSeed.settings.simulation?.initialCondition?.cells).toEqual([[4, 2, 2, 1], [0, 2, 2, 1]])
expect(rightSeed.settings.simulation?.initialCondition?.cells).toEqual([[1, 2, 2, 1], [3, 2, 2, 1]])
})
it('keeps Naga 3D sparse coordinates in place when fixed boundaries would leave the grid', () => {
const current = cells(5, 5)
const params = settings({