FAILURE MAP
← Case archive

FA-86776 / Procedural level generation constraints / Open access

Encounter pacing along the critical path: First encounter ignores the start gap · case 01

Enemies appear right at the level entrance.

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

ROOT CAUSE

The anchor starts before the level start.

VERIFIED REPAIR

Restore `last = 0` at the initial anchor step.

Unsuccessful approach: Anchoring at tile one shifts the first gap by one.

Case contract

Proposed positions are deduplicated and taken ascending. A position is legal when 1 <= pos <= length-2, is not a rest checkpoint (pos % rest_every == 0 when rest_every > 0), and lies at least min_gap after the anchor: the later of the last accepted encounter (initially the start, 0) and the last checkpoint at or before pos. Returns accepted positions.

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(length, encounters, min_gap, rest_every):
    out = []
    last = -min_gap
    for pos in sorted(set(encounters)):
        if pos < 1 or pos > length - 2:
            continue
        if rest_every and pos % rest_every == 0:
            continue
        anchor = last
        if rest_every:
            anchor = max(anchor, pos // rest_every * rest_every)
        if pos - anchor < min_gap:
            continue
        out.append(pos)
        last = pos
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('fault site initial anchor #1', [5, [-1, 1, 7, 5, -2], 3, 0], []),
  ('partial repair boundary #1', [40, [3, 4], 3, 0], [3]),
  ('partial repair boundary #2', [22, [17, 15, -1, 24, 7, 1, -2, 18, 2], 2, 7], [2, 17]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('fault site initial anchor #1', [14, [2], 5, 0], []),
  ('regression initial anchor #1', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('regression initial anchor #2', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('partial repair boundary #1', [22, [17, 15, -1, 24, 7, 1, -2, 18, 2], 2, 7], [2, 17]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [8, [3, 2, 8, 9, 7, -2, 0, 1], 2, 0], [2]),
  ('fault site initial anchor #1', [12, [2, 1, 11], 5, 0], []),
  ('partial repair boundary #1', [23, [2], 2, 0], [2]),
  ('partial repair boundary #2', [13, [4, 11, 8, 5], 5, 7], [5]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [13, [15, 4, 0, 6, 1, 2, 1, 14, 11], 2, 0], [2, 4, 6, 11]),
  ('fault site initial anchor #1', [20, [21, 8, 21, 2, -2, 8, 7], 5, 0], [7]),
  ('regression initial anchor #2', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('partial repair boundary #1', [5, [5, 0, 4, 3, 7], 3, 0], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [27, [20, 6, 10, 15, 26, -2, 12, 27, -1], 0, 0], [6, 10, 12, 15, 20])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('fault site initial anchor #1', [11, [3, 1, 9, 8, 7, 12], 5, 0], [7]),
  ('fault site initial anchor #2', [21, [4, 11, 0, 3, 11, 4, 4, -1, 23], 5, 0], [11]),
  ('partial repair boundary #1', [33, [17, 5, -1], 5, 7], [5]),
  ('partial repair boundary #2', [24, [5], 5, 7], [5]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [34, [-1, 30, 25, 20, 1, 11, 0], 5, 4], [])]]
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
checkpoint resets gap #1[2, 7][2, 7]Passed
regression initial anchor #1[1, 6][3, 6]Failed
fault site initial anchor #1[1][]Failed
partial repair boundary #1[3][3]Passed
partial repair boundary #2[2, 17][2, 17]Passed
duplicate proposals #1[3, 4][3, 4]Passed
last legal tile #1[8][8]Passed
control #1[][]Passed

SHA-256 / 6b9a912394204a0fa7fedc2de6df5710bbb2c556cf3deb132866019f533593b3

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(length, encounters, min_gap, rest_every):
    out = []
    last = 1
    for pos in sorted(set(encounters)):
        if pos < 1 or pos > length - 2:
            continue
        if rest_every and pos % rest_every == 0:
            continue
        anchor = last
        if rest_every:
            anchor = max(anchor, pos // rest_every * rest_every)
        if pos - anchor < min_gap:
            continue
        out.append(pos)
        last = pos
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('fault site initial anchor #1', [5, [-1, 1, 7, 5, -2], 3, 0], []),
  ('partial repair boundary #1', [40, [3, 4], 3, 0], [3]),
  ('partial repair boundary #2', [22, [17, 15, -1, 24, 7, 1, -2, 18, 2], 2, 7], [2, 17]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('fault site initial anchor #1', [14, [2], 5, 0], []),
  ('regression initial anchor #1', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('regression initial anchor #2', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('partial repair boundary #1', [22, [17, 15, -1, 24, 7, 1, -2, 18, 2], 2, 7], [2, 17]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [8, [3, 2, 8, 9, 7, -2, 0, 1], 2, 0], [2]),
  ('fault site initial anchor #1', [12, [2, 1, 11], 5, 0], []),
  ('partial repair boundary #1', [23, [2], 2, 0], [2]),
  ('partial repair boundary #2', [13, [4, 11, 8, 5], 5, 7], [5]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [13, [15, 4, 0, 6, 1, 2, 1, 14, 11], 2, 0], [2, 4, 6, 11]),
  ('fault site initial anchor #1', [20, [21, 8, 21, 2, -2, 8, 7], 5, 0], [7]),
  ('regression initial anchor #2', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('partial repair boundary #1', [5, [5, 0, 4, 3, 7], 3, 0], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [27, [20, 6, 10, 15, 26, -2, 12, 27, -1], 0, 0], [6, 10, 12, 15, 20])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('fault site initial anchor #1', [11, [3, 1, 9, 8, 7, 12], 5, 0], [7]),
  ('fault site initial anchor #2', [21, [4, 11, 0, 3, 11, 4, 4, -1, 23], 5, 0], [11]),
  ('partial repair boundary #1', [33, [17, 5, -1], 5, 7], [5]),
  ('partial repair boundary #2', [24, [5], 5, 7], [5]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [34, [-1, 30, 25, 20, 1, 11, 0], 5, 4], [])]]
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
checkpoint resets gap #1[7][2, 7]Failed
regression initial anchor #1[6][3, 6]Failed
fault site initial anchor #1[][]Passed
partial repair boundary #1[4][3]Failed
partial repair boundary #2[17][2, 17]Failed
duplicate proposals #1[3, 4][3, 4]Passed
last legal tile #1[8][8]Passed
control #1[][]Passed

SHA-256 / 3e4dfc1ab1bbcb9c3eebbe2351e84b97eb0b0491d94e2c876162e2dd4af3743d

3 / The verified repair

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

N = 1
observations = []
def solve(length, encounters, min_gap, rest_every):
    out = []
    last = 0
    for pos in sorted(set(encounters)):
        if pos < 1 or pos > length - 2:
            continue
        if rest_every and pos % rest_every == 0:
            continue
        anchor = last
        if rest_every:
            anchor = max(anchor, pos // rest_every * rest_every)
        if pos - anchor < min_gap:
            continue
        out.append(pos)
        last = pos
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('fault site initial anchor #1', [5, [-1, 1, 7, 5, -2], 3, 0], []),
  ('partial repair boundary #1', [40, [3, 4], 3, 0], [3]),
  ('partial repair boundary #2', [22, [17, 15, -1, 24, 7, 1, -2, 18, 2], 2, 7], [2, 17]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('fault site initial anchor #1', [14, [2], 5, 0], []),
  ('regression initial anchor #1', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('regression initial anchor #2', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('partial repair boundary #1', [22, [17, 15, -1, 24, 7, 1, -2, 18, 2], 2, 7], [2, 17]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [8, [3, 2, 8, 9, 7, -2, 0, 1], 2, 0], [2]),
  ('fault site initial anchor #1', [12, [2, 1, 11], 5, 0], []),
  ('partial repair boundary #1', [23, [2], 2, 0], [2]),
  ('partial repair boundary #2', [13, [4, 11, 8, 5], 5, 7], [5]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('regression initial anchor #1', [13, [15, 4, 0, 6, 1, 2, 1, 14, 11], 2, 0], [2, 4, 6, 11]),
  ('fault site initial anchor #1', [20, [21, 8, 21, 2, -2, 8, 7], 5, 0], [7]),
  ('regression initial anchor #2', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('partial repair boundary #1', [5, [5, 0, 4, 3, 7], 3, 0], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [27, [20, 6, 10, 15, 26, -2, 12, 27, -1], 0, 0], [6, 10, 12, 15, 20])],
 [('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('fault site initial anchor #1', [11, [3, 1, 9, 8, 7, 12], 5, 0], [7]),
  ('fault site initial anchor #2', [21, [4, 11, 0, 3, 11, 4, 4, -1, 23], 5, 0], [11]),
  ('partial repair boundary #1', [33, [17, 5, -1], 5, 7], [5]),
  ('partial repair boundary #2', [24, [5], 5, 7], [5]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('control #1', [34, [-1, 30, 25, 20, 1, 11, 0], 5, 4], [])]]
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
checkpoint resets gap #1[2, 7][2, 7]Passed
regression initial anchor #1[3, 6][3, 6]Passed
fault site initial anchor #1[][]Passed
partial repair boundary #1[3][3]Passed
partial repair boundary #2[2, 17][2, 17]Passed
duplicate proposals #1[3, 4][3, 4]Passed
last legal tile #1[8][8]Passed
control #1[][]Passed

SHA-256 / 4b4177be5313237f4553e042ae672e88c80823b01f70a80c234ce60c00af2693

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:52.719434+00:00.

Case digest / f7410f1cbc159e138970514dbcfe0e32f4985b404edac2358c7a1327d2a65268