FAILURE MAP
← Case archive

FA-90046 / Bytecode virtual machines / Open access

Method descriptors: arrays of long counted as two slots · case 01

Methods taking long[] or double[] parameters get oversized frames and shifted locals.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Two-slot width is applied to J/D element types of arrays, which are single references.

VERIFIED REPAIR

Only non-array long and double values take two slots.

Unsuccessful approach: Forgetting double keeps double parameters at one slot.

Case contract

Parse a method descriptor "(args)ret". Field types: B C D F I J S Z, L<binary name>; with a non-empty name, and up to 255 leading "[" dimensions. V is allowed only as a non-array return type. Local-slot count: one extra slot for "this" unless static; J and D take two slots unless they are array element types. Return {args (readable names, "[]" per dimension), slots, ret} or ["ClassFormatError", position].

Why this case matters

Frame sizes and argument placement in bytecode VMs are derived from descriptors.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i + 1:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0 if is_static else 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
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 fixtureActualExpectedOutcome
regression: mixed wide and array arguments{'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 9}{'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}Failed
instance method reserves this slot{'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}{'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}Passed
void array return rejected['ClassFormatError', 4]['ClassFormatError', 4]Passed
void argument rejected['ClassFormatError', 2]['ClassFormatError', 2]Passed
empty class name rejected['ClassFormatError', 2]['ClassFormatError', 2]Passed
trailing characters rejected['ClassFormatError', 17]['ClassFormatError', 17]Passed
255 array dimensions accepted{'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]', 'int'], 'ret': 'void', 'slots': 2}{'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]', 'int'], 'ret': 'void', 'slots': 2}Passed
256 array dimensions rejected['ClassFormatError', 257]['ClassFormatError', 257]Passed
control: missing parenthesis['ClassFormatError', 0]['ClassFormatError', 0]Passed

SHA-256 / 0f4a6dc35bf28d938c44923fc757498c89daafba4e729cac7b750486b7cdb2aa

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i + 1:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c == 'J' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0 if is_static else 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
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 fixtureActualExpectedOutcome
regression: mixed wide and array arguments{'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 7}{'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}Failed
instance method reserves this slot{'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 5}{'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}Failed
void array return rejected['ClassFormatError', 4]['ClassFormatError', 4]Passed
void argument rejected['ClassFormatError', 2]['ClassFormatError', 2]Passed
empty class name rejected['ClassFormatError', 2]['ClassFormatError', 2]Passed
trailing characters rejected['ClassFormatError', 17]['ClassFormatError', 17]Passed
255 array dimensions accepted{'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]', 'int'], 'ret': 'void', 'slots': 2}{'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]', 'int'], 'ret': 'void', 'slots': 2}Passed
256 array dimensions rejected['ClassFormatError', 257]['ClassFormatError', 257]Passed
control: missing parenthesis['ClassFormatError', 0]['ClassFormatError', 0]Passed

