{"abstract":"SGD adds the gradient instead of taking a descent step.","category":"Optimizer update state","checks":6,"contract":"One scalar SGD step returns p-lr*g for finite inputs and nonnegative lr.","contract_signature":"p, g, lr","evaluation_group":"optimizer-toy-sgd-gradient-sign","failed_approach":"Taking the gradient magnitude fixes positive gradients but still mishandles negative ones.","family":"w3-optimizer-update-state-sgd-gradient-sign","id":"FA-98941","implementations":{"attempt":{"sha256":"d6e047089e0dfde423a97ebbaa0fb4cb76fe33c63952dac96c33912b531ab011","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(p, g, lr):\n    return p-lr*abs(g)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('positive gradient',solve(5,2,N),5-2*N)\ncheck('negative gradient',solve(5,-2,N),5+2*N)\ncheck('zero gradient',solve(N,0,N),N)\ncheck('zero rate',solve(3,-4,0),3)\ncheck('fractional rate',solve(2,1,0.5),1.5)\ncheck('negative parameter',solve(-N,1,2),-N-2)\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":"ad199038872cedda8c3ccad61a8fc2bafe6860f5ae7c3e590a8a36752c26ec21","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(p, g, lr):\n    return p+lr*g\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('positive gradient',solve(5,2,N),5-2*N)\ncheck('negative gradient',solve(5,-2,N),5+2*N)\ncheck('zero gradient',solve(N,0,N),N)\ncheck('zero rate',solve(3,-4,0),3)\ncheck('fractional rate',solve(2,1,0.5),1.5)\ncheck('negative parameter',solve(-N,1,2),-N-2)\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":"These are deterministic scalar or short-vector toy contracts, not claims about production optimizer APIs or training quality. 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-optimizer-update-state-sgd-gradient-sign","generated_at":"2026-09-30T16:48:18.534164+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Optimizer implementations must associate each parameter with its own mathematically specified update state.","root_cause":"The gradient is added to the parameter.","sha256":"487db718c739f51065dd586ca3f0658b6a786ef0cf5c02999eb2acbd40792cc4","title":"SGD adds the gradient instead of taking a descent step · 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":29.739,"exit_code":1,"observations":[{"actual":3,"check":"positive gradient","expected":3,"passed":true},{"actual":3,"check":"negative gradient","expected":7,"passed":false},{"actual":1,"check":"zero gradient","expected":1,"passed":true},{"actual":3,"check":"zero rate","expected":3,"passed":true},{"actual":1.5,"check":"fractional rate","expected":1.5,"passed":true},{"actual":-3,"check":"negative parameter","expected":-3,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive gradient\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"negative gradient\", \"actual\": 3, \"expected\": 7, \"passed\": false}, {\"check\": \"zero gradient\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"zero rate\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"fractional rate\", \"actual\": 1.5, \"expected\": 1.5, \"passed\": true}, {\"check\": \"negative parameter\", \"actual\": -3, \"expected\": -3, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.094,"exit_code":1,"observations":[{"actual":7,"check":"positive gradient","expected":3,"passed":false},{"actual":3,"check":"negative gradient","expected":7,"passed":false},{"actual":1,"check":"zero gradient","expected":1,"passed":true},{"actual":3,"check":"zero rate","expected":3,"passed":true},{"actual":2.5,"check":"fractional rate","expected":1.5,"passed":false},{"actual":1,"check":"negative parameter","expected":-3,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive gradient\", \"actual\": 7, \"expected\": 3, \"passed\": false}, {\"check\": \"negative gradient\", \"actual\": 3, \"expected\": 7, \"passed\": false}, {\"check\": \"zero gradient\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"zero rate\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"fractional rate\", \"actual\": 2.5, \"expected\": 1.5, \"passed\": false}, {\"check\": \"negative parameter\", \"actual\": 1, \"expected\": -3, \"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."}}