From d22abae47656605e2b706bfd5cb744af82bf1b19 Mon Sep 17 00:00:00 2001 From: Orkuncakilkaya Date: Wed, 30 Sep 2026 15:38:39 +0300 Subject: [PATCH] render3d: gf_hash's comment says what it is - a 64-bit mix (the big constants lex as longs, & 0xFFFFFFFF is & -1); deterministic, and narrowing it would move every painted thing Co-Authored-By: Claude Opus 5.5 --- packages/ludic.render3d/ground_fill.ludic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/ludic.render3d/ground_fill.ludic b/packages/ludic.render3d/ground_fill.ludic index 24821bc3..f456ed79 100644 --- a/packages/ludic.render3d/ground_fill.ludic +++ b/packages/ludic.render3d/ground_fill.ludic @@ -31,7 +31,8 @@ export function gf_step(g: GroundFill, band: int) -> float { return g.step3 } -# a hash of the candidate and one of its draws, 0..1 (a 32-bit mix: the same on every machine) +# a hash of the candidate and one of its draws, 0..1: a 64-bit mix (the big constants are longs, `& 0xFFFFFFFF` +# is & -1, a no-op) - deterministic everywhere; narrowing it moves every painted thing, as the golden shows export function gf_hash(a: int, b: int, c: int, d: int, e: int, k: int) -> float { var h = (a * 73856093) ^ (b * 19349663) ^ (c * 83492791) ^ (d * 2654435761) ^ (e * 1597334677) ^ (k * 3812015801) h = h & 0xFFFFFFFF