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 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-30 15:38:39 +03:00
parent 9ce51c2d49
commit d22abae476

View file

@ -31,7 +31,8 @@ export function gf_step(g: GroundFill, band: int) -> float {
return g.step3 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 { 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) var h = (a * 73856093) ^ (b * 19349663) ^ (c * 83492791) ^ (d * 2654435761) ^ (e * 1597334677) ^ (k * 3812015801)
h = h & 0xFFFFFFFF h = h & 0xFFFFFFFF