{"abstract":"Microbatch gradients are summed when the objective expects their mean.","category":"Gradient accumulation weighting","checks":7,"contract":"Each input is one already-normalized microbatch gradient. Return the arithmetic mean over updates; no updates yields zero.","contract_signature":"gradient_sums","evaluation_group":"gradient-accumulation-mean_of_sums","failed_approach":"Dividing by update count plus one assumes an extra empty contribution that is not in the window.","family":"w3-gradient-accumulation-weighting-mean-of-sums","id":"FA-98936","implementations":{"attempt":{"sha256":"d351604d6b22ab93e89734cb226bd27e0376466a737606a4d9014ceba7f73cf2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(gradient_sums):\n    return sum(gradient_sums) / (len(gradient_sums)+1) if gradient_sums else 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two sums',solve([2*N,4*N]),3*N)\ncheck('uneven sums',solve([N,9*N,2*N]),4*N)\ncheck('singleton',solve([8*N]),8*N)\ncheck('empty',solve([]),0)\ncheck('zero term',solve([0,6*N]),3*N)\ncheck('cancellation',solve([4*N,-2*N]),N)\ncheck('four sums',solve([N,2*N,3*N,10*N]),4*N)\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":"b1c1c9071d05aa5293c01f3b9d13ff597e163eb66a69c4e2f48c79e1ed6e9af2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(gradient_sums):\n    return sum(gradient_sums)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two sums',solve([2*N,4*N]),3*N)\ncheck('uneven sums',solve([N,9*N,2*N]),4*N)\ncheck('singleton',solve([8*N]),8*N)\ncheck('empty',solve([]),0)\ncheck('zero term',solve([0,6*N]),3*N)\ncheck('cancellation',solve([4*N,-2*N]),N)\ncheck('four sums',solve([N,2*N,3*N,10*N]),4*N)\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":"Inputs are scalar or short-list summaries and do not model autodiff, devices, or an optimizer. 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":"w3-gradient-accumulation-weighting-mean-of-sums","generated_at":"2026-09-30T16:48:18.534684+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic toy model isolates one local accumulation contract.","root_cause":"The broken path returns the raw sum of already normalized microbatch gradients.","sha256":"cb9b9290e676f8d06d632868f7e8d6aa00e358e3bc8c86a6f4d5e4d773409832","title":"Microbatch gradients are summed when the objective expects their mean · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.403,"exit_code":1,"observations":[{"actual":2.0,"check":"two sums","expected":3,"passed":false},{"actual":3.0,"check":"uneven sums","expected":4,"passed":false},{"actual":4.0,"check":"singleton","expected":8,"passed":false},{"actual":0,"check":"empty","expected":0,"passed":true},{"actual":2.0,"check":"zero term","expected":3,"passed":false},{"actual":0.6666666666666666,"check":"cancellation","expected":1,"passed":false},{"actual":3.2,"check":"four sums","expected":4,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two sums\", \"actual\": 2.0, \"expected\": 3, \"passed\": false}, {\"check\": \"uneven sums\", \"actual\": 3.0, \"expected\": 4, \"passed\": false}, {\"check\": \"singleton\", \"actual\": 4.0, \"expected\": 8, \"passed\": false}, {\"check\": \"empty\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"zero term\", \"actual\": 2.0, \"expected\": 3, \"passed\": false}, {\"check\": \"cancellation\", \"actual\": 0.6666666666666666, \"expected\": 1, \"passed\": false}, {\"check\": \"four sums\", \"actual\": 3.2, \"expected\": 4, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.243,"exit_code":1,"observations":[{"actual":6,"check":"two sums","expected":3,"passed":false},{"actual":12,"check":"uneven sums","expected":4,"passed":false},{"actual":8,"check":"singleton","expected":8,"passed":true},{"actual":0,"check":"empty","expected":0,"passed":true},{"actual":6,"check":"zero term","expected":3,"passed":false},{"actual":2,"check":"cancellation","expected":1,"passed":false},{"actual":16,"check":"four sums","expected":4,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two sums\", \"actual\": 6, \"expected\": 3, \"passed\": false}, {\"check\": \"uneven sums\", \"actual\": 12, \"expected\": 4, \"passed\": false}, {\"check\": \"singleton\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"empty\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"zero term\", \"actual\": 6, \"expected\": 3, \"passed\": false}, {\"check\": \"cancellation\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"four sums\", \"actual\": 16, \"expected\": 4, \"passed\": false}], \"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."}}