FA-86501 / Procedural level generation constraints / Open access
Chunk seed derivation: Negative chunks reuse positive seeds · case 01
Terrain at chunk -1 repeats chunk 1.
ROOT CAUSE
Negative coordinates map to the same code as their positive mirror.
VERIFIED REPAIR
Restore `-v * 2 - 1` at the zigzag negatives step.
Unsuccessful approach: Odd codes offset by one collide with the next negative coordinate.
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
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 = [[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [42, -1, 1], [78162845, 87]),
('regression zigzag negatives #2', [1099511627779, -1, 155], [1640198686, 4]),
('regression zigzag negatives #3', [1099511627779, -374, 0], [3628518806, 87]),
('regression zigzag negatives #4', [0, 2, -3], [341807727, 72]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [1099511627779, -1, 155], [1640198686, 4]),
('regression zigzag negatives #2', [1099511627779, -374, 0], [3628518806, 87]),
('regression zigzag negatives #3', [0, 2, -3], [341807727, 72]),
('regression zigzag negatives #4', [1099511627779, -1, 3], [44085550, 32]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [0, 2, -3], [341807727, 72]),
('regression zigzag negatives #2', [1099511627779, -1, 3], [44085550, 32]),
('regression zigzag negatives #3', [2147483655, -2, 0], [2371752642, 72]),
('regression zigzag negatives #4', [1, -2, 1], [259333738, 52]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [2147483655, -2, 0], [2371752642, 72]),
('regression zigzag negatives #2', [1, -2, 1], [259333738, 52]),
('regression zigzag negatives #3', [42, -1, -303], [3206913376, 67]),
('regression zigzag negatives #4', [17601332116874, -1, 1], [1431083645, 95]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [1099511627779, 1, 1], [179220301, 79])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [42, -1, -303], [3206913376, 67]),
('regression zigzag negatives #2', [17601332116874, -1, 1], [1431083645, 95]),
('regression zigzag negatives #3', [1099511627779, -1, 0], [72037012, 17]),
('regression zigzag negatives #4', [0, -22, 3], [3147860005, 93]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [42, 1, 0], [172832324, 53])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| negative neighbour chunk #1 | [172832324, 53] | [115747491, 56] | Failed |
| regression zigzag negatives #1 | [134461306, 50] | [78162845, 87] | Failed |
| regression zigzag negatives #2 | [1835560697, 73] | [1640198686, 4] | Failed |
| regression zigzag negatives #3 | [3707517301, 91] | [3628518806, 87] | Failed |
| regression zigzag negatives #4 | [393237198, 82] | [341807727, 72] | Failed |
| origin with zero seed #1 | [0, 61] | [0, 61] | Passed |
| mirrored coordinates #1 | [294384589, 20] | [294384589, 20] | Passed |
| control #1 | [116097978, 65] | [116097978, 65] | Passed |
SHA-256 / 5df387e6c9cc79dc48fb00ae571021515ff8d23f43742c048bf32ea16092a13e
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 abs(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 = [[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [42, -1, 1], [78162845, 87]),
('regression zigzag negatives #2', [1099511627779, -1, 155], [1640198686, 4]),
('regression zigzag negatives #3', [1099511627779, -374, 0], [3628518806, 87]),
('regression zigzag negatives #4', [0, 2, -3], [341807727, 72]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [1099511627779, -1, 155], [1640198686, 4]),
('regression zigzag negatives #2', [1099511627779, -374, 0], [3628518806, 87]),
('regression zigzag negatives #3', [0, 2, -3], [341807727, 72]),
('regression zigzag negatives #4', [1099511627779, -1, 3], [44085550, 32]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [0, 2, -3], [341807727, 72]),
('regression zigzag negatives #2', [1099511627779, -1, 3], [44085550, 32]),
('regression zigzag negatives #3', [2147483655, -2, 0], [2371752642, 72]),
('regression zigzag negatives #4', [1, -2, 1], [259333738, 52]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [2147483655, -2, 0], [2371752642, 72]),
('regression zigzag negatives #2', [1, -2, 1], [259333738, 52]),
('regression zigzag negatives #3', [42, -1, -303], [3206913376, 67]),
('regression zigzag negatives #4', [17601332116874, -1, 1], [1431083645, 95]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [1099511627779, 1, 1], [179220301, 79])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [42, -1, -303], [3206913376, 67]),
('regression zigzag negatives #2', [17601332116874, -1, 1], [1431083645, 95]),
('regression zigzag negatives #3', [1099511627779, -1, 0], [72037012, 17]),
('regression zigzag negatives #4', [0, -22, 3], [3147860005, 93]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [42, 1, 0], [172832324, 53])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| negative neighbour chunk #1 | [263455721, 65] | [115747491, 56] | Failed |
| regression zigzag negatives #1 | [234521303, 90] | [78162845, 87] | Failed |
| regression zigzag negatives #2 | [1754356564, 21] | [1640198686, 4] | Failed |
| regression zigzag negatives #3 | [3776262864, 85] | [3628518806, 87] | Failed |
| regression zigzag negatives #4 | [428414253, 50] | [341807727, 72] | Failed |
| origin with zero seed #1 | [0, 61] | [0, 61] | Passed |
| mirrored coordinates #1 | [294384589, 20] | [294384589, 20] | Passed |
| control #1 | [116097978, 65] | [116097978, 65] | Passed |
SHA-256 / 4ef0e760d4134a84b5b94357c9e3916413495047466a63e30e199d7049ab1e98
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 = [[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [42, -1, 1], [78162845, 87]),
('regression zigzag negatives #2', [1099511627779, -1, 155], [1640198686, 4]),
('regression zigzag negatives #3', [1099511627779, -374, 0], [3628518806, 87]),
('regression zigzag negatives #4', [0, 2, -3], [341807727, 72]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [1099511627779, -1, 155], [1640198686, 4]),
('regression zigzag negatives #2', [1099511627779, -374, 0], [3628518806, 87]),
('regression zigzag negatives #3', [0, 2, -3], [341807727, 72]),
('regression zigzag negatives #4', [1099511627779, -1, 3], [44085550, 32]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [0, 2, -3], [341807727, 72]),
('regression zigzag negatives #2', [1099511627779, -1, 3], [44085550, 32]),
('regression zigzag negatives #3', [2147483655, -2, 0], [2371752642, 72]),
('regression zigzag negatives #4', [1, -2, 1], [259333738, 52]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [0, 0, 3], [116097978, 65])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [2147483655, -2, 0], [2371752642, 72]),
('regression zigzag negatives #2', [1, -2, 1], [259333738, 52]),
('regression zigzag negatives #3', [42, -1, -303], [3206913376, 67]),
('regression zigzag negatives #4', [17601332116874, -1, 1], [1431083645, 95]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [1099511627779, 1, 1], [179220301, 79])],
[('negative neighbour chunk #1', [42, -1, 0], [115747491, 56]),
('regression zigzag negatives #1', [42, -1, -303], [3206913376, 67]),
('regression zigzag negatives #2', [17601332116874, -1, 1], [1431083645, 95]),
('regression zigzag negatives #3', [1099511627779, -1, 0], [72037012, 17]),
('regression zigzag negatives #4', [0, -22, 3], [3147860005, 93]),
('origin with zero seed #1', [0, 0, 0], [0, 61]),
('mirrored coordinates #1', [7, 3, 5], [294384589, 20]),
('control #1', [42, 1, 0], [172832324, 53])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| negative neighbour chunk #1 | [115747491, 56] | [115747491, 56] | Passed |
| regression zigzag negatives #1 | [78162845, 87] | [78162845, 87] | Passed |
| regression zigzag negatives #2 | [1640198686, 4] | [1640198686, 4] | Passed |
| regression zigzag negatives #3 | [3628518806, 87] | [3628518806, 87] | Passed |
| regression zigzag negatives #4 | [341807727, 72] | [341807727, 72] | Passed |
| origin with zero seed #1 | [0, 61] | [0, 61] | Passed |
| mirrored coordinates #1 | [294384589, 20] | [294384589, 20] | Passed |
| control #1 | [116097978, 65] | [116097978, 65] | Passed |
SHA-256 / 5e684957fa8ad4cdc4836094dd66abe1f271388b2d1a5600051846d7bcc1c29d
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.147349+00:00.
Case digest / a75f6ba1114ac21c277c349156b74e3fa9f83b5d0ade90716610fac24456df45