Faster roof scan and heat pass with identical results (t21)

- The roof is rescanned only in area columns that changed since the last scan: a quiet Huge
  world goes from 4.60 to 1.88 ms per scan (every 20 ticks).
- The heat pass skips react() for solids and powders below their first reaction threshold:
  Huge world digging 2.54 -> 2.34 ms/tick, quiet 1.39 -> 1.18.
- Every suite's output is identical apart from timing lines; seeds make the same worlds.
- test/t_sim_optimizations.js checks the dirty roof against a full scan and the heat loop
  against the reference loop byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 22:18:50 -04:00
co-authored by Claude Opus 5.5
parent cce81e4eca
commit 9937683a2c
9 changed files with 160 additions and 11 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
function simTick() {
tick++;
tickStamp = (tickStamp % 255) + 1;
if (tick % 20 === 1) updateRoof();
if (tick % 20 === 1) updateDirtyRoof();
weatherTick();
machinesTick();
pipesTick();