{"abstract":"Ties go to alphabetically earlier accounts instead of older positions.","category":"Options payoff and settlement","checks":8,"contract":"Inputs exercised contracts (<= total short), shorts [account, qty, open sequence] and method. fifo assigns in ascending open sequence, each up to its quantity. pro-rata gives floor(exercised*qty/total) and distributes the remaining contracts one each by largest fractional remainder, ties by lower open sequence. Return sorted [account, assigned] for accounts with assignments.","evaluation_group":"w2-options_payoff_and_settlement-assignment-allocation","failed_approach":"Preferring the higher open sequence favours newer positions.","family":"w2-options_payoff_and_settlement-assignment-allocation-remainder-tie-break","id":"FA-61651","implementations":{"attempt":{"sha256":"a73c4a619de13e65f21ee385682a22521ca2f076b95598c68a9e1f278d633083","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(exercised, shorts, method):\n    total = sum(q for _, q, _ in shorts)\n    alloc = {}\n    if method == 'fifo':\n        left = exercised\n        for acct, q, seq in sorted(shorts, key=lambda s: s[2]):\n            take = min(q, left)\n            alloc[acct] = alloc.get(acct, 0) + take\n            left -= take\n    else:\n        rem = []\n        for acct, q, seq in shorts:\n            alloc[acct] = alloc.get(acct, 0) + exercised * q // total\n            rem.append((-(exercised * q % total), -seq, acct))\n        left = exercised - sum(alloc.values())\n        for _, seq, acct in sorted(rem)[:left]:\n            alloc[acct] += 1\n    return sorted([a, n] for a, n in alloc.items() if n > 0)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression remainder tie break 1', [8, [['F6', 1, 1], ['C3', 2, 11], ['E5', 7, 8]], 'pro-rata'], [['C3', 1], ['E5', 6], ['F6', 1]]], ['regression remainder tie break 2', [5, [['E5', 3, 12], ['F6', 3, 10]], 'pro-rata'], [['E5', 2], ['F6', 3]]], ['partial repair probe 1', [8, [['F6', 1, 14], ['D4', 3, 11], ['C3', 3, 10], ['B2', 2, 18]], 'pro-rata'], [['B2', 2], ['C3', 3], ['D4', 2], ['F6', 1]]], ['partial repair probe 2', [16, [['F6', 10, 19], ['A1', 10, 8], ['D4', 3, 10], ['C3', 1, 12]], 'pro-rata'], [['A1', 7], ['C3', 1], ['D4', 2], ['F6', 6]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [1, [['F6', 2, 14]], 'fifo'], [['F6', 1]]], ['normal control 2', [4, [['F6', 1, 4], ['E5', 7, 18], ['C3', 5, 19], ['D4', 7, 8]], 'fifo'], [['D4', 3], ['F6', 1]]]], [['regression remainder tie break 1', [1, [['F6', 3, 8], ['B2', 7, 4], ['C3', 3, 19], ['D4', 7, 1]], 'pro-rata'], [['D4', 1]]], ['regression remainder tie break 2', [3, [['B2', 2, 6], ['D4', 2, 5]], 'pro-rata'], [['B2', 1], ['D4', 2]]], ['partial repair probe 1', [12, [['B2', 10, 4], ['A1', 1, 11], ['F6', 3, 10], ['E5', 2, 8]], 'pro-rata'], [['A1', 1], ['B2', 8], ['E5', 1], ['F6', 2]]], ['partial repair probe 2', [14, [['A1', 10, 9], ['F6', 7, 16], ['C3', 1, 4], ['B2', 3, 7]], 'pro-rata'], [['A1', 7], ['B2', 2], ['C3', 1], ['F6', 4]]], ['boundary control 1', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['boundary control 2', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['normal control 1', [5, [['D4', 3, 2], ['C3', 7, 6], ['A1', 7, 13], ['B2', 3, 9]], 'fifo'], [['C3', 2], ['D4', 3]]], ['normal control 2', [1, [['F6', 1, 3]], 'pro-rata'], [['F6', 1]]]], [['regression remainder tie break 1', [8, [['D4', 1, 13], ['F6', 7, 9], ['B2', 2, 15]], 'pro-rata'], [['B2', 1], ['D4', 1], ['F6', 6]]], ['regression remainder tie break 2', [12, [['D4', 2, 19], ['B2', 7, 10], ['F6', 2, 13], ['E5', 3, 9], ['C3', 3, 11]], 'pro-rata'], [['B2', 5], ['C3', 2], ['D4', 1], ['E5', 2], ['F6', 2]]], ['partial repair probe 1', [24, [['D4', 3, 8], ['F6', 10, 19], ['B2', 2, 11], ['A1', 10, 9]], 'pro-rata'], [['A1', 10], ['B2', 2], ['D4', 3], ['F6', 9]]], ['partial repair probe 2', [9, [['B2', 3, 13], ['A1', 2, 2], ['E5', 2, 1], ['D4', 3, 17]], 'pro-rata'], [['A1', 2], ['B2', 3], ['D4', 2], ['E5', 2]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [10, [['E5', 10, 5], ['D4', 5, 10], ['F6', 1, 12], ['B2', 7, 2]], 'fifo'], [['B2', 7], ['E5', 3]]], ['normal control 2', [2, [['F6', 2, 4]], 'fifo'], [['F6', 2]]]], [['regression remainder tie break 1', [12, [['C3', 10, 6], ['E5', 3, 12], ['B2', 7, 8], ['D4', 1, 17], ['A1', 3, 18]], 'pro-rata'], [['A1', 1], ['B2', 4], ['C3', 5], ['E5', 2]]], ['regression remainder tie break 2', [14, [['D4', 3, 11], ['B2', 10, 16], ['C3', 2, 18], ['E5', 10, 9]], 'pro-rata'], [['B2', 5], ['C3', 1], ['D4', 2], ['E5', 6]]], ['partial repair probe 1', [7, [['C3', 1, 14], ['A1', 1, 11], ['F6', 2, 6], ['B2', 5, 5], ['D4', 5, 19]], 'pro-rata'], [['A1', 1], ['B2', 3], ['D4', 2], ['F6', 1]]], ['partial repair probe 2', [1, [['C3', 3, 4], ['A1', 1, 9], ['D4', 3, 6]], 'pro-rata'], [['C3', 1]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [6, [['C3', 10, 5], ['D4', 3, 15]], 'fifo'], [['C3', 6]]], ['normal control 2', [2, [['B2', 7, 5], ['F6', 7, 9]], 'pro-rata'], [['B2', 1], ['F6', 1]]]], [['regression remainder tie break 1', [15, [['A1', 7, 13], ['B2', 5, 14], ['C3', 5, 5]], 'pro-rata'], [['A1', 6], ['B2', 4], ['C3', 5]]], ['regression remainder tie break 2', [2, [['E5', 7, 6], ['C3', 7, 8], ['F6', 10, 11]], 'pro-rata'], [['E5', 1], ['F6', 1]]], ['partial repair probe 1', [9, [['D4', 7, 18], ['C3', 5, 1], ['F6', 3, 11], ['A1', 3, 3]], 'pro-rata'], [['A1', 2], ['C3', 3], ['D4', 3], ['F6', 1]]], ['partial repair probe 2', [7, [['D4', 1, 5], ['C3', 3, 3], ['A1', 1, 6], ['E5', 3, 8]], 'pro-rata'], [['A1', 1], ['C3', 3], ['D4', 1], ['E5', 2]]], ['boundary control 1', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['boundary control 2', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['normal control 1', [1, [['C3', 3, 6]], 'pro-rata'], [['C3', 1]]], ['normal control 2', [1, [['D4', 5, 9], ['C3', 3, 2], ['F6', 3, 17], ['E5', 1, 11]], 'fifo'], [['C3', 1]]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), 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":"00b475aa76c6ceb774fb6b97e918c99f09c83ed94bb2731bdf099424f95ca477","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(exercised, shorts, method):\n    total = sum(q for _, q, _ in shorts)\n    alloc = {}\n    if method == 'fifo':\n        left = exercised\n        for acct, q, seq in sorted(shorts, key=lambda s: s[2]):\n            take = min(q, left)\n            alloc[acct] = alloc.get(acct, 0) + take\n            left -= take\n    else:\n        rem = []\n        for acct, q, seq in shorts:\n            alloc[acct] = alloc.get(acct, 0) + exercised * q // total\n            rem.append((-(exercised * q % total), acct, acct))\n        left = exercised - sum(alloc.values())\n        for _, seq, acct in sorted(rem)[:left]:\n            alloc[acct] += 1\n    return sorted([a, n] for a, n in alloc.items() if n > 0)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression remainder tie break 1', [8, [['F6', 1, 1], ['C3', 2, 11], ['E5', 7, 8]], 'pro-rata'], [['C3', 1], ['E5', 6], ['F6', 1]]], ['regression remainder tie break 2', [5, [['E5', 3, 12], ['F6', 3, 10]], 'pro-rata'], [['E5', 2], ['F6', 3]]], ['partial repair probe 1', [8, [['F6', 1, 14], ['D4', 3, 11], ['C3', 3, 10], ['B2', 2, 18]], 'pro-rata'], [['B2', 2], ['C3', 3], ['D4', 2], ['F6', 1]]], ['partial repair probe 2', [16, [['F6', 10, 19], ['A1', 10, 8], ['D4', 3, 10], ['C3', 1, 12]], 'pro-rata'], [['A1', 7], ['C3', 1], ['D4', 2], ['F6', 6]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [1, [['F6', 2, 14]], 'fifo'], [['F6', 1]]], ['normal control 2', [4, [['F6', 1, 4], ['E5', 7, 18], ['C3', 5, 19], ['D4', 7, 8]], 'fifo'], [['D4', 3], ['F6', 1]]]], [['regression remainder tie break 1', [1, [['F6', 3, 8], ['B2', 7, 4], ['C3', 3, 19], ['D4', 7, 1]], 'pro-rata'], [['D4', 1]]], ['regression remainder tie break 2', [3, [['B2', 2, 6], ['D4', 2, 5]], 'pro-rata'], [['B2', 1], ['D4', 2]]], ['partial repair probe 1', [12, [['B2', 10, 4], ['A1', 1, 11], ['F6', 3, 10], ['E5', 2, 8]], 'pro-rata'], [['A1', 1], ['B2', 8], ['E5', 1], ['F6', 2]]], ['partial repair probe 2', [14, [['A1', 10, 9], ['F6', 7, 16], ['C3', 1, 4], ['B2', 3, 7]], 'pro-rata'], [['A1', 7], ['B2', 2], ['C3', 1], ['F6', 4]]], ['boundary control 1', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['boundary control 2', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['normal control 1', [5, [['D4', 3, 2], ['C3', 7, 6], ['A1', 7, 13], ['B2', 3, 9]], 'fifo'], [['C3', 2], ['D4', 3]]], ['normal control 2', [1, [['F6', 1, 3]], 'pro-rata'], [['F6', 1]]]], [['regression remainder tie break 1', [8, [['D4', 1, 13], ['F6', 7, 9], ['B2', 2, 15]], 'pro-rata'], [['B2', 1], ['D4', 1], ['F6', 6]]], ['regression remainder tie break 2', [12, [['D4', 2, 19], ['B2', 7, 10], ['F6', 2, 13], ['E5', 3, 9], ['C3', 3, 11]], 'pro-rata'], [['B2', 5], ['C3', 2], ['D4', 1], ['E5', 2], ['F6', 2]]], ['partial repair probe 1', [24, [['D4', 3, 8], ['F6', 10, 19], ['B2', 2, 11], ['A1', 10, 9]], 'pro-rata'], [['A1', 10], ['B2', 2], ['D4', 3], ['F6', 9]]], ['partial repair probe 2', [9, [['B2', 3, 13], ['A1', 2, 2], ['E5', 2, 1], ['D4', 3, 17]], 'pro-rata'], [['A1', 2], ['B2', 3], ['D4', 2], ['E5', 2]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [10, [['E5', 10, 5], ['D4', 5, 10], ['F6', 1, 12], ['B2', 7, 2]], 'fifo'], [['B2', 7], ['E5', 3]]], ['normal control 2', [2, [['F6', 2, 4]], 'fifo'], [['F6', 2]]]], [['regression remainder tie break 1', [12, [['C3', 10, 6], ['E5', 3, 12], ['B2', 7, 8], ['D4', 1, 17], ['A1', 3, 18]], 'pro-rata'], [['A1', 1], ['B2', 4], ['C3', 5], ['E5', 2]]], ['regression remainder tie break 2', [14, [['D4', 3, 11], ['B2', 10, 16], ['C3', 2, 18], ['E5', 10, 9]], 'pro-rata'], [['B2', 5], ['C3', 1], ['D4', 2], ['E5', 6]]], ['partial repair probe 1', [7, [['C3', 1, 14], ['A1', 1, 11], ['F6', 2, 6], ['B2', 5, 5], ['D4', 5, 19]], 'pro-rata'], [['A1', 1], ['B2', 3], ['D4', 2], ['F6', 1]]], ['partial repair probe 2', [1, [['C3', 3, 4], ['A1', 1, 9], ['D4', 3, 6]], 'pro-rata'], [['C3', 1]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [6, [['C3', 10, 5], ['D4', 3, 15]], 'fifo'], [['C3', 6]]], ['normal control 2', [2, [['B2', 7, 5], ['F6', 7, 9]], 'pro-rata'], [['B2', 1], ['F6', 1]]]], [['regression remainder tie break 1', [15, [['A1', 7, 13], ['B2', 5, 14], ['C3', 5, 5]], 'pro-rata'], [['A1', 6], ['B2', 4], ['C3', 5]]], ['regression remainder tie break 2', [2, [['E5', 7, 6], ['C3', 7, 8], ['F6', 10, 11]], 'pro-rata'], [['E5', 1], ['F6', 1]]], ['partial repair probe 1', [9, [['D4', 7, 18], ['C3', 5, 1], ['F6', 3, 11], ['A1', 3, 3]], 'pro-rata'], [['A1', 2], ['C3', 3], ['D4', 3], ['F6', 1]]], ['partial repair probe 2', [7, [['D4', 1, 5], ['C3', 3, 3], ['A1', 1, 6], ['E5', 3, 8]], 'pro-rata'], [['A1', 1], ['C3', 3], ['D4', 1], ['E5', 2]]], ['boundary control 1', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['boundary control 2', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['normal control 1', [1, [['C3', 3, 6]], 'pro-rata'], [['C3', 1]]], ['normal control 2', [1, [['D4', 5, 9], ['C3', 3, 2], ['F6', 3, 17], ['E5', 1, 11]], 'fifo'], [['C3', 1]]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), 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":"8245a87ed75f353a090b6f7cb39ed9df85a704716ce0c2e0bbfba8d28c261920","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(exercised, shorts, method):\n    total = sum(q for _, q, _ in shorts)\n    alloc = {}\n    if method == 'fifo':\n        left = exercised\n        for acct, q, seq in sorted(shorts, key=lambda s: s[2]):\n            take = min(q, left)\n            alloc[acct] = alloc.get(acct, 0) + take\n            left -= take\n    else:\n        rem = []\n        for acct, q, seq in shorts:\n            alloc[acct] = alloc.get(acct, 0) + exercised * q // total\n            rem.append((-(exercised * q % total), seq, acct))\n        left = exercised - sum(alloc.values())\n        for _, seq, acct in sorted(rem)[:left]:\n            alloc[acct] += 1\n    return sorted([a, n] for a, n in alloc.items() if n > 0)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression remainder tie break 1', [8, [['F6', 1, 1], ['C3', 2, 11], ['E5', 7, 8]], 'pro-rata'], [['C3', 1], ['E5', 6], ['F6', 1]]], ['regression remainder tie break 2', [5, [['E5', 3, 12], ['F6', 3, 10]], 'pro-rata'], [['E5', 2], ['F6', 3]]], ['partial repair probe 1', [8, [['F6', 1, 14], ['D4', 3, 11], ['C3', 3, 10], ['B2', 2, 18]], 'pro-rata'], [['B2', 2], ['C3', 3], ['D4', 2], ['F6', 1]]], ['partial repair probe 2', [16, [['F6', 10, 19], ['A1', 10, 8], ['D4', 3, 10], ['C3', 1, 12]], 'pro-rata'], [['A1', 7], ['C3', 1], ['D4', 2], ['F6', 6]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [1, [['F6', 2, 14]], 'fifo'], [['F6', 1]]], ['normal control 2', [4, [['F6', 1, 4], ['E5', 7, 18], ['C3', 5, 19], ['D4', 7, 8]], 'fifo'], [['D4', 3], ['F6', 1]]]], [['regression remainder tie break 1', [1, [['F6', 3, 8], ['B2', 7, 4], ['C3', 3, 19], ['D4', 7, 1]], 'pro-rata'], [['D4', 1]]], ['regression remainder tie break 2', [3, [['B2', 2, 6], ['D4', 2, 5]], 'pro-rata'], [['B2', 1], ['D4', 2]]], ['partial repair probe 1', [12, [['B2', 10, 4], ['A1', 1, 11], ['F6', 3, 10], ['E5', 2, 8]], 'pro-rata'], [['A1', 1], ['B2', 8], ['E5', 1], ['F6', 2]]], ['partial repair probe 2', [14, [['A1', 10, 9], ['F6', 7, 16], ['C3', 1, 4], ['B2', 3, 7]], 'pro-rata'], [['A1', 7], ['B2', 2], ['C3', 1], ['F6', 4]]], ['boundary control 1', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['boundary control 2', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['normal control 1', [5, [['D4', 3, 2], ['C3', 7, 6], ['A1', 7, 13], ['B2', 3, 9]], 'fifo'], [['C3', 2], ['D4', 3]]], ['normal control 2', [1, [['F6', 1, 3]], 'pro-rata'], [['F6', 1]]]], [['regression remainder tie break 1', [8, [['D4', 1, 13], ['F6', 7, 9], ['B2', 2, 15]], 'pro-rata'], [['B2', 1], ['D4', 1], ['F6', 6]]], ['regression remainder tie break 2', [12, [['D4', 2, 19], ['B2', 7, 10], ['F6', 2, 13], ['E5', 3, 9], ['C3', 3, 11]], 'pro-rata'], [['B2', 5], ['C3', 2], ['D4', 1], ['E5', 2], ['F6', 2]]], ['partial repair probe 1', [24, [['D4', 3, 8], ['F6', 10, 19], ['B2', 2, 11], ['A1', 10, 9]], 'pro-rata'], [['A1', 10], ['B2', 2], ['D4', 3], ['F6', 9]]], ['partial repair probe 2', [9, [['B2', 3, 13], ['A1', 2, 2], ['E5', 2, 1], ['D4', 3, 17]], 'pro-rata'], [['A1', 2], ['B2', 3], ['D4', 2], ['E5', 2]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [10, [['E5', 10, 5], ['D4', 5, 10], ['F6', 1, 12], ['B2', 7, 2]], 'fifo'], [['B2', 7], ['E5', 3]]], ['normal control 2', [2, [['F6', 2, 4]], 'fifo'], [['F6', 2]]]], [['regression remainder tie break 1', [12, [['C3', 10, 6], ['E5', 3, 12], ['B2', 7, 8], ['D4', 1, 17], ['A1', 3, 18]], 'pro-rata'], [['A1', 1], ['B2', 4], ['C3', 5], ['E5', 2]]], ['regression remainder tie break 2', [14, [['D4', 3, 11], ['B2', 10, 16], ['C3', 2, 18], ['E5', 10, 9]], 'pro-rata'], [['B2', 5], ['C3', 1], ['D4', 2], ['E5', 6]]], ['partial repair probe 1', [7, [['C3', 1, 14], ['A1', 1, 11], ['F6', 2, 6], ['B2', 5, 5], ['D4', 5, 19]], 'pro-rata'], [['A1', 1], ['B2', 3], ['D4', 2], ['F6', 1]]], ['partial repair probe 2', [1, [['C3', 3, 4], ['A1', 1, 9], ['D4', 3, 6]], 'pro-rata'], [['C3', 1]]], ['boundary control 1', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['boundary control 2', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['normal control 1', [6, [['C3', 10, 5], ['D4', 3, 15]], 'fifo'], [['C3', 6]]], ['normal control 2', [2, [['B2', 7, 5], ['F6', 7, 9]], 'pro-rata'], [['B2', 1], ['F6', 1]]]], [['regression remainder tie break 1', [15, [['A1', 7, 13], ['B2', 5, 14], ['C3', 5, 5]], 'pro-rata'], [['A1', 6], ['B2', 4], ['C3', 5]]], ['regression remainder tie break 2', [2, [['E5', 7, 6], ['C3', 7, 8], ['F6', 10, 11]], 'pro-rata'], [['E5', 1], ['F6', 1]]], ['partial repair probe 1', [9, [['D4', 7, 18], ['C3', 5, 1], ['F6', 3, 11], ['A1', 3, 3]], 'pro-rata'], [['A1', 2], ['C3', 3], ['D4', 3], ['F6', 1]]], ['partial repair probe 2', [7, [['D4', 1, 5], ['C3', 3, 3], ['A1', 1, 6], ['E5', 3, 8]], 'pro-rata'], [['A1', 1], ['C3', 3], ['D4', 1], ['E5', 2]]], ['boundary control 1', [3, [['A1', 1, 1], ['B2', 1, 2], ['C3', 1, 3]], 'pro-rata'], [['A1', 1], ['B2', 1], ['C3', 1]]], ['boundary control 2', [2, [['A1', 5, 2], ['B2', 5, 1]], 'fifo'], [['B2', 2]]], ['normal control 1', [1, [['C3', 3, 6]], 'pro-rata'], [['C3', 1]]], ['normal control 2', [1, [['D4', 5, 9], ['C3', 3, 2], ['F6', 3, 17], ['E5', 1, 11]], 'fifo'], [['C3', 1]]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), 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 toy contract stated explicitly in the contract field; no claim of conformance to any exchange or clearing rulebook. 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-options_payoff_and_settlement-assignment-allocation-remainder-tie-break","generated_at":"2026-09-29T14:46:57.225207+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Option expiry, exercise and settlement engines move cash and shares; a wrong branch misstates obligations.","repair":"Break ties by lower open sequence.","root_cause":"The tie-break key omits the open sequence.","sha256":"3e402e05aa2c1b50a8a93e74bbb7334d460b61ca7902cab8654b42dd6b2f2acd","title":"Exercise assignment allocation across short accounts: equal remainders are broken by account name · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.918,"exit_code":1,"observations":[{"actual":[["C3",2],["E5",5],["F6",1]],"check":"regression remainder tie break 1","expected":[["C3",1],["E5",6],["F6",1]],"passed":false},{"actual":[["E5",3],["F6",2]],"check":"regression remainder tie break 2","expected":[["E5",2],["F6",3]],"passed":false},{"actual":[["B2",2],["C3",2],["D4",3],["F6",1]],"check":"partial repair probe 1","expected":[["B2",2],["C3",3],["D4",2],["F6",1]],"passed":false},{"actual":[["A1",6],["C3",1],["D4",2],["F6",7]],"check":"partial repair probe 2","expected":[["A1",7],["C3",1],["D4",2],["F6",6]],"passed":false},{"actual":[["B2",2]],"check":"boundary control 1","expected":[["B2",2]],"passed":true},{"actual":[["A1",1],["B2",1],["C3",1]],"check":"boundary control 2","expected":[["A1",1],["B2",1],["C3",1]],"passed":true},{"actual":[["F6",1]],"check":"normal control 1","expected":[["F6",1]],"passed":true},{"actual":[["D4",3],["F6",1]],"check":"normal control 2","expected":[["D4",3],["F6",1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression remainder tie break 1\", \"actual\": [[\"C3\", 2], [\"E5\", 5], [\"F6\", 1]], \"expected\": [[\"C3\", 1], [\"E5\", 6], [\"F6\", 1]], \"passed\": false}, {\"check\": \"regression remainder tie break 2\", \"actual\": [[\"E5\", 3], [\"F6\", 2]], \"expected\": [[\"E5\", 2], [\"F6\", 3]], \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": [[\"B2\", 2], [\"C3\", 2], [\"D4\", 3], [\"F6\", 1]], \"expected\": [[\"B2\", 2], [\"C3\", 3], [\"D4\", 2], [\"F6\", 1]], \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": [[\"A1\", 6], [\"C3\", 1], [\"D4\", 2], [\"F6\", 7]], \"expected\": [[\"A1\", 7], [\"C3\", 1], [\"D4\", 2], [\"F6\", 6]], \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": [[\"B2\", 2]], \"expected\": [[\"B2\", 2]], \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": [[\"A1\", 1], [\"B2\", 1], [\"C3\", 1]], \"expected\": [[\"A1\", 1], [\"B2\", 1], [\"C3\", 1]], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [[\"F6\", 1]], \"expected\": [[\"F6\", 1]], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [[\"D4\", 3], [\"F6\", 1]], \"expected\": [[\"D4\", 3], [\"F6\", 1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.998,"exit_code":1,"observations":[{"actual":[["C3",2],["E5",5],["F6",1]],"check":"regression remainder tie break 1","expected":[["C3",1],["E5",6],["F6",1]],"passed":false},{"actual":[["E5",3],["F6",2]],"check":"regression remainder tie break 2","expected":[["E5",2],["F6",3]],"passed":false},{"actual":[["B2",2],["C3",3],["D4",2],["F6",1]],"check":"partial repair probe 1","expected":[["B2",2],["C3",3],["D4",2],["F6",1]],"passed":true},{"actual":[["A1",7],["C3",1],["D4",2],["F6",6]],"check":"partial repair probe 2","expected":[["A1",7],["C3",1],["D4",2],["F6",6]],"passed":true},{"actual":[["B2",2]],"check":"boundary control 1","expected":[["B2",2]],"passed":true},{"actual":[["A1",1],["B2",1],["C3",1]],"check":"boundary control 2","expected":[["A1",1],["B2",1],["C3",1]],"passed":true},{"actual":[["F6",1]],"check":"normal control 1","expected":[["F6",1]],"passed":true},{"actual":[["D4",3],["F6",1]],"check":"normal control 2","expected":[["D4",3],["F6",1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression remainder tie break 1\", \"actual\": [[\"C3\", 2], [\"E5\", 5], [\"F6\", 1]], \"expected\": [[\"C3\", 1], [\"E5\", 6], [\"F6\", 1]], \"passed\": false}, {\"check\": \"regression remainder tie break 2\", \"actual\": [[\"E5\", 3], [\"F6\", 2]], \"expected\": [[\"E5\", 2], [\"F6\", 3]], \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": [[\"B2\", 2], [\"C3\", 3], [\"D4\", 2], [\"F6\", 1]], \"expected\": [[\"B2\", 2], [\"C3\", 3], [\"D4\", 2], [\"F6\", 1]], \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": [[\"A1\", 7], [\"C3\", 1], [\"D4\", 2], [\"F6\", 6]], \"expected\": [[\"A1\", 7], [\"C3\", 1], [\"D4\", 2], [\"F6\", 6]], \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": [[\"B2\", 2]], \"expected\": [[\"B2\", 2]], \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": [[\"A1\", 1], [\"B2\", 1], [\"C3\", 1]], \"expected\": [[\"A1\", 1], [\"B2\", 1], [\"C3\", 1]], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [[\"F6\", 1]], \"expected\": [[\"F6\", 1]], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [[\"D4\", 3], [\"F6\", 1]], \"expected\": [[\"D4\", 3], [\"F6\", 1]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.102,"exit_code":0,"observations":[{"actual":[["C3",1],["E5",6],["F6",1]],"check":"regression remainder tie break 1","expected":[["C3",1],["E5",6],["F6",1]],"passed":true},{"actual":[["E5",2],["F6",3]],"check":"regression remainder tie break 2","expected":[["E5",2],["F6",3]],"passed":true},{"actual":[["B2",2],["C3",3],["D4",2],["F6",1]],"check":"partial repair probe 1","expected":[["B2",2],["C3",3],["D4",2],["F6",1]],"passed":true},{"actual":[["A1",7],["C3",1],["D4",2],["F6",6]],"check":"partial repair probe 2","expected":[["A1",7],["C3",1],["D4",2],["F6",6]],"passed":true},{"actual":[["B2",2]],"check":"boundary control 1","expected":[["B2",2]],"passed":true},{"actual":[["A1",1],["B2",1],["C3",1]],"check":"boundary control 2","expected":[["A1",1],["B2",1],["C3",1]],"passed":true},{"actual":[["F6",1]],"check":"normal control 1","expected":[["F6",1]],"passed":true},{"actual":[["D4",3],["F6",1]],"check":"normal control 2","expected":[["D4",3],["F6",1]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression remainder tie break 1\", \"actual\": [[\"C3\", 1], [\"E5\", 6], [\"F6\", 1]], \"expected\": [[\"C3\", 1], [\"E5\", 6], [\"F6\", 1]], \"passed\": true}, {\"check\": \"regression remainder tie break 2\", \"actual\": [[\"E5\", 2], [\"F6\", 3]], \"expected\": [[\"E5\", 2], [\"F6\", 3]], \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": [[\"B2\", 2], [\"C3\", 3], [\"D4\", 2], [\"F6\", 1]], \"expected\": [[\"B2\", 2], [\"C3\", 3], [\"D4\", 2], [\"F6\", 1]], \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": [[\"A1\", 7], [\"C3\", 1], [\"D4\", 2], [\"F6\", 6]], \"expected\": [[\"A1\", 7], [\"C3\", 1], [\"D4\", 2], [\"F6\", 6]], \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": [[\"B2\", 2]], \"expected\": [[\"B2\", 2]], \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": [[\"A1\", 1], [\"B2\", 1], [\"C3\", 1]], \"expected\": [[\"A1\", 1], [\"B2\", 1], [\"C3\", 1]], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [[\"F6\", 1]], \"expected\": [[\"F6\", 1]], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [[\"D4\", 3], [\"F6\", 1]], \"expected\": [[\"D4\", 3], [\"F6\", 1]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}