FA-90801 / Garbage collector invariants / Open access
Oop maps: primitive arrays scanned like object arrays · case 01
Integers stored in int[] arrays keep unrelated objects alive.
ROOT CAUSE
Every array kind takes the object-array path.
VERIFIED REPAIR
Only object arrays have reference elements.
Unsuccessful approach: Testing for non-instance kinds still routes primitive arrays to the element scan.
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'].endswith('array'):
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))
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': [[103, 4]], 'live': [100, 101, 102, 103, 104, 106, 107]} | {'bad': [], 'live': [100, 101, 102, 103, 104, 107]} | Failed |
| object array elements and trailing padding | {'bad': [[103, 4]], 'live': [102, 103, 104, 106, 107]} | {'bad': [], 'live': [102, 103, 104, 107]} | Failed |
| primitive array contents are not references | {'bad': [[103, 4]], 'live': [103, 106, 107]} | {'bad': [], 'live': [103]} | Failed |
| inherited reference field of a subclass | {'bad': [], 'live': [104, 107]} | {'bad': [], 'live': [104, 107]} | Passed |
| integer field that equals an object id | {'bad': [], 'live': [101, 105, 109]} | {'bad': [], 'live': [101, 105, 109]} | Passed |
| control: base object without references | {'bad': [], 'live': [106]} | {'bad': [], 'live': [106]} | Passed |
SHA-256 / cf1ced3d69092b250ebc9571d7877146818bc46ca0aef28e0aac7208d9dba35b
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'] != 'instance':
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))
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': [[103, 4]], 'live': [100, 101, 102, 103, 104, 106, 107]} | {'bad': [], 'live': [100, 101, 102, 103, 104, 107]} | Failed |
| object array elements and trailing padding | {'bad': [[103, 4]], 'live': [102, 103, 104, 106, 107]} | {'bad': [], 'live': [102, 103, 104, 107]} | Failed |
| primitive array contents are not references | {'bad': [[103, 4]], 'live': [103, 106, 107]} | {'bad': [], 'live': [103]} | Failed |
| inherited reference field of a subclass | {'bad': [], 'live': [104, 107]} | {'bad': [], 'live': [104, 107]} | Passed |
| integer field that equals an object id | {'bad': [], 'live': [101, 105, 109]} | {'bad': [], 'live': [101, 105, 109]} | Passed |
| control: base object without references | {'bad': [], 'live': [106]} | {'bad': [], 'live': [106]} | Passed |
SHA-256 / c9bc558dfc7779fbaab941ccdb1e2dc670cfc2cf2a960c2c12dfaeb10098323b
3 / The verified repair
Exit 0"""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))
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, 101, 102, 103, 104, 107]} | {'bad': [], 'live': [100, 101, 102, 103, 104, 107]} | Passed |
| object array elements and trailing padding | {'bad': [], 'live': [102, 103, 104, 107]} | {'bad': [], 'live': [102, 103, 104, 107]} | Passed |
| primitive array contents are not references | {'bad': [], 'live': [103]} | {'bad': [], 'live': [103]} | Passed |
| inherited reference field of a subclass | {'bad': [], 'live': [104, 107]} | {'bad': [], 'live': [104, 107]} | Passed |
| integer field that equals an object id | {'bad': [], 'live': [101, 105, 109]} | {'bad': [], 'live': [101, 105, 109]} | Passed |
| control: base object without references | {'bad': [], 'live': [106]} | {'bad': [], 'live': [106]} | Passed |
SHA-256 / 83b88a19f8ef29656bb5f53b04828216dd0677d2a8cfd5a82ca28f9598c83c1a
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.093006+00:00.
Case digest / 91a2276483caac0b303c59c446107c0e7a8a36cf9c4ba827fecb9fdcc45aefdb