{"abstract":"Equal scores inherit input order instead of ID order.","category":"Vector retrieval ranking","checks":6,"contract":"Rows [id,score] rank by descending score and ascending ID.","contract_signature":"rows","evaluation_group":"vector-retrieval-stable-tie-key","failed_approach":"Length-based ordering is not lexical ordering for equal length identifiers.","family":"w3-vector-retrieval-ranking-stable-tie-key","id":"FA-99456","implementations":{"attempt":{"sha256":"32394be6fb0ba49c883084dbb2055a492b44c5c6eb9c80aeef78a3f1dd787d0c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return [r[0] for r in sorted(rows,key=lambda r:(-r[1],-len(r[0])))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('reverse tied ids',solve([['z',N],['a',N]]),['a','z'])\ncheck('same length ids',solve([['b',N],['a',N]]),['a','b'])\ncheck('tie after leader',solve([['z',N],['x',N+1],['a',N]]),['x','a','z'])\ncheck('three tie',solve([['c',1],['b',1],['a',1]]),['a','b','c'])\ncheck('prefix tie',solve([['aa',N],['ab',N]]),['aa','ab'])\ncheck('unequal scores',solve([['a',N],['z',N+1]]),['z','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":"9bed7f3c7a8f6cdde8246bba0ba63affabb8f9fea724774ae16e78c9b940b62c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return [r[0] for r in sorted(rows,key=lambda r:-r[1])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('reverse tied ids',solve([['z',N],['a',N]]),['a','z'])\ncheck('same length ids',solve([['b',N],['a',N]]),['a','b'])\ncheck('tie after leader',solve([['z',N],['x',N+1],['a',N]]),['x','a','z'])\ncheck('three tie',solve([['c',1],['b',1],['a',1]]),['a','b','c'])\ncheck('prefix tie',solve([['aa',N],['ab',N]]),['aa','ab'])\ncheck('unequal scores',solve([['a',N],['z',N+1]]),['z','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":"Inputs are small exact toy vectors and scores. No production index, ANN recall, embedding quality, or latency claim is implied. 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":"w3-vector-retrieval-ranking-stable-tie-key","generated_at":"2026-09-30T16:48:24.474426+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline vector retrieval toy model isolates one ranking contract from embedding generation, storage, and serving.","root_cause":"No identifier tie key is supplied, so stable input order leaks into output.","sha256":"846f332fc907d5205ebf6fe88cc22c9f556a7bfc42af321123e9314569ccfd5a","title":"Vector retrieval: Equal scores inherit input order instead of ID order · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.063,"exit_code":1,"observations":[{"actual":["z","a"],"check":"reverse tied ids","expected":["a","z"],"passed":false},{"actual":["b","a"],"check":"same length ids","expected":["a","b"],"passed":false},{"actual":["x","z","a"],"check":"tie after leader","expected":["x","a","z"],"passed":false},{"actual":["c","b","a"],"check":"three tie","expected":["a","b","c"],"passed":false},{"actual":["aa","ab"],"check":"prefix tie","expected":["aa","ab"],"passed":true},{"actual":["z","a"],"check":"unequal scores","expected":["z","a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"reverse tied ids\", \"actual\": [\"z\", \"a\"], \"expected\": [\"a\", \"z\"], \"passed\": false}, {\"check\": \"same length ids\", \"actual\": [\"b\", \"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"tie after leader\", \"actual\": [\"x\", \"z\", \"a\"], \"expected\": [\"x\", \"a\", \"z\"], \"passed\": false}, {\"check\": \"three tie\", \"actual\": [\"c\", \"b\", \"a\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"prefix tie\", \"actual\": [\"aa\", \"ab\"], \"expected\": [\"aa\", \"ab\"], \"passed\": true}, {\"check\": \"unequal scores\", \"actual\": [\"z\", \"a\"], \"expected\": [\"z\", \"a\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.727,"exit_code":1,"observations":[{"actual":["z","a"],"check":"reverse tied ids","expected":["a","z"],"passed":false},{"actual":["b","a"],"check":"same length ids","expected":["a","b"],"passed":false},{"actual":["x","z","a"],"check":"tie after leader","expected":["x","a","z"],"passed":false},{"actual":["c","b","a"],"check":"three tie","expected":["a","b","c"],"passed":false},{"actual":["aa","ab"],"check":"prefix tie","expected":["aa","ab"],"passed":true},{"actual":["z","a"],"check":"unequal scores","expected":["z","a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"reverse tied ids\", \"actual\": [\"z\", \"a\"], \"expected\": [\"a\", \"z\"], \"passed\": false}, {\"check\": \"same length ids\", \"actual\": [\"b\", \"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"tie after leader\", \"actual\": [\"x\", \"z\", \"a\"], \"expected\": [\"x\", \"a\", \"z\"], \"passed\": false}, {\"check\": \"three tie\", \"actual\": [\"c\", \"b\", \"a\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"prefix tie\", \"actual\": [\"aa\", \"ab\"], \"expected\": [\"aa\", \"ab\"], \"passed\": true}, {\"check\": \"unequal scores\", \"actual\": [\"z\", \"a\"], \"expected\": [\"z\", \"a\"], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}