FAILURE MAP
← Case archive

FA-86511 / Procedural level generation constraints / Open access

Chunk seed derivation: Zero seed locks the generator · case 01

The origin chunk rolls the same value forever.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

A zero seed is fed to xorshift, which stays at zero.

VERIFIED REPAIR

Restore `x = s or 1` at the zero state guard step.

Unsuccessful approach: Forcing the low bit changes every even seed, not just zero.

Case contract

Coordinates are zigzag encoded (v >= 0 -> 2v, v < 0 -> -2v-1). seed = (world_seed*1000003 mod 2^32) xor (zz(cx)*73856093 mod 2^32) xor (zz(cy)*19349663 mod 2^32). The generator state is seed, or 1 when seed is 0, advanced by three 32-bit xorshift rounds (<<13, >>17, <<5, each left shift masked to 32 bits). Returns [seed, state % 100].

Why this case matters

Procedural generators silently emit unplayable or unfair levels when a single constraint check uses the wrong boundary, axis, neighborhood or update order; the defect is visible in exact generated geometry.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(world_seed, cx, cy):
    def zz(v):
        return v * 2 if v >= 0 else -v * 2 - 1
    s = (world_seed * 1000003) & 0xFFFFFFFF
    s ^= (zz(cx) * 73856093) & 0xFFFFFFFF
    s ^= (zz(cy) * 19349663) & 0xFFFFFFFF
    x = s
    for _ in range(3):
        x ^= (x << 13) & 0xFFFFFFFF
        x ^= x >> 17
        x ^= (x << 5) & 0xFFFFFFFF
    return [s, x % 100]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [0, 0, 3], [116097978, 65]),
  ('partial repair boundary #2', [1099511627779, -1, 155], [1640198686, 4]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [42, -1, 1], [78162845, 87]),
  ('control #2', [1099511627779, 1, 1], [179220301, 79]),
  ('control #3', [0, 2, -3], [341807727, 72])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [1099511627779, -374, 0], [3628518806, 87]),
  ('partial repair boundary #2', [1099511627779, -1, 3], [44085550, 32]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1099511627779, 1, 1], [179220301, 79]),
  ('control #2', [0, 2, -3], [341807727, 72]),
  ('control #3', [17601332116874, -1, 1], [1431083645, 95])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [2147483655, -2, 0], [2371752642, 72]),
  ('partial repair boundary #2', [1, -2, 1], [259333738, 52]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [0, -22, 3], [3147860005, 93]),
  ('control #2', [3799470242044, -1, 0], [3783972265, 71]),
  ('control #3', [0, 2, -405], [3029395203, 17])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [42, -1, -303], [3206913376, 67]),
  ('partial repair boundary #2', [1099511627779, -1, 0], [72037012, 17]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1099511627779, -1, -450], [144497865, 51]),
  ('control #2', [42, 1, -1], [191526619, 48]),
  ('control #3', [1099511627779, -2, -3], [148723909, 87])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [1099511627779, -2, 1], [257399520, 7]),
  ('partial repair boundary #2', [34120951125993, -2, 3], [4279618902, 0]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1, 1, 3], [237578563, 58]),
  ('control #2', [1099511627779, 420, 1], [1941083871, 61]),
  ('control #3', [2147483655, -2, -3], [2291814873, 91])]]
for label, args, expected in cases[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
origin with zero seed #1[0, 0][0, 61]Failed
partial repair boundary #1[116097978, 65][116097978, 65]Passed
partial repair boundary #2[1640198686, 4][1640198686, 4]Passed
negative neighbour chunk #1[115747491, 56][115747491, 56]Passed
mirrored coordinates #1[294384589, 20][294384589, 20]Passed
control #1[78162845, 87][78162845, 87]Passed
control #2[179220301, 79][179220301, 79]Passed
control #3[341807727, 72][341807727, 72]Passed

SHA-256 / 6ebaa149e49538662bbc66cc250c867414d39658d6621e83a014b2744a30749b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(world_seed, cx, cy):
    def zz(v):
        return v * 2 if v >= 0 else -v * 2 - 1
    s = (world_seed * 1000003) & 0xFFFFFFFF
    s ^= (zz(cx) * 73856093) & 0xFFFFFFFF
    s ^= (zz(cy) * 19349663) & 0xFFFFFFFF
    x = s | 1
    for _ in range(3):
        x ^= (x << 13) & 0xFFFFFFFF
        x ^= x >> 17
        x ^= (x << 5) & 0xFFFFFFFF
    return [s, x % 100]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [0, 0, 3], [116097978, 65]),
  ('partial repair boundary #2', [1099511627779, -1, 155], [1640198686, 4]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [42, -1, 1], [78162845, 87]),
  ('control #2', [1099511627779, 1, 1], [179220301, 79]),
  ('control #3', [0, 2, -3], [341807727, 72])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [1099511627779, -374, 0], [3628518806, 87]),
  ('partial repair boundary #2', [1099511627779, -1, 3], [44085550, 32]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1099511627779, 1, 1], [179220301, 79]),
  ('control #2', [0, 2, -3], [341807727, 72]),
  ('control #3', [17601332116874, -1, 1], [1431083645, 95])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [2147483655, -2, 0], [2371752642, 72]),
  ('partial repair boundary #2', [1, -2, 1], [259333738, 52]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [0, -22, 3], [3147860005, 93]),
  ('control #2', [3799470242044, -1, 0], [3783972265, 71]),
  ('control #3', [0, 2, -405], [3029395203, 17])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [42, -1, -303], [3206913376, 67]),
  ('partial repair boundary #2', [1099511627779, -1, 0], [72037012, 17]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1099511627779, -1, -450], [144497865, 51]),
  ('control #2', [42, 1, -1], [191526619, 48]),
  ('control #3', [1099511627779, -2, -3], [148723909, 87])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [1099511627779, -2, 1], [257399520, 7]),
  ('partial repair boundary #2', [34120951125993, -2, 3], [4279618902, 0]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1, 1, 3], [237578563, 58]),
  ('control #2', [1099511627779, 420, 1], [1941083871, 61]),
  ('control #3', [2147483655, -2, -3], [2291814873, 91])]]
