{"abstract":"Hashes of unmoved objects disagree with the value later stored on move.","category":"Garbage collector invariants","checks":6,"contract":"objs maps id -> [address, size]. The identity hash of an object is (address >> 3) & 0xFFFF of the address at which it was first hashed. Objects start unhashed; hash marks them hashed and returns the hash computed from the current address while they have not moved. The first move of a hashed object stores that hash in a new 8-byte trailing slot (size grows by 8) and later moves keep it; moving an unhashed object stores nothing. Return all hashes and the final [address, size] layout.","evaluation_group":"w2-garbage-collector-invariants-identity-hash-relocation","failed_approach":"Masking before shifting drops address bits 16-18 that the stored hash keeps.","family":"w2-garbage-collector-invariants-identity-hash-relocation-hash-derivation","id":"FA-90726","implementations":{"attempt":{"sha256":"c5c636f57f3896fa3af414b616caf019ed13c9e24977bd2406af7e803431e616","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(objs, events):\n    objs = {k: list(v) for k, v in objs.items()}\n    state = {o: 'unhashed' for o in objs}\n    stored = {}\n    out = []\n    for ev in events:\n        o = ev[1]\n        if ev[0] == 'hash':\n            if state[o] == 'unhashed':\n                state[o] = 'hashed'\n            if state[o] == 'hashed':\n                out.append((objs[o][0] & 0xFFFF) >> 3)\n            else:\n                out.append(stored[o])\n        else:\n            if state[o] == 'hashed':\n                stored[o] = objs[o][0] >> 3 & 0xFFFF\n                state[o] = 'moved'\n                objs[o][1] += 8\n            objs[o][0] = ev[2]\n    return {'hashes': out, 'layout': {str(k): v for k, v in sorted(objs.items())}}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: hash survives a move',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8201, 8201], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36872], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65608, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16400], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2050, 2050], 'layout': {'1': [65608, 24], '2': [8192, 16], '3': [16400, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8201], 'layout': {'1': [65608, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20488]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20488, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28680]]),\n   {'hashes': [], 'layout': {'1': [65608, 24], '2': [28680, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8202, 8202], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36880], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65616, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16416], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2052, 2052], 'layout': {'1': [65616, 24], '2': [8192, 16], '3': [16416, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8202], 'layout': {'1': [65616, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20496]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20496, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28688]]),\n   {'hashes': [], 'layout': {'1': [65616, 24], '2': [28688, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8203, 8203], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36888], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65624, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16432], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2054, 2054], 'layout': {'1': [65624, 24], '2': [8192, 16], '3': [16432, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8203], 'layout': {'1': [65624, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20504]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20504, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28696]]),\n   {'hashes': [], 'layout': {'1': [65624, 24], '2': [28696, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8204, 8204], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36896], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65632, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16448], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2056, 2056], 'layout': {'1': [65632, 24], '2': [8192, 16], '3': [16448, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8204], 'layout': {'1': [65632, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20512]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20512, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28704]]),\n   {'hashes': [], 'layout': {'1': [65632, 24], '2': [28704, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8205, 8205], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36904], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65640, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16464], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2058, 2058], 'layout': {'1': [65640, 24], '2': [8192, 16], '3': [16464, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8205], 'layout': {'1': [65640, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20520]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20520, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28712]]),\n   {'hashes': [], 'layout': {'1': [65640, 24], '2': [28712, 16], '3': [201272, 32]}})]]\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":"07fe622eac8ce38b87c3fe65878336a9519cd5c62b4a45b3226507f889b47a44","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(objs, events):\n    objs = {k: list(v) for k, v in objs.items()}\n    state = {o: 'unhashed' for o in objs}\n    stored = {}\n    out = []\n    for ev in events:\n        o = ev[1]\n        if ev[0] == 'hash':\n            if state[o] == 'unhashed':\n                state[o] = 'hashed'\n            if state[o] == 'hashed':\n                out.append(objs[o][0] & 0xFFFF >> 3)\n            else:\n                out.append(stored[o])\n        else:\n            if state[o] == 'hashed':\n                stored[o] = objs[o][0] >> 3 & 0xFFFF\n                state[o] = 'moved'\n                objs[o][1] += 8\n            objs[o][0] = ev[2]\n    return {'hashes': out, 'layout': {str(k): v for k, v in sorted(objs.items())}}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: hash survives a move',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8201, 8201], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36872], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65608, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16400], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2050, 2050], 'layout': {'1': [65608, 24], '2': [8192, 16], '3': [16400, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8201], 'layout': {'1': [65608, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20488]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20488, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28680]]),\n   {'hashes': [], 'layout': {'1': [65608, 24], '2': [28680, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8202, 8202], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36880], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65616, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16416], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2052, 2052], 'layout': {'1': [65616, 24], '2': [8192, 16], '3': [16416, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8202], 'layout': {'1': [65616, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20496]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20496, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28688]]),\n   {'hashes': [], 'layout': {'1': [65616, 24], '2': [28688, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8203, 8203], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36888], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65624, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16432], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2054, 2054], 'layout': {'1': [65624, 24], '2': [8192, 16], '3': [16432, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8203], 'layout': {'1': [65624, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20504]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20504, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28696]]),\n   {'hashes': [], 'layout': {'1': [65624, 24], '2': [28696, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8204, 8204], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36896], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65632, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16448], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2056, 2056], 'layout': {'1': [65632, 24], '2': [8192, 16], '3': [16448, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8204], 'layout': {'1': [65632, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20512]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20512, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28704]]),\n   {'hashes': [], 'layout': {'1': [65632, 24], '2': [28704, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8205, 8205], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36904], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65640, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16464], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2058, 2058], 'layout': {'1': [65640, 24], '2': [8192, 16], '3': [16464, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8205], 'layout': {'1': [65640, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20520]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20520, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28712]]),\n   {'hashes': [], 'layout': {'1': [65640, 24], '2': [28712, 16], '3': [201272, 32]}})]]\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":"833e8694f855cae3d49d4a975513f32316eb3a8276ffe6c1edb0c9e30f962259","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(objs, events):\n    objs = {k: list(v) for k, v in objs.items()}\n    state = {o: 'unhashed' for o in objs}\n    stored = {}\n    out = []\n    for ev in events:\n        o = ev[1]\n        if ev[0] == 'hash':\n            if state[o] == 'unhashed':\n                state[o] = 'hashed'\n            if state[o] == 'hashed':\n                out.append(objs[o][0] >> 3 & 0xFFFF)\n            else:\n                out.append(stored[o])\n        else:\n            if state[o] == 'hashed':\n                stored[o] = objs[o][0] >> 3 & 0xFFFF\n                state[o] = 'moved'\n                objs[o][1] += 8\n            objs[o][0] = ev[2]\n    return {'hashes': out, 'layout': {str(k): v for k, v in sorted(objs.items())}}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: hash survives a move',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8201, 8201], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36872], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65608, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16400], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2050, 2050], 'layout': {'1': [65608, 24], '2': [8192, 16], '3': [16400, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8201], 'layout': {'1': [65608, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20488]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20488, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65608, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28680]]),\n   {'hashes': [], 'layout': {'1': [65608, 24], '2': [28680, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8202, 8202], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36880], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65616, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16416], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2052, 2052], 'layout': {'1': [65616, 24], '2': [8192, 16], '3': [16416, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8202], 'layout': {'1': [65616, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20496]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20496, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65616, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28688]]),\n   {'hashes': [], 'layout': {'1': [65616, 24], '2': [28688, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8203, 8203], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36888], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65624, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16432], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2054, 2054], 'layout': {'1': [65624, 24], '2': [8192, 16], '3': [16432, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8203], 'layout': {'1': [65624, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20504]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20504, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65624, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28696]]),\n   {'hashes': [], 'layout': {'1': [65624, 24], '2': [28696, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8204, 8204], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36896], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65632, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16448], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2056, 2056], 'layout': {'1': [65632, 24], '2': [8192, 16], '3': [16448, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8204], 'layout': {'1': [65632, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20512]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20512, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65632, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28704]]),\n   {'hashes': [], 'layout': {'1': [65632, 24], '2': [28704, 16], '3': [201272, 32]}})],\n [('regression: hash survives a move',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 1], ['move', 1, 32768], ['hash', 1]]),\n   {'hashes': [8205, 8205], 'layout': {'1': [32768, 32], '2': [8192, 16], '3': [201272, 32]}}),\n  ('object moved twice after hashing',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]},\n    [['hash', 2], ['move', 2, 36904], ['move', 2, 40960], ['hash', 2]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [65640, 24], '2': [40960, 24], '3': [201272, 32]}}),\n  ('unhashed object moves freely',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 3, 16464], ['hash', 3], ['hash', 3]]),\n   {'hashes': [2058, 2058], 'layout': {'1': [65640, 24], '2': [8192, 16], '3': [16464, 32]}}),\n  ('high address bits masked after shifting',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 3], ['hash', 1]]),\n   {'hashes': [25159, 8205], 'layout': {'1': [65640, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('hash requested again before any move',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['hash', 2], ['hash', 2], ['move', 1, 20520]]),\n   {'hashes': [1024, 1024], 'layout': {'1': [20520, 24], '2': [8192, 16], '3': [201272, 32]}}),\n  ('control: no hashing',\n   ({1: [65640, 24], 2: [8192, 16], 3: [201272, 32]}, [['move', 2, 24576], ['move', 2, 28712]]),\n   {'hashes': [], 'layout': {'1': [65640, 24], '2': [28712, 16], '3': [201272, 32]}})]]\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-identity-hash-relocation-hash-derivation","generated_at":"2026-09-29T14:51:29.282595+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Moving collectors must keep identity hashes stable even though they are derived from addresses.","repair":"Shift the address right by 3, then mask with 0xFFFF.","root_cause":"The expression masks the address with 0xFFFF >> 3 instead of shifting first.","sha256":"adb5dbdb133ac995d97c7cdf18a08c8d355c7378b5c55266890dc6210780f1ff","title":"Identity hash: mask applied before the shift · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.026,"exit_code":1,"observations":[{"actual":{"hashes":[9,8201],"layout":{"1":[32768,32],"2":[8192,16],"3":[201272,32]}},"check":"regression: hash survives a move","expected":{"hashes":[8201,8201],"layout":{"1":[32768,32],"2":[8192,16],"3":[201272,32]}},"passed":false},{"actual":{"hashes":[1024,1024],"layout":{"1":[65608,24],"2":[40960,24],"3":[201272,32]}},"check":"object moved twice after hashing","expected":{"hashes":[1024,1024],"layout":{"1":[65608,24],"2":[40960,24],"3":[201272,32]}},"passed":true},{"actual":{"hashes":[2050,2050],"layout":{"1":[65608,24],"2":[8192,16],"3":[16400,32]}},"check":"unhashed object moves freely","expected":{"hashes":[2050,2050],"layout":{"1":[65608,24],"2":[8192,16],"3":[16400,32]}},"passed":true},{"actual":{"hashes":[583,9],"layout":{"1":[65608,24],"2":[8192,16],"3":[201272,32]}},"check":"high address bits masked after shifting","expected":{"hashes":[25159,8201],"layout":{"1":[65608,24],"2":[8192,16],"3":[201272,32]}},"passed":false},{"actual":{"hashes":[1024,1024],"layout":{"1":[20488,24],"2":[8192,16],"3":[201272,32]}},"check":"hash requested again before any move","expected":{"hashes":[1024,1024],"layout":{"1":[20488,24],"2":[8192,16],"3":[201272,32]}},"passed":true},{"actual":{"hashes":[],"layout":{"1":[65608,24],"2":[28680,16],"3":[201272,32]}},"check":"control: no hashing","expected":{"hashes":[],"layout":{"1":[65608,24],"2":[28680,16],"3":[201272,32]}},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: hash survives a move\", \"actual\": {\"hashes\": [9, 8201], \"layout\": {\"1\": [32768, 32], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [8201, 8201], \"layout\": {\"1\": [32768, 32], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": false}, {\"check\": \"object moved twice after hashing\", \"actual\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [65608, 24], \"2\": [40960, 24], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [65608, 24], \"2\": [40960, 24], \"3\": [201272, 32]}}, \"passed\": true}, {\"check\": \"unhashed object moves freely\", \"actual\": {\"hashes\": [2050, 2050], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [16400, 32]}}, \"expected\": {\"hashes\": [2050, 2050], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [16400, 32]}}, \"passed\": true}, {\"check\": \"high address bits masked after shifting\", \"actual\": {\"hashes\": [583, 9], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [25159, 8201], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": false}, {\"check\": \"hash requested again before any move\", \"actual\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [20488, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [20488, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": true}, {\"check\": \"control: no hashing\", \"actual\": {\"hashes\": [], \"layout\": {\"1\": [65608, 24], \"2\": [28680, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [], \"layout\": {\"1\": [65608, 24], \"2\": [28680, 16], \"3\": [201272, 32]}}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.553,"exit_code":1,"observations":[{"actual":{"hashes":[72,8201],"layout":{"1":[32768,32],"2":[8192,16],"3":[201272,32]}},"check":"regression: hash survives a move","expected":{"hashes":[8201,8201],"layout":{"1":[32768,32],"2":[8192,16],"3":[201272,32]}},"passed":false},{"actual":{"hashes":[0,1024],"layout":{"1":[65608,24],"2":[40960,24],"3":[201272,32]}},"check":"object moved twice after hashing","expected":{"hashes":[1024,1024],"layout":{"1":[65608,24],"2":[40960,24],"3":[201272,32]}},"passed":false},{"actual":{"hashes":[16,16],"layout":{"1":[65608,24],"2":[8192,16],"3":[16400,32]}},"check":"unhashed object moves freely","expected":{"hashes":[2050,2050],"layout":{"1":[65608,24],"2":[8192,16],"3":[16400,32]}},"passed":false},{"actual":{"hashes":[4664,72],"layout":{"1":[65608,24],"2":[8192,16],"3":[201272,32]}},"check":"high address bits masked after shifting","expected":{"hashes":[25159,8201],"layout":{"1":[65608,24],"2":[8192,16],"3":[201272,32]}},"passed":false},{"actual":{"hashes":[0,0],"layout":{"1":[20488,24],"2":[8192,16],"3":[201272,32]}},"check":"hash requested again before any move","expected":{"hashes":[1024,1024],"layout":{"1":[20488,24],"2":[8192,16],"3":[201272,32]}},"passed":false},{"actual":{"hashes":[],"layout":{"1":[65608,24],"2":[28680,16],"3":[201272,32]}},"check":"control: no hashing","expected":{"hashes":[],"layout":{"1":[65608,24],"2":[28680,16],"3":[201272,32]}},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: hash survives a move\", \"actual\": {\"hashes\": [72, 8201], \"layout\": {\"1\": [32768, 32], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [8201, 8201], \"layout\": {\"1\": [32768, 32], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": false}, {\"check\": \"object moved twice after hashing\", \"actual\": {\"hashes\": [0, 1024], \"layout\": {\"1\": [65608, 24], \"2\": [40960, 24], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [65608, 24], \"2\": [40960, 24], \"3\": [201272, 32]}}, \"passed\": false}, {\"check\": \"unhashed object moves freely\", \"actual\": {\"hashes\": [16, 16], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [16400, 32]}}, \"expected\": {\"hashes\": [2050, 2050], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [16400, 32]}}, \"passed\": false}, {\"check\": \"high address bits masked after shifting\", \"actual\": {\"hashes\": [4664, 72], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [25159, 8201], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": false}, {\"check\": \"hash requested again before any move\", \"actual\": {\"hashes\": [0, 0], \"layout\": {\"1\": [20488, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [20488, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": false}, {\"check\": \"control: no hashing\", \"actual\": {\"hashes\": [], \"layout\": {\"1\": [65608, 24], \"2\": [28680, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [], \"layout\": {\"1\": [65608, 24], \"2\": [28680, 16], \"3\": [201272, 32]}}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.509,"exit_code":0,"observations":[{"actual":{"hashes":[8201,8201],"layout":{"1":[32768,32],"2":[8192,16],"3":[201272,32]}},"check":"regression: hash survives a move","expected":{"hashes":[8201,8201],"layout":{"1":[32768,32],"2":[8192,16],"3":[201272,32]}},"passed":true},{"actual":{"hashes":[1024,1024],"layout":{"1":[65608,24],"2":[40960,24],"3":[201272,32]}},"check":"object moved twice after hashing","expected":{"hashes":[1024,1024],"layout":{"1":[65608,24],"2":[40960,24],"3":[201272,32]}},"passed":true},{"actual":{"hashes":[2050,2050],"layout":{"1":[65608,24],"2":[8192,16],"3":[16400,32]}},"check":"unhashed object moves freely","expected":{"hashes":[2050,2050],"layout":{"1":[65608,24],"2":[8192,16],"3":[16400,32]}},"passed":true},{"actual":{"hashes":[25159,8201],"layout":{"1":[65608,24],"2":[8192,16],"3":[201272,32]}},"check":"high address bits masked after shifting","expected":{"hashes":[25159,8201],"layout":{"1":[65608,24],"2":[8192,16],"3":[201272,32]}},"passed":true},{"actual":{"hashes":[1024,1024],"layout":{"1":[20488,24],"2":[8192,16],"3":[201272,32]}},"check":"hash requested again before any move","expected":{"hashes":[1024,1024],"layout":{"1":[20488,24],"2":[8192,16],"3":[201272,32]}},"passed":true},{"actual":{"hashes":[],"layout":{"1":[65608,24],"2":[28680,16],"3":[201272,32]}},"check":"control: no hashing","expected":{"hashes":[],"layout":{"1":[65608,24],"2":[28680,16],"3":[201272,32]}},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: hash survives a move\", \"actual\": {\"hashes\": [8201, 8201], \"layout\": {\"1\": [32768, 32], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [8201, 8201], \"layout\": {\"1\": [32768, 32], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": true}, {\"check\": \"object moved twice after hashing\", \"actual\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [65608, 24], \"2\": [40960, 24], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [65608, 24], \"2\": [40960, 24], \"3\": [201272, 32]}}, \"passed\": true}, {\"check\": \"unhashed object moves freely\", \"actual\": {\"hashes\": [2050, 2050], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [16400, 32]}}, \"expected\": {\"hashes\": [2050, 2050], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [16400, 32]}}, \"passed\": true}, {\"check\": \"high address bits masked after shifting\", \"actual\": {\"hashes\": [25159, 8201], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [25159, 8201], \"layout\": {\"1\": [65608, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": true}, {\"check\": \"hash requested again before any move\", \"actual\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [20488, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [1024, 1024], \"layout\": {\"1\": [20488, 24], \"2\": [8192, 16], \"3\": [201272, 32]}}, \"passed\": true}, {\"check\": \"control: no hashing\", \"actual\": {\"hashes\": [], \"layout\": {\"1\": [65608, 24], \"2\": [28680, 16], \"3\": [201272, 32]}}, \"expected\": {\"hashes\": [], \"layout\": {\"1\": [65608, 24], \"2\": [28680, 16], \"3\": [201272, 32]}}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}