{"abstract":"Survivor populations exactly at the target size are promoted a cycle early.","category":"Garbage collector invariants","checks":7,"contract":"Survivors are [id, age, size] after a minor collection. desired = capacity * ratio // 100. Walking ages 1..max_threshold, accumulate sizes; the first age at which the running total exceeds desired becomes the tenuring threshold (max_threshold if never exceeded). Objects with age >= threshold are promoted; the rest are placed youngest first (ties by id) into the survivor space of the given capacity, and any that do not fit overflow into promotion. Return threshold, promoted ids, kept ids and bytes used.","evaluation_group":"w2-garbage-collector-invariants-adaptive-tenuring","failed_approach":"Comparing with the full capacity ignores the target ratio.","family":"w2-garbage-collector-invariants-adaptive-tenuring-threshold-crossing-test","id":"FA-90616","implementations":{"attempt":{"sha256":"38216f55a6850f0dd752c2d1ebbce340c889e30637aea3bf4470ec87ec4e8dfd","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(ages, capacity, ratio, max_threshold):\n    desired = capacity * ratio // 100\n    by_age = {}\n    for _, age, size in ages:\n        by_age[age] = by_age.get(age, 0) + size\n    total = 0\n    threshold = max_threshold\n    for age in range(1, max_threshold + 1):\n        total += by_age.get(age, 0)\n        if total > capacity:\n            threshold = age\n            break\n    promote = [o for o, age, size in ages if age >= threshold]\n    stay = sorted([x for x in ages if x[1] < threshold], key=lambda x: (x[1], x[0]))\n    used = 0\n    kept = []\n    for o, age, size in stay:\n        if used + size <= capacity:\n            kept.append(o)\n            used += size\n        else:\n            promote.append(o)\n    return {'threshold': threshold, 'promoted': sorted(promote), 'kept': sorted(kept), 'used': used}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 1]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 46}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 6]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 1]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 71}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 11], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 71}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 1]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 6]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 11}),\n  ('control: empty survivor set',\n   ([], 101, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 2]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 47}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 7]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 2]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 72}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 12], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 72}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 2]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 7]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 12}),\n  ('control: empty survivor set',\n   ([], 102, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 3]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 48}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 8]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 3]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 73}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 13], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 73}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 3]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 8]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 13}),\n  ('control: empty survivor set',\n   ([], 103, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 4]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 49}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 9]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 4]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 74}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 14], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 74}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 4]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 9]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 14}),\n  ('control: empty survivor set',\n   ([], 104, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 5]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 50}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 10]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 5]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 75}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 15], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 75}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 5]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 10]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 15}),\n  ('control: empty survivor set',\n   ([], 105, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 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":"994c0dbe23546bb63d921346f344f3cf8b48164cff4e99ce8e90d3c21acaa90a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(ages, capacity, ratio, max_threshold):\n    desired = capacity * ratio // 100\n    by_age = {}\n    for _, age, size in ages:\n        by_age[age] = by_age.get(age, 0) + size\n    total = 0\n    threshold = max_threshold\n    for age in range(1, max_threshold + 1):\n        total += by_age.get(age, 0)\n        if total >= desired:\n            threshold = age\n            break\n    promote = [o for o, age, size in ages if age >= threshold]\n    stay = sorted([x for x in ages if x[1] < threshold], key=lambda x: (x[1], x[0]))\n    used = 0\n    kept = []\n    for o, age, size in stay:\n        if used + size <= capacity:\n            kept.append(o)\n            used += size\n        else:\n            promote.append(o)\n    return {'threshold': threshold, 'promoted': sorted(promote), 'kept': sorted(kept), 'used': used}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 1]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 46}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 6]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 1]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 71}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 11], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 71}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 1]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 6]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 11}),\n  ('control: empty survivor set',\n   ([], 101, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 2]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 47}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 7]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 2]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 72}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 12], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 72}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 2]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 7]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 12}),\n  ('control: empty survivor set',\n   ([], 102, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 3]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 48}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 8]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 3]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 73}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 13], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 73}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 3]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 8]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 13}),\n  ('control: empty survivor set',\n   ([], 103, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 4]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 49}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 9]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 4]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 74}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 14], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 74}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 4]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 9]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 14}),\n  ('control: empty survivor set',\n   ([], 104, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 5]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 50}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 10]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 5]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 75}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 15], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 75}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 5]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 10]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 15}),\n  ('control: empty survivor set',\n   ([], 105, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 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":"baecc4f96fc4585f74bdb493a81d8d58f45de5dbb20a14be44435c78c8eec39e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(ages, capacity, ratio, max_threshold):\n    desired = capacity * ratio // 100\n    by_age = {}\n    for _, age, size in ages:\n        by_age[age] = by_age.get(age, 0) + size\n    total = 0\n    threshold = max_threshold\n    for age in range(1, max_threshold + 1):\n        total += by_age.get(age, 0)\n        if total > desired:\n            threshold = age\n            break\n    promote = [o for o, age, size in ages if age >= threshold]\n    stay = sorted([x for x in ages if x[1] < threshold], key=lambda x: (x[1], x[0]))\n    used = 0\n    kept = []\n    for o, age, size in stay:\n        if used + size <= capacity:\n            kept.append(o)\n            used += size\n        else:\n            promote.append(o)\n    return {'threshold': threshold, 'promoted': sorted(promote), 'kept': sorted(kept), 'used': used}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 1]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 46}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 6]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 1]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 71}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 11], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 71}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 1]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 6]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 11}),\n  ('control: empty survivor set',\n   ([], 101, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 2]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 47}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 7]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 2]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 72}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 12], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 72}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 2]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 7]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 12}),\n  ('control: empty survivor set',\n   ([], 102, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 3]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 48}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 8]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 3]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 73}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 13], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 73}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 3]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 8]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 13}),\n  ('control: empty survivor set',\n   ([], 103, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 4]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 49}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 9]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 4]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 74}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 14], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 74}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 4]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 9]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 14}),\n  ('control: empty survivor set',\n   ([], 104, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 0})],\n [('regression: cumulative sizes cross the desired size',\n   ([[1, 1, 20], [2, 2, 25], [3, 3, 10], [4, 4, 30], [5, 1, 5]], 100, 50, 15),\n   {'kept': [1, 2, 5], 'promoted': [3, 4], 'threshold': 3, 'used': 50}),\n  ('cumulative size exactly at the desired size',\n   ([[1, 1, 30], [2, 2, 20], [3, 3, 10]], 100, 50, 15),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 3, 'used': 50}),\n  ('ratio of a capacity that is not a multiple of 100',\n   ([[1, 1, 40], [2, 2, 30], [3, 3, 5]], 150, 50, 15),\n   {'kept': [1, 2, 3], 'promoted': [], 'threshold': 15, 'used': 75}),\n  ('survivors overflow the survivor space',\n   ([[1, 1, 30], [2, 1, 30], [3, 2, 30], [4, 1, 15], [5, 2, 40]], 100, 200, 3),\n   {'kept': [1, 2, 4], 'promoted': [3, 5], 'threshold': 3, 'used': 75}),\n  ('survivors fill the space exactly',\n   ([[1, 1, 60], [2, 1, 40], [3, 2, 5]], 100, 200, 2),\n   {'kept': [1, 2], 'promoted': [3], 'threshold': 2, 'used': 100}),\n  ('threshold never crossed',\n   ([[1, 1, 5], [2, 3, 10]], 100, 50, 6),\n   {'kept': [1, 2], 'promoted': [], 'threshold': 6, 'used': 15}),\n  ('control: empty survivor set',\n   ([], 105, 50, 15),\n   {'kept': [], 'promoted': [], 'threshold': 15, 'used': 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 of one garbage-collector mechanism with stipulated rules; it is not a production collector and claims no conformance to any particular runtime. 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-garbage-collector-invariants-adaptive-tenuring-threshold-crossing-test","generated_at":"2026-09-29T14:51:28.400559+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Tenuring policy controls premature promotion and survivor overflow in generational collectors.","repair":"Stop only when the running total exceeds the desired size.","root_cause":"The threshold search stops when the running total equals the desired size.","sha256":"0ca7c35fa3f4fb18c93fb5fdeeda84f926a9cce182d0c352b0cd26fe64a66db2","title":"Adaptive tenuring: reaching the desired size lowers the threshold · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.665,"exit_code":1,"observations":[{"actual":{"kept":[1,2,3,4,5],"promoted":[],"threshold":15,"used":86},"check":"regression: cumulative sizes cross the desired size","expected":{"kept":[1,2,5],"promoted":[3,4],"threshold":3,"used":46},"passed":false},{"actual":{"kept":[1,2,3],"promoted":[],"threshold":15,"used":56},"check":"cumulative size exactly at the desired size","expected":{"kept":[1,2],"promoted":[3],"threshold":3,"used":50},"passed":false},{"actual":{"kept":[1,2,3],"promoted":[],"threshold":15,"used":71},"check":"ratio of a capacity that is not a multiple of 100","expected":{"kept":[1,2,3],"promoted":[],"threshold":15,"used":71},"passed":true},{"actual":{"kept":[1,2,4],"promoted":[3,5],"threshold":2,"used":71},"check":"survivors overflow the survivor space","expected":{"kept":[1,2,4],"promoted":[3,5],"threshold":3,"used":71},"passed":false},{"actual":{"kept":[1,2],"promoted":[3],"threshold":2,"used":100},"check":"survivors fill the space exactly","expected":{"kept":[1,2],"promoted":[3],"threshold":2,"used":100},"passed":true},{"actual":{"kept":[1,2],"promoted":[],"threshold":6,"used":11},"check":"threshold never crossed","expected":{"kept":[1,2],"promoted":[],"threshold":6,"used":11},"passed":true},{"actual":{"kept":[],"promoted":[],"threshold":15,"used":0},"check":"control: empty survivor set","expected":{"kept":[],"promoted":[],"threshold":15,"used":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: cumulative sizes cross the desired size\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [1, 2, 3, 4, 5], \"used\": 86}, \"expected\": {\"kept\": [1, 2, 5], \"promoted\": [3, 4], \"threshold\": 3, \"used\": 46}, \"passed\": false}, {\"check\": \"cumulative size exactly at the desired size\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [1, 2, 3], \"used\": 56}, \"expected\": {\"kept\": [1, 2], \"promoted\": [3], \"threshold\": 3, \"used\": 50}, \"passed\": false}, {\"check\": \"ratio of a capacity that is not a multiple of 100\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [1, 2, 3], \"used\": 71}, \"expected\": {\"kept\": [1, 2, 3], \"promoted\": [], \"threshold\": 15, \"used\": 71}, \"passed\": true}, {\"check\": \"survivors overflow the survivor space\", \"actual\": {\"threshold\": 2, \"promoted\": [3, 5], \"kept\": [1, 2, 4], \"used\": 71}, \"expected\": {\"kept\": [1, 2, 4], \"promoted\": [3, 5], \"threshold\": 3, \"used\": 71}, \"passed\": false}, {\"check\": \"survivors fill the space exactly\", \"actual\": {\"threshold\": 2, \"promoted\": [3], \"kept\": [1, 2], \"used\": 100}, \"expected\": {\"kept\": [1, 2], \"promoted\": [3], \"threshold\": 2, \"used\": 100}, \"passed\": true}, {\"check\": \"threshold never crossed\", \"actual\": {\"threshold\": 6, \"promoted\": [], \"kept\": [1, 2], \"used\": 11}, \"expected\": {\"kept\": [1, 2], \"promoted\": [], \"threshold\": 6, \"used\": 11}, \"passed\": true}, {\"check\": \"control: empty survivor set\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [], \"used\": 0}, \"expected\": {\"kept\": [], \"promoted\": [], \"threshold\": 15, \"used\": 0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.043,"exit_code":1,"observations":[{"actual":{"kept":[1,2,5],"promoted":[3,4],"threshold":3,"used":46},"check":"regression: cumulative sizes cross the desired size","expected":{"kept":[1,2,5],"promoted":[3,4],"threshold":3,"used":46},"passed":true},{"actual":{"kept":[1],"promoted":[2,3],"threshold":2,"used":30},"check":"cumulative size exactly at the desired size","expected":{"kept":[1,2],"promoted":[3],"threshold":3,"used":50},"passed":false},{"actual":{"kept":[1,2,3],"promoted":[],"threshold":15,"used":71},"check":"ratio of a capacity that is not a multiple of 100","expected":{"kept":[1,2,3],"promoted":[],"threshold":15,"used":71},"passed":true},{"actual":{"kept":[1,2,4],"promoted":[3,5],"threshold":3,"used":71},"check":"survivors overflow the survivor space","expected":{"kept":[1,2,4],"promoted":[3,5],"threshold":3,"used":71},"passed":true},{"actual":{"kept":[1,2],"promoted":[3],"threshold":2,"used":100},"check":"survivors fill the space exactly","expected":{"kept":[1,2],"promoted":[3],"threshold":2,"used":100},"passed":true},{"actual":{"kept":[1,2],"promoted":[],"threshold":6,"used":11},"check":"threshold never crossed","expected":{"kept":[1,2],"promoted":[],"threshold":6,"used":11},"passed":true},{"actual":{"kept":[],"promoted":[],"threshold":15,"used":0},"check":"control: empty survivor set","expected":{"kept":[],"promoted":[],"threshold":15,"used":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: cumulative sizes cross the desired size\", \"actual\": {\"threshold\": 3, \"promoted\": [3, 4], \"kept\": [1, 2, 5], \"used\": 46}, \"expected\": {\"kept\": [1, 2, 5], \"promoted\": [3, 4], \"threshold\": 3, \"used\": 46}, \"passed\": true}, {\"check\": \"cumulative size exactly at the desired size\", \"actual\": {\"threshold\": 2, \"promoted\": [2, 3], \"kept\": [1], \"used\": 30}, \"expected\": {\"kept\": [1, 2], \"promoted\": [3], \"threshold\": 3, \"used\": 50}, \"passed\": false}, {\"check\": \"ratio of a capacity that is not a multiple of 100\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [1, 2, 3], \"used\": 71}, \"expected\": {\"kept\": [1, 2, 3], \"promoted\": [], \"threshold\": 15, \"used\": 71}, \"passed\": true}, {\"check\": \"survivors overflow the survivor space\", \"actual\": {\"threshold\": 3, \"promoted\": [3, 5], \"kept\": [1, 2, 4], \"used\": 71}, \"expected\": {\"kept\": [1, 2, 4], \"promoted\": [3, 5], \"threshold\": 3, \"used\": 71}, \"passed\": true}, {\"check\": \"survivors fill the space exactly\", \"actual\": {\"threshold\": 2, \"promoted\": [3], \"kept\": [1, 2], \"used\": 100}, \"expected\": {\"kept\": [1, 2], \"promoted\": [3], \"threshold\": 2, \"used\": 100}, \"passed\": true}, {\"check\": \"threshold never crossed\", \"actual\": {\"threshold\": 6, \"promoted\": [], \"kept\": [1, 2], \"used\": 11}, \"expected\": {\"kept\": [1, 2], \"promoted\": [], \"threshold\": 6, \"used\": 11}, \"passed\": true}, {\"check\": \"control: empty survivor set\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [], \"used\": 0}, \"expected\": {\"kept\": [], \"promoted\": [], \"threshold\": 15, \"used\": 0}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.809,"exit_code":0,"observations":[{"actual":{"kept":[1,2,5],"promoted":[3,4],"threshold":3,"used":46},"check":"regression: cumulative sizes cross the desired size","expected":{"kept":[1,2,5],"promoted":[3,4],"threshold":3,"used":46},"passed":true},{"actual":{"kept":[1,2],"promoted":[3],"threshold":3,"used":50},"check":"cumulative size exactly at the desired size","expected":{"kept":[1,2],"promoted":[3],"threshold":3,"used":50},"passed":true},{"actual":{"kept":[1,2,3],"promoted":[],"threshold":15,"used":71},"check":"ratio of a capacity that is not a multiple of 100","expected":{"kept":[1,2,3],"promoted":[],"threshold":15,"used":71},"passed":true},{"actual":{"kept":[1,2,4],"promoted":[3,5],"threshold":3,"used":71},"check":"survivors overflow the survivor space","expected":{"kept":[1,2,4],"promoted":[3,5],"threshold":3,"used":71},"passed":true},{"actual":{"kept":[1,2],"promoted":[3],"threshold":2,"used":100},"check":"survivors fill the space exactly","expected":{"kept":[1,2],"promoted":[3],"threshold":2,"used":100},"passed":true},{"actual":{"kept":[1,2],"promoted":[],"threshold":6,"used":11},"check":"threshold never crossed","expected":{"kept":[1,2],"promoted":[],"threshold":6,"used":11},"passed":true},{"actual":{"kept":[],"promoted":[],"threshold":15,"used":0},"check":"control: empty survivor set","expected":{"kept":[],"promoted":[],"threshold":15,"used":0},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: cumulative sizes cross the desired size\", \"actual\": {\"threshold\": 3, \"promoted\": [3, 4], \"kept\": [1, 2, 5], \"used\": 46}, \"expected\": {\"kept\": [1, 2, 5], \"promoted\": [3, 4], \"threshold\": 3, \"used\": 46}, \"passed\": true}, {\"check\": \"cumulative size exactly at the desired size\", \"actual\": {\"threshold\": 3, \"promoted\": [3], \"kept\": [1, 2], \"used\": 50}, \"expected\": {\"kept\": [1, 2], \"promoted\": [3], \"threshold\": 3, \"used\": 50}, \"passed\": true}, {\"check\": \"ratio of a capacity that is not a multiple of 100\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [1, 2, 3], \"used\": 71}, \"expected\": {\"kept\": [1, 2, 3], \"promoted\": [], \"threshold\": 15, \"used\": 71}, \"passed\": true}, {\"check\": \"survivors overflow the survivor space\", \"actual\": {\"threshold\": 3, \"promoted\": [3, 5], \"kept\": [1, 2, 4], \"used\": 71}, \"expected\": {\"kept\": [1, 2, 4], \"promoted\": [3, 5], \"threshold\": 3, \"used\": 71}, \"passed\": true}, {\"check\": \"survivors fill the space exactly\", \"actual\": {\"threshold\": 2, \"promoted\": [3], \"kept\": [1, 2], \"used\": 100}, \"expected\": {\"kept\": [1, 2], \"promoted\": [3], \"threshold\": 2, \"used\": 100}, \"passed\": true}, {\"check\": \"threshold never crossed\", \"actual\": {\"threshold\": 6, \"promoted\": [], \"kept\": [1, 2], \"used\": 11}, \"expected\": {\"kept\": [1, 2], \"promoted\": [], \"threshold\": 6, \"used\": 11}, \"passed\": true}, {\"check\": \"control: empty survivor set\", \"actual\": {\"threshold\": 15, \"promoted\": [], \"kept\": [], \"used\": 0}, \"expected\": {\"kept\": [], \"promoted\": [], \"threshold\": 15, \"used\": 0}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}