{"abstract":"Bandwidth estimates count padding bytes that a shortened code never sends.","category":"Error-correcting codes","checks":8,"contract":"Frame a payload of the given number of bytes into shortened RS(n, k) codewords: cw = ceil(payload / k) codewords, the last one carries payload - (cw - 1)*k data bytes (shortened, zero padding not transmitted), and each codeword adds n - k parity bytes. An empty payload uses no codewords. Return [cw, last data bytes, bytes sent]; invalid parameters return None.","evaluation_group":"w2-error_correcting_codes-rs-framing","failed_approach":"Counting the parity bytes only once ignores every codeword after the first.","family":"w2-error_correcting_codes-rs-framing-shortening","id":"FA-72306","implementations":{"attempt":{"sha256":"508ea841d1c79a0a38a0546546c5dcec2b21bd909807855c50af9ec5b21d71a2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(payload, n, k):\n    if payload < 0 or not 0 < k < n:\n        return None\n    cw = -(-payload // k)\n    last = payload - (cw - 1) * k if cw else 0\n    sent = payload + (n - k)\n    return [cw, last, sent]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [1, 255, 239]', [1, 255, 239], [1, 1, 17]], ['regression [240, 255, 239]', [240, 255, 239], [2, 1, 272]], ['partial-repair [0, 255, 239]', [0, 255, 239], [0, 0, 0]], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None]], [['regression [5, 15, 11]', [5, 15, 11], [1, 5, 9]], ['regression [12, 15, 11]', [12, 15, 11], [2, 1, 20]], ['partial-repair [1000, 255, 223]', [1000, 255, 223], [5, 108, 1160]], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]]], [['regression [22, 7, 4]', [22, 7, 4], [6, 2, 40]], ['regression [1, 7, 4]', [1, 7, 4], [1, 1, 4]], ['partial-repair [376, 204, 188]', [376, 204, 188], [2, 188, 408]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]]], [['regression [240, 255, 239]', [240, 255, 239], [2, 1, 272]], ['regression [1000, 255, 223]', [1000, 255, 223], [5, 108, 1160]], ['partial-repair [478, 255, 239]', [478, 255, 239], [2, 239, 510]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]]], [['regression [12, 15, 11]', [12, 15, 11], [2, 1, 20]], ['regression [100, 204, 188]', [100, 204, 188], [1, 100, 116]], ['partial-repair [33, 15, 11]', [33, 15, 11], [3, 11, 45]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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":"4c80c26251f3ee0e2cc1132086c2ca24064ab4feed67515e337dc1e80b92f4f0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(payload, n, k):\n    if payload < 0 or not 0 < k < n:\n        return None\n    cw = -(-payload // k)\n    last = payload - (cw - 1) * k if cw else 0\n    sent = cw * n\n    return [cw, last, sent]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [1, 255, 239]', [1, 255, 239], [1, 1, 17]], ['regression [240, 255, 239]', [240, 255, 239], [2, 1, 272]], ['partial-repair [0, 255, 239]', [0, 255, 239], [0, 0, 0]], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None]], [['regression [5, 15, 11]', [5, 15, 11], [1, 5, 9]], ['regression [12, 15, 11]', [12, 15, 11], [2, 1, 20]], ['partial-repair [1000, 255, 223]', [1000, 255, 223], [5, 108, 1160]], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]]], [['regression [22, 7, 4]', [22, 7, 4], [6, 2, 40]], ['regression [1, 7, 4]', [1, 7, 4], [1, 1, 4]], ['partial-repair [376, 204, 188]', [376, 204, 188], [2, 188, 408]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]]], [['regression [240, 255, 239]', [240, 255, 239], [2, 1, 272]], ['regression [1000, 255, 223]', [1000, 255, 223], [5, 108, 1160]], ['partial-repair [478, 255, 239]', [478, 255, 239], [2, 239, 510]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]]], [['regression [12, 15, 11]', [12, 15, 11], [2, 1, 20]], ['regression [100, 204, 188]', [100, 204, 188], [1, 100, 116]], ['partial-repair [33, 15, 11]', [33, 15, 11], [3, 11, 45]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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"},"fixed":{"sha256":"369d3a285c7d58c12d6dcdfb4ee2b36b5cbc92875091b014e03e840a3be57b69","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(payload, n, k):\n    if payload < 0 or not 0 < k < n:\n        return None\n    cw = -(-payload // k)\n    last = payload - (cw - 1) * k if cw else 0\n    sent = payload + cw * (n - k)\n    return [cw, last, sent]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [1, 255, 239]', [1, 255, 239], [1, 1, 17]], ['regression [240, 255, 239]', [240, 255, 239], [2, 1, 272]], ['partial-repair [0, 255, 239]', [0, 255, 239], [0, 0, 0]], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None]], [['regression [5, 15, 11]', [5, 15, 11], [1, 5, 9]], ['regression [12, 15, 11]', [12, 15, 11], [2, 1, 20]], ['partial-repair [1000, 255, 223]', [1000, 255, 223], [5, 108, 1160]], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]]], [['regression [22, 7, 4]', [22, 7, 4], [6, 2, 40]], ['regression [1, 7, 4]', [1, 7, 4], [1, 1, 4]], ['partial-repair [376, 204, 188]', [376, 204, 188], [2, 188, 408]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]]], [['regression [240, 255, 239]', [240, 255, 239], [2, 1, 272]], ['regression [1000, 255, 223]', [1000, 255, 223], [5, 108, 1160]], ['partial-repair [478, 255, 239]', [478, 255, 239], [2, 239, 510]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]], ['control [223, 255, 223]', [223, 255, 223], [1, 223, 255]]], [['regression [12, 15, 11]', [12, 15, 11], [2, 1, 20]], ['regression [100, 204, 188]', [100, 204, 188], [1, 100, 116]], ['partial-repair [33, 15, 11]', [33, 15, 11], [3, 11, 45]], ['control [11, 15, 11]', [11, 15, 11], [1, 11, 15]], ['control [188, 204, 188]', [188, 204, 188], [1, 188, 204]], ['control [-1, 15, 11]', [-1, 15, 11], None], ['control [5, 11, 11]', [5, 11, 11], None], ['control [239, 255, 239]', [239, 255, 239], [1, 239, 255]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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 of the named code under the stated contract; not a production codec. 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-error_correcting_codes-rs-framing-shortening","generated_at":"2026-09-29T14:48:37.321582+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Link layers size FEC frames and transmit budgets from the payload length.","repair":"Send payload bytes plus n - k parity bytes per codeword.","root_cause":"Bytes sent are cw * n, as if every codeword were full length.","sha256":"bba3377b415d754742368496cf37728f8d9ec3d652aae3640215ba0521ad7c51","title":"RS framing transmits the zero padding · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.725,"exit_code":1,"observations":[{"actual":[1,1,17],"check":"regression [1, 255, 239]","expected":[1,1,17],"passed":true},{"actual":[2,1,256],"check":"regression [240, 255, 239]","expected":[2,1,272],"passed":false},{"actual":[0,0,16],"check":"partial-repair [0, 255, 239]","expected":[0,0,0],"passed":false},{"actual":[1,239,255],"check":"control [239, 255, 239]","expected":[1,239,255],"passed":true},{"actual":[1,223,255],"check":"control [223, 255, 223]","expected":[1,223,255],"passed":true},{"actual":[1,11,15],"check":"control [11, 15, 11]","expected":[1,11,15],"passed":true},{"actual":[1,188,204],"check":"control [188, 204, 188]","expected":[1,188,204],"passed":true},{"actual":null,"check":"control [-1, 15, 11]","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [1, 255, 239]\", \"actual\": [1, 1, 17], \"expected\": [1, 1, 17], \"passed\": true}, {\"check\": \"regression [240, 255, 239]\", \"actual\": [2, 1, 256], \"expected\": [2, 1, 272], \"passed\": false}, {\"check\": \"partial-repair [0, 255, 239]\", \"actual\": [0, 0, 16], \"expected\": [0, 0, 0], \"passed\": false}, {\"check\": \"control [239, 255, 239]\", \"actual\": [1, 239, 255], \"expected\": [1, 239, 255], \"passed\": true}, {\"check\": \"control [223, 255, 223]\", \"actual\": [1, 223, 255], \"expected\": [1, 223, 255], \"passed\": true}, {\"check\": \"control [11, 15, 11]\", \"actual\": [1, 11, 15], \"expected\": [1, 11, 15], \"passed\": true}, {\"check\": \"control [188, 204, 188]\", \"actual\": [1, 188, 204], \"expected\": [1, 188, 204], \"passed\": true}, {\"check\": \"control [-1, 15, 11]\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.251,"exit_code":1,"observations":[{"actual":[1,1,255],"check":"regression [1, 255, 239]","expected":[1,1,17],"passed":false},{"actual":[2,1,510],"check":"regression [240, 255, 239]","expected":[2,1,272],"passed":false},{"actual":[0,0,0],"check":"partial-repair [0, 255, 239]","expected":[0,0,0],"passed":true},{"actual":[1,239,255],"check":"control [239, 255, 239]","expected":[1,239,255],"passed":true},{"actual":[1,223,255],"check":"control [223, 255, 223]","expected":[1,223,255],"passed":true},{"actual":[1,11,15],"check":"control [11, 15, 11]","expected":[1,11,15],"passed":true},{"actual":[1,188,204],"check":"control [188, 204, 188]","expected":[1,188,204],"passed":true},{"actual":null,"check":"control [-1, 15, 11]","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [1, 255, 239]\", \"actual\": [1, 1, 255], \"expected\": [1, 1, 17], \"passed\": false}, {\"check\": \"regression [240, 255, 239]\", \"actual\": [2, 1, 510], \"expected\": [2, 1, 272], \"passed\": false}, {\"check\": \"partial-repair [0, 255, 239]\", \"actual\": [0, 0, 0], \"expected\": [0, 0, 0], \"passed\": true}, {\"check\": \"control [239, 255, 239]\", \"actual\": [1, 239, 255], \"expected\": [1, 239, 255], \"passed\": true}, {\"check\": \"control [223, 255, 223]\", \"actual\": [1, 223, 255], \"expected\": [1, 223, 255], \"passed\": true}, {\"check\": \"control [11, 15, 11]\", \"actual\": [1, 11, 15], \"expected\": [1, 11, 15], \"passed\": true}, {\"check\": \"control [188, 204, 188]\", \"actual\": [1, 188, 204], \"expected\": [1, 188, 204], \"passed\": true}, {\"check\": \"control [-1, 15, 11]\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.385,"exit_code":0,"observations":[{"actual":[1,1,17],"check":"regression [1, 255, 239]","expected":[1,1,17],"passed":true},{"actual":[2,1,272],"check":"regression [240, 255, 239]","expected":[2,1,272],"passed":true},{"actual":[0,0,0],"check":"partial-repair [0, 255, 239]","expected":[0,0,0],"passed":true},{"actual":[1,239,255],"check":"control [239, 255, 239]","expected":[1,239,255],"passed":true},{"actual":[1,223,255],"check":"control [223, 255, 223]","expected":[1,223,255],"passed":true},{"actual":[1,11,15],"check":"control [11, 15, 11]","expected":[1,11,15],"passed":true},{"actual":[1,188,204],"check":"control [188, 204, 188]","expected":[1,188,204],"passed":true},{"actual":null,"check":"control [-1, 15, 11]","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [1, 255, 239]\", \"actual\": [1, 1, 17], \"expected\": [1, 1, 17], \"passed\": true}, {\"check\": \"regression [240, 255, 239]\", \"actual\": [2, 1, 272], \"expected\": [2, 1, 272], \"passed\": true}, {\"check\": \"partial-repair [0, 255, 239]\", \"actual\": [0, 0, 0], \"expected\": [0, 0, 0], \"passed\": true}, {\"check\": \"control [239, 255, 239]\", \"actual\": [1, 239, 255], \"expected\": [1, 239, 255], \"passed\": true}, {\"check\": \"control [223, 255, 223]\", \"actual\": [1, 223, 255], \"expected\": [1, 223, 255], \"passed\": true}, {\"check\": \"control [11, 15, 11]\", \"actual\": [1, 11, 15], \"expected\": [1, 11, 15], \"passed\": true}, {\"check\": \"control [188, 204, 188]\", \"actual\": [1, 188, 204], \"expected\": [1, 188, 204], \"passed\": true}, {\"check\": \"control [-1, 15, 11]\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}