FA-89896 / Bytecode virtual machines / Open access
Stack-depth verifier: dup_x1 accepted with one operand · case 01
A method using dup_x1 on a single-item stack verifies and later corrupts the frame.
ROOT CAUSE
The effect table says dup_x1 needs one operand although it inserts beneath the second item.
THE FAILURE
The effect table says dup_x1 needs one operand although it inserts beneath the second item.
Unsuccessful approach: Requiring three operands rejects legal dup_x1 uses on two-item stacks.
Case contract
code is a list of [op, arg]. Stack effects (required, delta): push (0,+1), pop (1,-1), dup (1,+1), dup_x1 (2,+1), swap (2,0), add (2,-1), ifeq (1,-1; successors fallthrough and arg), goto (0,0; only arg), return (1,-1; none). Dataflow from index 0 with depth 0: report ["underflow", i], ["falls-off", i] for a successor outside the code, ["inconsistent", s] when a merge sees two depths, else ["ok", max depth]. Unreachable code is never examined.
Why this case matters
Bytecode verifiers must agree exactly on stack effects and control-flow successors.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(code):
effects = {'push': (0, 1), 'pop': (1, -1), 'dup': (1, 1), 'dup_x1': (1, 1), 'swap': (2, 0),
'add': (2, -1), 'ifeq': (1, -1), 'goto': (0, 0), 'return': (1, -1)}
def verify():
depth = {0: 0}
work = [0]
maxd = 0
while work:
i = work.pop()
op, arg = code[i]
need, delta = effects[op]
d = depth[i]
if d < need:
return ['underflow', i]
nd = d + delta
maxd = max(maxd, nd)
if op == 'goto':
succ = [arg]
elif op == 'ifeq':
succ = [i + 1, arg]
elif op == 'return':
succ = []
else:
succ = [i + 1]
for s in succ:
if s < 0 or s >= len(code):
return ['falls-off', i]
if s in depth:
if depth[s] != nd:
return ['inconsistent', s]
else:
depth[s] = nd
work.append(s)
return ['ok', maxd]
try:
return verify()
except (IndexError, KeyError):
return ['vm-crash']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('dup_x1 with one item underflows', ([['push', 1], ['dup_x1', None], ['return', None]],), ['underflow', 1]),
('dup_x1 with two items is legal',
([['push', 1], ['push', 2], ['dup_x1', None], ['add', None], ['add', None], ['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1], ['goto', 3], ['add', None], ['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 0], ['ifeq', 4], ['push', 5], ['goto', 5], ['push', 7], ['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows', ([['ifeq', 1], ['push', 1], ['return', None]],), ['underflow', 0]),
('deeper arm reaching merge first is inconsistent',
([['push', 1], ['push', 0], ['ifeq', 4], ['pop', None], ['return', None]],),
['inconsistent', 4]),
('shallower arm reaching merge first is inconsistent',
([['push', 1], ['ifeq', 3], ['push', 9], ['push', 1], ['return', None]],),
['inconsistent', 3]),
('execution falling off the end', ([['push', 1], ['push', 1]],), ['falls-off', 1]),
('negative branch target', ([['push', 1], ['goto', -1], ['return', None]],), ['falls-off', 1]),
('swap with one item underflows', ([['push', 1], ['swap', None], ['return', None]],), ['underflow', 1])],
[('dup_x1 with one item underflows',
([['push', 1], ['pop', None], ['push', 1], ['dup_x1', None], ['return', None]],),
['underflow', 3]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1], ['pop', None], ['push', 1], ['goto', 5], ['add', None], ['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 0],
['ifeq', 6],
['push', 5],
['goto', 7],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1], ['pop', None], ['ifeq', 3], ['push', 1], ['return', None]],),
['underflow', 2]),
('deeper arm reaching merge first is inconsistent',
([['push', 1], ['pop', None], ['push', 1], ['push', 0], ['ifeq', 6], ['pop', None], ['return', None]],),
['inconsistent', 6]),
('shallower arm reaching merge first is inconsistent',
([['push', 1], ['pop', None], ['push', 1], ['ifeq', 5], ['push', 9], ['push', 1], ['return', None]],),
['inconsistent', 5]),
('execution falling off the end', ([['push', 1], ['pop', None], ['push', 1]],), ['falls-off', 2]),
('negative branch target',
([['push', 1], ['pop', None], ['push', 1], ['goto', -1], ['return', None]],),
['falls-off', 3]),
('swap with one item underflows',
([['push', 1], ['pop', None], ['push', 1], ['swap', None], ['return', None]],),
['underflow', 3])],
[('dup_x1 with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['dup_x1', None],
['return', None]],),
['underflow', 5]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['goto', 7],
['add', None],
['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 0],
['ifeq', 8],
['push', 5],
['goto', 9],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['ifeq', 5], ['push', 1], ['return', None]],),
['underflow', 4]),
('deeper arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['push', 0],
['ifeq', 8],
['pop', None],
['return', None]],),
['inconsistent', 8]),
('shallower arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['ifeq', 7],
['push', 9],
['push', 1],
['return', None]],),
['inconsistent', 7]),
('execution falling off the end',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 1], ['push', 1]],),
['falls-off', 5]),
('negative branch target',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 1], ['goto', -1], ['return', None]],),
['falls-off', 5]),
('swap with one item underflows',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 1], ['swap', None], ['return', None]],),
['underflow', 5])],
[('dup_x1 with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['dup_x1', None],
['return', None]],),
['underflow', 7]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['goto', 9],
['add', None],
['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 0],
['ifeq', 10],
['push', 5],
['goto', 11],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['ifeq', 7],
['push', 1],
['return', None]],),
['underflow', 6]),
('deeper arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['push', 0],
['ifeq', 10],
['pop', None],
['return', None]],),
['inconsistent', 10]),
('shallower arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['ifeq', 9],
['push', 9],
['push', 1],
['return', None]],),
['inconsistent', 9]),
('execution falling off the end',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 3], ['pop', None], ['push', 1]],),
['falls-off', 6]),
('negative branch target',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['goto', -1],
['return', None]],),
['falls-off', 7]),
('swap with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['swap', None],
['return', None]],),
['underflow', 7])],
[('dup_x1 with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['dup_x1', None],
['return', None]],),
['underflow', 9]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['goto', 11],
['add', None],
['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 0],
['ifeq', 12],
['push', 5],
['goto', 13],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['ifeq', 9],
['push', 1],
['return', None]],),
['underflow', 8]),
('deeper arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['push', 0],
['ifeq', 12],
['pop', None],
['return', None]],),
['inconsistent', 12]),
('shallower arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['ifeq', 11],
['push', 9],
['push', 1],
['return', None]],),
['inconsistent', 11]),
('execution falling off the end',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['push', 1]],),
['falls-off', 9]),
('negative branch target',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['goto', -1],
['return', None]],),
['falls-off', 9]),
('swap with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['swap', None],
['return', None]],),
['underflow', 9])]]
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 |
|---|---|---|---|
| dup_x1 with one item underflows | ['ok', 2] | ['underflow', 1] | Failed |
| dup_x1 with two items is legal | ['ok', 3] | ['ok', 3] | Passed |
| regression: dead code after goto is not verified | ['ok', 1] | ['ok', 1] | Passed |
| if/else arms merge at equal depth | ['ok', 1] | ['ok', 1] | Passed |
| ifeq on empty stack underflows | ['underflow', 0] | ['underflow', 0] | Passed |
| deeper arm reaching merge first is inconsistent | ['inconsistent', 4] | ['inconsistent', 4] | Passed |
| shallower arm reaching merge first is inconsistent | ['inconsistent', 3] | ['inconsistent', 3] | Passed |
| execution falling off the end | ['falls-off', 1] | ['falls-off', 1] | Passed |
| negative branch target | ['falls-off', 1] | ['falls-off', 1] | Passed |
| swap with one item underflows | ['underflow', 1] | ['underflow', 1] | Passed |
SHA-256 / 2e6566051b9f310f91c950263e60341743adf20588482c91594b84d1bc101f00
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(code):
effects = {'push': (0, 1), 'pop': (1, -1), 'dup': (1, 1), 'dup_x1': (3, 1), 'swap': (2, 0),
'add': (2, -1), 'ifeq': (1, -1), 'goto': (0, 0), 'return': (1, -1)}
def verify():
depth = {0: 0}
work = [0]
maxd = 0
while work:
i = work.pop()
op, arg = code[i]
need, delta = effects[op]
d = depth[i]
if d < need:
return ['underflow', i]
nd = d + delta
maxd = max(maxd, nd)
if op == 'goto':
succ = [arg]
elif op == 'ifeq':
succ = [i + 1, arg]
elif op == 'return':
succ = []
else:
succ = [i + 1]
for s in succ:
if s < 0 or s >= len(code):
return ['falls-off', i]
if s in depth:
if depth[s] != nd:
return ['inconsistent', s]
else:
depth[s] = nd
work.append(s)
return ['ok', maxd]
try:
return verify()
except (IndexError, KeyError):
return ['vm-crash']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('dup_x1 with one item underflows', ([['push', 1], ['dup_x1', None], ['return', None]],), ['underflow', 1]),
('dup_x1 with two items is legal',
([['push', 1], ['push', 2], ['dup_x1', None], ['add', None], ['add', None], ['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1], ['goto', 3], ['add', None], ['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 0], ['ifeq', 4], ['push', 5], ['goto', 5], ['push', 7], ['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows', ([['ifeq', 1], ['push', 1], ['return', None]],), ['underflow', 0]),
('deeper arm reaching merge first is inconsistent',
([['push', 1], ['push', 0], ['ifeq', 4], ['pop', None], ['return', None]],),
['inconsistent', 4]),
('shallower arm reaching merge first is inconsistent',
([['push', 1], ['ifeq', 3], ['push', 9], ['push', 1], ['return', None]],),
['inconsistent', 3]),
('execution falling off the end', ([['push', 1], ['push', 1]],), ['falls-off', 1]),
('negative branch target', ([['push', 1], ['goto', -1], ['return', None]],), ['falls-off', 1]),
('swap with one item underflows', ([['push', 1], ['swap', None], ['return', None]],), ['underflow', 1])],
[('dup_x1 with one item underflows',
([['push', 1], ['pop', None], ['push', 1], ['dup_x1', None], ['return', None]],),
['underflow', 3]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1], ['pop', None], ['push', 1], ['goto', 5], ['add', None], ['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 0],
['ifeq', 6],
['push', 5],
['goto', 7],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1], ['pop', None], ['ifeq', 3], ['push', 1], ['return', None]],),
['underflow', 2]),
('deeper arm reaching merge first is inconsistent',
([['push', 1], ['pop', None], ['push', 1], ['push', 0], ['ifeq', 6], ['pop', None], ['return', None]],),
['inconsistent', 6]),
('shallower arm reaching merge first is inconsistent',
([['push', 1], ['pop', None], ['push', 1], ['ifeq', 5], ['push', 9], ['push', 1], ['return', None]],),
['inconsistent', 5]),
('execution falling off the end', ([['push', 1], ['pop', None], ['push', 1]],), ['falls-off', 2]),
('negative branch target',
([['push', 1], ['pop', None], ['push', 1], ['goto', -1], ['return', None]],),
['falls-off', 3]),
('swap with one item underflows',
([['push', 1], ['pop', None], ['push', 1], ['swap', None], ['return', None]],),
['underflow', 3])],
[('dup_x1 with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['dup_x1', None],
['return', None]],),
['underflow', 5]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['goto', 7],
['add', None],
['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 0],
['ifeq', 8],
['push', 5],
['goto', 9],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['ifeq', 5], ['push', 1], ['return', None]],),
['underflow', 4]),
('deeper arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['push', 0],
['ifeq', 8],
['pop', None],
['return', None]],),
['inconsistent', 8]),
('shallower arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 1],
['ifeq', 7],
['push', 9],
['push', 1],
['return', None]],),
['inconsistent', 7]),
('execution falling off the end',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 1], ['push', 1]],),
['falls-off', 5]),
('negative branch target',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 1], ['goto', -1], ['return', None]],),
['falls-off', 5]),
('swap with one item underflows',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 1], ['swap', None], ['return', None]],),
['underflow', 5])],
[('dup_x1 with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['dup_x1', None],
['return', None]],),
['underflow', 7]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['goto', 9],
['add', None],
['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 0],
['ifeq', 10],
['push', 5],
['goto', 11],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['ifeq', 7],
['push', 1],
['return', None]],),
['underflow', 6]),
('deeper arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['push', 0],
['ifeq', 10],
['pop', None],
['return', None]],),
['inconsistent', 10]),
('shallower arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['ifeq', 9],
['push', 9],
['push', 1],
['return', None]],),
['inconsistent', 9]),
('execution falling off the end',
([['push', 1], ['pop', None], ['push', 2], ['pop', None], ['push', 3], ['pop', None], ['push', 1]],),
['falls-off', 6]),
('negative branch target',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['goto', -1],
['return', None]],),
['falls-off', 7]),
('swap with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 1],
['swap', None],
['return', None]],),
['underflow', 7])],
[('dup_x1 with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['dup_x1', None],
['return', None]],),
['underflow', 9]),
('dup_x1 with two items is legal',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['push', 2],
['dup_x1', None],
['add', None],
['add', None],
['return', None]],),
['ok', 3]),
('regression: dead code after goto is not verified',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['goto', 11],
['add', None],
['return', None]],),
['ok', 1]),
('if/else arms merge at equal depth',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 0],
['ifeq', 12],
['push', 5],
['goto', 13],
['push', 7],
['return', None]],),
['ok', 1]),
('ifeq on empty stack underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['ifeq', 9],
['push', 1],
['return', None]],),
['underflow', 8]),
('deeper arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['push', 0],
['ifeq', 12],
['pop', None],
['return', None]],),
['inconsistent', 12]),
('shallower arm reaching merge first is inconsistent',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['ifeq', 11],
['push', 9],
['push', 1],
['return', None]],),
['inconsistent', 11]),
('execution falling off the end',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['push', 1]],),
['falls-off', 9]),
('negative branch target',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['goto', -1],
['return', None]],),
['falls-off', 9]),
('swap with one item underflows',
([['push', 1],
['pop', None],
['push', 2],
['pop', None],
['push', 3],
['pop', None],
['push', 4],
['pop', None],
['push', 1],
['swap', None],
['return', None]],),
['underflow', 9])]]
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 |
|---|---|---|---|
| dup_x1 with one item underflows | ['underflow', 1] | ['underflow', 1] | Passed |
| dup_x1 with two items is legal | ['underflow', 2] | ['ok', 3] | Failed |
| regression: dead code after goto is not verified | ['ok', 1] | ['ok', 1] | Passed |
| if/else arms merge at equal depth | ['ok', 1] | ['ok', 1] | Passed |
| ifeq on empty stack underflows | ['underflow', 0] | ['underflow', 0] | Passed |
| deeper arm reaching merge first is inconsistent | ['inconsistent', 4] | ['inconsistent', 4] | Passed |
| shallower arm reaching merge first is inconsistent | ['inconsistent', 3] | ['inconsistent', 3] | Passed |
| execution falling off the end | ['falls-off', 1] | ['falls-off', 1] | Passed |
| negative branch target | ['falls-off', 1] | ['falls-off', 1] | Passed |
| swap with one item underflows | ['underflow', 1] | ['underflow', 1] | Passed |
SHA-256 / b5c1acd7e7dd4f83c60edab4898542c385af667e83e66d2984f337728a72dcd3
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic, bounded teaching model of one bytecode virtual machine mechanism with a stipulated instruction encoding; it is not a production VM and claims no conformance to any real specification. 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:21.897955+00:00.
Case digest / bd3d0fafd9000cfcfb22c1acd13c8aafc1b7546d7b45991ecfa7ac87a0561d67