{"abstract":"reshape preserves total element count.","category":"Tensor stride and reshape semantics","checks":6,"contract":"A reshape target without inferred axes is valid exactly when products match; return boolean.","contract_signature":"shape, target","evaluation_group":"tensor-reshape-element-count","failed_approach":"Adding a rank check wrongly rejects valid reshapes that change rank.","family":"w3-tensor-stride-reshape-reshape-element-count","id":"FA-98771","implementations":{"attempt":{"sha256":"08210f22063de8379643b5ddce3d0cead49a46bd3699242c86c92dbf2b65fddf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shape, target):\n    return len(shape)==len(target) and __import__('math').prod(shape)==__import__('math').prod(target)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('flatten valid',solve([N,3],[3*N]),True)\ncheck('same count reordered',solve([2,3],[3,2]),True)\ncheck('wrong count',solve([N,3],[N+1,3]),False)\ncheck('same rank wrong count',solve([2,3],[2,4]),False)\ncheck('scalar',solve([],[]),True)\ncheck('singleton count',solve([1],[1,1]),True)\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":"d68ed511b7f1fc5f9b69f2da9e0caf4c13d3c8f8cfb8237393088c80fb6d0ce4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shape, target):\n    return len(shape)==len(target)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('flatten valid',solve([N,3],[3*N]),True)\ncheck('same count reordered',solve([2,3],[3,2]),True)\ncheck('wrong count',solve([N,3],[N+1,3]),False)\ncheck('same rank wrong count',solve([2,3],[2,4]),False)\ncheck('scalar',solve([],[]),True)\ncheck('singleton count',solve([1],[1,1]),True)\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":"Self-contained integer metadata models only; no production framework compatibility or performance 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":"w3-tensor-stride-reshape-reshape-element-count","generated_at":"2026-09-30T16:48:16.725058+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Dense tensor views rely on consistent logical coordinates and physical storage addresses.","root_cause":"Matching ranks does not establish that source and target contain the same number of elements.","sha256":"b039e21bee7358b8bb92002ecf09528b77f6bcd06159c5d138c3a957a3f10bdc","title":"Tensor views: reshape preserves total element count · 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.078,"exit_code":1,"observations":[{"actual":false,"check":"flatten valid","expected":true,"passed":false},{"actual":true,"check":"same count reordered","expected":true,"passed":true},{"actual":false,"check":"wrong count","expected":false,"passed":true},{"actual":false,"check":"same rank wrong count","expected":false,"passed":true},{"actual":true,"check":"scalar","expected":true,"passed":true},{"actual":false,"check":"singleton count","expected":true,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"flatten valid\", \"actual\": false, \"expected\": true, \"passed\": false}, {\"check\": \"same count reordered\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"wrong count\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"same rank wrong count\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"scalar\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"singleton count\", \"actual\": false, \"expected\": true, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.435,"exit_code":1,"observations":[{"actual":false,"check":"flatten valid","expected":true,"passed":false},{"actual":true,"check":"same count reordered","expected":true,"passed":true},{"actual":true,"check":"wrong count","expected":false,"passed":false},{"actual":true,"check":"same rank wrong count","expected":false,"passed":false},{"actual":true,"check":"scalar","expected":true,"passed":true},{"actual":false,"check":"singleton count","expected":true,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"flatten valid\", \"actual\": false, \"expected\": true, \"passed\": false}, {\"check\": \"same count reordered\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"wrong count\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"same rank wrong count\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"scalar\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"singleton count\", \"actual\": false, \"expected\": true, \"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."}}