{"abstract":"The operation returns a result or retained state that violates this contract: Build a min heap from arbitrary input and pop all values in sorted order, retaining duplicates.","category":"Heap invariants","checks":4,"contract":"Build a min heap from arbitrary input and pop all values in sorted order, retaining duplicates. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","evaluation_group":"model-4ed801b1a5ac71fd","failed_approach":"Deduplication before heap construction loses repeated input values.","family":"xr-heapify-required-before-successive-pops","id":"FA-4801","implementations":{"attempt":{"sha256":"65b64fc68d8a2536f5edd3b8ea57e35884e780eb4fedbe103bd5431352d32e39","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=list(dict.fromkeys(x)); heapq.heapify(a); return [heapq.heappop(a) for _ in range(len(a))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('arbitrary input order', solve(['c', 'a', 'b']), ['a', 'b', 'c'])\ncheck('duplicates retained', solve(['b', 'a', 'b']), ['a', 'b', 'b'])\ncheck('empty', solve([]), [])\ncheck('singleton', solve(['a']), ['a'])\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":"209f0f22817997f39390e321bf04be7bd56d5599d9c96309001262e1ea62ee8d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=list(x); return [heapq.heappop(a) for _ in range(len(a))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('arbitrary input order', solve(['c', 'a', 'b']), ['a', 'b', 'c'])\ncheck('duplicates retained', solve(['b', 'a', 'b']), ['a', 'b', 'b'])\ncheck('empty', solve([]), [])\ncheck('singleton', solve(['a']), ['a'])\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":"dcebf8e35aaf9dd7b7562cbfac84586cb7fb316ebff09cee8ecb4a313b3c3446","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=list(x); heapq.heapify(a); return [heapq.heappop(a) for _ in range(len(a))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('arbitrary input order', solve(['c', 'a', 'b']), ['a', 'b', 'c'])\ncheck('duplicates retained', solve(['b', 'a', 'b']), ['a', 'b', 'b'])\ncheck('empty', solve([]), [])\ncheck('singleton', solve(['a']), ['a'])\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":" 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":"xr-heapify-required-before-successive-pops","generated_at":"2026-09-29T14:37:42.886487+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.","repair":"Build a min heap from arbitrary input and pop all values in sorted order, retaining duplicates.","root_cause":"Heap pop is applied to an arbitrary array without establishing the heap invariant.","sha256":"66046e34a42f515c9d8624fa0d502790355a9a4158bd9ba33dfa638edd0d7538","title":"Heapify required before successive pops · case 01","variant":1,"variant_policy":"Five execution reruns of a fixed adversarial fixture suite; variant number does not alter semantic inputs.","verification":{"attempt":{"elapsed_ms":35.416,"exit_code":1,"observations":[{"actual":["a","b","c"],"check":"arbitrary input order","expected":["a","b","c"],"passed":true},{"actual":["a","b"],"check":"duplicates retained","expected":["a","b","b"],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["a"],"check":"singleton","expected":["a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"arbitrary input order\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"duplicates retained\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\", \"b\"], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.465,"exit_code":1,"observations":[{"actual":["c","a","b"],"check":"arbitrary input order","expected":["a","b","c"],"passed":false},{"actual":["b","a","b"],"check":"duplicates retained","expected":["a","b","b"],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["a"],"check":"singleton","expected":["a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"arbitrary input order\", \"actual\": [\"c\", \"a\", \"b\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"duplicates retained\", \"actual\": [\"b\", \"a\", \"b\"], \"expected\": [\"a\", \"b\", \"b\"], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.832,"exit_code":0,"observations":[{"actual":["a","b","c"],"check":"arbitrary input order","expected":["a","b","c"],"passed":true},{"actual":["a","b","b"],"check":"duplicates retained","expected":["a","b","b"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["a"],"check":"singleton","expected":["a"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"arbitrary input order\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"duplicates retained\", \"actual\": [\"a\", \"b\", \"b\"], \"expected\": [\"a\", \"b\", \"b\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}