{"abstract":"The reduction disagrees with its explicit aggregation oracle.","category":"Numerical aggregation","checks":6,"contract":"Starting at zero, apply each signed delta and clamp the running balance into [0,cap] after every event. cap is positive.","evaluation_group":"s3-na-capped-prefix-balance","failed_approach":"Processing positive deltas first also changes chronology.","family":"s3-numerical-aggregation-capped-prefix-balance-sorted-events","id":"FA-12931","implementations":{"attempt":{"sha256":"d7392875cd7f71e653ddc1abf3008f8a8915dbe693ab55b33c824f2ec507a9b1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(xs, cap):\n    b=0\n    for x in sorted(xs,reverse=True): b=max(0,min(cap,b+x))\n    return b\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([8, -3], 5)), 2)\ncheck('regression 2', solve(*([-4, 3], 5)), 3)\ncheck('regression 3', solve(*([], 5)), 0)\ncheck('regression 4', solve(*([2, 2], 5)), 4)\ncheck('regression 5', solve(*([8, -9, 2], 5)), 2)\ncheck(\"variable path\",solve([N+4,-2],N+1),N-1)\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":"f9ba74cced4413f68f5cd646ab3cf776b79e65069f15428b591a229c2d7b1192","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(xs, cap):\n    b=0\n    for x in sorted(xs): b=max(0,min(cap,b+x))\n    return b\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([8, -3], 5)), 2)\ncheck('regression 2', solve(*([-4, 3], 5)), 3)\ncheck('regression 3', solve(*([], 5)), 0)\ncheck('regression 4', solve(*([2, 2], 5)), 4)\ncheck('regression 5', solve(*([8, -9, 2], 5)), 2)\ncheck(\"variable path\",solve([N+4,-2],N+1),N-1)\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":"67d2a02cda1a3ed2cde9738695bf60f9bb77734d47397183af3752d8ab110627","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(xs, cap):\n    balance=0\n    for x in xs:\n        balance=max(0,min(cap,balance+x))\n    return balance\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([8, -3], 5)), 2)\ncheck('regression 2', solve(*([-4, 3], 5)), 3)\ncheck('regression 3', solve(*([], 5)), 0)\ncheck('regression 4', solve(*([2, 2], 5)), 4)\ncheck('regression 5', solve(*([8, -9, 2], 5)), 2)\ncheck(\"variable path\",solve([N+4,-2],N+1),N-1)\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":"Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. 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":"s3-numerical-aggregation-capped-prefix-balance-sorted-events","generated_at":"2026-09-29T14:39:01.632328+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exact bounded examples isolate a reduction defect without floating-point or external-service effects.","repair":"Preserve the capped prefix balance contract at the identified reduction decision.","root_cause":"Events are sorted before an order-dependent reduction.","sha256":"3e227242cb18927fb7f7d63f7daa71c4618826161733d5708a5811325c622c5a","title":"Capped prefix balance: Events are sorted before an order-dependent reduction. · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.825,"exit_code":1,"observations":[{"actual":2,"check":"regression 1","expected":2,"passed":true},{"actual":0,"check":"regression 2","expected":3,"passed":false},{"actual":0,"check":"regression 3","expected":0,"passed":true},{"actual":4,"check":"regression 4","expected":4,"passed":true},{"actual":0,"check":"regression 5","expected":2,"passed":false},{"actual":0,"check":"variable path","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"regression 2\", \"actual\": 0, \"expected\": 3, \"passed\": false}, {\"check\": \"regression 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"regression 4\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"regression 5\", \"actual\": 0, \"expected\": 2, \"passed\": false}, {\"check\": \"variable path\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.4,"exit_code":1,"observations":[{"actual":5,"check":"regression 1","expected":2,"passed":false},{"actual":3,"check":"regression 2","expected":3,"passed":true},{"actual":0,"check":"regression 3","expected":0,"passed":true},{"actual":4,"check":"regression 4","expected":4,"passed":true},{"actual":5,"check":"regression 5","expected":2,"passed":false},{"actual":2,"check":"variable path","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": 5, \"expected\": 2, \"passed\": false}, {\"check\": \"regression 2\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"regression 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"regression 4\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"regression 5\", \"actual\": 5, \"expected\": 2, \"passed\": false}, {\"check\": \"variable path\", \"actual\": 2, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":47.252,"exit_code":0,"observations":[{"actual":2,"check":"regression 1","expected":2,"passed":true},{"actual":3,"check":"regression 2","expected":3,"passed":true},{"actual":0,"check":"regression 3","expected":0,"passed":true},{"actual":4,"check":"regression 4","expected":4,"passed":true},{"actual":2,"check":"regression 5","expected":2,"passed":true},{"actual":0,"check":"variable path","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"regression 2\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"regression 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"regression 4\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"regression 5\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"variable path\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}