FA-90806 / Garbage collector invariants / Open access
Oop maps: run count used as an end index · case 01
Reference runs that start beyond their count scan nothing, so referenced objects are missed.
ROOT CAUSE
The [offset, count] pair is expanded as range(offset, count).
THE FAILURE
The [offset, count] pair is expanded as range(offset, count).
Unsuccessful approach: Including one extra word treats the following primitive field as a reference.
Case contract
Precise tracing with per-class reference maps. Objects are word lists: words 0-1 are the header; object arrays keep their length in word 2 and elements in words 3..3+len-1 (anything after is padding); primitive arrays contain no references. Instance classes list [offset, count] runs of reference words and inherit all superclass runs. A reference word of 0 is null; a nonzero reference that is not an object id is reported as [object, word]. Return the reachable ids and the bad references.
Why this case matters
Tracing must follow exactly the reference words described by type metadata, no more and no less.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(classes, objects, roots):
def ref_slots(o):
ob = objects[o]
cls = classes[ob['class']]
if cls['kind'] == 'objarray':
return list(range(3, 3 + ob['words'][2]))
if cls['kind'] == 'primarray':
return []
slots = []
c = ob['class']
while c is not None:
for off, cnt in classes[c]['maps']:
slots.extend(range(off, cnt))
c = classes[c]['super']
return slots
seen = set()
stack = list(roots)
bad = []
while stack:
o = stack.pop()
if o in seen:
continue
seen.add(o)
words = objects[o]['words']
for s in ref_slots(o):
v = words[s]
if v == 0:
continue
if v not in objects:
bad.append([o, s])
continue
stack.append(v)
return {'live': sorted(seen), 'bad': sorted(bad)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[106]),
{'bad': [], 'live': [106]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[107]),
{'bad': [], 'live': [107]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[105]),
{'bad': [], 'live': [105]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[106]),
{'bad': [], 'live': [106]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[107]),
{'bad': [], 'live': [107]})]]
for label, args, expected in cases[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: trace through fields, arrays and subclasses | {'bad': [], 'live': [100]} | {'bad': [], 'live': [100, 101, 102, 103, 104, 107]} | Failed |
| object array elements and trailing padding | {'bad': [], 'live': [102, 103, 104]} | {'bad': [], 'live': [102, 103, 104, 107]} | Failed |
| primitive array contents are not references | {'bad': [], 'live': [103]} | {'bad': [], 'live': [103]} | Passed |
| inherited reference field of a subclass | {'bad': [], 'live': [104]} | {'bad': [], 'live': [104, 107]} | Failed |
| integer field that equals an object id | {'bad': [], 'live': [101, 109]} | {'bad': [], 'live': [101, 105, 109]} | Failed |
| control: base object without references | {'bad': [], 'live': [106]} | {'bad': [], 'live': [106]} | Passed |
SHA-256 / 9ce33d51473aade4dcf2df7703e0a5baf713d0dd95f44492519bc2d2303866ac
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(classes, objects, roots):
def ref_slots(o):
ob = objects[o]
cls = classes[ob['class']]
if cls['kind'] == 'objarray':
return list(range(3, 3 + ob['words'][2]))
if cls['kind'] == 'primarray':
return []
slots = []
c = ob['class']
while c is not None:
for off, cnt in classes[c]['maps']:
slots.extend(range(off, off + cnt + 1))
c = classes[c]['super']
return slots
seen = set()
stack = list(roots)
bad = []
while stack:
o = stack.pop()
if o in seen:
continue
seen.add(o)
words = objects[o]['words']
for s in ref_slots(o):
v = words[s]
if v == 0:
continue
if v not in objects:
bad.append([o, s])
continue
stack.append(v)
return {'live': sorted(seen), 'bad': sorted(bad)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 6, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[106]),
{'bad': [], 'live': [106]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 7, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[107]),
{'bad': [], 'live': [107]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 8, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[105]),
{'bad': [], 'live': [105]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 9, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[106]),
{'bad': [], 'live': [106]})],
[('regression: trace through fields, arrays and subclasses',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[100]),
{'bad': [], 'live': [100, 101, 102, 103, 104, 107]}),
('object array elements and trailing padding',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[102]),
{'bad': [], 'live': [102, 103, 104, 107]}),
('primitive array contents are not references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[103]),
{'bad': [], 'live': [103]}),
('inherited reference field of a subclass',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[104]),
{'bad': [], 'live': [104, 107]}),
('integer field that equals an object id',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[109, 101]),
{'bad': [], 'live': [101, 105, 109]}),
('control: base object without references',
({'Base': {'kind': 'instance', 'maps': [[2, 1]], 'super': None},
'Derived': {'kind': 'instance', 'maps': [[4, 2]], 'super': 'Base'},
'Leaf': {'kind': 'instance', 'maps': [], 'super': 'Derived'},
'Object[]': {'kind': 'objarray', 'maps': [], 'super': None},
'int[]': {'kind': 'primarray', 'maps': [], 'super': None}},
{100: {'class': 'Derived', 'words': [51966, 0, 101, 7, 102, 0, 999]},
101: {'class': 'Base', 'words': [51966, 0, 0, 105]},
102: {'class': 'Object[]', 'words': [51966, 0, 2, 103, 104, 106]},
103: {'class': 'int[]', 'words': [51966, 0, 3, 106, 10, 107]},
104: {'class': 'Leaf', 'words': [51966, 0, 0, 108, 0, 107, 0]},
105: {'class': 'Base', 'words': [51966, 0, 0, 0]},
106: {'class': 'Base', 'words': [51966, 0, 0, 0]},
107: {'class': 'Base', 'words': [51966, 0, 0, 0]},
108: {'class': 'Base', 'words': [51966, 0, 0, 0]},
109: {'class': 'Derived', 'words': [51966, 0, 105, 106, 0, 0, 0]}},
[107]),
{'bad': [], 'live': [107]})]]
for label, args, expected in cases[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: trace through fields, arrays and subclasses | {'bad': [[100, 3], [100, 6]], 'live': [100, 101, 102, 103, 104, 105, 107, 108]} | {'bad': [], 'live': [100, 101, 102, 103, 104, 107]} | Failed |
| object array elements and trailing padding | {'bad': [], 'live': [102, 103, 104, 107, 108]} | {'bad': [], 'live': [102, 103, 104, 107]} | Failed |
| primitive array contents are not references | {'bad': [], 'live': [103]} | {'bad': [], 'live': [103]} | Passed |
| inherited reference field of a subclass | {'bad': [], 'live': [104, 107, 108]} | {'bad': [], 'live': [104, 107]} | Failed |
| integer field that equals an object id | {'bad': [], 'live': [101, 105, 106, 109]} | {'bad': [], 'live': [101, 105, 109]} | Failed |
| control: base object without references | {'bad': [], 'live': [106]} | {'bad': [], 'live': [106]} | Passed |
SHA-256 / a2f3e1fa3ecd4b8a2d622d4bd6ad7ba6f42de9070f85d8140921a079c2455ae4
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:51:30.262888+00:00.
Case digest / f3c2897c490541a1c5a606af3b670501d4f30d3b376c59d8cab5bae780b9f54d