{"abstract":"Overflow wraps a large positive sample into a negative amplitude.","category":"PCM sample encoding","checks":4,"contract":"Saturate arbitrary integer intermediate amplitudes to the asymmetric signed 16-bit PCM range.","evaluation_group":"xaud-pcm16-saturation-before-encoding","failed_approach":"Symmetric clamping excludes the valid -32768 endpoint.","family":"xaud-pcm16-saturation-before-encoding","id":"FA-10801","implementations":{"attempt":{"sha256":"a75b700ddb8ec8a865b88134c8efcc2a9279f0bfdea0e3af199325d6bbf7741c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(samples):\n    return [max(-32767,min(32767,x)) for x in samples]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1',solve(*([-40000, 40000],)),[-32768, 32767])\ncheck('fixture 2',solve(*([-32768, 32767],)),[-32768, 32767])\ncheck('fixture 3',solve(*([0, 1, -1],)),[0, 1, -1])\ncheck('fixture 4',solve(*([],)),[])\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":"9653a1e26265a0a9f6668368be04fd79890f1cbd8203bea3223b49573696eb01","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(samples):\n    return [((x+32768)%65536)-32768 for x in samples]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1',solve(*([-40000, 40000],)),[-32768, 32767])\ncheck('fixture 2',solve(*([-32768, 32767],)),[-32768, 32767])\ncheck('fixture 3',solve(*([0, 1, -1],)),[0, 1, -1])\ncheck('fixture 4',solve(*([],)),[])\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":"85b060522bc2a67175c4a6f6ab5ecec86c70ef2064bf359522e4a0adf261b809","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(samples):\n    return [max(-32768,min(32767,x)) for x in samples]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1',solve(*([-40000, 40000],)),[-32768, 32767])\ncheck('fixture 2',solve(*([-32768, 32767],)),[-32768, 32767])\ncheck('fixture 3',solve(*([0, 1, -1],)),[0, 1, -1])\ncheck('fixture 4',solve(*([],)),[])\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":" 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":"xaud-pcm16-saturation-before-encoding","generated_at":"2026-09-29T14:38:42.355665+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A pure Python local audio pipeline stage with explicit sample formats and frame conventions; no real-time device or signal-spectrum claims.","repair":"Apply the explicit PCM/playback contract: Saturate arbitrary integer intermediate amplitudes to the asymmetric signed 16-bit PCM range.","root_cause":"Overflow wraps a large positive sample into a negative amplitude.","sha256":"939466da27b304c0d38dd1c817647fb1529f520d91884725930a592e49181995","title":"Pcm16 saturation before encoding · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.417,"exit_code":1,"observations":[{"actual":[-32767,32767],"check":"fixture 1","expected":[-32768,32767],"passed":false},{"actual":[-32767,32767],"check":"fixture 2","expected":[-32768,32767],"passed":false},{"actual":[0,1,-1],"check":"fixture 3","expected":[0,1,-1],"passed":true},{"actual":[],"check":"fixture 4","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [-32767, 32767], \"expected\": [-32768, 32767], \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": [-32767, 32767], \"expected\": [-32768, 32767], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [0, 1, -1], \"expected\": [0, 1, -1], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.286,"exit_code":1,"observations":[{"actual":[25536,-25536],"check":"fixture 1","expected":[-32768,32767],"passed":false},{"actual":[-32768,32767],"check":"fixture 2","expected":[-32768,32767],"passed":true},{"actual":[0,1,-1],"check":"fixture 3","expected":[0,1,-1],"passed":true},{"actual":[],"check":"fixture 4","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [25536, -25536], \"expected\": [-32768, 32767], \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": [-32768, 32767], \"expected\": [-32768, 32767], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [0, 1, -1], \"expected\": [0, 1, -1], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.954,"exit_code":0,"observations":[{"actual":[-32768,32767],"check":"fixture 1","expected":[-32768,32767],"passed":true},{"actual":[-32768,32767],"check":"fixture 2","expected":[-32768,32767],"passed":true},{"actual":[0,1,-1],"check":"fixture 3","expected":[0,1,-1],"passed":true},{"actual":[],"check":"fixture 4","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [-32768, 32767], \"expected\": [-32768, 32767], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [-32768, 32767], \"expected\": [-32768, 32767], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [0, 1, -1], \"expected\": [0, 1, -1], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}