Multi-core simulation: grain movement and heat across a worker pool (t88 phase 3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+12
-2
@@ -1,5 +1,5 @@
|
||||
"""Frozen legacy references, captured before retirement; compare the WebGPU world only."""
|
||||
import base64, pathlib, sys, subprocess
|
||||
import base64, gzip, json, pathlib, sys, subprocess
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent / 'tools'))
|
||||
from use_venv import ensure_playwright; ensure_playwright()
|
||||
from browser import launch, consume_gpu_option
|
||||
@@ -16,7 +16,17 @@ with launch(viewport={'width': 640, 'height': 480}) as (_, pg, url):
|
||||
for scene in ['renderer','joins','sky','lamp','opening','magma','fire']:
|
||||
for look in ['pixel','smooth']:
|
||||
for zoom in [12,2]:
|
||||
pg.evaluate('(h)=>{generateWorld(424242,640,h,null);enterGame();GAME.paused=true;}',512 if scene=='joins' else 384)
|
||||
height = 512 if scene=='joins' else 384
|
||||
frozen = json.loads(gzip.decompress((ROOT/f'test/fixtures/golden-world-640x{height}.json.gz').read_bytes()))
|
||||
# Keep the inputs that produced the legacy PNGs when simulation RNG changes.
|
||||
pg.evaluate("""([h, frozen])=>{
|
||||
generateWorld(424242,640,h,null);
|
||||
for(const [name,encoded]of Object.entries(frozen)) {
|
||||
const target=eval(name),raw=Uint8Array.from(atob(encoded),c=>c.charCodeAt(0));
|
||||
new Uint8Array(target.buffer).set(raw);
|
||||
}
|
||||
enterGame();GAME.paused=true;
|
||||
}""",[height,frozen])
|
||||
name = 'joins' if scene=='joins' else 't88-renderer' if scene in ['renderer','sky'] else 't88-light'
|
||||
pg.evaluate('() => {'+(ROOT / f'tools/scenes/{name}.js').read_text()+'}')
|
||||
if scene not in ['renderer','joins','sky']:
|
||||
|
||||
Reference in New Issue
Block a user