{"abstract":"row-major linear index uses dimension suffix products.","category":"Tensor stride and reshape semantics","checks":6,"contract":"Convert a valid row-major multidimensional coordinate to its flattened index.","contract_signature":"shape, index","evaluation_group":"tensor-linear-index","failed_approach":"Multiplying each coordinate by its own dimension uses the wrong radix.","family":"w3-tensor-stride-reshape-linear-index","id":"FA-98836","implementations":{"attempt":{"sha256":"08d19a6c9ff52428f4bbd7674c10d1e014f0c94441b596edb26245d4c57fdca0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shape, index):\n    out=0\n    for d,i in zip(shape,index): out+=i*d\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('matrix index',solve([N,4],[1,2]),6)\ncheck('first',solve([2,3],[0,0]),0)\ncheck('last',solve([2,3],[1,2]),5)\ncheck('three axes',solve([2,N,3],[1,2,1]),N*3+7)\ncheck('unit axis',solve([1,N],[0,N-1]),N-1)\ncheck('scalar',solve([],[]),0)\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":"e2a9c103a2a90f8b80e8b814332f794925372bdca30b747bc2d319b773179b1d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shape, index):\n    return sum(index)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('matrix index',solve([N,4],[1,2]),6)\ncheck('first',solve([2,3],[0,0]),0)\ncheck('last',solve([2,3],[1,2]),5)\ncheck('three axes',solve([2,N,3],[1,2,1]),N*3+7)\ncheck('unit axis',solve([1,N],[0,N-1]),N-1)\ncheck('scalar',solve([],[]),0)\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-linear-index","generated_at":"2026-09-30T16:48:17.166166+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":"A row-major linear index weights each coordinate by the product of dimensions after its axis.","sha256":"94346b75952eb3c02e512173d1e09e3bb9a8900a3d33d0b450abee8905a52d08","title":"Tensor views: row-major linear index uses dimension suffix products · 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":27.997,"exit_code":1,"observations":[{"actual":9,"check":"matrix index","expected":6,"passed":false},{"actual":0,"check":"first","expected":0,"passed":true},{"actual":8,"check":"last","expected":5,"passed":false},{"actual":7,"check":"three axes","expected":10,"passed":false},{"actual":0,"check":"unit axis","expected":0,"passed":true},{"actual":0,"check":"scalar","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"matrix index\", \"actual\": 9, \"expected\": 6, \"passed\": false}, {\"check\": \"first\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"last\", \"actual\": 8, \"expected\": 5, \"passed\": false}, {\"check\": \"three axes\", \"actual\": 7, \"expected\": 10, \"passed\": false}, {\"check\": \"unit axis\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"scalar\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.129,"exit_code":1,"observations":[{"actual":3,"check":"matrix index","expected":6,"passed":false},{"actual":0,"check":"first","expected":0,"passed":true},{"actual":3,"check":"last","expected":5,"passed":false},{"actual":4,"check":"three axes","expected":10,"passed":false},{"actual":0,"check":"unit axis","expected":0,"passed":true},{"actual":0,"check":"scalar","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"matrix index\", \"actual\": 3, \"expected\": 6, \"passed\": false}, {\"check\": \"first\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"last\", \"actual\": 3, \"expected\": 5, \"passed\": false}, {\"check\": \"three axes\", \"actual\": 4, \"expected\": 10, \"passed\": false}, {\"check\": \"unit axis\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"scalar\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"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."}}