FAILURE MAP
← Case archive

FA-86219 / Game economy crafting balance / Member archive

Currency exchange desk: Exchange fee truncates · case 04

Small conversions avoid most of the fee.

Member previewVariant 4 · 3 implementations · 8 checks per implementation

Case contract

rates map currency -> copper value. Same currency returns [amount, 0] without fee. Otherwise value = amount*rate[from]; fee = ceil(value*fee_bp/10000), at least 1 copper when value > 0 and fee_bp > 0 and 0 otherwise; net = value - fee; return [net // rate[to], net % rate[to]] (change in copper).

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.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
fee rounds up #1[7, 49][7, 48]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

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

Sign in to the archive ↗