{"abstract":"The spare cent goes to the last of several equally entitled centers.","category":"Double-entry ledger accounting","checks":7,"contract":"x = {'amount': signed cents, 'weights': [[center, non-negative weight]] (some positive), 'source': account}. The pool magnitude is split across positive-weight centers by the largest remainder method: floor shares, then one extra cent to the largest remainders, ties to the earlier-listed center. A non-negative amount credits the source and debits centers; a negative amount (reversal) debits the source and credits centers, all amounts positive. Return lines [[source, side, magnitude]] + [[center, side, share]] for nonzero shares in listing order.","evaluation_group":"w2-double-entry-ledger-accounting-cost-allocation","failed_approach":"Breaking ties by center name only matches listing order by accident.","family":"w2-double-entry-ledger-accounting-cost-allocation-remainder-tie-break","id":"FA-58151","implementations":{"attempt":{"sha256":"da15b119b9e905b71b1caee209a0e9af91a0787ac597784a7077c03b511107e7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    amt = x['amount']\n    side_src, side_dst = ('C', 'D') if amt >= 0 else ('D', 'C')\n    mag = abs(amt)\n    ws = [(c, w) for c, w in x['weights'] if w > 0]\n    total = sum(w for _, w in ws)\n    base = [mag * w // total for _, w in ws]\n    rems = [mag * w % total for _, w in ws]\n    left = mag - sum(base)\n    order = sorted(range(len(ws)), key=lambda i: (-rems[i], ws[i][0]))\n    for i in order[:left]:\n        base[i] += 1\n    lines = [[x['source'], side_src, mag]]\n    for (c, w), share in zip(ws, base):\n        if share:\n            lines.append([c, side_dst, share])\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: remainder tie-break', {'amount': 7, 'weights': [['fin', 0], ['it', 7], ['hr', 2], ['lab', 3], ['ops', 2]], 'source': 'pool'}, [['pool', 'C', 7], ['it', 'D', 4], ['hr', 'D', 1], ['lab', 'D', 1], ['ops', 'D', 1]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 10, 'weights': [['mkt', 1], ['ops', 7], ['lab', 1], ['it', 5], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['ops', 'D', 5], ['lab', 'D', 1], ['it', 'D', 3]]], ['control 1', {'amount': 7, 'weights': [['mkt', 0], ['fin', 1]], 'source': 'pool'}, [['pool', 'C', 7], ['fin', 'D', 7]]], ['control 2', {'amount': 99999, 'weights': [['hr', 1], ['it', 0]], 'source': 'pool'}, [['pool', 'C', 99999], ['hr', 'D', 99999]]], ['control 3', {'amount': 0, 'weights': [['ops', 3], ['mkt', 7], ['fin', 3], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 0]]], ['control 4', {'amount': 100, 'weights': [['ops', 5], ['it', 5]], 'source': 'pool'}, [['pool', 'C', 100], ['ops', 'D', 50], ['it', 'D', 50]]], ['control 5', {'amount': 0, 'weights': [['ops', 5], ['hr', 5], ['mkt', 7], ['fin', 3]], 'source': 'pool'}, [['pool', 'C', 0]]]], [['regression: remainder tie-break', {'amount': 3, 'weights': [['it', 0], ['hr', 0], ['fin', 2], ['ops', 2]], 'source': 'pool'}, [['pool', 'C', 3], ['fin', 'D', 2], ['ops', 'D', 1]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 101, 'weights': [['it', 3], ['mkt', 0], ['lab', 7], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 101], ['it', 'D', 18], ['lab', 'D', 42], ['hr', 'D', 41]]], ['control 1', {'amount': 7, 'weights': [['mkt', 0], ['it', 7], ['ops', 2], ['fin', 2], ['lab', 1]], 'source': 'pool'}, [['pool', 'C', 7], ['it', 'D', 4], ['ops', 'D', 1], ['fin', 'D', 1], ['lab', 'D', 1]]], ['control 2', {'amount': 0, 'weights': [['it', 3], ['lab', 1], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 0]]], ['control 3', {'amount': 101, 'weights': [['lab', 7], ['hr', 5]], 'source': 'pool'}, [['pool', 'C', 101], ['lab', 'D', 59], ['hr', 'D', 42]]], ['control 4', {'amount': 10, 'weights': [['lab', 1], ['it', 3], ['hr', 1], ['ops', 7], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 10], ['lab', 'D', 1], ['it', 'D', 2], ['hr', 'D', 1], ['ops', 'D', 6]]], ['control 5', {'amount': 10, 'weights': [['mkt', 1], ['it', 2], ['fin', 1], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['it', 'D', 2], ['fin', 'D', 1], ['hr', 'D', 6]]]], [['regression: remainder tie-break', {'amount': 1000, 'weights': [['ops', 7], ['mkt', 5], ['fin', 7]], 'source': 'pool'}, [['pool', 'C', 1000], ['ops', 'D', 369], ['mkt', 'D', 263], ['fin', 'D', 368]]], ['control 1', {'amount': 7, 'weights': [['fin', 1], ['mkt', 5]], 'source': 'pool'}, [['pool', 'C', 7], ['fin', 'D', 1], ['mkt', 'D', 6]]], ['control 2', {'amount': 7, 'weights': [['it', 0], ['lab', 7], ['mkt', 1], ['hr', 3]], 'source': 'pool'}, [['pool', 'C', 7], ['lab', 'D', 4], ['mkt', 'D', 1], ['hr', 'D', 2]]], ['control 3', {'amount': 3, 'weights': [['it', 7], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 3], ['it', 'D', 3]]], ['control 4', {'amount': 10, 'weights': [['ops', 3], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 4], ['lab', 'D', 6]]], ['control 5', {'amount': 10, 'weights': [['ops', 1], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 2], ['lab', 'D', 8]]], ['control 6', {'amount': 0, 'weights': [['it', 7], ['ops', 7], ['lab', 5], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 0]]]], [['regression: remainder tie-break', {'amount': -101, 'weights': [['fin', 7], ['mkt', 0], ['hr', 3], ['it', 7], ['ops', 7]], 'source': 'pool'}, [['pool', 'D', 101], ['fin', 'C', 30], ['hr', 'C', 13], ['it', 'C', 29], ['ops', 'C', 29]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 1000, 'weights': [['fin', 7], ['mkt', 3], ['it', 3], ['lab', 1], ['hr', 2]], 'source': 'pool'}, [['pool', 'C', 1000], ['fin', 'D', 438], ['mkt', 'D', 188], ['it', 'D', 187], ['lab', 'D', 62], ['hr', 'D', 125]]], ['control 1', {'amount': -7, 'weights': [['lab', 2], ['ops', 7], ['mkt', 2]], 'source': 'pool'}, [['pool', 'D', 7], ['lab', 'C', 1], ['ops', 'C', 5], ['mkt', 'C', 1]]], ['control 2', {'amount': -101, 'weights': [['it', 5], ['ops', 7]], 'source': 'pool'}, [['pool', 'D', 101], ['it', 'C', 42], ['ops', 'C', 59]]], ['control 3', {'amount': 100, 'weights': [['it', 7], ['fin', 3], ['mkt', 7], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 100], ['it', 'D', 39], ['fin', 'D', 17], ['mkt', 'D', 39], ['hr', 'D', 5]]], ['control 4', {'amount': 10, 'weights': [['lab', 2], ['it', 5], ['hr', 7], ['mkt', 0], ['ops', 7]], 'source': 'pool'}, [['pool', 'C', 10], ['lab', 'D', 1], ['it', 'D', 3], ['hr', 'D', 3], ['ops', 'D', 3]]], ['control 5', {'amount': 3, 'weights': [['it', 3], ['lab', 3], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 3], ['it', 'D', 1], ['lab', 'D', 1], ['hr', 'D', 1]]]], [['regression: remainder tie-break', {'amount': 101, 'weights': [['fin', 2], ['hr', 2]], 'source': 'pool'}, [['pool', 'C', 101], ['fin', 'D', 51], ['hr', 'D', 50]]], ['regression: remainder tie-break, partial-repair probe', {'amount': -101, 'weights': [['ops', 2], ['hr', 2], ['lab', 7], ['it', 1], ['fin', 1]], 'source': 'pool'}, [['pool', 'D', 101], ['ops', 'C', 16], ['hr', 'C', 15], ['lab', 'C', 54], ['it', 'C', 8], ['fin', 'C', 8]]], ['control 1', {'amount': 100, 'weights': [['fin', 2], ['hr', 0], ['it', 0], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 100], ['fin', 'D', 100]]], ['control 2', {'amount': 10, 'weights': [['ops', 3], ['it', 1], ['mkt', 3], ['hr', 0]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 4], ['it', 'D', 2], ['mkt', 'D', 4]]], ['control 3', {'amount': -7, 'weights': [['fin', 3], ['mkt', 1]], 'source': 'pool'}, [['pool', 'D', 7], ['fin', 'C', 5], ['mkt', 'C', 2]]], ['control 4', {'amount': 7, 'weights': [['mkt', 1], ['it', 0]], 'source': 'pool'}, [['pool', 'C', 7], ['mkt', 'D', 7]]], ['control 5', {'amount': 10, 'weights': [['mkt', 1], ['it', 7], ['fin', 0], ['ops', 1]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['it', 'D', 8], ['ops', 'D', 1]]]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"0f1dcb374faae944d8ebac2866f494307043bcb4224d6f5f8548c0bb0500456e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    amt = x['amount']\n    side_src, side_dst = ('C', 'D') if amt >= 0 else ('D', 'C')\n    mag = abs(amt)\n    ws = [(c, w) for c, w in x['weights'] if w > 0]\n    total = sum(w for _, w in ws)\n    base = [mag * w // total for _, w in ws]\n    rems = [mag * w % total for _, w in ws]\n    left = mag - sum(base)\n    order = sorted(range(len(ws)), key=lambda i: (-rems[i], -i))\n    for i in order[:left]:\n        base[i] += 1\n    lines = [[x['source'], side_src, mag]]\n    for (c, w), share in zip(ws, base):\n        if share:\n            lines.append([c, side_dst, share])\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: remainder tie-break', {'amount': 7, 'weights': [['fin', 0], ['it', 7], ['hr', 2], ['lab', 3], ['ops', 2]], 'source': 'pool'}, [['pool', 'C', 7], ['it', 'D', 4], ['hr', 'D', 1], ['lab', 'D', 1], ['ops', 'D', 1]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 10, 'weights': [['mkt', 1], ['ops', 7], ['lab', 1], ['it', 5], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['ops', 'D', 5], ['lab', 'D', 1], ['it', 'D', 3]]], ['control 1', {'amount': 7, 'weights': [['mkt', 0], ['fin', 1]], 'source': 'pool'}, [['pool', 'C', 7], ['fin', 'D', 7]]], ['control 2', {'amount': 99999, 'weights': [['hr', 1], ['it', 0]], 'source': 'pool'}, [['pool', 'C', 99999], ['hr', 'D', 99999]]], ['control 3', {'amount': 0, 'weights': [['ops', 3], ['mkt', 7], ['fin', 3], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 0]]], ['control 4', {'amount': 100, 'weights': [['ops', 5], ['it', 5]], 'source': 'pool'}, [['pool', 'C', 100], ['ops', 'D', 50], ['it', 'D', 50]]], ['control 5', {'amount': 0, 'weights': [['ops', 5], ['hr', 5], ['mkt', 7], ['fin', 3]], 'source': 'pool'}, [['pool', 'C', 0]]]], [['regression: remainder tie-break', {'amount': 3, 'weights': [['it', 0], ['hr', 0], ['fin', 2], ['ops', 2]], 'source': 'pool'}, [['pool', 'C', 3], ['fin', 'D', 2], ['ops', 'D', 1]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 101, 'weights': [['it', 3], ['mkt', 0], ['lab', 7], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 101], ['it', 'D', 18], ['lab', 'D', 42], ['hr', 'D', 41]]], ['control 1', {'amount': 7, 'weights': [['mkt', 0], ['it', 7], ['ops', 2], ['fin', 2], ['lab', 1]], 'source': 'pool'}, [['pool', 'C', 7], ['it', 'D', 4], ['ops', 'D', 1], ['fin', 'D', 1], ['lab', 'D', 1]]], ['control 2', {'amount': 0, 'weights': [['it', 3], ['lab', 1], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 0]]], ['control 3', {'amount': 101, 'weights': [['lab', 7], ['hr', 5]], 'source': 'pool'}, [['pool', 'C', 101], ['lab', 'D', 59], ['hr', 'D', 42]]], ['control 4', {'amount': 10, 'weights': [['lab', 1], ['it', 3], ['hr', 1], ['ops', 7], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 10], ['lab', 'D', 1], ['it', 'D', 2], ['hr', 'D', 1], ['ops', 'D', 6]]], ['control 5', {'amount': 10, 'weights': [['mkt', 1], ['it', 2], ['fin', 1], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['it', 'D', 2], ['fin', 'D', 1], ['hr', 'D', 6]]]], [['regression: remainder tie-break', {'amount': 1000, 'weights': [['ops', 7], ['mkt', 5], ['fin', 7]], 'source': 'pool'}, [['pool', 'C', 1000], ['ops', 'D', 369], ['mkt', 'D', 263], ['fin', 'D', 368]]], ['control 1', {'amount': 7, 'weights': [['fin', 1], ['mkt', 5]], 'source': 'pool'}, [['pool', 'C', 7], ['fin', 'D', 1], ['mkt', 'D', 6]]], ['control 2', {'amount': 7, 'weights': [['it', 0], ['lab', 7], ['mkt', 1], ['hr', 3]], 'source': 'pool'}, [['pool', 'C', 7], ['lab', 'D', 4], ['mkt', 'D', 1], ['hr', 'D', 2]]], ['control 3', {'amount': 3, 'weights': [['it', 7], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 3], ['it', 'D', 3]]], ['control 4', {'amount': 10, 'weights': [['ops', 3], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 4], ['lab', 'D', 6]]], ['control 5', {'amount': 10, 'weights': [['ops', 1], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 2], ['lab', 'D', 8]]], ['control 6', {'amount': 0, 'weights': [['it', 7], ['ops', 7], ['lab', 5], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 0]]]], [['regression: remainder tie-break', {'amount': -101, 'weights': [['fin', 7], ['mkt', 0], ['hr', 3], ['it', 7], ['ops', 7]], 'source': 'pool'}, [['pool', 'D', 101], ['fin', 'C', 30], ['hr', 'C', 13], ['it', 'C', 29], ['ops', 'C', 29]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 1000, 'weights': [['fin', 7], ['mkt', 3], ['it', 3], ['lab', 1], ['hr', 2]], 'source': 'pool'}, [['pool', 'C', 1000], ['fin', 'D', 438], ['mkt', 'D', 188], ['it', 'D', 187], ['lab', 'D', 62], ['hr', 'D', 125]]], ['control 1', {'amount': -7, 'weights': [['lab', 2], ['ops', 7], ['mkt', 2]], 'source': 'pool'}, [['pool', 'D', 7], ['lab', 'C', 1], ['ops', 'C', 5], ['mkt', 'C', 1]]], ['control 2', {'amount': -101, 'weights': [['it', 5], ['ops', 7]], 'source': 'pool'}, [['pool', 'D', 101], ['it', 'C', 42], ['ops', 'C', 59]]], ['control 3', {'amount': 100, 'weights': [['it', 7], ['fin', 3], ['mkt', 7], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 100], ['it', 'D', 39], ['fin', 'D', 17], ['mkt', 'D', 39], ['hr', 'D', 5]]], ['control 4', {'amount': 10, 'weights': [['lab', 2], ['it', 5], ['hr', 7], ['mkt', 0], ['ops', 7]], 'source': 'pool'}, [['pool', 'C', 10], ['lab', 'D', 1], ['it', 'D', 3], ['hr', 'D', 3], ['ops', 'D', 3]]], ['control 5', {'amount': 3, 'weights': [['it', 3], ['lab', 3], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 3], ['it', 'D', 1], ['lab', 'D', 1], ['hr', 'D', 1]]]], [['regression: remainder tie-break', {'amount': 101, 'weights': [['fin', 2], ['hr', 2]], 'source': 'pool'}, [['pool', 'C', 101], ['fin', 'D', 51], ['hr', 'D', 50]]], ['regression: remainder tie-break, partial-repair probe', {'amount': -101, 'weights': [['ops', 2], ['hr', 2], ['lab', 7], ['it', 1], ['fin', 1]], 'source': 'pool'}, [['pool', 'D', 101], ['ops', 'C', 16], ['hr', 'C', 15], ['lab', 'C', 54], ['it', 'C', 8], ['fin', 'C', 8]]], ['control 1', {'amount': 100, 'weights': [['fin', 2], ['hr', 0], ['it', 0], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 100], ['fin', 'D', 100]]], ['control 2', {'amount': 10, 'weights': [['ops', 3], ['it', 1], ['mkt', 3], ['hr', 0]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 4], ['it', 'D', 2], ['mkt', 'D', 4]]], ['control 3', {'amount': -7, 'weights': [['fin', 3], ['mkt', 1]], 'source': 'pool'}, [['pool', 'D', 7], ['fin', 'C', 5], ['mkt', 'C', 2]]], ['control 4', {'amount': 7, 'weights': [['mkt', 1], ['it', 0]], 'source': 'pool'}, [['pool', 'C', 7], ['mkt', 'D', 7]]], ['control 5', {'amount': 10, 'weights': [['mkt', 1], ['it', 7], ['fin', 0], ['ops', 1]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['it', 'D', 8], ['ops', 'D', 1]]]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"b080019e34c3561c0d45d44f7efa3bb1c8c02d7168c106252368bd196c9f4350","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    amt = x['amount']\n    side_src, side_dst = ('C', 'D') if amt >= 0 else ('D', 'C')\n    mag = abs(amt)\n    ws = [(c, w) for c, w in x['weights'] if w > 0]\n    total = sum(w for _, w in ws)\n    base = [mag * w // total for _, w in ws]\n    rems = [mag * w % total for _, w in ws]\n    left = mag - sum(base)\n    order = sorted(range(len(ws)), key=lambda i: (-rems[i], i))\n    for i in order[:left]:\n        base[i] += 1\n    lines = [[x['source'], side_src, mag]]\n    for (c, w), share in zip(ws, base):\n        if share:\n            lines.append([c, side_dst, share])\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: remainder tie-break', {'amount': 7, 'weights': [['fin', 0], ['it', 7], ['hr', 2], ['lab', 3], ['ops', 2]], 'source': 'pool'}, [['pool', 'C', 7], ['it', 'D', 4], ['hr', 'D', 1], ['lab', 'D', 1], ['ops', 'D', 1]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 10, 'weights': [['mkt', 1], ['ops', 7], ['lab', 1], ['it', 5], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['ops', 'D', 5], ['lab', 'D', 1], ['it', 'D', 3]]], ['control 1', {'amount': 7, 'weights': [['mkt', 0], ['fin', 1]], 'source': 'pool'}, [['pool', 'C', 7], ['fin', 'D', 7]]], ['control 2', {'amount': 99999, 'weights': [['hr', 1], ['it', 0]], 'source': 'pool'}, [['pool', 'C', 99999], ['hr', 'D', 99999]]], ['control 3', {'amount': 0, 'weights': [['ops', 3], ['mkt', 7], ['fin', 3], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 0]]], ['control 4', {'amount': 100, 'weights': [['ops', 5], ['it', 5]], 'source': 'pool'}, [['pool', 'C', 100], ['ops', 'D', 50], ['it', 'D', 50]]], ['control 5', {'amount': 0, 'weights': [['ops', 5], ['hr', 5], ['mkt', 7], ['fin', 3]], 'source': 'pool'}, [['pool', 'C', 0]]]], [['regression: remainder tie-break', {'amount': 3, 'weights': [['it', 0], ['hr', 0], ['fin', 2], ['ops', 2]], 'source': 'pool'}, [['pool', 'C', 3], ['fin', 'D', 2], ['ops', 'D', 1]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 101, 'weights': [['it', 3], ['mkt', 0], ['lab', 7], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 101], ['it', 'D', 18], ['lab', 'D', 42], ['hr', 'D', 41]]], ['control 1', {'amount': 7, 'weights': [['mkt', 0], ['it', 7], ['ops', 2], ['fin', 2], ['lab', 1]], 'source': 'pool'}, [['pool', 'C', 7], ['it', 'D', 4], ['ops', 'D', 1], ['fin', 'D', 1], ['lab', 'D', 1]]], ['control 2', {'amount': 0, 'weights': [['it', 3], ['lab', 1], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 0]]], ['control 3', {'amount': 101, 'weights': [['lab', 7], ['hr', 5]], 'source': 'pool'}, [['pool', 'C', 101], ['lab', 'D', 59], ['hr', 'D', 42]]], ['control 4', {'amount': 10, 'weights': [['lab', 1], ['it', 3], ['hr', 1], ['ops', 7], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 10], ['lab', 'D', 1], ['it', 'D', 2], ['hr', 'D', 1], ['ops', 'D', 6]]], ['control 5', {'amount': 10, 'weights': [['mkt', 1], ['it', 2], ['fin', 1], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['it', 'D', 2], ['fin', 'D', 1], ['hr', 'D', 6]]]], [['regression: remainder tie-break', {'amount': 1000, 'weights': [['ops', 7], ['mkt', 5], ['fin', 7]], 'source': 'pool'}, [['pool', 'C', 1000], ['ops', 'D', 369], ['mkt', 'D', 263], ['fin', 'D', 368]]], ['control 1', {'amount': 7, 'weights': [['fin', 1], ['mkt', 5]], 'source': 'pool'}, [['pool', 'C', 7], ['fin', 'D', 1], ['mkt', 'D', 6]]], ['control 2', {'amount': 7, 'weights': [['it', 0], ['lab', 7], ['mkt', 1], ['hr', 3]], 'source': 'pool'}, [['pool', 'C', 7], ['lab', 'D', 4], ['mkt', 'D', 1], ['hr', 'D', 2]]], ['control 3', {'amount': 3, 'weights': [['it', 7], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 3], ['it', 'D', 3]]], ['control 4', {'amount': 10, 'weights': [['ops', 3], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 4], ['lab', 'D', 6]]], ['control 5', {'amount': 10, 'weights': [['ops', 1], ['lab', 5]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 2], ['lab', 'D', 8]]], ['control 6', {'amount': 0, 'weights': [['it', 7], ['ops', 7], ['lab', 5], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 0]]]], [['regression: remainder tie-break', {'amount': -101, 'weights': [['fin', 7], ['mkt', 0], ['hr', 3], ['it', 7], ['ops', 7]], 'source': 'pool'}, [['pool', 'D', 101], ['fin', 'C', 30], ['hr', 'C', 13], ['it', 'C', 29], ['ops', 'C', 29]]], ['regression: remainder tie-break, partial-repair probe', {'amount': 1000, 'weights': [['fin', 7], ['mkt', 3], ['it', 3], ['lab', 1], ['hr', 2]], 'source': 'pool'}, [['pool', 'C', 1000], ['fin', 'D', 438], ['mkt', 'D', 188], ['it', 'D', 187], ['lab', 'D', 62], ['hr', 'D', 125]]], ['control 1', {'amount': -7, 'weights': [['lab', 2], ['ops', 7], ['mkt', 2]], 'source': 'pool'}, [['pool', 'D', 7], ['lab', 'C', 1], ['ops', 'C', 5], ['mkt', 'C', 1]]], ['control 2', {'amount': -101, 'weights': [['it', 5], ['ops', 7]], 'source': 'pool'}, [['pool', 'D', 101], ['it', 'C', 42], ['ops', 'C', 59]]], ['control 3', {'amount': 100, 'weights': [['it', 7], ['fin', 3], ['mkt', 7], ['hr', 1]], 'source': 'pool'}, [['pool', 'C', 100], ['it', 'D', 39], ['fin', 'D', 17], ['mkt', 'D', 39], ['hr', 'D', 5]]], ['control 4', {'amount': 10, 'weights': [['lab', 2], ['it', 5], ['hr', 7], ['mkt', 0], ['ops', 7]], 'source': 'pool'}, [['pool', 'C', 10], ['lab', 'D', 1], ['it', 'D', 3], ['hr', 'D', 3], ['ops', 'D', 3]]], ['control 5', {'amount': 3, 'weights': [['it', 3], ['lab', 3], ['hr', 7]], 'source': 'pool'}, [['pool', 'C', 3], ['it', 'D', 1], ['lab', 'D', 1], ['hr', 'D', 1]]]], [['regression: remainder tie-break', {'amount': 101, 'weights': [['fin', 2], ['hr', 2]], 'source': 'pool'}, [['pool', 'C', 101], ['fin', 'D', 51], ['hr', 'D', 50]]], ['regression: remainder tie-break, partial-repair probe', {'amount': -101, 'weights': [['ops', 2], ['hr', 2], ['lab', 7], ['it', 1], ['fin', 1]], 'source': 'pool'}, [['pool', 'D', 101], ['ops', 'C', 16], ['hr', 'C', 15], ['lab', 'C', 54], ['it', 'C', 8], ['fin', 'C', 8]]], ['control 1', {'amount': 100, 'weights': [['fin', 2], ['hr', 0], ['it', 0], ['mkt', 0]], 'source': 'pool'}, [['pool', 'C', 100], ['fin', 'D', 100]]], ['control 2', {'amount': 10, 'weights': [['ops', 3], ['it', 1], ['mkt', 3], ['hr', 0]], 'source': 'pool'}, [['pool', 'C', 10], ['ops', 'D', 4], ['it', 'D', 2], ['mkt', 'D', 4]]], ['control 3', {'amount': -7, 'weights': [['fin', 3], ['mkt', 1]], 'source': 'pool'}, [['pool', 'D', 7], ['fin', 'C', 5], ['mkt', 'C', 2]]], ['control 4', {'amount': 7, 'weights': [['mkt', 1], ['it', 0]], 'source': 'pool'}, [['pool', 'C', 7], ['mkt', 'D', 7]]], ['control 5', {'amount': 10, 'weights': [['mkt', 1], ['it', 7], ['fin', 0], ['ops', 1]], 'source': 'pool'}, [['pool', 'C', 10], ['mkt', 'D', 1], ['it', 'D', 8], ['ops', 'D', 1]]]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model with stipulated toy bookkeeping rules stated in the contract; amounts are integer cents; it makes no claim of conformance to any accounting standard or product. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-double-entry-ledger-accounting-cost-allocation-remainder-tie-break","generated_at":"2026-09-29T14:46:24.021015+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.","repair":"Break remainder ties by listing order, earlier first.","root_cause":"Equal remainders are broken in reverse listing order.","sha256":"39403b004a2c09bf4bef7a940d5413a629ce38dd75308db450b49c6ce6cc9ba8","title":"Cost pool allocation entry: remainder tie-break · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.23,"exit_code":1,"observations":[{"actual":[["pool","C",7],["it","D",4],["hr","D",1],["lab","D",1],["ops","D",1]],"check":"regression: remainder tie-break","expected":[["pool","C",7],["it","D",4],["hr","D",1],["lab","D",1],["ops","D",1]],"passed":true},{"actual":[["pool","C",10],["mkt","D",1],["ops","D",4],["lab","D",1],["it","D",3],["hr","D",1]],"check":"regression: remainder tie-break, partial-repair probe","expected":[["pool","C",10],["mkt","D",1],["ops","D",5],["lab","D",1],["it","D",3]],"passed":false},{"actual":[["pool","C",7],["fin","D",7]],"check":"control 1","expected":[["pool","C",7],["fin","D",7]],"passed":true},{"actual":[["pool","C",99999],["hr","D",99999]],"check":"control 2","expected":[["pool","C",99999],["hr","D",99999]],"passed":true},{"actual":[["pool","C",0]],"check":"control 3","expected":[["pool","C",0]],"passed":true},{"actual":[["pool","C",100],["ops","D",50],["it","D",50]],"check":"control 4","expected":[["pool","C",100],["ops","D",50],["it","D",50]],"passed":true},{"actual":[["pool","C",0]],"check":"control 5","expected":[["pool","C",0]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: remainder tie-break\", \"actual\": [[\"pool\", \"C\", 7], [\"it\", \"D\", 4], [\"hr\", \"D\", 1], [\"lab\", \"D\", 1], [\"ops\", \"D\", 1]], \"expected\": [[\"pool\", \"C\", 7], [\"it\", \"D\", 4], [\"hr\", \"D\", 1], [\"lab\", \"D\", 1], [\"ops\", \"D\", 1]], \"passed\": true}, {\"check\": \"regression: remainder tie-break, partial-repair probe\", \"actual\": [[\"pool\", \"C\", 10], [\"mkt\", \"D\", 1], [\"ops\", \"D\", 4], [\"lab\", \"D\", 1], [\"it\", \"D\", 3], [\"hr\", \"D\", 1]], \"expected\": [[\"pool\", \"C\", 10], [\"mkt\", \"D\", 1], [\"ops\", \"D\", 5], [\"lab\", \"D\", 1], [\"it\", \"D\", 3]], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [[\"pool\", \"C\", 7], [\"fin\", \"D\", 7]], \"expected\": [[\"pool\", \"C\", 7], [\"fin\", \"D\", 7]], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [[\"pool\", \"C\", 99999], [\"hr\", \"D\", 99999]], \"expected\": [[\"pool\", \"C\", 99999], [\"hr\", \"D\", 99999]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [[\"pool\", \"C\", 0]], \"expected\": [[\"pool\", \"C\", 0]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [[\"pool\", \"C\", 100], [\"ops\", \"D\", 50], [\"it\", \"D\", 50]], \"expected\": [[\"pool\", \"C\", 100], [\"ops\", \"D\", 50], [\"it\", \"D\", 50]], \"passed\": true}, {\"check\": \"control 5\", \"actual\": [[\"pool\", \"C\", 0]], \"expected\": [[\"pool\", \"C\", 0]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.4,"exit_code":1,"observations":[{"actual":[["pool","C",7],["it","D",3],["hr","D",1],["lab","D",2],["ops","D",1]],"check":"regression: remainder tie-break","expected":[["pool","C",7],["it","D",4],["hr","D",1],["lab","D",1],["ops","D",1]],"passed":false},{"actual":[["pool","C",10],["ops","D",5],["lab","D",1],["it","D",3],["hr","D",1]],"check":"regression: remainder tie-break, partial-repair probe","expected":[["pool","C",10],["mkt","D",1],["ops","D",5],["lab","D",1],["it","D",3]],"passed":false},{"actual":[["pool","C",7],["fin","D",7]],"check":"control 1","expected":[["pool","C",7],["fin","D",7]],"passed":true},{"actual":[["pool","C",99999],["hr","D",99999]],"check":"control 2","expected":[["pool","C",99999],["hr","D",99999]],"passed":true},{"actual":[["pool","C",0]],"check":"control 3","expected":[["pool","C",0]],"passed":true},{"actual":[["pool","C",100],["ops","D",50],["it","D",50]],"check":"control 4","expected":[["pool","C",100],["ops","D",50],["it","D",50]],"passed":true},{"actual":[["pool","C",0]],"check":"control 5","expected":[["pool","C",0]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: remainder tie-break\", \"actual\": [[\"pool\", \"C\", 7], [\"it\", \"D\", 3], [\"hr\", \"D\", 1], [\"lab\", \"D\", 2], [\"ops\", \"D\", 1]], \"expected\": [[\"pool\", \"C\", 7], [\"it\", \"D\", 4], [\"hr\", \"D\", 1], [\"lab\", \"D\", 1], [\"ops\", \"D\", 1]], \"passed\": false}, {\"check\": \"regression: remainder tie-break, partial-repair probe\", \"actual\": [[\"pool\", \"C\", 10], [\"ops\", \"D\", 5], [\"lab\", \"D\", 1], [\"it\", \"D\", 3], [\"hr\", \"D\", 1]], \"expected\": [[\"pool\", \"C\", 10], [\"mkt\", \"D\", 1], [\"ops\", \"D\", 5], [\"lab\", \"D\", 1], [\"it\", \"D\", 3]], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [[\"pool\", \"C\", 7], [\"fin\", \"D\", 7]], \"expected\": [[\"pool\", \"C\", 7], [\"fin\", \"D\", 7]], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [[\"pool\", \"C\", 99999], [\"hr\", \"D\", 99999]], \"expected\": [[\"pool\", \"C\", 99999], [\"hr\", \"D\", 99999]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [[\"pool\", \"C\", 0]], \"expected\": [[\"pool\", \"C\", 0]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [[\"pool\", \"C\", 100], [\"ops\", \"D\", 50], [\"it\", \"D\", 50]], \"expected\": [[\"pool\", \"C\", 100], [\"ops\", \"D\", 50], [\"it\", \"D\", 50]], \"passed\": true}, {\"check\": \"control 5\", \"actual\": [[\"pool\", \"C\", 0]], \"expected\": [[\"pool\", \"C\", 0]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.147,"exit_code":0,"observations":[{"actual":[["pool","C",7],["it","D",4],["hr","D",1],["lab","D",1],["ops","D",1]],"check":"regression: remainder tie-break","expected":[["pool","C",7],["it","D",4],["hr","D",1],["lab","D",1],["ops","D",1]],"passed":true},{"actual":[["pool","C",10],["mkt","D",1],["ops","D",5],["lab","D",1],["it","D",3]],"check":"regression: remainder tie-break, partial-repair probe","expected":[["pool","C",10],["mkt","D",1],["ops","D",5],["lab","D",1],["it","D",3]],"passed":true},{"actual":[["pool","C",7],["fin","D",7]],"check":"control 1","expected":[["pool","C",7],["fin","D",7]],"passed":true},{"actual":[["pool","C",99999],["hr","D",99999]],"check":"control 2","expected":[["pool","C",99999],["hr","D",99999]],"passed":true},{"actual":[["pool","C",0]],"check":"control 3","expected":[["pool","C",0]],"passed":true},{"actual":[["pool","C",100],["ops","D",50],["it","D",50]],"check":"control 4","expected":[["pool","C",100],["ops","D",50],["it","D",50]],"passed":true},{"actual":[["pool","C",0]],"check":"control 5","expected":[["pool","C",0]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: remainder tie-break\", \"actual\": [[\"pool\", \"C\", 7], [\"it\", \"D\", 4], [\"hr\", \"D\", 1], [\"lab\", \"D\", 1], [\"ops\", \"D\", 1]], \"expected\": [[\"pool\", \"C\", 7], [\"it\", \"D\", 4], [\"hr\", \"D\", 1], [\"lab\", \"D\", 1], [\"ops\", \"D\", 1]], \"passed\": true}, {\"check\": \"regression: remainder tie-break, partial-repair probe\", \"actual\": [[\"pool\", \"C\", 10], [\"mkt\", \"D\", 1], [\"ops\", \"D\", 5], [\"lab\", \"D\", 1], [\"it\", \"D\", 3]], \"expected\": [[\"pool\", \"C\", 10], [\"mkt\", \"D\", 1], [\"ops\", \"D\", 5], [\"lab\", \"D\", 1], [\"it\", \"D\", 3]], \"passed\": true}, {\"check\": \"control 1\", \"actual\": [[\"pool\", \"C\", 7], [\"fin\", \"D\", 7]], \"expected\": [[\"pool\", \"C\", 7], [\"fin\", \"D\", 7]], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [[\"pool\", \"C\", 99999], [\"hr\", \"D\", 99999]], \"expected\": [[\"pool\", \"C\", 99999], [\"hr\", \"D\", 99999]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [[\"pool\", \"C\", 0]], \"expected\": [[\"pool\", \"C\", 0]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [[\"pool\", \"C\", 100], [\"ops\", \"D\", 50], [\"it\", \"D\", 50]], \"expected\": [[\"pool\", \"C\", 100], [\"ops\", \"D\", 50], [\"it\", \"D\", 50]], \"passed\": true}, {\"check\": \"control 5\", \"actual\": [[\"pool\", \"C\", 0]], \"expected\": [[\"pool\", \"C\", 0]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}