{"abstract":"The operation returns a result or retained state that violates this contract: Sort values lexically and retain original positions, preserving original order among equal values.","category":"Sequence semantics","checks":4,"contract":"Sort values lexically and retain original positions, preserving original order among equal values. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","evaluation_group":"model-c27c359c226eaebd","failed_approach":"Looking up each sorted value recovers only the first equal original position.","family":"xr-stable-value-ranking","id":"FA-4201","implementations":{"attempt":{"sha256":"72d1db1fd0ef00f93e542f62065e857c31116fbd9aed44c2e6602a3ec990206c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return [[x.index(v),v] for v in sorted(x)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty collection', solve([]), [])\ncheck('singleton collection', solve(['a']), [[0, 'a']])\ncheck('two distinct elements', solve(['a', 'b']), [[0, 'a'], [1, 'b']])\ncheck('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [[1, 'a'], [0, 'b'], [2, 'b'], [3, 'c']])\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":"5d344e10c69a1a90c775a50dff57dba84a8844e59dc436858d29fcdcac3fb670","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return [[i,v] for i,v in enumerate(sorted(x))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty collection', solve([]), [])\ncheck('singleton collection', solve(['a']), [[0, 'a']])\ncheck('two distinct elements', solve(['a', 'b']), [[0, 'a'], [1, 'b']])\ncheck('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [[1, 'a'], [0, 'b'], [2, 'b'], [3, 'c']])\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":"c095377a823a8db84d576ebdeb1f1ae5889e1e27ed81334d25a665d11ab94898","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return [[i,x[i]] for i in sorted(range(len(x)), key=lambda i:x[i])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty collection', solve([]), [])\ncheck('singleton collection', solve(['a']), [[0, 'a']])\ncheck('two distinct elements', solve(['a', 'b']), [[0, 'a'], [1, 'b']])\ncheck('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [[1, 'a'], [0, 'b'], [2, 'b'], [3, 'c']])\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-stable-value-ranking","generated_at":"2026-09-29T14:37:36.839418+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":"Sort values lexically and retain original positions, preserving original order among equal values.","root_cause":"Positions are assigned after sorting, losing original positions.","sha256":"7e0dc57fcf7eb3699a8e6c3bc5d7e0fc8de874fe31182629f336edf9c71113df","title":"Stable value ranking · 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":122.911,"exit_code":1,"observations":[{"actual":[],"check":"empty collection","expected":[],"passed":true},{"actual":[[0,"a"]],"check":"singleton collection","expected":[[0,"a"]],"passed":true},{"actual":[[0,"a"],[1,"b"]],"check":"two distinct elements","expected":[[0,"a"],[1,"b"]],"passed":true},{"actual":[[1,"a"],[0,"b"],[0,"b"],[3,"c"]],"check":"nonadjacent duplicate and unsorted order","expected":[[1,"a"],[0,"b"],[2,"b"],[3,"c"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty collection\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton collection\", \"actual\": [[0, \"a\"]], \"expected\": [[0, \"a\"]], \"passed\": true}, {\"check\": \"two distinct elements\", \"actual\": [[0, \"a\"], [1, \"b\"]], \"expected\": [[0, \"a\"], [1, \"b\"]], \"passed\": true}, {\"check\": \"nonadjacent duplicate and unsorted order\", \"actual\": [[1, \"a\"], [0, \"b\"], [0, \"b\"], [3, \"c\"]], \"expected\": [[1, \"a\"], [0, \"b\"], [2, \"b\"], [3, \"c\"]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.701,"exit_code":1,"observations":[{"actual":[],"check":"empty collection","expected":[],"passed":true},{"actual":[[0,"a"]],"check":"singleton collection","expected":[[0,"a"]],"passed":true},{"actual":[[0,"a"],[1,"b"]],"check":"two distinct elements","expected":[[0,"a"],[1,"b"]],"passed":true},{"actual":[[0,"a"],[1,"b"],[2,"b"],[3,"c"]],"check":"nonadjacent duplicate and unsorted order","expected":[[1,"a"],[0,"b"],[2,"b"],[3,"c"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty collection\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton collection\", \"actual\": [[0, \"a\"]], \"expected\": [[0, \"a\"]], \"passed\": true}, {\"check\": \"two distinct elements\", \"actual\": [[0, \"a\"], [1, \"b\"]], \"expected\": [[0, \"a\"], [1, \"b\"]], \"passed\": true}, {\"check\": \"nonadjacent duplicate and unsorted order\", \"actual\": [[0, \"a\"], [1, \"b\"], [2, \"b\"], [3, \"c\"]], \"expected\": [[1, \"a\"], [0, \"b\"], [2, \"b\"], [3, \"c\"]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.33,"exit_code":0,"observations":[{"actual":[],"check":"empty collection","expected":[],"passed":true},{"actual":[[0,"a"]],"check":"singleton collection","expected":[[0,"a"]],"passed":true},{"actual":[[0,"a"],[1,"b"]],"check":"two distinct elements","expected":[[0,"a"],[1,"b"]],"passed":true},{"actual":[[1,"a"],[0,"b"],[2,"b"],[3,"c"]],"check":"nonadjacent duplicate and unsorted order","expected":[[1,"a"],[0,"b"],[2,"b"],[3,"c"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty collection\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton collection\", \"actual\": [[0, \"a\"]], \"expected\": [[0, \"a\"]], \"passed\": true}, {\"check\": \"two distinct elements\", \"actual\": [[0, \"a\"], [1, \"b\"]], \"expected\": [[0, \"a\"], [1, \"b\"]], \"passed\": true}, {\"check\": \"nonadjacent duplicate and unsorted order\", \"actual\": [[1, \"a\"], [0, \"b\"], [2, \"b\"], [3, \"c\"]], \"expected\": [[1, \"a\"], [0, \"b\"], [2, \"b\"], [3, \"c\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}