FAILURE MAP
← Case archive

FA-90066 / Bytecode virtual machines / Open access

Method descriptors: garbage after the return type ignored · case 01

Descriptors with trailing characters after the return type are accepted.

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

ROOT CAUSE

After parsing the return type, nothing checks that the whole descriptor was consumed.

VERIFIED REPAIR

Require the return type to end exactly at the end of the descriptor.

Unsuccessful approach: Testing j > len(desc) cannot detect leftover characters because the parser never runs past the end.

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 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:
        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{'args': ['int', 'pkg.A'], 'ret': 'pkg.B', 'slots': 3}['ClassFormatError', 17]Failed
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 / a99829f9065d3fcf6decde42b436d03583b6e749a96ea5fcc781d39a6284e22a

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 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{'args': ['int', 'pkg.A'], 'ret': 'pkg.B', 'slots': 3}['ClassFormatError', 17]Failed
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 / 36f52f3fe78c17f5ad78ca7a36c0a18e908822c7c2688e740df3e8426f32324b

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

Case digest / 3d1ee9deb7c2969299ed9370dc6060aae2a963c792d6d63b38e809326d94d4aa