{"abstract":"A few units of capacity are left unused even though clients still want them.","category":"Rate limiter algorithms","checks":10,"contract":"Input {capacity, demands [[client, demand]]} in integer requests per second. Clients with positive demand are active. Repeatedly give each active client min(floor(left / active count), unmet demand) and drop satisfied clients; when the per-client share rounds to zero, hand single units to active clients in ascending id order until capacity is exhausted. Return [sorted [client, allocation]], unallocated capacity].","evaluation_group":"w2-rate_limiter_algorithms-max-min-fair-share","failed_approach":"Handing the remainder to the highest ids contradicts the tie-break.","family":"w2-rate_limiter_algorithms-max-min-fair-share-remainder-order","id":"FA-73831","implementations":{"attempt":{"sha256":"068b5a30bc511ad000a992877bab496bd48d8bd4b8e80e0d5ae5e8ed486c79e1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['capacity']\n    need = dict(x['demands'])\n    alloc = {c: 0 for c in need}\n    active = sorted(c for c, d in need.items() if d > 0)\n    left = C\n    while active and left > 0:\n        share = left // len(active)\n        if share == 0:\n            for c in active[-left:]:\n                alloc[c] += 1\n            left = 0\n            break\n        nxt = []\n        for c in active:\n            give = min(share, need[c] - alloc[c])\n            alloc[c] += give\n            left -= give\n            if alloc[c] < need[c]:\n                nxt.append(c)\n        active = nxt\n    return [sorted([c, a] for c, a in alloc.items()), left]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 12, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 4], ['b', 4], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 6]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 5]]},\n   [[['a', 3], ['b', 5]], 12]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 7], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 0], ['q', 3], ['r', 5], ['s', 5], ['t', 1]]},\n   [[['p', 0], ['q', 3], ['r', 5], ['s', 5], ['t', 1]], 7]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 101]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 6]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 4]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 6]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 13, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 4], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 7]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 6]]},\n   [[['a', 3], ['b', 6]], 11]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 8], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 2], ['q', 4], ['r', 8], ['s', 8], ['t', 4]]},\n   [[['p', 2], ['q', 4], ['r', 6], ['s', 5], ['t', 4]], 0]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 102]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 7]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 5]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 7]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 14, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 5], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 8]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 7]]},\n   [[['a', 3], ['b', 7]], 10]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 9], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 7], ['q', 8], ['r', 2], ['s', 9], ['t', 1]]},\n   [[['p', 6], ['q', 6], ['r', 2], ['s', 6], ['t', 1]], 0]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 103]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 8]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 6]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 8]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 15, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 5], ['c', 5]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 9]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 8]]},\n   [[['a', 3], ['b', 8]], 9]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 10], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 2], ['q', 0], ['r', 5], ['s', 3], ['t', 8]]},\n   [[['p', 2], ['q', 0], ['r', 5], ['s', 3], ['t', 8]], 3]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 104]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 9]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 7]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 9]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 16, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 6], ['b', 5], ['c', 5]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 10]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 9]]},\n   [[['a', 3], ['b', 9]], 8]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 11], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 1], ['q', 3], ['r', 0], ['s', 6], ['t', 7]]},\n   [[['p', 1], ['q', 3], ['r', 0], ['s', 6], ['t', 7]], 4]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 105]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 10]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 8]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 10]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]]]\nfor label, args, expected in cases[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":"1568993391f6941533b9b9556ab03b24a68c08c08d11a3b5c3b8f8fb14cc2864","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['capacity']\n    need = dict(x['demands'])\n    alloc = {c: 0 for c in need}\n    active = sorted(c for c, d in need.items() if d > 0)\n    left = C\n    while active and left > 0:\n        share = left // len(active)\n        if share == 0:\n            for c in active[:0]:\n                alloc[c] += 1\n            left = 0\n            break\n        nxt = []\n        for c in active:\n            give = min(share, need[c] - alloc[c])\n            alloc[c] += give\n            left -= give\n            if alloc[c] < need[c]:\n                nxt.append(c)\n        active = nxt\n    return [sorted([c, a] for c, a in alloc.items()), left]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 12, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 4], ['b', 4], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 6]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 5]]},\n   [[['a', 3], ['b', 5]], 12]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 7], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 0], ['q', 3], ['r', 5], ['s', 5], ['t', 1]]},\n   [[['p', 0], ['q', 3], ['r', 5], ['s', 5], ['t', 1]], 7]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 101]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 6]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 4]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 6]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 13, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 4], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 7]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 6]]},\n   [[['a', 3], ['b', 6]], 11]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 8], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 2], ['q', 4], ['r', 8], ['s', 8], ['t', 4]]},\n   [[['p', 2], ['q', 4], ['r', 6], ['s', 5], ['t', 4]], 0]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 102]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 7]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 5]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 7]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 14, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 5], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 8]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 7]]},\n   [[['a', 3], ['b', 7]], 10]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 9], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 7], ['q', 8], ['r', 2], ['s', 9], ['t', 1]]},\n   [[['p', 6], ['q', 6], ['r', 2], ['s', 6], ['t', 1]], 0]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 103]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 8]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 6]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 8]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 15, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 5], ['c', 5]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 9]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 8]]},\n   [[['a', 3], ['b', 8]], 9]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 10], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 2], ['q', 0], ['r', 5], ['s', 3], ['t', 8]]},\n   [[['p', 2], ['q', 0], ['r', 5], ['s', 3], ['t', 8]], 3]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 104]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 9]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 7]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 9]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 16, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 6], ['b', 5], ['c', 5]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 10]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 9]]},\n   [[['a', 3], ['b', 9]], 8]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 11], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 1], ['q', 3], ['r', 0], ['s', 6], ['t', 7]]},\n   [[['p', 1], ['q', 3], ['r', 0], ['s', 6], ['t', 7]], 4]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 105]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 10]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 8]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 10]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]]]\nfor label, args, expected in cases[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":"6d1415162cbbad040d68637a47fc608c97f41cb462def47fcb0c5dd7f7b7bd5b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['capacity']\n    need = dict(x['demands'])\n    alloc = {c: 0 for c in need}\n    active = sorted(c for c, d in need.items() if d > 0)\n    left = C\n    while active and left > 0:\n        share = left // len(active)\n        if share == 0:\n            for c in active[:left]:\n                alloc[c] += 1\n            left = 0\n            break\n        nxt = []\n        for c in active:\n            give = min(share, need[c] - alloc[c])\n            alloc[c] += give\n            left -= give\n            if alloc[c] < need[c]:\n                nxt.append(c)\n        active = nxt\n    return [sorted([c, a] for c, a in alloc.items()), left]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 12, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 4], ['b', 4], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 6]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 5]]},\n   [[['a', 3], ['b', 5]], 12]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 7], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 0], ['q', 3], ['r', 5], ['s', 5], ['t', 1]]},\n   [[['p', 0], ['q', 3], ['r', 5], ['s', 5], ['t', 1]], 7]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 101]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 6]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 4]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 6]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 13, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 4], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 7]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 6]]},\n   [[['a', 3], ['b', 6]], 11]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 8], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 2], ['q', 4], ['r', 8], ['s', 8], ['t', 4]]},\n   [[['p', 2], ['q', 4], ['r', 6], ['s', 5], ['t', 4]], 0]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 102]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 7]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 5]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 7]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 14, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 5], ['c', 4]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 8]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 7]]},\n   [[['a', 3], ['b', 7]], 10]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 9], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 7], ['q', 8], ['r', 2], ['s', 9], ['t', 1]]},\n   [[['p', 6], ['q', 6], ['r', 2], ['s', 6], ['t', 1]], 0]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 103]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 8]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 6]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 8]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 15, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 5], ['b', 5], ['c', 5]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 9]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 8]]},\n   [[['a', 3], ['b', 8]], 9]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 10], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 2], ['q', 0], ['r', 5], ['s', 3], ['t', 8]]},\n   [[['p', 2], ['q', 0], ['r', 5], ['s', 3], ['t', 8]], 3]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 104]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 9]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 7]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 9]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]],\n [['small demand satisfied first',\n   {'capacity': 10, 'demands': [['a', 2], ['b', 8], ['c', 8]]},\n   [[['a', 2], ['b', 4], ['c', 4]], 0]],\n  ['remainder to lowest ids',\n   {'capacity': 16, 'demands': [['b', 20], ['a', 20], ['c', 20]]},\n   [[['a', 6], ['b', 5], ['c', 5]], 0]],\n  ['zero demand ignored',\n   {'capacity': 7, 'demands': [['x', 0], ['y', 5], ['z', 10]]},\n   [[['x', 0], ['y', 4], ['z', 3]], 0]],\n  ['surplus left over',\n   {'capacity': 20, 'demands': [['a', 3], ['b', 9]]},\n   [[['a', 3], ['b', 9]], 8]],\n  ['multi-round water filling',\n   {'capacity': 17, 'demands': [['a', 1], ['b', 3], ['c', 11], ['d', 20]]},\n   [[['a', 1], ['b', 3], ['c', 7], ['d', 6]], 0]],\n  ['random demands',\n   {'capacity': 21, 'demands': [['p', 1], ['q', 3], ['r', 0], ['s', 6], ['t', 7]]},\n   [[['p', 1], ['q', 3], ['r', 0], ['s', 6], ['t', 7]], 4]],\n  ['second round respects unmet demand',\n   {'capacity': 18, 'demands': [['a', 2], ['b', 7], ['c', 105]]},\n   [[['a', 2], ['b', 7], ['c', 9]], 0]],\n  ['tiny capacity with idle client',\n   {'capacity': 2, 'demands': [['a', 0], ['b', 5], ['c', 10]]},\n   [[['a', 0], ['b', 1], ['c', 1]], 0]],\n  ['remainder ignores demand size',\n   {'capacity': 2, 'demands': [['a', 9], ['b', 3], ['c', 8]]},\n   [[['a', 1], ['b', 1], ['c', 0]], 0]],\n  ['exact share satisfies',\n   {'capacity': 9, 'demands': [['a', 3], ['b', 3], ['c', 10]]},\n   [[['a', 3], ['b', 3], ['c', 3]], 0]]]]\nfor label, args, expected in cases[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, bounded teaching model with stipulated constants and pre-hashed or explicitly hashed inputs; it is not a production implementation and makes no claim of conformance to any library or paper beyond the stated contract. 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-rate_limiter_algorithms-max-min-fair-share-remainder-order","generated_at":"2026-09-29T14:48:51.216217+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Distributed limiters split a global rate among clients or nodes by max-min fairness so light users are fully served and heavy users share the rest.","repair":"Give the remainder one unit each to active clients in ascending id order.","root_cause":"The final units smaller than one per client are not handed out.","sha256":"d123a5b7037e9ed8c972a1d9cc4b74fc62b01d3cc89a4c85cea95ceb30379de1","title":"Max-min fair split of a global rate limit: indivisible remainder discarded · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.933,"exit_code":1,"observations":[{"actual":[[["a",2],["b",4],["c",4]],0],"check":"small demand satisfied first","expected":[[["a",2],["b",4],["c",4]],0],"passed":true},{"actual":[[["a",4],["b",4],["c",4]],0],"check":"remainder to lowest ids","expected":[[["a",4],["b",4],["c",4]],0],"passed":true},{"actual":[[["x",0],["y",3],["z",4]],0],"check":"zero demand ignored","expected":[[["x",0],["y",4],["z",3]],0],"passed":false},{"actual":[[["a",3],["b",5]],12],"check":"surplus left over","expected":[[["a",3],["b",5]],12],"passed":true},{"actual":[[["a",1],["b",3],["c",6],["d",7]],0],"check":"multi-round water filling","expected":[[["a",1],["b",3],["c",7],["d",6]],0],"passed":false},{"actual":[[["p",0],["q",3],["r",5],["s",5],["t",1]],7],"check":"random demands","expected":[[["p",0],["q",3],["r",5],["s",5],["t",1]],7],"passed":true},{"actual":[[["a",2],["b",7],["c",9]],0],"check":"second round respects unmet demand","expected":[[["a",2],["b",7],["c",9]],0],"passed":true},{"actual":[[["a",0],["b",1],["c",1]],0],"check":"tiny capacity with idle client","expected":[[["a",0],["b",1],["c",1]],0],"passed":true},{"actual":[[["a",0],["b",1],["c",1]],0],"check":"remainder ignores demand size","expected":[[["a",1],["b",1],["c",0]],0],"passed":false},{"actual":[[["a",3],["b",3],["c",3]],0],"check":"exact share satisfies","expected":[[["a",3],["b",3],["c",3]],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"small demand satisfied first\", \"actual\": [[[\"a\", 2], [\"b\", 4], [\"c\", 4]], 0], \"expected\": [[[\"a\", 2], [\"b\", 4], [\"c\", 4]], 0], \"passed\": true}, {\"check\": \"remainder to lowest ids\", \"actual\": [[[\"a\", 4], [\"b\", 4], [\"c\", 4]], 0], \"expected\": [[[\"a\", 4], [\"b\", 4], [\"c\", 4]], 0], \"passed\": true}, {\"check\": \"zero demand ignored\", \"actual\": [[[\"x\", 0], [\"y\", 3], [\"z\", 4]], 0], \"expected\": [[[\"x\", 0], [\"y\", 4], [\"z\", 3]], 0], \"passed\": false}, {\"check\": \"surplus left over\", \"actual\": [[[\"a\", 3], [\"b\", 5]], 12], \"expected\": [[[\"a\", 3], [\"b\", 5]], 12], \"passed\": true}, {\"check\": \"multi-round water filling\", \"actual\": [[[\"a\", 1], [\"b\", 3], [\"c\", 6], [\"d\", 7]], 0], \"expected\": [[[\"a\", 1], [\"b\", 3], [\"c\", 7], [\"d\", 6]], 0], \"passed\": false}, {\"check\": \"random demands\", \"actual\": [[[\"p\", 0], [\"q\", 3], [\"r\", 5], [\"s\", 5], [\"t\", 1]], 7], \"expected\": [[[\"p\", 0], [\"q\", 3], [\"r\", 5], [\"s\", 5], [\"t\", 1]], 7], \"passed\": true}, {\"check\": \"second round respects unmet demand\", \"actual\": [[[\"a\", 2], [\"b\", 7], [\"c\", 9]], 0], \"expected\": [[[\"a\", 2], [\"b\", 7], [\"c\", 9]], 0], \"passed\": true}, {\"check\": \"tiny capacity with idle client\", \"actual\": [[[\"a\", 0], [\"b\", 1], [\"c\", 1]], 0], \"expected\": [[[\"a\", 0], [\"b\", 1], [\"c\", 1]], 0], \"passed\": true}, {\"check\": \"remainder ignores demand size\", \"actual\": [[[\"a\", 0], [\"b\", 1], [\"c\", 1]], 0], \"expected\": [[[\"a\", 1], [\"b\", 1], [\"c\", 0]], 0], \"passed\": false}, {\"check\": \"exact share satisfies\", \"actual\": [[[\"a\", 3], [\"b\", 3], [\"c\", 3]], 0], \"expected\": [[[\"a\", 3], [\"b\", 3], [\"c\", 3]], 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.785,"exit_code":1,"observations":[{"actual":[[["a",2],["b",4],["c",4]],0],"check":"small demand satisfied first","expected":[[["a",2],["b",4],["c",4]],0],"passed":true},{"actual":[[["a",4],["b",4],["c",4]],0],"check":"remainder to lowest ids","expected":[[["a",4],["b",4],["c",4]],0],"passed":true},{"actual":[[["x",0],["y",3],["z",3]],0],"check":"zero demand ignored","expected":[[["x",0],["y",4],["z",3]],0],"passed":false},{"actual":[[["a",3],["b",5]],12],"check":"surplus left over","expected":[[["a",3],["b",5]],12],"passed":true},{"actual":[[["a",1],["b",3],["c",6],["d",6]],0],"check":"multi-round water filling","expected":[[["a",1],["b",3],["c",7],["d",6]],0],"passed":false},{"actual":[[["p",0],["q",3],["r",5],["s",5],["t",1]],7],"check":"random demands","expected":[[["p",0],["q",3],["r",5],["s",5],["t",1]],7],"passed":true},{"actual":[[["a",2],["b",7],["c",9]],0],"check":"second round respects unmet demand","expected":[[["a",2],["b",7],["c",9]],0],"passed":true},{"actual":[[["a",0],["b",1],["c",1]],0],"check":"tiny capacity with idle client","expected":[[["a",0],["b",1],["c",1]],0],"passed":true},{"actual":[[["a",0],["b",0],["c",0]],0],"check":"remainder ignores demand size","expected":[[["a",1],["b",1],["c",0]],0],"passed":false},{"actual":[[["a",3],["b",3],["c",3]],0],"check":"exact share satisfies","expected":[[["a",3],["b",3],["c",3]],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"small demand satisfied first\", \"actual\": [[[\"a\", 2], [\"b\", 4], [\"c\", 4]], 0], \"expected\": [[[\"a\", 2], [\"b\", 4], [\"c\", 4]], 0], \"passed\": true}, {\"check\": \"remainder to lowest ids\", \"actual\": [[[\"a\", 4], [\"b\", 4], [\"c\", 4]], 0], \"expected\": [[[\"a\", 4], [\"b\", 4], [\"c\", 4]], 0], \"passed\": true}, {\"check\": \"zero demand ignored\", \"actual\": [[[\"x\", 0], [\"y\", 3], [\"z\", 3]], 0], \"expected\": [[[\"x\", 0], [\"y\", 4], [\"z\", 3]], 0], \"passed\": false}, {\"check\": \"surplus left over\", \"actual\": [[[\"a\", 3], [\"b\", 5]], 12], \"expected\": [[[\"a\", 3], [\"b\", 5]], 12], \"passed\": true}, {\"check\": \"multi-round water filling\", \"actual\": [[[\"a\", 1], [\"b\", 3], [\"c\", 6], [\"d\", 6]], 0], \"expected\": [[[\"a\", 1], [\"b\", 3], [\"c\", 7], [\"d\", 6]], 0], \"passed\": false}, {\"check\": \"random demands\", \"actual\": [[[\"p\", 0], [\"q\", 3], [\"r\", 5], [\"s\", 5], [\"t\", 1]], 7], \"expected\": [[[\"p\", 0], [\"q\", 3], [\"r\", 5], [\"s\", 5], [\"t\", 1]], 7], \"passed\": true}, {\"check\": \"second round respects unmet demand\", \"actual\": [[[\"a\", 2], [\"b\", 7], [\"c\", 9]], 0], \"expected\": [[[\"a\", 2], [\"b\", 7], [\"c\", 9]], 0], \"passed\": true}, {\"check\": \"tiny capacity with idle client\", \"actual\": [[[\"a\", 0], [\"b\", 1], [\"c\", 1]], 0], \"expected\": [[[\"a\", 0], [\"b\", 1], [\"c\", 1]], 0], \"passed\": true}, {\"check\": \"remainder ignores demand size\", \"actual\": [[[\"a\", 0], [\"b\", 0], [\"c\", 0]], 0], \"expected\": [[[\"a\", 1], [\"b\", 1], [\"c\", 0]], 0], \"passed\": false}, {\"check\": \"exact share satisfies\", \"actual\": [[[\"a\", 3], [\"b\", 3], [\"c\", 3]], 0], \"expected\": [[[\"a\", 3], [\"b\", 3], [\"c\", 3]], 0], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.14,"exit_code":0,"observations":[{"actual":[[["a",2],["b",4],["c",4]],0],"check":"small demand satisfied first","expected":[[["a",2],["b",4],["c",4]],0],"passed":true},{"actual":[[["a",4],["b",4],["c",4]],0],"check":"remainder to lowest ids","expected":[[["a",4],["b",4],["c",4]],0],"passed":true},{"actual":[[["x",0],["y",4],["z",3]],0],"check":"zero demand ignored","expected":[[["x",0],["y",4],["z",3]],0],"passed":true},{"actual":[[["a",3],["b",5]],12],"check":"surplus left over","expected":[[["a",3],["b",5]],12],"passed":true},{"actual":[[["a",1],["b",3],["c",7],["d",6]],0],"check":"multi-round water filling","expected":[[["a",1],["b",3],["c",7],["d",6]],0],"passed":true},{"actual":[[["p",0],["q",3],["r",5],["s",5],["t",1]],7],"check":"random demands","expected":[[["p",0],["q",3],["r",5],["s",5],["t",1]],7],"passed":true},{"actual":[[["a",2],["b",7],["c",9]],0],"check":"second round respects unmet demand","expected":[[["a",2],["b",7],["c",9]],0],"passed":true},{"actual":[[["a",0],["b",1],["c",1]],0],"check":"tiny capacity with idle client","expected":[[["a",0],["b",1],["c",1]],0],"passed":true},{"actual":[[["a",1],["b",1],["c",0]],0],"check":"remainder ignores demand size","expected":[[["a",1],["b",1],["c",0]],0],"passed":true},{"actual":[[["a",3],["b",3],["c",3]],0],"check":"exact share satisfies","expected":[[["a",3],["b",3],["c",3]],0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"small demand satisfied first\", \"actual\": [[[\"a\", 2], [\"b\", 4], [\"c\", 4]], 0], \"expected\": [[[\"a\", 2], [\"b\", 4], [\"c\", 4]], 0], \"passed\": true}, {\"check\": \"remainder to lowest ids\", \"actual\": [[[\"a\", 4], [\"b\", 4], [\"c\", 4]], 0], \"expected\": [[[\"a\", 4], [\"b\", 4], [\"c\", 4]], 0], \"passed\": true}, {\"check\": \"zero demand ignored\", \"actual\": [[[\"x\", 0], [\"y\", 4], [\"z\", 3]], 0], \"expected\": [[[\"x\", 0], [\"y\", 4], [\"z\", 3]], 0], \"passed\": true}, {\"check\": \"surplus left over\", \"actual\": [[[\"a\", 3], [\"b\", 5]], 12], \"expected\": [[[\"a\", 3], [\"b\", 5]], 12], \"passed\": true}, {\"check\": \"multi-round water filling\", \"actual\": [[[\"a\", 1], [\"b\", 3], [\"c\", 7], [\"d\", 6]], 0], \"expected\": [[[\"a\", 1], [\"b\", 3], [\"c\", 7], [\"d\", 6]], 0], \"passed\": true}, {\"check\": \"random demands\", \"actual\": [[[\"p\", 0], [\"q\", 3], [\"r\", 5], [\"s\", 5], [\"t\", 1]], 7], \"expected\": [[[\"p\", 0], [\"q\", 3], [\"r\", 5], [\"s\", 5], [\"t\", 1]], 7], \"passed\": true}, {\"check\": \"second round respects unmet demand\", \"actual\": [[[\"a\", 2], [\"b\", 7], [\"c\", 9]], 0], \"expected\": [[[\"a\", 2], [\"b\", 7], [\"c\", 9]], 0], \"passed\": true}, {\"check\": \"tiny capacity with idle client\", \"actual\": [[[\"a\", 0], [\"b\", 1], [\"c\", 1]], 0], \"expected\": [[[\"a\", 0], [\"b\", 1], [\"c\", 1]], 0], \"passed\": true}, {\"check\": \"remainder ignores demand size\", \"actual\": [[[\"a\", 1], [\"b\", 1], [\"c\", 0]], 0], \"expected\": [[[\"a\", 1], [\"b\", 1], [\"c\", 0]], 0], \"passed\": true}, {\"check\": \"exact share satisfies\", \"actual\": [[[\"a\", 3], [\"b\", 3], [\"c\", 3]], 0], \"expected\": [[[\"a\", 3], [\"b\", 3], [\"c\", 3]], 0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}