The sand hash moves with the grid it is over

screen-width and screen-height went from 1400x1000 to 900x600, and the first
colour changed. Those are defconsts the checker consumes to size rows and cols,
so the grid is a different shape and the hash over it is a different number.
Updated rather than reverted: the change is deliberate and the hash is a
regression test for the simulation being reproducible, not for it being any
particular size.

Checked the way the old number was: -2851001042534928384 on native and on
wasm32, byte for byte. A hash that moved on only one target would mean the
change had broken reproducibility rather than the grid, which is the thing this
case exists to catch.
This commit is contained in:
Joseph Ferano 2026-09-12 03:43:18 +07:00
parent 5170746de5
commit 540b2aaadd
2 changed files with 3 additions and 3 deletions

View File

@ -139,7 +139,7 @@ reader ✅ → parse ✅ → load ✅ → check ✅ → emit ✅ → clang ✅
$ flan run calc-me.flan "1 + 2 * (3 - 0.5) / 2"
3.5
$ flan run test/programs/sand-headless.flan
2256461126764447066
-2851001042534928384
$ flan run sand.flan # a window, 120 fps, hold space
```
@ -1277,7 +1277,7 @@ and changing one's type is a silent mismatch against storage the host already la
Deferred until after the dev loop:
6. ~~**wasm32.**~~ **Done, with one glued joint.** `flan build --target=wasm32-wasi` produces a module, and
`test/programs/sand-headless.flan` prints `2256461126764447066` under it — the same hash as native, byte for byte, at
`test/programs/sand-headless.flan` prints `-2851001042534928384` under it — the same hash as native, byte for byte, at
`-O2` and at `-O0`. That is the milestone: the RNG is ours rather than libc's precisely so that number can be compared
across targets, and it compares equal. `values.flan` and `machine.flan` run there too, which is where a 32-bit pointer
would have shown. The acceptance table runs all four, and skips them by *probing* — it builds the smallest program and

View File

@ -361,7 +361,7 @@ let () =
and not raylib, deliberately a program that imports raylib links
libraylib on every target, and this one is the version meant to run on
wasm32 too. The hash is reproducible only because rand-f32 is ours. *)
let sand_out = "2256461126764447066\n" in
let sand_out = "-2851001042534928384\n" in
outputs "sand, headless" "programs/sand-headless.flan" sand_out;
outputs ~opt:"-O0" "sand, headless, -O0" "programs/sand-headless.flan" sand_out;