FAILURE MAP
← Case archive

FA-86286 / Game economy crafting balance / Open access

Crafting station queue: Sped-up durations round up · case 01

Speed bonuses are worth less than the floor rule.

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

ROOT CAUSE

The effective duration is rounded up.

THE FAILURE

The effective duration is rounded up.

Unsuccessful approach: Round-to-nearest still rounds half and above upward.

Case contract

jobs = [[name, duration], ...] in queue order. Effective duration = max(1, floor(duration*(100-speed)/100)). Each job starts on the station that frees earliest (lowest index on ties) at that station free time. Return names of jobs finished by now (finish <= now) ordered by finish time then queue position.

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(jobs, stations, speed, now):
    free = [0] * stations
    done = []
    for idx, (name, dur) in enumerate(jobs):
        d = max(1, -(-dur * (100 - speed) // 100))
        s = min(range(stations), key=lambda k: (free[k], k))
        start = free[s]
        free[s] = start + d
        done.append((free[s], idx, name))
    return [name for fin, idx, name in sorted(done) if fin <= now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site duration rounding #1',
   [[['flask', 5], ['bow', 10], ['anvil', 1], ['dagger', 2], ['cape', 78]], 2, 50, 208],
   ['flask', 'anvil', 'dagger', 'bow', 'cape']),
  ('regression duration rounding #1', [[['ember', 2], ['cape', 5]], 1, 10, 5], ['ember', 'cape']),
  ('regression duration rounding #2', [[['flask', 2], ['cape', 1]], 3, 25, 30], ['flask', 'cape']),
  ('regression duration rounding #3',
   [[['cape', 2], ['flask', 2], ['dagger', 32], ['anvil', 1]], 1, 10, 30],
   ['cape', 'flask', 'dagger']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('speed floor #1', [[['x', 1], ['y', 1]], 1, 90, 2], ['x', 'y']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('control #1',
   [[['flask', 2], ['bow', 10], ['cape', 1], ['dagger', 2], ['anvil', 10], ['ember', 10]], 2, 10, 5],
   ['flask', 'cape', 'dagger'])],
 [('fault site duration rounding #1',
   [[['flask', 114], ['ember', 60], ['cape', 10], ['anvil', 5]], 2, 99, 169],
   ['flask', 'ember', 'cape', 'anvil']),
  ('regression duration rounding #1', [[['flask', 2], ['cape', 1]], 3, 25, 30], ['flask', 'cape']),
  ('regression duration rounding #2',
   [[['cape', 2], ['flask', 2], ['dagger', 32], ['anvil', 1]], 1, 10, 30],
   ['cape', 'flask', 'dagger']),
  ('regression duration rounding #3', [[['dagger', 2], ['flask', 1]], 2, 10, 148], ['dagger', 'flask']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('control #1',
   [[['flask', 2], ['bow', 10], ['cape', 1], ['dagger', 2], ['anvil', 10], ['ember', 10]], 2, 10, 5],
   ['flask', 'cape', 'dagger']),
  ('control #2',
   [[['flask', 1], ['cape', 60], ['ember', 1], ['bow', 1], ['anvil', 2], ['dagger', 33]], 2, 25, 1],
   ['flask'])],
 [('regression duration rounding #1',
   [[['cape', 2], ['flask', 2], ['dagger', 32], ['anvil', 1]], 1, 10, 30],
   ['cape', 'flask', 'dagger']),
  ('regression duration rounding #2', [[['dagger', 2], ['flask', 1]], 2, 10, 148], ['dagger', 'flask']),
  ('regression duration rounding #3', [[['dagger', 2], ['ember', 1]], 3, 25, 48], ['dagger', 'ember']),
  ('regression duration rounding #4',
   [[['ember', 2], ['cape', 2], ['dagger', 55], ['anvil', 1]], 3, 90, 5],
   ['ember', 'cape', 'anvil', 'dagger']),
  ('speed floor #1', [[['x', 1], ['y', 1]], 1, 90, 2], ['x', 'y']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('control #1',
   [[['flask', 1], ['cape', 60], ['ember', 1], ['bow', 1], ['anvil', 2], ['dagger', 33]], 2, 25, 1],
   ['flask']),
  ('control #2',
   [[['anvil', 2], ['flask', 2], ['cape', 1], ['dagger', 103], ['ember', 5]], 2, 10, 60],
   ['anvil', 'flask', 'cape', 'ember'])],
 [('fault site duration rounding #1',
   [[['cape', 32], ['anvil', 1], ['flask', 1], ['ember', 5], ['bow', 10], ['dagger', 5]], 3, 50, 5],
   ['anvil', 'flask', 'ember', 'dagger']),
  ('regression duration rounding #1', [[['dagger', 2], ['ember', 1]], 3, 25, 48], ['dagger', 'ember']),
  ('regression duration rounding #2',
   [[['cape', 10], ['bow', 5], ['dagger', 38], ['anvil', 60]], 1, 90, 5],
   ['cape', 'bow', 'dagger']),
  ('regression duration rounding #3',
   [[['bow', 5], ['anvil', 2], ['cape', 60], ['dagger', 60], ['ember', 44], ['flask', 2]], 1, 25, 5],
   ['bow', 'anvil']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('speed floor #1', [[['x', 1], ['y', 1]], 1, 90, 2], ['x', 'y']),
  ('control #1',
   [[['dagger', 10], ['bow', 119], ['cape', 1], ['flask', 2], ['ember', 60], ['anvil', 5]], 1, 0, 60],
   ['dagger']),
  ('control #2', [[['dagger', 1], ['bow', 5]], 1, 99, 161], ['dagger', 'bow'])],
 [('regression duration rounding #1',
   [[['ember', 2], ['cape', 2], ['dagger', 55], ['anvil', 1]], 3, 90, 5],
   ['ember', 'cape', 'anvil', 'dagger']),
  ('fault site duration rounding #1',
   [[['anvil', 71], ['ember', 5], ['flask', 16], ['dagger', 60], ['cape', 88]], 3, 90, 60],
   ['ember', 'flask', 'anvil', 'dagger', 'cape']),
  ('regression duration rounding #2',
   [[['anvil', 69], ['bow', 118], ['flask', 2], ['ember', 60], ['dagger', 1]], 3, 10, 1],
   ['flask']),
  ('regression duration rounding #3',
   [[['flask', 17], ['bow', 1], ['dagger', 60], ['ember', 17]], 3, 90, 1],
   ['flask', 'bow']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('control #1',
   [[['dagger', 60], ['flask', 1], ['anvil', 60], ['cape', 1], ['ember', 5], ['bow', 33]], 1, 99, 154],
   ['dagger', 'flask', 'anvil', 'cape', 'ember', 'bow']),
  ('control #2', [[['anvil', 2]], 3, 90, 1], ['anvil'])]]
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
fault site duration rounding #1['flask', 'anvil', 'bow', 'dagger', 'cape']['flask', 'anvil', 'dagger', 'bow', 'cape']Failed
regression duration rounding #1['ember']['ember', 'cape']Failed
regression duration rounding #2['cape', 'flask']['flask', 'cape']Failed
regression duration rounding #3['cape', 'flask']['cape', 'flask', 'dagger']Failed
two stations tie #1['a', 'b', 'c']['a', 'b', 'c']Passed
speed floor #1['x', 'y']['x', 'y']Passed
finish exactly now #1['a']['a']Passed
control #1['flask', 'cape', 'dagger']['flask', 'cape', 'dagger']Passed

SHA-256 / c4cd6eb6b48a47fe9e343480bd6f7e1fef112f5b61ab4817acbf2601750ff446

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(jobs, stations, speed, now):
    free = [0] * stations
    done = []
    for idx, (name, dur) in enumerate(jobs):
        d = max(1, round(dur * (100 - speed) / 100))
        s = min(range(stations), key=lambda k: (free[k], k))
        start = free[s]
        free[s] = start + d
        done.append((free[s], idx, name))
    return [name for fin, idx, name in sorted(done) if fin <= now]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site duration rounding #1',
   [[['flask', 5], ['bow', 10], ['anvil', 1], ['dagger', 2], ['cape', 78]], 2, 50, 208],
   ['flask', 'anvil', 'dagger', 'bow', 'cape']),
  ('regression duration rounding #1', [[['ember', 2], ['cape', 5]], 1, 10, 5], ['ember', 'cape']),
  ('regression duration rounding #2', [[['flask', 2], ['cape', 1]], 3, 25, 30], ['flask', 'cape']),
  ('regression duration rounding #3',
   [[['cape', 2], ['flask', 2], ['dagger', 32], ['anvil', 1]], 1, 10, 30],
   ['cape', 'flask', 'dagger']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('speed floor #1', [[['x', 1], ['y', 1]], 1, 90, 2], ['x', 'y']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('control #1',
   [[['flask', 2], ['bow', 10], ['cape', 1], ['dagger', 2], ['anvil', 10], ['ember', 10]], 2, 10, 5],
   ['flask', 'cape', 'dagger'])],
 [('fault site duration rounding #1',
   [[['flask', 114], ['ember', 60], ['cape', 10], ['anvil', 5]], 2, 99, 169],
   ['flask', 'ember', 'cape', 'anvil']),
  ('regression duration rounding #1', [[['flask', 2], ['cape', 1]], 3, 25, 30], ['flask', 'cape']),
  ('regression duration rounding #2',
   [[['cape', 2], ['flask', 2], ['dagger', 32], ['anvil', 1]], 1, 10, 30],
   ['cape', 'flask', 'dagger']),
  ('regression duration rounding #3', [[['dagger', 2], ['flask', 1]], 2, 10, 148], ['dagger', 'flask']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('control #1',
   [[['flask', 2], ['bow', 10], ['cape', 1], ['dagger', 2], ['anvil', 10], ['ember', 10]], 2, 10, 5],
   ['flask', 'cape', 'dagger']),
  ('control #2',
   [[['flask', 1], ['cape', 60], ['ember', 1], ['bow', 1], ['anvil', 2], ['dagger', 33]], 2, 25, 1],
   ['flask'])],
 [('regression duration rounding #1',
   [[['cape', 2], ['flask', 2], ['dagger', 32], ['anvil', 1]], 1, 10, 30],
   ['cape', 'flask', 'dagger']),
  ('regression duration rounding #2', [[['dagger', 2], ['flask', 1]], 2, 10, 148], ['dagger', 'flask']),
  ('regression duration rounding #3', [[['dagger', 2], ['ember', 1]], 3, 25, 48], ['dagger', 'ember']),
  ('regression duration rounding #4',
   [[['ember', 2], ['cape', 2], ['dagger', 55], ['anvil', 1]], 3, 90, 5],
   ['ember', 'cape', 'anvil', 'dagger']),
  ('speed floor #1', [[['x', 1], ['y', 1]], 1, 90, 2], ['x', 'y']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('control #1',
   [[['flask', 1], ['cape', 60], ['ember', 1], ['bow', 1], ['anvil', 2], ['dagger', 33]], 2, 25, 1],
   ['flask']),
  ('control #2',
   [[['anvil', 2], ['flask', 2], ['cape', 1], ['dagger', 103], ['ember', 5]], 2, 10, 60],
   ['anvil', 'flask', 'cape', 'ember'])],
 [('fault site duration rounding #1',
   [[['cape', 32], ['anvil', 1], ['flask', 1], ['ember', 5], ['bow', 10], ['dagger', 5]], 3, 50, 5],
   ['anvil', 'flask', 'ember', 'dagger']),
  ('regression duration rounding #1', [[['dagger', 2], ['ember', 1]], 3, 25, 48], ['dagger', 'ember']),
  ('regression duration rounding #2',
   [[['cape', 10], ['bow', 5], ['dagger', 38], ['anvil', 60]], 1, 90, 5],
   ['cape', 'bow', 'dagger']),
  ('regression duration rounding #3',
   [[['bow', 5], ['anvil', 2], ['cape', 60], ['dagger', 60], ['ember', 44], ['flask', 2]], 1, 25, 5],
   ['bow', 'anvil']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('speed floor #1', [[['x', 1], ['y', 1]], 1, 90, 2], ['x', 'y']),
  ('control #1',
   [[['dagger', 10], ['bow', 119], ['cape', 1], ['flask', 2], ['ember', 60], ['anvil', 5]], 1, 0, 60],
   ['dagger']),
  ('control #2', [[['dagger', 1], ['bow', 5]], 1, 99, 161], ['dagger', 'bow'])],
 [('regression duration rounding #1',
   [[['ember', 2], ['cape', 2], ['dagger', 55], ['anvil', 1]], 3, 90, 5],
   ['ember', 'cape', 'anvil', 'dagger']),
  ('fault site duration rounding #1',
   [[['anvil', 71], ['ember', 5], ['flask', 16], ['dagger', 60], ['cape', 88]], 3, 90, 60],
   ['ember', 'flask', 'anvil', 'dagger', 'cape']),
  ('regression duration rounding #2',
   [[['anvil', 69], ['bow', 118], ['flask', 2], ['ember', 60], ['dagger', 1]], 3, 10, 1],
   ['flask']),
  ('regression duration rounding #3',
   [[['flask', 17], ['bow', 1], ['dagger', 60], ['ember', 17]], 3, 90, 1],
   ['flask', 'bow']),
  ('finish exactly now #1', [[['a', 30]], 1, 0, 30], ['a']),
  ('two stations tie #1', [[['a', 10], ['b', 10], ['c', 5]], 2, 0, 15], ['a', 'b', 'c']),
  ('control #1',
   [[['dagger', 60], ['flask', 1], ['anvil', 60], ['cape', 1], ['ember', 5], ['bow', 33]], 1, 99, 154],
   ['dagger', 'flask', 'anvil', 'cape', 'ember', 'bow']),
  ('control #2', [[['anvil', 2]], 3, 90, 1], ['anvil'])]]
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
fault site duration rounding #1['flask', 'anvil', 'dagger', 'bow', 'cape']['flask', 'anvil', 'dagger', 'bow', 'cape']Passed
regression duration rounding #1['ember']['ember', 'cape']Failed
regression duration rounding #2['cape', 'flask']['flask', 'cape']Failed
regression duration rounding #3['cape', 'flask']['cape', 'flask', 'dagger']Failed
two stations tie #1['a', 'b', 'c']['a', 'b', 'c']Passed
speed floor #1['x', 'y']['x', 'y']Passed
finish exactly now #1['a']['a']Passed
control #1['flask', 'cape', 'dagger']['flask', 'cape', 'dagger']Passed

SHA-256 / 1230e2217806d2264d380cad1ab07225db0c2eccb2fdadda962ef28ccb5ffcbd

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

Case digest / 0e8509a8c0f4f06e6a2a9975005a0b9398d39f63e5d6c7416fefdfb9ff6e8cad