FAILURE MAP
← Case archive

FA-86026 / Game economy crafting balance / Open access

Enchantment upgrade ladder: Roll equal to chance succeeds · case 01

Upgrades succeed one percentage point more often than published.

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

ROOT CAUSE

The roll comparison is inclusive of the chance value.

THE FAILURE

The roll comparison is inclusive of the chance value.

Unsuccessful approach: Reading the next level chance applies the wrong row of the table.

Case contract

Success chance (percent) from level L: [100,100,100,90,80,70,60,50,40,30][L]; max level 10. A roll r (0..99) succeeds when r < chance. Failure at L <= 5 keeps the level; at L >= 6 consumes a protection if one is left (level kept); otherwise L 6..7 downgrades by one and L >= 8 breaks the item. Rolls stop being consumed once the item is at max level or broken; used counts consumed rolls.

Why this case matters

Game economies leak or destroy currency when one crafting or pricing rule is off by one boundary, rounding stage or state update; the defect is observable in exact integer outcomes.

1 / The failure

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

N = 1
observations = []
def solve(level, rolls, protections):
    chance = [100, 100, 100, 90, 80, 70, 60, 50, 40, 30]
    used = 0
    broken = False
    for r in rolls:
        if level >= 10 or broken:
            break
        used += 1
        if r <= chance[level]:
            level += 1
        elif level >= 6:
            if protections > 0:
                protections -= 1
            elif level >= 8:
                broken = True
            else:
                level -= 1
    return {'level': level, 'broken': broken, 'protections': protections, 'used': used}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('fault site success comparison #1',
   [9, [39, 30, 99, 29, 59, 99, 0], 1],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 2}),
  ('fault site success comparison #2',
   [8, [49, 40, 59], 2],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 3}),
  ('partial repair boundary #1',
   [0, [0, 30, 89, 99, 60, 0, 59, 59], 2],
   {'level': 7, 'broken': False, 'protections': 2, 'used': 8}),
  ('regression success comparison #1',
   [6, [40, 99, 50, 50, 29, 60], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 6}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [9, [99, 30], 0], {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('fault site success comparison #1',
   [8, [49, 40, 59], 2],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 3}),
  ('fault site success comparison #2',
   [6, [59, 50, 99, 50], 0],
   {'level': 6, 'broken': False, 'protections': 0, 'used': 4}),
  ('partial repair boundary #1',
   [0, [29, 91, 60, 89, 60, 39, 49], 0],
   {'level': 7, 'broken': False, 'protections': 0, 'used': 7}),
  ('regression success comparison #1',
   [7, [50, 39, 49, 90], 0],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 4}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [9, [99, 30], 0], {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('regression success comparison #1',
   [6, [40, 99, 50, 50, 29, 60], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 6}),
  ('fault site success comparison #1',
   [9, [30, 90, 40], 0],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 1}),
  ('partial repair boundary #1',
   [6, [47, 29, 60, 59, 39, 49, 59, 30], 2],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 6}),
  ('partial repair boundary #2',
   [3, [90, 89], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 2}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [9, [99, 30], 0], {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('fault site success comparison #1',
   [3, [49, 0, 0, 99, 50, 60], 0],
   {'level': 5, 'broken': False, 'protections': 0, 'used': 6}),
  ('regression success comparison #1',
   [7, [50, 39, 49, 90], 0],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 4}),
  ('partial repair boundary #1',
   [0, [90, 29, 59, 30, 59, 39, 50], 1],
   {'level': 7, 'broken': False, 'protections': 1, 'used': 7}),
  ('partial repair boundary #2',
   [6, [50, 90, 30, 89], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 4}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1',
   [9, [50, 40, 50, 0, 40, 29, 0], 0],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('regression success comparison #1',
   [6, [29, 50, 99, 60, 0, 50, 29, 99], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 8}),
  ('fault site success comparison #1',
   [3, [90], 1],
   {'level': 3, 'broken': False, 'protections': 1, 'used': 1}),
  ('partial repair boundary #1',
   [3, [89, 89, 0], 0],
   {'level': 5, 'broken': False, 'protections': 0, 'used': 3}),
  ('partial repair boundary #2',
   [6, [90, 59, 30, 90, 29, 40, 29, 40], 0],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 8}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [10, [90, 49, 29], 0], {'level': 10, 'broken': False, 'protections': 0, 'used': 0})]]
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
boundary roll equals chance #1{'broken': False, 'level': 5, 'protections': 0, 'used': 1}{'broken': False, 'level': 4, 'protections': 0, 'used': 1}Failed
fault site success comparison #1{'broken': False, 'level': 10, 'protections': 0, 'used': 2}{'broken': True, 'level': 9, 'protections': 0, 'used': 2}Failed
fault site success comparison #2{'broken': False, 'level': 9, 'protections': 0, 'used': 3}{'broken': True, 'level': 8, 'protections': 0, 'used': 3}Failed
partial repair boundary #1{'broken': False, 'level': 7, 'protections': 2, 'used': 8}{'broken': False, 'level': 7, 'protections': 2, 'used': 8}Passed
regression success comparison #1{'broken': True, 'level': 8, 'protections': 0, 'used': 4}{'broken': True, 'level': 8, 'protections': 0, 'used': 6}Failed
break at eight #1{'broken': True, 'level': 8, 'protections': 0, 'used': 1}{'broken': True, 'level': 8, 'protections': 0, 'used': 1}Passed
protected downgrade #1{'broken': False, 'level': 5, 'protections': 0, 'used': 2}{'broken': False, 'level': 5, 'protections': 0, 'used': 2}Passed
control #1{'broken': True, 'level': 9, 'protections': 0, 'used': 1}{'broken': True, 'level': 9, 'protections': 0, 'used': 1}Passed