SHA-256 / d01e43d569075304bc5b55698ab1aaa57db96a200dc763d921ac6d512a34fbc7

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(desc, is_static):
    names = {'B': 'byte', 'C': 'char', 'D': 'double', 'F': 'float', 'I': 'int', 'J': 'long', 'S': 'short', 'Z': 'boolean'}
    def field(i, allow_void):
        dims = 0
        while i < len(desc) and desc[i] == '[':
            dims += 1
            i += 1
        if dims > 255 or i >= len(desc):
            return None, i, 0
        c = desc[i]
        if c == 'L':
            j = desc.find(';', i)
            if j < 0 or j == i + 1:
                return None, i, 0
            base = desc[i + 1:j].replace('/', '.')
            i = j + 1
        elif c in names:
            base = names[c]
            i += 1
        elif c == 'V' and allow_void and dims == 0:
            base = 'void'
            i += 1
        else:
            return None, i, 0
        width = 2 if dims == 0 and c in 'JD' else 1
        return base + '[]' * dims, i, width
    if not desc.startswith('('):
        return ['ClassFormatError', 0]
    i = 1
    args = []
    slots = 0 if is_static else 1
    while i < len(desc) and desc[i] != ')':
        t, i, w = field(i, False)
        if t is None:
            return ['ClassFormatError', i]
        args.append(t)
        slots += w
    if i >= len(desc):
        return ['ClassFormatError', i]
    ret, j, _ = field(i + 1, True)
    if ret is None or j != len(desc):
        return ['ClassFormatError', j]
    return {'args': args, 'slots': slots, 'ret': ret}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;I)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}),
  ('instance method reserves this slot',
   ('(JDI)J', False),
   {'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}),
  ('void array return rejected', ('(I)[V', True), ['ClassFormatError', 4]),
  ('void argument rejected', ('(IV)V', True), ['ClassFormatError', 2]),
  ('empty class name rejected', ('(IL;)V', False), ['ClassFormatError', 2]),
  ('trailing characters rejected', ('(ILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 17]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int'],
    'ret': 'void',
    'slots': 2}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[II)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;II)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int'],
    'ret': 'void',
    'slots': 9}),
  ('instance method reserves this slot',
   ('(JDII)J', False),
   {'args': ['long', 'double', 'int', 'int'], 'ret': 'long', 'slots': 7}),
  ('void array return rejected', ('(II)[V', True), ['ClassFormatError', 5]),
  ('void argument rejected', ('(IIV)V', True), ['ClassFormatError', 3]),
  ('empty class name rejected', ('(IIL;)V', False), ['ClassFormatError', 3]),
  ('trailing characters rejected', ('(IILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 18]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int'],
    'ret': 'void',
    'slots': 3}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[III)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;III)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 10}),
  ('instance method reserves this slot',
   ('(JDIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int'], 'ret': 'long', 'slots': 8}),
  ('void array return rejected', ('(III)[V', True), ['ClassFormatError', 6]),
  ('void argument rejected', ('(IIIV)V', True), ['ClassFormatError', 4]),
  ('empty class name rejected', ('(IIIL;)V', False), ['ClassFormatError', 4]),
  ('trailing characters rejected', ('(IIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 19]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 4}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 11}),
  ('instance method reserves this slot',
   ('(JDIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 9}),
  ('void array return rejected', ('(IIII)[V', True), ['ClassFormatError', 7]),
  ('void argument rejected', ('(IIIIV)V', True), ['ClassFormatError', 5]),
  ('empty class name rejected', ('(IIIIL;)V', False), ['ClassFormatError', 5]),
  ('trailing characters rejected', ('(IIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 20]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 5}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])],
 [('regression: mixed wide and array arguments',
   ('(IJ[JD[[Ljava/lang/String;IIIII)V', True),
   {'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int', 'int', 'int', 'int', 'int'],
    'ret': 'void',
    'slots': 12}),
  ('instance method reserves this slot',
   ('(JDIIIII)J', False),
   {'args': ['long', 'double', 'int', 'int', 'int', 'int', 'int'], 'ret': 'long', 'slots': 10}),
  ('void array return rejected', ('(IIIII)[V', True), ['ClassFormatError', 8]),
  ('void argument rejected', ('(IIIIIV)V', True), ['ClassFormatError', 6]),
  ('empty class name rejected', ('(IIIIIL;)V', False), ['ClassFormatError', 6]),
  ('trailing characters rejected', ('(IIIIILpkg/A;)Lpkg/B;x', False), ['ClassFormatError', 21]),
  ('255 array dimensions accepted',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   {'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]',
             'int',
             'int',
             'int',
             'int',
             'int'],
    'ret': 'void',
    'slots': 6}),
  ('256 array dimensions rejected',
   ('([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[IIIIII)V',
    True),
   ['ClassFormatError', 257]),
  ('control: missing parenthesis', ('I)V', True), ['ClassFormatError', 0])]]
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 fixtureActualExpectedOutcome
regression: mixed wide and array arguments{'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}{'args': ['int', 'long', 'long[]', 'double', 'java.lang.String[][]', 'int'], 'ret': 'void', 'slots': 8}Passed
instance method reserves this slot{'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}{'args': ['long', 'double', 'int'], 'ret': 'long', 'slots': 6}Passed
void array return rejected['ClassFormatError', 4]['ClassFormatError', 4]Passed
void argument rejected['ClassFormatError', 2]['ClassFormatError', 2]Passed
empty class name rejected['ClassFormatError', 2]['ClassFormatError', 2]Passed
trailing characters rejected['ClassFormatError', 17]['ClassFormatError', 17]Passed
255 array dimensions accepted{'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]', 'int'], 'ret': 'void', 'slots': 2}{'args': ['int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]', 'int'], 'ret': 'void', 'slots': 2}Passed
256 array dimensions rejected['ClassFormatError', 257]['ClassFormatError', 257]Passed
control: missing parenthesis['ClassFormatError', 0]['ClassFormatError', 0]Passed

SHA-256 / 16a7b4b351b3d9f2abbd716c4133ca4ef622b119416663d26e8e968a9e2ec0ce

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:23.128029+00:00.

Case digest / b33c1d45bd23b5a6ed5589dfec5b69b9216ec7b785c50932253b91f17e84bb23