for label, args, expected in cases[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
origin with zero seed #1[0, 61][0, 61]Passed
partial repair boundary #1[116097978, 84][116097978, 65]Failed
partial repair boundary #2[1640198686, 49][1640198686, 4]Failed
negative neighbour chunk #1[115747491, 56][115747491, 56]Passed
mirrored coordinates #1[294384589, 20][294384589, 20]Passed
control #1[78162845, 87][78162845, 87]Passed
control #2[179220301, 79][179220301, 79]Passed
control #3[341807727, 72][341807727, 72]Passed

SHA-256 / 3da1a7fc5c87bdb4a861688ec4255b138a6d065f669eb29984b0ce96a6085239

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(world_seed, cx, cy):
    def zz(v):
        return v * 2 if v >= 0 else -v * 2 - 1
    s = (world_seed * 1000003) & 0xFFFFFFFF
    s ^= (zz(cx) * 73856093) & 0xFFFFFFFF
    s ^= (zz(cy) * 19349663) & 0xFFFFFFFF
    x = s or 1
    for _ in range(3):
        x ^= (x << 13) & 0xFFFFFFFF
        x ^= x >> 17
        x ^= (x << 5) & 0xFFFFFFFF
    return [s, x % 100]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [0, 0, 3], [116097978, 65]),
  ('partial repair boundary #2', [1099511627779, -1, 155], [1640198686, 4]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [42, -1, 1], [78162845, 87]),
  ('control #2', [1099511627779, 1, 1], [179220301, 79]),
  ('control #3', [0, 2, -3], [341807727, 72])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [1099511627779, -374, 0], [3628518806, 87]),
  ('partial repair boundary #2', [1099511627779, -1, 3], [44085550, 32]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1099511627779, 1, 1], [179220301, 79]),
  ('control #2', [0, 2, -3], [341807727, 72]),
  ('control #3', [17601332116874, -1, 1], [1431083645, 95])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [2147483655, -2, 0], [2371752642, 72]),
  ('partial repair boundary #2', [1, -2, 1], [259333738, 52]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [0, -22, 3], [3147860005, 93]),
  ('control #2', [3799470242044, -1, 0], [3783972265, 71]),
  ('control #3', [0, 2, -405], [3029395203, 17])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [42, -1, -303], [3206913376, 67]),
  ('partial repair boundary #2', [1099511627779, -1, 0], [72037012, 17]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1099511627779, -1, -450], [144497865, 51]),
  ('control #2', [42, 1, -1], [191526619, 48]),
  ('control #3', [1099511627779, -2, -3], [148723909, 87])],
 [('origin with zero seed #1', [0, 0, 0], [0, 61]),
  ('partial repair boundary #1', [1099511627779, -2, 1], [257399520, 7]),
  ('partial repair boundary #2', [34120951125993, -2, 3], [4279618902, 0]),
  ('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
  ('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
  ('control #1', [1, 1, 3], [237578563, 58]),
  ('control #2', [1099511627779, 420, 1], [1941083871, 61]),
  ('control #3', [2147483655, -2, -3], [2291814873, 91])]]
for label, args, expected in cases[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
origin with zero seed #1[0, 61][0, 61]Passed
partial repair boundary #1[116097978, 65][116097978, 65]Passed
partial repair boundary #2[1640198686, 4][1640198686, 4]Passed
negative neighbour chunk #1[115747491, 56][115747491, 56]Passed
mirrored coordinates #1[294384589, 20][294384589, 20]Passed
control #1[78162845, 87][78162845, 87]Passed
control #2[179220301, 79][179220301, 79]Passed
control #3[341807727, 72][341807727, 72]Passed

SHA-256 / 7f0cdf97bb6a47e4d3fdd2d3ebe27fa4b36d973db53067d53f5093a0a4307561

Verification & scope

Deterministic toy contract stipulated for this model; integer or exact arithmetic only, not a reproduction of any specific game engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:50.198472+00:00.

Case digest / 0bfd5531231e25c07c467793932b2c6af510c8589810c190bd699239b5d6ffa8