SHA-256 / 099aaa591a775e8d897ebb66f866a8d3aff9b198872a70e42432fb9a1adff731

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(level, rolls, protections):
    chance = [100, 100, 100, 90, 80, 70, 60, 50, 40, 30]
    used = 0
    broken = False
    for r in rolls:
        if level >= 10 or broken:
            break
        used += 1
        if r < chance[min(level + 1, 9)]:
            level += 1
        elif level >= 6:
            if protections > 0:
                protections -= 1
            elif level >= 8:
                broken = True
            else:
                level -= 1
    return {'level': level, 'broken': broken, 'protections': protections, 'used': used}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('fault site success comparison #1',
   [9, [39, 30, 99, 29, 59, 99, 0], 1],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 2}),
  ('fault site success comparison #2',
   [8, [49, 40, 59], 2],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 3}),
  ('partial repair boundary #1',
   [0, [0, 30, 89, 99, 60, 0, 59, 59], 2],
   {'level': 7, 'broken': False, 'protections': 2, 'used': 8}),
  ('regression success comparison #1',
   [6, [40, 99, 50, 50, 29, 60], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 6}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [9, [99, 30], 0], {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('fault site success comparison #1',
   [8, [49, 40, 59], 2],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 3}),
  ('fault site success comparison #2',
   [6, [59, 50, 99, 50], 0],
   {'level': 6, 'broken': False, 'protections': 0, 'used': 4}),
  ('partial repair boundary #1',
   [0, [29, 91, 60, 89, 60, 39, 49], 0],
   {'level': 7, 'broken': False, 'protections': 0, 'used': 7}),
  ('regression success comparison #1',
   [7, [50, 39, 49, 90], 0],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 4}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [9, [99, 30], 0], {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('regression success comparison #1',
   [6, [40, 99, 50, 50, 29, 60], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 6}),
  ('fault site success comparison #1',
   [9, [30, 90, 40], 0],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 1}),
  ('partial repair boundary #1',
   [6, [47, 29, 60, 59, 39, 49, 59, 30], 2],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 6}),
  ('partial repair boundary #2',
   [3, [90, 89], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 2}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [9, [99, 30], 0], {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('fault site success comparison #1',
   [3, [49, 0, 0, 99, 50, 60], 0],
   {'level': 5, 'broken': False, 'protections': 0, 'used': 6}),
  ('regression success comparison #1',
   [7, [50, 39, 49, 90], 0],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 4}),
  ('partial repair boundary #1',
   [0, [90, 29, 59, 30, 59, 39, 50], 1],
   {'level': 7, 'broken': False, 'protections': 1, 'used': 7}),
  ('partial repair boundary #2',
   [6, [50, 90, 30, 89], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 4}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1',
   [9, [50, 40, 50, 0, 40, 29, 0], 0],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 1})],
 [('boundary roll equals chance #1',
   [4, [80], 0],
   {'level': 4, 'broken': False, 'protections': 0, 'used': 1}),
  ('regression success comparison #1',
   [6, [29, 50, 99, 60, 0, 50, 29, 99], 1],
   {'level': 8, 'broken': True, 'protections': 0, 'used': 8}),
  ('fault site success comparison #1',
   [3, [90], 1],
   {'level': 3, 'broken': False, 'protections': 1, 'used': 1}),
  ('partial repair boundary #1',
   [3, [89, 89, 0], 0],
   {'level': 5, 'broken': False, 'protections': 0, 'used': 3}),
  ('partial repair boundary #2',
   [6, [90, 59, 30, 90, 29, 40, 29, 40], 0],
   {'level': 9, 'broken': True, 'protections': 0, 'used': 8}),
  ('break at eight #1', [8, [95, 0], 0], {'level': 8, 'broken': True, 'protections': 0, 'used': 1}),
  ('protected downgrade #1', [6, [70, 70], 1], {'level': 5, 'broken': False, 'protections': 0, 'used': 2}),
  ('control #1', [10, [90, 49, 29], 0], {'level': 10, 'broken': False, 'protections': 0, 'used': 0})]]
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
boundary roll equals chance #1{'broken': False, 'level': 4, 'protections': 0, 'used': 1}{'broken': False, 'level': 4, 'protections': 0, 'used': 1}Passed
fault site success comparison #1{'broken': True, 'level': 9, 'protections': 0, 'used': 2}{'broken': True, 'level': 9, 'protections': 0, 'used': 2}Passed
fault site success comparison #2{'broken': True, 'level': 8, 'protections': 0, 'used': 3}{'broken': True, 'level': 8, 'protections': 0, 'used': 3}Passed
partial repair boundary #1{'broken': False, 'level': 6, 'protections': 1, 'used': 8}{'broken': False, 'level': 7, 'protections': 2, 'used': 8}Failed
regression success comparison #1{'broken': False, 'level': 5, 'protections': 0, 'used': 6}{'broken': True, 'level': 8, 'protections': 0, 'used': 6}Failed
break at eight #1{'broken': True, 'level': 8, 'protections': 0, 'used': 1}{'broken': True, 'level': 8, 'protections': 0, 'used': 1}Passed
protected downgrade #1{'broken': False, 'level': 5, 'protections': 0, 'used': 2}{'broken': False, 'level': 5, 'protections': 0, 'used': 2}Passed
control #1{'broken': True, 'level': 9, 'protections': 0, 'used': 1}{'broken': True, 'level': 9, 'protections': 0, 'used': 1}Passed

SHA-256 / 367ad49f2cb2a95cc37050d865c7f6ead2c4ccd762a19942821984f5b3145b5d

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / c97306921ffdab073f2a6dba853e7e965f6785421db3823eab9bc8b75b6ee189