FAILURE MAP
← Case archive

FA-86766 / Procedural level generation constraints / Open access

Encounter pacing along the critical path: Encounter on the exit tile · case 01

Players fight on the level exit.

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

ROOT CAUSE

The upper bound allows the exit position.

VERIFIED REPAIR

Restore `pos > length - 2` at the exit exclusion step.

Unsuccessful approach: The inclusive bound rejects the last legal tile.

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 = 0
    for pos in sorted(set(encounters)):
        if pos < 1 or pos > length - 1:
            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 = [[('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [27, [20, 6, 10, 15, 26, -2, 12, 27, -1], 0, 0], [6, 10, 12, 15, 20]),
  ('fault site exit exclusion #2', [14, [4, 9, 16, 9, 16, 7, 8, 16, 0, 13], 1, 5], [4, 7, 8, 9]),
  ('partial repair boundary #1', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('partial repair boundary #2', [5, [4, 5, 0, 7, 4, 3], 1, 4], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [14, [4, 9, 16, 9, 16, 7, 8, 16, 0, 13], 1, 5], [4, 7, 8, 9]),
  ('fault site exit exclusion #2', [40, [41, 39, 8, 9, 9, 32, 18, 41], 5, 0], [8, 18, 32]),
  ('partial repair boundary #1', [5, [4, 5, 0, 7, 4, 3], 1, 4], [3]),
  ('partial repair boundary #2', [5, [5, 0, 4, 3, 7], 3, 0], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('fault site exit exclusion #2', [14, [11, 0, 11, 6, 13, 15, 15, 3], 5, 7], [6]),
  ('regression exit exclusion #1', [20, [16, 11, 18, 18, -2, 4, 21, 19, 21], 0, 0], [4, 11, 16, 18]),
  ('partial repair boundary #1', [11, [-2, 9, 11], 0, 5], [9]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('regression exit exclusion #1', [20, [16, 11, 18, 18, -2, 4, 21, 19, 21], 0, 0], [4, 11, 16, 18]),
  ('fault site exit exclusion #1', [14, [13, -1, 2, 6], 0, 7], [2, 6]),
  ('partial repair boundary #1', [13, [15, 4, 0, 6, 1, 2, 1, 14, 11], 2, 0], [2, 4, 6, 11]),
  ('partial repair boundary #2', [12, [7, 2, 14, 6, 14, 14, 10], 1, 7], [2, 6, 10]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [34, [-1, 30, 25, 20, 1, 11, 0], 5, 4], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [8, [3, 2, 8, 9, 7, -2, 0, 1], 2, 0], [2]),
  ('fault site exit exclusion #2', [12, [2, 1, 11], 5, 0], []),
  ('partial repair boundary #1', [15, [3, 15, 2, 13], 2, 5], [2, 13]),
  ('regression exit exclusion #1', [5, [-2, 6, 4, 3, 7, 5, -1, 1, 2, -2], 1, 0], [1, 2, 3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [40, [3, 4], 3, 0], [3])]]
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
last legal tile #1[8, 9][8]Failed
fault site exit exclusion #1[6, 10, 12, 15, 20, 26][6, 10, 12, 15, 20]Failed
fault site exit exclusion #2[4, 7, 8, 9, 13][4, 7, 8, 9]Failed
partial repair boundary #1[3][3]Passed
partial repair boundary #2[3][3]Passed
duplicate proposals #1[3, 4][3, 4]Passed
checkpoint resets gap #1[2, 7][2, 7]Passed
control #1[][]Passed

SHA-256 / aee1cd2cfe2f1c494f179261bfa657358f0fe501cfbc82051c2368820c446474

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 = 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 = [[('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [27, [20, 6, 10, 15, 26, -2, 12, 27, -1], 0, 0], [6, 10, 12, 15, 20]),
  ('fault site exit exclusion #2', [14, [4, 9, 16, 9, 16, 7, 8, 16, 0, 13], 1, 5], [4, 7, 8, 9]),
  ('partial repair boundary #1', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('partial repair boundary #2', [5, [4, 5, 0, 7, 4, 3], 1, 4], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [14, [4, 9, 16, 9, 16, 7, 8, 16, 0, 13], 1, 5], [4, 7, 8, 9]),
  ('fault site exit exclusion #2', [40, [41, 39, 8, 9, 9, 32, 18, 41], 5, 0], [8, 18, 32]),
  ('partial repair boundary #1', [5, [4, 5, 0, 7, 4, 3], 1, 4], [3]),
  ('partial repair boundary #2', [5, [5, 0, 4, 3, 7], 3, 0], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('fault site exit exclusion #2', [14, [11, 0, 11, 6, 13, 15, 15, 3], 5, 7], [6]),
  ('regression exit exclusion #1', [20, [16, 11, 18, 18, -2, 4, 21, 19, 21], 0, 0], [4, 11, 16, 18]),
  ('partial repair boundary #1', [11, [-2, 9, 11], 0, 5], [9]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('regression exit exclusion #1', [20, [16, 11, 18, 18, -2, 4, 21, 19, 21], 0, 0], [4, 11, 16, 18]),
  ('fault site exit exclusion #1', [14, [13, -1, 2, 6], 0, 7], [2, 6]),
  ('partial repair boundary #1', [13, [15, 4, 0, 6, 1, 2, 1, 14, 11], 2, 0], [2, 4, 6, 11]),
  ('partial repair boundary #2', [12, [7, 2, 14, 6, 14, 14, 10], 1, 7], [2, 6, 10]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [34, [-1, 30, 25, 20, 1, 11, 0], 5, 4], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [8, [3, 2, 8, 9, 7, -2, 0, 1], 2, 0], [2]),
  ('fault site exit exclusion #2', [12, [2, 1, 11], 5, 0], []),
  ('partial repair boundary #1', [15, [3, 15, 2, 13], 2, 5], [2, 13]),
  ('regression exit exclusion #1', [5, [-2, 6, 4, 3, 7, 5, -1, 1, 2, -2], 1, 0], [1, 2, 3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [40, [3, 4], 3, 0], [3])]]
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
last legal tile #1[][8]Failed
fault site exit exclusion #1[6, 10, 12, 15, 20][6, 10, 12, 15, 20]Passed
fault site exit exclusion #2[4, 7, 8, 9][4, 7, 8, 9]Passed
partial repair boundary #1[][3]Failed
partial repair boundary #2[][3]Failed
duplicate proposals #1[3, 4][3, 4]Passed
checkpoint resets gap #1[2, 7][2, 7]Passed
control #1[][]Passed

SHA-256 / ad15436e309030c88f29d554771b4bcf7149b06a38767c5d4edfaf25944bf159

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 = [[('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [27, [20, 6, 10, 15, 26, -2, 12, 27, -1], 0, 0], [6, 10, 12, 15, 20]),
  ('fault site exit exclusion #2', [14, [4, 9, 16, 9, 16, 7, 8, 16, 0, 13], 1, 5], [4, 7, 8, 9]),
  ('partial repair boundary #1', [5, [4, 3, 1, 6, 0, 1, 3, 4], 3, 0], [3]),
  ('partial repair boundary #2', [5, [4, 5, 0, 7, 4, 3], 1, 4], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [14, [4, 9, 16, 9, 16, 7, 8, 16, 0, 13], 1, 5], [4, 7, 8, 9]),
  ('fault site exit exclusion #2', [40, [41, 39, 8, 9, 9, 32, 18, 41], 5, 0], [8, 18, 32]),
  ('partial repair boundary #1', [5, [4, 5, 0, 7, 4, 3], 1, 4], [3]),
  ('partial repair boundary #2', [5, [5, 0, 4, 3, 7], 3, 0], [3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [10, [1, 3, 6, 0, 12, 9, 7, -1], 3, 0], [3, 6]),
  ('fault site exit exclusion #2', [14, [11, 0, 11, 6, 13, 15, 15, 3], 5, 7], [6]),
  ('regression exit exclusion #1', [20, [16, 11, 18, 18, -2, 4, 21, 19, 21], 0, 0], [4, 11, 16, 18]),
  ('partial repair boundary #1', [11, [-2, 9, 11], 0, 5], [9]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [21, [-2, 16], 2, 5], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('regression exit exclusion #1', [20, [16, 11, 18, 18, -2, 4, 21, 19, 21], 0, 0], [4, 11, 16, 18]),
  ('fault site exit exclusion #1', [14, [13, -1, 2, 6], 0, 7], [2, 6]),
  ('partial repair boundary #1', [13, [15, 4, 0, 6, 1, 2, 1, 14, 11], 2, 0], [2, 4, 6, 11]),
  ('partial repair boundary #2', [12, [7, 2, 14, 6, 14, 14, 10], 1, 7], [2, 6, 10]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [34, [-1, 30, 25, 20, 1, 11, 0], 5, 4], [])],
 [('last legal tile #1', [10, [8, 9], 1, 0], [8]),
  ('fault site exit exclusion #1', [8, [3, 2, 8, 9, 7, -2, 0, 1], 2, 0], [2]),
  ('fault site exit exclusion #2', [12, [2, 1, 11], 5, 0], []),
  ('partial repair boundary #1', [15, [3, 15, 2, 13], 2, 5], [2, 13]),
  ('regression exit exclusion #1', [5, [-2, 6, 4, 3, 7, 5, -1, 1, 2, -2], 1, 0], [1, 2, 3]),
  ('duplicate proposals #1', [10, [3, 3, 4], 0, 0], [3, 4]),
  ('checkpoint resets gap #1', [20, [2, 6, 7], 2, 5], [2, 7]),
  ('control #1', [40, [3, 4], 3, 0], [3])]]
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
last legal tile #1[8][8]Passed
fault site exit exclusion #1[6, 10, 12, 15, 20][6, 10, 12, 15, 20]Passed
fault site exit exclusion #2[4, 7, 8, 9][4, 7, 8, 9]Passed
partial repair boundary #1[3][3]Passed
partial repair boundary #2[3][3]Passed
duplicate proposals #1[3, 4][3, 4]Passed
checkpoint resets gap #1[2, 7][2, 7]Passed
control #1[][]Passed

SHA-256 / 16c3e17a451cf4a4b70542298f6dbdb6f47b78da06048dd876d81eba0d55ae02

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

Case digest / 02532f6f59306615a9614b15a9a56afa6e6891fe3c7a6eac5ab71e67b1a27e69