FA-89436 / Instruction set emulation / Open access
Absolute Y-indexed mode adds the X register · case 01
abs,Y accesses the address offset by X, so table lookups indexed by Y read the wrong element.
ROOT CAUSE
The abs,Y case was copied from abs,X without changing the index register.
THE FAILURE
The abs,Y case was copied from abs,X without changing the index register.
Unsuccessful approach: Falling back to X when Y is zero still reads the wrong address whenever X is nonzero.
Case contract
Input [mode, operand, x, y, mem] with mem mapping decimal-string addresses to bytes (missing = 0). zp: operand & 0xFF. zpx: (operand + x) & 0xFF. abs: operand. absx: (operand + x) & 0xFFFF. absy: (operand + y) & 0xFFFF. ind: little-endian pointer at operand, where the high byte is fetched from the same page ((operand & 0xFF00) | ((operand + 1) & 0xFF)). indx: pointer at zero-page (operand + x) & 0xFF, high byte from the next zero-page byte (wrapping). indy: pointer at zero-page operand (high byte wrapping in zero page), plus y, wrapped to 16 bits.
Why this case matters
Addressing-mode decoding is the core of any 8-bit CPU emulator; page-wrap quirks are observable program behaviour.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(*args):
mode, operand, x, y, mem = args
def rd(a):
return mem.get(str(a & 0xFFFF), 0)
if mode == 'zp': return operand & 0xFF
if mode == 'zpx': return (operand + x) & 0xFF
if mode == 'abs': return operand
if mode == 'absx': return (operand + x) & 0xFFFF
if mode == 'absy': return (operand + x) & 0xFFFF
if mode == 'ind':
lo = rd(operand)
hi = rd((operand & 0xFF00) | ((operand + 1) & 0xFF))
return hi << 8 | lo
if mode == 'indx':
p = (operand + x) & 0xFF
return rd((p + 1) & 0xFF) << 8 | rd(p)
if mode == 'indy':
p = operand & 0xFF
base = rd((p + 1) & 0xFF) << 8 | rd(p)
return (base + y) & 0xFFFF
return None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('zero page indexed wraps', ['zpx', 241, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 17), ('absolute indexed crosses page', ['absx', 4336, 33, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4369), ('absolute indexed wraps top', ['absx', 65520, 49, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 33), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 8448, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 119), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 17, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43998), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 33, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 17), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8193, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8193), ('absolute Y indexed', ['absy', 12528, 5, 33, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12561)], [('zero page indexed wraps', ['zpx', 242, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 18), ('absolute indexed crosses page', ['absx', 4336, 34, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4370), ('absolute indexed wraps top', ['absx', 65520, 50, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 34), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 16, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 18, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43999), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 34, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 18), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8194, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8194), ('absolute Y indexed', ['absy', 12528, 5, 34, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12562)], [('zero page indexed wraps', ['zpx', 243, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 19), ('absolute indexed crosses page', ['absx', 4336, 35, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4371), ('absolute indexed wraps top', ['absx', 65520, 51, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 35), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 8448, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 119), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 19, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 44000), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 35, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 19), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8195, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8195), ('absolute Y indexed', ['absy', 12528, 5, 35, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12563)], [('zero page indexed wraps', ['zpx', 244, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 20), ('absolute indexed crosses page', ['absx', 4336, 36, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4372), ('absolute indexed wraps top', ['absx', 65520, 52, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 36), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 16, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 20, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 44001), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 36, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 20), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8196, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8196), ('absolute Y indexed', ['absy', 12528, 5, 36, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12564)], [('zero page indexed wraps', ['zpx', 245, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 21), ('absolute indexed crosses page', ['absx', 4336, 37, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4373), ('absolute indexed wraps top', ['absx', 65520, 53, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 37), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 8448, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 119), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 21, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 44002), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 37, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 21), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8197, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8197), ('absolute Y indexed', ['absy', 12528, 5, 37, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12565)]]
for label, args, expected in fixtures[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 |
|---|---|---|---|
| zero page indexed wraps | 17 | 17 | Passed |
| absolute indexed crosses page | 4369 | 4369 | Passed |
| absolute indexed wraps top | 33 | 33 | Passed |
| indirect jump page bug | 25889 | 25889 | Passed |
| indirect jump normal | 119 | 119 | Passed |
| indexed indirect pointer wraps | 13432 | 13432 | Passed |
| indexed indirect plain | 43981 | 43981 | Passed |
| indirect indexed adds after load | 43998 | 43998 | Passed |
| indirect indexed pointer wraps and crosses | 13672 | 13672 | Passed |
| indirect indexed result wraps | 17 | 17 | Passed |
| zero page plain | 255 | 255 | Passed |
| absolute Y with X set | 8210 | 8193 | Failed |
| absolute Y indexed | 12533 | 12561 | Failed |
SHA-256 / 48f3d1ea6a41b1ebd2ccbb52aa631dc88d6cd1c632d89de9e2e45900da1194cd
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(*args):
mode, operand, x, y, mem = args
def rd(a):
return mem.get(str(a & 0xFFFF), 0)
if mode == 'zp': return operand & 0xFF
if mode == 'zpx': return (operand + x) & 0xFF
if mode == 'abs': return operand
if mode == 'absx': return (operand + x) & 0xFFFF
if mode == 'absy': return (operand + y if y else operand + x) & 0xFFFF
if mode == 'ind':
lo = rd(operand)
hi = rd((operand & 0xFF00) | ((operand + 1) & 0xFF))
return hi << 8 | lo
if mode == 'indx':
p = (operand + x) & 0xFF
return rd((p + 1) & 0xFF) << 8 | rd(p)
if mode == 'indy':
p = operand & 0xFF
base = rd((p + 1) & 0xFF) << 8 | rd(p)
return (base + y) & 0xFFFF
return None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('zero page indexed wraps', ['zpx', 241, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 17), ('absolute indexed crosses page', ['absx', 4336, 33, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4369), ('absolute indexed wraps top', ['absx', 65520, 49, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 33), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 8448, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 119), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 17, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43998), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 33, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 17), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8193, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8193), ('absolute Y indexed', ['absy', 12528, 5, 33, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12561)], [('zero page indexed wraps', ['zpx', 242, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 18), ('absolute indexed crosses page', ['absx', 4336, 34, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4370), ('absolute indexed wraps top', ['absx', 65520, 50, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 34), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 16, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 18, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43999), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 34, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 18), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8194, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8194), ('absolute Y indexed', ['absy', 12528, 5, 34, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12562)], [('zero page indexed wraps', ['zpx', 243, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 19), ('absolute indexed crosses page', ['absx', 4336, 35, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4371), ('absolute indexed wraps top', ['absx', 65520, 51, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 35), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 8448, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 119), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 19, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 44000), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 35, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 19), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8195, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8195), ('absolute Y indexed', ['absy', 12528, 5, 35, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12563)], [('zero page indexed wraps', ['zpx', 244, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 20), ('absolute indexed crosses page', ['absx', 4336, 36, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4372), ('absolute indexed wraps top', ['absx', 65520, 52, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 36), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 16, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 20, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 44001), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 36, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 20), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8196, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8196), ('absolute Y indexed', ['absy', 12528, 5, 36, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12564)], [('zero page indexed wraps', ['zpx', 245, 32, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 21), ('absolute indexed crosses page', ['absx', 4336, 37, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 4373), ('absolute indexed wraps top', ['absx', 65520, 53, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 37), ('indirect jump page bug', ['ind', 4351, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 25889), ('indirect jump normal', ['ind', 8448, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 119), ('indexed indirect pointer wraps', ['indx', 254, 1, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13432), ('indexed indirect plain', ['indx', 14, 2, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 43981), ('indirect indexed adds after load', ['indy', 16, 0, 21, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 44002), ('indirect indexed pointer wraps and crosses', ['indy', 255, 0, 240, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 13672), ('indirect indexed result wraps', ['indy', 128, 0, 37, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 21), ('zero page plain', ['zp', 511, 0, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 255), ('absolute Y with X set', ['absy', 8197, 17, 0, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 8197), ('absolute Y indexed', ['absy', 12528, 5, 37, {'0': 52, '1': 18, '255': 120, '254': 86, '16': 205, '17': 171, '4351': 33, '4352': 67, '4096': 101, '8447': 153, '8192': 136, '8448': 119, '128': 240, '129': 255}], 12565)]]
for label, args, expected in fixtures[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 |
|---|---|---|---|
| zero page indexed wraps | 17 | 17 | Passed |
| absolute indexed crosses page | 4369 | 4369 | Passed |
| absolute indexed wraps top | 33 | 33 | Passed |
| indirect jump page bug | 25889 | 25889 | Passed |
| indirect jump normal | 119 | 119 | Passed |
| indexed indirect pointer wraps | 13432 | 13432 | Passed |
| indexed indirect plain | 43981 | 43981 | Passed |
| indirect indexed adds after load | 43998 | 43998 | Passed |
| indirect indexed pointer wraps and crosses | 13672 | 13672 | Passed |
| indirect indexed result wraps | 17 | 17 | Passed |
| zero page plain | 255 | 255 | Passed |
| absolute Y with X set | 8210 | 8193 | Failed |
| absolute Y indexed | 12561 | 12561 | Passed |
SHA-256 / 627fb881964a7d3d61ead3c5ac412db7b76fb1bb3180ff2480ff540f9f01aa7c
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 13 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 emulator rule; the instruction semantics are a stipulated contract inspired by common ISAs and are not a claim of cycle-exact or architectural conformance. 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:17.371624+00:00.
Case digest / f377d7a41a225a393834c5196bcbb4017864936f6765dce8b01e4268a10dfa20