FA-85876 / Game economy crafting balance / Open access
Salvage component return: Salvage floors the rarity share before condition · case 01
Damaged items return fewer components than the single-floor rule allows.
ROOT CAUSE
The rarity percentage is floored before multiplying by condition, compounding truncation.
THE FAILURE
The rarity percentage is floored before multiplying by condition, compounding truncation.
Unsuccessful approach: Rounding to nearest over-returns components whenever the fraction is at least one half.
Case contract
Return rate: common 50%, rare 70%, epic 90%. Condition d/mx with d clamped to mx; max_durability 0 means indestructible (full condition). Durability <= 0 yields {"scrap": 1}. Each component amount = floor(count*pct*d/(100*mx)) computed once; rare and epic items return at least 1 of each component; zero amounts are omitted.
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(item, components):
pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]
mx = item['max_durability']
if mx == 0:
d, mx = 1, 1
else:
d = min(item['durability'], mx)
if d <= 0:
return {'scrap': 1}
out = {}
for name, count in components.items():
amt = count * pct // 100 * d // mx
if item['rarity'] != 'common' and amt < 1:
amt = 1
if amt:
out[name] = amt
return dict(sorted(out.items()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('regression return rounding stage #1',
[{'rarity': 'epic', 'durability': 67, 'max_durability': 100}, {'cloth': 6, 'ingot': 2, 'shard': 5}],
{'cloth': 3, 'ingot': 1, 'shard': 3}),
('fault site return rounding stage #1',
[{'rarity': 'epic', 'durability': 4, 'max_durability': 7}, {'shard': 4, 'ingot': 4, 'cloth': 6}],
{'cloth': 3, 'ingot': 2, 'shard': 2}),
('partial repair boundary #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{}),
('partial repair boundary #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],
{'cloth': 3, 'ingot': 2, 'shard': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('regression return rounding stage #1',
[{'rarity': 'common', 'durability': 70, 'max_durability': 100}, {'cloth': 3, 'shard': 2}],
{'cloth': 1}),
('regression return rounding stage #2',
[{'rarity': 'epic', 'durability': 8, 'max_durability': 10}, {'ingot': 3, 'cloth': 5}],
{'cloth': 3, 'ingot': 2}),
('partial repair boundary #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],
{'cloth': 3, 'ingot': 2, 'shard': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 4, 'max_durability': 7}, {'cloth': 5}],
{'cloth': 2}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('fault site return rounding stage #1',
[{'rarity': 'epic', 'durability': 9, 'max_durability': 10}, {'cloth': 3, 'shard': 4, 'thread': 1}],
{'cloth': 2, 'shard': 3, 'thread': 1}),
('fault site return rounding stage #2',
[{'rarity': 'rare', 'durability': 37, 'max_durability': 50}, {'ingot': 4, 'shard': 6, 'cloth': 2}],
{'cloth': 1, 'ingot': 2, 'shard': 3}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 7, 'max_durability': 7}, {'thread': 2, 'ingot': 1, 'cloth': 1}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('partial repair boundary #2',
[{'rarity': 'rare', 'durability': 50, 'max_durability': 50}, {'thread': 4, 'shard': 2, 'ingot': 4}],
{'ingot': 2, 'shard': 1, 'thread': 2}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('regression return rounding stage #1',
[{'rarity': 'epic', 'durability': 5, 'max_durability': 7}, {'shard': 4, 'thread': 5, 'ingot': 5}],
{'ingot': 3, 'shard': 2, 'thread': 3}),
('regression return rounding stage #2',
[{'rarity': 'epic', 'durability': 67, 'max_durability': 100}, {'cloth': 6, 'ingot': 2, 'shard': 5}],
{'cloth': 3, 'ingot': 1, 'shard': 3}),
('partial repair boundary #1',
[{'rarity': 'rare', 'durability': 20, 'max_durability': 20}, {'shard': 2, 'cloth': 5, 'thread': 6}],
{'cloth': 3, 'shard': 1, 'thread': 4}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],
{'ingot': 4, 'thread': 3}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1',
[{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],
{'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('fault site return rounding stage #1',
[{'rarity': 'epic', 'durability': 4, 'max_durability': 7}, {'shard': 4, 'ingot': 4, 'cloth': 6}],
{'cloth': 3, 'ingot': 2, 'shard': 2}),
('regression return rounding stage #1',
[{'rarity': 'common', 'durability': 70, 'max_durability': 100}, {'cloth': 3, 'shard': 2}],
{'cloth': 1}),
('partial repair boundary #1',
[{'rarity': 'common', 'durability': 100, 'max_durability': 100}, {'thread': 3}],
{'thread': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 31, 'max_durability': 100}, {'thread': 1, 'cloth': 4, 'shard': 6}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1',
[{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],
{'ingot': 1, 'shard': 1, 'thread': 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| over-repaired common #1 | {'cloth': 1, 'ingot': 2} | {'cloth': 1, 'ingot': 2} | Passed |
| regression return rounding stage #1 | {'cloth': 3, 'ingot': 1, 'shard': 2} | {'cloth': 3, 'ingot': 1, 'shard': 3} | Failed |
| fault site return rounding stage #1 | {'cloth': 2, 'ingot': 1, 'shard': 1} | {'cloth': 3, 'ingot': 2, 'shard': 2} | Failed |
| partial repair boundary #1 | {} | {} | Passed |
| partial repair boundary #2 | {'cloth': 3, 'ingot': 2, 'shard': 1} | {'cloth': 3, 'ingot': 2, 'shard': 1} | Passed |
| indestructible relic #1 | {'shard': 4} | {'shard': 4} | Passed |
| broken rare #1 | {'scrap': 1} | {'scrap': 1} | Passed |
| control #1 | {'scrap': 1} | {'scrap': 1} | Passed |
SHA-256 / a6752da41f7b3af35b65cf902e762e982d385fdab7efe956510d0c16a477e761
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(item, components):
pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]
mx = item['max_durability']
if mx == 0:
d, mx = 1, 1
else:
d = min(item['durability'], mx)
if d <= 0:
return {'scrap': 1}
out = {}
for name, count in components.items():
amt = round(count * pct * d / (100 * mx))
if item['rarity'] != 'common' and amt < 1:
amt = 1
if amt:
out[name] = amt
return dict(sorted(out.items()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('regression return rounding stage #1',
[{'rarity': 'epic', 'durability': 67, 'max_durability': 100}, {'cloth': 6, 'ingot': 2, 'shard': 5}],
{'cloth': 3, 'ingot': 1, 'shard': 3}),
('fault site return rounding stage #1',
[{'rarity': 'epic', 'durability': 4, 'max_durability': 7}, {'shard': 4, 'ingot': 4, 'cloth': 6}],
{'cloth': 3, 'ingot': 2, 'shard': 2}),
('partial repair boundary #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{}),
('partial repair boundary #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],
{'cloth': 3, 'ingot': 2, 'shard': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('regression return rounding stage #1',
[{'rarity': 'common', 'durability': 70, 'max_durability': 100}, {'cloth': 3, 'shard': 2}],
{'cloth': 1}),
('regression return rounding stage #2',
[{'rarity': 'epic', 'durability': 8, 'max_durability': 10}, {'ingot': 3, 'cloth': 5}],
{'cloth': 3, 'ingot': 2}),
('partial repair boundary #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],
{'cloth': 3, 'ingot': 2, 'shard': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 4, 'max_durability': 7}, {'cloth': 5}],
{'cloth': 2}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('fault site return rounding stage #1',
[{'rarity': 'epic', 'durability': 9, 'max_durability': 10}, {'cloth': 3, 'shard': 4, 'thread': 1}],
{'cloth': 2, 'shard': 3, 'thread': 1}),
('fault site return rounding stage #2',
[{'rarity': 'rare', 'durability': 37, 'max_durability': 50}, {'ingot': 4, 'shard': 6, 'cloth': 2}],
{'cloth': 1, 'ingot': 2, 'shard': 3}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 7, 'max_durability': 7}, {'thread': 2, 'ingot': 1, 'cloth': 1}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('partial repair boundary #2',
[{'rarity': 'rare', 'durability': 50, 'max_durability': 50}, {'thread': 4, 'shard': 2, 'ingot': 4}],
{'ingot': 2, 'shard': 1, 'thread': 2}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('regression return rounding stage #1',
[{'rarity': 'epic', 'durability': 5, 'max_durability': 7}, {'shard': 4, 'thread': 5, 'ingot': 5}],
{'ingot': 3, 'shard': 2, 'thread': 3}),
('regression return rounding stage #2',
[{'rarity': 'epic', 'durability': 67, 'max_durability': 100}, {'cloth': 6, 'ingot': 2, 'shard': 5}],
{'cloth': 3, 'ingot': 1, 'shard': 3}),
('partial repair boundary #1',
[{'rarity': 'rare', 'durability': 20, 'max_durability': 20}, {'shard': 2, 'cloth': 5, 'thread': 6}],
{'cloth': 3, 'shard': 1, 'thread': 4}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],
{'ingot': 4, 'thread': 3}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1',
[{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],
{'scrap': 1})],
[('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('fault site return rounding stage #1',
[{'rarity': 'epic', 'durability': 4, 'max_durability': 7}, {'shard': 4, 'ingot': 4, 'cloth': 6}],
{'cloth': 3, 'ingot': 2, 'shard': 2}),
('regression return rounding stage #1',
[{'rarity': 'common', 'durability': 70, 'max_durability': 100}, {'cloth': 3, 'shard': 2}],
{'cloth': 1}),
('partial repair boundary #1',
[{'rarity': 'common', 'durability': 100, 'max_durability': 100}, {'thread': 3}],
{'thread': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 31, 'max_durability': 100}, {'thread': 1, 'cloth': 4, 'shard': 6}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1',
[{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],
{'ingot': 1, 'shard': 1, 'thread': 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| over-repaired common #1 | {'cloth': 2, 'ingot': 2} | {'cloth': 1, 'ingot': 2} | Failed |
| regression return rounding stage #1 | {'cloth': 4, 'ingot': 1, 'shard': 3} | {'cloth': 3, 'ingot': 1, 'shard': 3} | Failed |
| fault site return rounding stage #1 | {'cloth': 3, 'ingot': 2, 'shard': 2} | {'cloth': 3, 'ingot': 2, 'shard': 2} | Passed |
| partial repair boundary #1 | {'cloth': 1, 'thread': 1} | {} | Failed |
| partial repair boundary #2 | {'cloth': 4, 'ingot': 3, 'shard': 1} | {'cloth': 3, 'ingot': 2, 'shard': 1} | Failed |
| indestructible relic #1 | {'shard': 4} | {'shard': 4} | Passed |
| broken rare #1 | {'scrap': 1} | {'scrap': 1} | Passed |
| control #1 | {'scrap': 1} | {'scrap': 1} | Passed |
SHA-256 / 56f2f62fd24facf0f19d7048da6b42c67dad880469b68bcd42e1cbaae4609c6e
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:44.399507+00:00.
Case digest / a2174376efa38c5797095d66196483b7377227b248ef9e49fc89ccebb94f2871