{"abstract":"Masking only the new stencil value clears protected existing bits.","category":"Rendering state","checks":4,"contract":"Old/new/mask are bytes. Replace only stencil bits enabled by the write mask; preserve every masked-off old bit.","evaluation_group":"xg-stencil-write-mask-preserves-bits","failed_approach":"Reversing mask roles updates protected bits instead of enabled bits.","family":"xg-stencil-write-mask-preserves-bits","id":"FA-10696","implementations":{"attempt":{"sha256":"45ca43d3f84c92258bb2b67663e51314a94e7946a1390878f0a7622fe29582af","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(old, new, mask):\n    return (old & mask) | (new & (255^mask))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*(240, 15, 15)), 255)\ncheck('fixture 2', solve(*(170, 85, 0)), 170)\ncheck('fixture 3', solve(*(170, 85, 255)), 85)\ncheck('fixture 4', solve(*(0, 255, 240)), 240)\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":"097df9d1dfe8c3742ca63bd5e9371995900c0e8bb6378b908c5ac95704494217","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(old, new, mask):\n    return new & mask\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*(240, 15, 15)), 255)\ncheck('fixture 2', solve(*(170, 85, 0)), 170)\ncheck('fixture 3', solve(*(170, 85, 255)), 85)\ncheck('fixture 4', solve(*(0, 255, 240)), 240)\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":"e6551e8e092b972dbf4f15990c9c8d0e2f2425f716086e487c7e4f785c4fea5d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(old, new, mask):\n    return (old & (255^mask)) | (new & mask)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*(240, 15, 15)), 255)\ncheck('fixture 2', solve(*(170, 85, 0)), 170)\ncheck('fixture 3', solve(*(170, 85, 255)), 85)\ncheck('fixture 4', solve(*(0, 255, 240)), 240)\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":" 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":"xg-stencil-write-mask-preserves-bits","generated_at":"2026-09-29T14:38:41.342043+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic software graphics stage with explicit channel and coordinate conventions; no hardware, device profile or API behavior is inferred.","repair":"Use the stage contract: Old/new/mask are bytes. Replace only stencil bits enabled by the write mask; preserve every masked-off old bit.","root_cause":"Masking only the new stencil value clears protected existing bits.","sha256":"7833d9e871212d1f24a31943b5e7a594c4ba13cbc32c1c49ce09a823e265c682","title":"Stencil write mask preserves bits · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":56.7,"exit_code":1,"observations":[{"actual":0,"check":"fixture 1","expected":255,"passed":false},{"actual":85,"check":"fixture 2","expected":170,"passed":false},{"actual":170,"check":"fixture 3","expected":85,"passed":false},{"actual":15,"check":"fixture 4","expected":240,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": 0, \"expected\": 255, \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": 85, \"expected\": 170, \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": 170, \"expected\": 85, \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": 15, \"expected\": 240, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.753,"exit_code":1,"observations":[{"actual":15,"check":"fixture 1","expected":255,"passed":false},{"actual":0,"check":"fixture 2","expected":170,"passed":false},{"actual":85,"check":"fixture 3","expected":85,"passed":true},{"actual":240,"check":"fixture 4","expected":240,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": 15, \"expected\": 255, \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": 0, \"expected\": 170, \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": 85, \"expected\": 85, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": 240, \"expected\": 240, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.64,"exit_code":0,"observations":[{"actual":255,"check":"fixture 1","expected":255,"passed":true},{"actual":170,"check":"fixture 2","expected":170,"passed":true},{"actual":85,"check":"fixture 3","expected":85,"passed":true},{"actual":240,"check":"fixture 4","expected":240,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": 255, \"expected\": 255, \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": 170, \"expected\": 170, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": 85, \"expected\": 85, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": 240, \"expected\": 240, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}