{"abstract":"Delta 128 is written as [0, 129]; the terminating byte comes first and the stream desynchronises.","category":"MIDI event timing","checks":8,"contract":"Input a delta-time integer 0..0x0FFFFFFF (booleans rejected). Encode as 7-bit groups, most significant group first, with bit 7 set on every byte except the last. Zero encodes as [0]. Out-of-range or non-integer input returns None.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-vlq-encode","failed_approach":"Sorting bytes in descending order happens to put flagged bytes first but scrambles their relative order for multi-byte values.","family":"w2-midi-event-timing-vlq-encode-group-order","id":"FA-81346","implementations":{"attempt":{"sha256":"9925b5117624a922281db4608e24b0b3207d93cf40dcc893a3a32e3d4e700396","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, int) or isinstance(x, bool) or x < 0 or x > 0x0FFFFFFF:\n        return None\n    out = [x & 0x7F]\n    x >>= 7\n    while x:\n        out.append((x & 0x7F) | 0x80)\n        x >>= 7\n    return sorted(out, reverse=True)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(0, [0]), (1, [1]), (64, [64]), (127, [127]), (128, [129, 0]), (255, [129, 127]), (100000, [134, 141, 32]), (268435456, None)], [(127, [127]), (129, [129, 1]), (8192, [192, 0]), (100000, [134, 141, 32]), (268435456, None), (-1, None), (True, None), ('7', None)], [(128, [129, 0]), (129, [129, 1]), (255, [129, 127]), (8192, [192, 0]), (16383, [255, 127]), (100000, [134, 141, 32]), (True, None), ('7', None)], [(129, [129, 1]), (255, [129, 127]), (8192, [192, 0]), (16383, [255, 127]), (16384, [129, 128, 0]), (100000, [134, 141, 32]), (2097151, [255, 255, 127]), (2097152, [129, 128, 128, 0])], [(16383, [255, 127]), (16384, [129, 128, 0]), (100000, [134, 141, 32]), (2097151, [255, 255, 127]), (2097152, [129, 128, 128, 0]), (268435455, [255, 255, 255, 127]), (480, [131, 96]), (960, [135, 64])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"oracle %d\" % i, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"6ae2928604c9545097e1a3dfebcd522e62e5a3393b669f5d408f240a828a7dbe","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, int) or isinstance(x, bool) or x < 0 or x > 0x0FFFFFFF:\n        return None\n    out = [x & 0x7F]\n    x >>= 7\n    while x:\n        out.append((x & 0x7F) | 0x80)\n        x >>= 7\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(0, [0]), (1, [1]), (64, [64]), (127, [127]), (128, [129, 0]), (255, [129, 127]), (100000, [134, 141, 32]), (268435456, None)], [(127, [127]), (129, [129, 1]), (8192, [192, 0]), (100000, [134, 141, 32]), (268435456, None), (-1, None), (True, None), ('7', None)], [(128, [129, 0]), (129, [129, 1]), (255, [129, 127]), (8192, [192, 0]), (16383, [255, 127]), (100000, [134, 141, 32]), (True, None), ('7', None)], [(129, [129, 1]), (255, [129, 127]), (8192, [192, 0]), (16383, [255, 127]), (16384, [129, 128, 0]), (100000, [134, 141, 32]), (2097151, [255, 255, 127]), (2097152, [129, 128, 128, 0])], [(16383, [255, 127]), (16384, [129, 128, 0]), (100000, [134, 141, 32]), (2097151, [255, 255, 127]), (2097152, [129, 128, 128, 0]), (268435455, [255, 255, 255, 127]), (480, [131, 96]), (960, [135, 64])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"oracle %d\" % i, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model with a stipulated toy contract; it is not a complete Standard MIDI File or MIDI 1.0/2.0 implementation. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-midi-event-timing-vlq-encode-group-order","generated_at":"2026-09-29T14:50:02.116343+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"MIDI sequencers, file readers and synth drivers depend on exact event ordering and tick/time arithmetic.","root_cause":"The groups are collected from least significant upward and returned without reversing.","sha256":"396c0d26db7ed45760b55646d971981b858caa587c6fce2a16b5366a416ee784","title":"Variable-length quantity delta encoder: groups emitted least significant first · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.476,"exit_code":1,"observations":[{"actual":[0],"check":"oracle 0","expected":[0],"passed":true},{"actual":[1],"check":"oracle 1","expected":[1],"passed":true},{"actual":[64],"check":"oracle 2","expected":[64],"passed":true},{"actual":[127],"check":"oracle 3","expected":[127],"passed":true},{"actual":[129,0],"check":"oracle 4","expected":[129,0],"passed":true},{"actual":[129,127],"check":"oracle 5","expected":[129,127],"passed":true},{"actual":[141,134,32],"check":"oracle 6","expected":[134,141,32],"passed":false},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [64], \"expected\": [64], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [127], \"expected\": [127], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [129, 0], \"expected\": [129, 0], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [129, 127], \"expected\": [129, 127], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [141, 134, 32], \"expected\": [134, 141, 32], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.889,"exit_code":1,"observations":[{"actual":[0],"check":"oracle 0","expected":[0],"passed":true},{"actual":[1],"check":"oracle 1","expected":[1],"passed":true},{"actual":[64],"check":"oracle 2","expected":[64],"passed":true},{"actual":[127],"check":"oracle 3","expected":[127],"passed":true},{"actual":[0,129],"check":"oracle 4","expected":[129,0],"passed":false},{"actual":[127,129],"check":"oracle 5","expected":[129,127],"passed":false},{"actual":[32,141,134],"check":"oracle 6","expected":[134,141,32],"passed":false},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [64], \"expected\": [64], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [127], \"expected\": [127], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [0, 129], \"expected\": [129, 0], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [127, 129], \"expected\": [129, 127], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": [32, 141, 134], \"expected\": [134, 141, 32], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}