{"abstract":"Pivot substitutes a null element for an absent cell.","category":"Data systems","checks":7,"contract":"Pivot [row-id,category,value] into [row-id,list-for-category...] using the caller category order. Each cell is an ordered bag list. Unknown categories do not populate cells but retain their row identity; absent cells are empty lists and null values remain elements.","evaluation_group":"s3-data-systems-categorical-pivot-lists","failed_approach":"A null cell is different from a present empty bag.","family":"s3-data-systems-categorical-pivot-lists-empty-cell","id":"FA-44901","implementations":{"attempt":{"sha256":"c0ebda8743e4a26817d4292079bcb32e96ba6b72aa6b034569951134ec16d992","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,categories=d\n        ids=list(dict.fromkeys(row[0] for row in rows))\n        out=[]\n        for ident in ids:\n            record=[ident]\n            for category in categories:\n                cell=[value for i,c,value in rows if i==ident and c==category]\n                record.append(cell if cell else None)\n            out.append(record)\n        return out\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('column order', solve([[[1, 'a', 1], [1, 'b', 2]], ['b', 'a']]), [[1, [2], [1]]])\n    check('unknown-only row', solve([[[1, 'z', 1]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 1], [2, 'a', 2]], ['a']]), [[1, [1]], [2, [2]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 1], [1, 'a', 1]], ['a']]), [[1, [1, 1]]])\n    check('no categories', solve([[[1, 'a', 1]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 2:\n    check('column order', solve([[[1, 'a', 2], [1, 'b', 3]], ['b', 'a']]), [[1, [3], [2]]])\n    check('unknown-only row', solve([[[1, 'z', 2]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 2], [2, 'a', 3]], ['a']]), [[1, [2]], [2, [3]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 2], [1, 'a', 2]], ['a']]), [[1, [2, 2]]])\n    check('no categories', solve([[[1, 'a', 2]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 3:\n    check('column order', solve([[[1, 'a', 3], [1, 'b', 4]], ['b', 'a']]), [[1, [4], [3]]])\n    check('unknown-only row', solve([[[1, 'z', 3]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 3], [2, 'a', 4]], ['a']]), [[1, [3]], [2, [4]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 3], [1, 'a', 3]], ['a']]), [[1, [3, 3]]])\n    check('no categories', solve([[[1, 'a', 3]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 4:\n    check('column order', solve([[[1, 'a', 4], [1, 'b', 5]], ['b', 'a']]), [[1, [5], [4]]])\n    check('unknown-only row', solve([[[1, 'z', 4]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 4], [2, 'a', 5]], ['a']]), [[1, [4]], [2, [5]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 4], [1, 'a', 4]], ['a']]), [[1, [4, 4]]])\n    check('no categories', solve([[[1, 'a', 4]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 5:\n    check('column order', solve([[[1, 'a', 5], [1, 'b', 6]], ['b', 'a']]), [[1, [6], [5]]])\n    check('unknown-only row', solve([[[1, 'z', 5]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 5], [2, 'a', 6]], ['a']]), [[1, [5]], [2, [6]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 5], [1, 'a', 5]], ['a']]), [[1, [5, 5]]])\n    check('no categories', solve([[[1, 'a', 5]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\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":"228bc2bece54d5a70a3fce0f72e51be0da695cb6c39497f023c610b8e34c90e0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,categories=d\n        ids=list(dict.fromkeys(row[0] for row in rows))\n        out=[]\n        for ident in ids:\n            record=[ident]\n            for category in categories:\n                cell=[value for i,c,value in rows if i==ident and c==category]\n                record.append(cell if cell else [None])\n            out.append(record)\n        return out\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('column order', solve([[[1, 'a', 1], [1, 'b', 2]], ['b', 'a']]), [[1, [2], [1]]])\n    check('unknown-only row', solve([[[1, 'z', 1]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 1], [2, 'a', 2]], ['a']]), [[1, [1]], [2, [2]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 1], [1, 'a', 1]], ['a']]), [[1, [1, 1]]])\n    check('no categories', solve([[[1, 'a', 1]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 2:\n    check('column order', solve([[[1, 'a', 2], [1, 'b', 3]], ['b', 'a']]), [[1, [3], [2]]])\n    check('unknown-only row', solve([[[1, 'z', 2]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 2], [2, 'a', 3]], ['a']]), [[1, [2]], [2, [3]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 2], [1, 'a', 2]], ['a']]), [[1, [2, 2]]])\n    check('no categories', solve([[[1, 'a', 2]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 3:\n    check('column order', solve([[[1, 'a', 3], [1, 'b', 4]], ['b', 'a']]), [[1, [4], [3]]])\n    check('unknown-only row', solve([[[1, 'z', 3]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 3], [2, 'a', 4]], ['a']]), [[1, [3]], [2, [4]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 3], [1, 'a', 3]], ['a']]), [[1, [3, 3]]])\n    check('no categories', solve([[[1, 'a', 3]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 4:\n    check('column order', solve([[[1, 'a', 4], [1, 'b', 5]], ['b', 'a']]), [[1, [5], [4]]])\n    check('unknown-only row', solve([[[1, 'z', 4]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 4], [2, 'a', 5]], ['a']]), [[1, [4]], [2, [5]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 4], [1, 'a', 4]], ['a']]), [[1, [4, 4]]])\n    check('no categories', solve([[[1, 'a', 4]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 5:\n    check('column order', solve([[[1, 'a', 5], [1, 'b', 6]], ['b', 'a']]), [[1, [6], [5]]])\n    check('unknown-only row', solve([[[1, 'z', 5]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 5], [2, 'a', 6]], ['a']]), [[1, [5]], [2, [6]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 5], [1, 'a', 5]], ['a']]), [[1, [5, 5]]])\n    check('no categories', solve([[[1, 'a', 5]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\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":"2321267ab165b73e3dfda40a3391dbb8b81872432dbbb2c0dec96f9a9147cab9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,categories=d\n        ids=list(dict.fromkeys(row[0] for row in rows))\n        out=[]\n        for ident in ids:\n            record=[ident]\n            for category in categories:\n                cell=[value for i,c,value in rows if i==ident and c==category]\n                record.append(cell)\n            out.append(record)\n        return out\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('column order', solve([[[1, 'a', 1], [1, 'b', 2]], ['b', 'a']]), [[1, [2], [1]]])\n    check('unknown-only row', solve([[[1, 'z', 1]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 1], [2, 'a', 2]], ['a']]), [[1, [1]], [2, [2]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 1], [1, 'a', 1]], ['a']]), [[1, [1, 1]]])\n    check('no categories', solve([[[1, 'a', 1]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 2:\n    check('column order', solve([[[1, 'a', 2], [1, 'b', 3]], ['b', 'a']]), [[1, [3], [2]]])\n    check('unknown-only row', solve([[[1, 'z', 2]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 2], [2, 'a', 3]], ['a']]), [[1, [2]], [2, [3]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 2], [1, 'a', 2]], ['a']]), [[1, [2, 2]]])\n    check('no categories', solve([[[1, 'a', 2]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 3:\n    check('column order', solve([[[1, 'a', 3], [1, 'b', 4]], ['b', 'a']]), [[1, [4], [3]]])\n    check('unknown-only row', solve([[[1, 'z', 3]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 3], [2, 'a', 4]], ['a']]), [[1, [3]], [2, [4]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 3], [1, 'a', 3]], ['a']]), [[1, [3, 3]]])\n    check('no categories', solve([[[1, 'a', 3]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 4:\n    check('column order', solve([[[1, 'a', 4], [1, 'b', 5]], ['b', 'a']]), [[1, [5], [4]]])\n    check('unknown-only row', solve([[[1, 'z', 4]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 4], [2, 'a', 5]], ['a']]), [[1, [4]], [2, [5]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 4], [1, 'a', 4]], ['a']]), [[1, [4, 4]]])\n    check('no categories', solve([[[1, 'a', 4]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 5:\n    check('column order', solve([[[1, 'a', 5], [1, 'b', 6]], ['b', 'a']]), [[1, [6], [5]]])\n    check('unknown-only row', solve([[[1, 'z', 5]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 5], [2, 'a', 6]], ['a']]), [[1, [5]], [2, [6]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 5], [1, 'a', 5]], ['a']]), [[1, [5, 5]]])\n    check('no categories', solve([[[1, 'a', 5]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\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":"Offline stipulated semantics over valid small inputs; no performance, concurrency, or production-engine 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-data-systems-categorical-pivot-lists-empty-cell","generated_at":"2026-09-29T14:44:16.786632+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A bounded deterministic data engine model makes representation and changelog faults reproducible.","repair":"Preserve the stated physical representation and operation order: Pivot [row-id,category,value] into [row-id,list-for-category...] using the caller category order. Each cell is an ordered bag list. Unknown categories do not populate cells but retain their row identity; absent cells are empty lists and null values remain elements.","root_cause":"categorical-pivot-lists: Pivot substitutes a null element for an absent cell.","sha256":"50027559c7556a3c327f244315bb1aedde4310300ddb0025064a65920dd3a34e","title":"Pivot substitutes a null element for an absent cell · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.393,"exit_code":1,"observations":[{"actual":[[1,[2],[1]]],"check":"column order","expected":[[1,[2],[1]]],"passed":true},{"actual":[[1,null]],"check":"unknown-only row","expected":[[1,[]]],"passed":false},{"actual":[[1,[1]],[2,[2]]],"check":"two row groups","expected":[[1,[1]],[2,[2]]],"passed":true},{"actual":[[1,[null]]],"check":"null fact","expected":[[1,[null]]],"passed":true},{"actual":[[1,[1,1]]],"check":"duplicate fact","expected":[[1,[1,1]]],"passed":true},{"actual":[[1]],"check":"no categories","expected":[[1]],"passed":true},{"actual":[],"check":"no facts","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"column order\", \"actual\": [[1, [2], [1]]], \"expected\": [[1, [2], [1]]], \"passed\": true}, {\"check\": \"unknown-only row\", \"actual\": [[1, null]], \"expected\": [[1, []]], \"passed\": false}, {\"check\": \"two row groups\", \"actual\": [[1, [1]], [2, [2]]], \"expected\": [[1, [1]], [2, [2]]], \"passed\": true}, {\"check\": \"null fact\", \"actual\": [[1, [null]]], \"expected\": [[1, [null]]], \"passed\": true}, {\"check\": \"duplicate fact\", \"actual\": [[1, [1, 1]]], \"expected\": [[1, [1, 1]]], \"passed\": true}, {\"check\": \"no categories\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"no facts\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.954,"exit_code":1,"observations":[{"actual":[[1,[2],[1]]],"check":"column order","expected":[[1,[2],[1]]],"passed":true},{"actual":[[1,[null]]],"check":"unknown-only row","expected":[[1,[]]],"passed":false},{"actual":[[1,[1]],[2,[2]]],"check":"two row groups","expected":[[1,[1]],[2,[2]]],"passed":true},{"actual":[[1,[null]]],"check":"null fact","expected":[[1,[null]]],"passed":true},{"actual":[[1,[1,1]]],"check":"duplicate fact","expected":[[1,[1,1]]],"passed":true},{"actual":[[1]],"check":"no categories","expected":[[1]],"passed":true},{"actual":[],"check":"no facts","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"column order\", \"actual\": [[1, [2], [1]]], \"expected\": [[1, [2], [1]]], \"passed\": true}, {\"check\": \"unknown-only row\", \"actual\": [[1, [null]]], \"expected\": [[1, []]], \"passed\": false}, {\"check\": \"two row groups\", \"actual\": [[1, [1]], [2, [2]]], \"expected\": [[1, [1]], [2, [2]]], \"passed\": true}, {\"check\": \"null fact\", \"actual\": [[1, [null]]], \"expected\": [[1, [null]]], \"passed\": true}, {\"check\": \"duplicate fact\", \"actual\": [[1, [1, 1]]], \"expected\": [[1, [1, 1]]], \"passed\": true}, {\"check\": \"no categories\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"no facts\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.186,"exit_code":0,"observations":[{"actual":[[1,[2],[1]]],"check":"column order","expected":[[1,[2],[1]]],"passed":true},{"actual":[[1,[]]],"check":"unknown-only row","expected":[[1,[]]],"passed":true},{"actual":[[1,[1]],[2,[2]]],"check":"two row groups","expected":[[1,[1]],[2,[2]]],"passed":true},{"actual":[[1,[null]]],"check":"null fact","expected":[[1,[null]]],"passed":true},{"actual":[[1,[1,1]]],"check":"duplicate fact","expected":[[1,[1,1]]],"passed":true},{"actual":[[1]],"check":"no categories","expected":[[1]],"passed":true},{"actual":[],"check":"no facts","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"column order\", \"actual\": [[1, [2], [1]]], \"expected\": [[1, [2], [1]]], \"passed\": true}, {\"check\": \"unknown-only row\", \"actual\": [[1, []]], \"expected\": [[1, []]], \"passed\": true}, {\"check\": \"two row groups\", \"actual\": [[1, [1]], [2, [2]]], \"expected\": [[1, [1]], [2, [2]]], \"passed\": true}, {\"check\": \"null fact\", \"actual\": [[1, [null]]], \"expected\": [[1, [null]]], \"passed\": true}, {\"check\": \"duplicate fact\", \"actual\": [[1, [1, 1]]], \"expected\": [[1, [1, 1]]], \"passed\": true}, {\"check\": \"no categories\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"no facts\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}