Belts carry 4 grains deep; stalled belts warn and stop animating (t45)

This commit is contained in:
2026-10-29 23:21:27 -04:00
parent 99aae0aae0
commit ac5f5a06d1
27 changed files with 335 additions and 51 deletions
+7 -1
View File
@@ -26,6 +26,11 @@ function setup() {
const m=materials[(random()*materials.length)|0];
setCell(y*W+x,m,m===MAGMA?1450:m===MCU?1200:m===STEAM?110:20,0);
}
for(let y=208;y<230;y++)for(let x=164;x<220;x++)setCell(y*W+x,EMPTY,20,0);
for(let bx=42;bx<53;bx++)placeBlock(BP_BELT,1,bx,55,true);
for(let y=210;y<222;y++)for(let x=212;x<216;x++)setCell(y*W+x,STONE,20,0);
for(let y=216;y<220;y++)for(let x=168;x<212;x++)setCell(y*W+x,SAND,20,0);
for(let k=0;k<6;k++)placeBlock(BP_BELT_UP,1,70+k,48-k,true);
// A cohesive vertical face spans chunk rows and must collapse identically in every pool.
for(let y=50;y<90;y++)for(let x=260;x<280;x++)
setCell(y*W+x,(x+y)%5===0?LCLAY:RSTONE,20,0);
@@ -42,7 +47,7 @@ function hash() {
const h = crypto.createHash('sha256');
for (const a of run('[mat,temp,life,flags,stamp,part,mach,digp,bgm,isPow,netId,awake,hot,hotLvl,powderArea,roofDirty,seen,renderDirty]'))
h.update(Buffer.from(a.buffer,a.byteOffset,a.byteLength));
h.update(run('JSON.stringify({RS,stats,EV,flyers,brokenMachines,pcells:[...pcells],powerDirty,weather,machines})'));
h.update(run('JSON.stringify({RS,stats,EV,flyers,brokenMachines,pcells:[...pcells],powerDirty,weather,machines,transport:[...transportState],slopePhase:Array.from(slopePhase)})'));
return h.digest('hex');
}
(async () => {
@@ -51,6 +56,7 @@ function hash() {
setup(); const stop = n ? await enableThreads(run,n) : null;
try {
run('for(let k=0;k<320;k++)simTick();');
assert(run('transportStalled(55*BW+48)'), 'worker fixture must include a loaded stalled belt');
const actual=hash();
if(!expected)expected=actual;
assert.strictEqual(actual,expected,`world and effects differ with ${n} workers`);