FA-10696 / Rendering state / Open access
Stencil write mask preserves bits · case 01
Masking only the new stencil value clears protected existing bits.
ROOT CAUSE
Masking only the new stencil value clears protected existing bits.
VERIFIED 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.
Unsuccessful approach: Reversing mask roles updates protected bits instead of enabled bits.
Case contract
Old/new/mask are bytes. Replace only stencil bits enabled by the write mask; preserve every masked-off old bit.
Why this case matters
A deterministic software graphics stage with explicit channel and coordinate conventions; no hardware, device profile or API behavior is inferred.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(old, new, mask):
return new & mask
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(240, 15, 15)), 255)
check('fixture 2', solve(*(170, 85, 0)), 170)
check('fixture 3', solve(*(170, 85, 255)), 85)
check('fixture 4', solve(*(0, 255, 240)), 240)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | 15 | 255 | Failed |
| fixture 2 | 0 | 170 | Failed |
| fixture 3 | 85 | 85 | Passed |
| fixture 4 | 240 | 240 | Passed |
SHA-256 / 097df9d1dfe8c3742ca63bd5e9371995900c0e8bb6378b908c5ac95704494217
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(old, new, mask):
return (old & mask) | (new & (255^mask))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(240, 15, 15)), 255)
check('fixture 2', solve(*(170, 85, 0)), 170)
check('fixture 3', solve(*(170, 85, 255)), 85)
check('fixture 4', solve(*(0, 255, 240)), 240)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | 0 | 255 | Failed |
| fixture 2 | 85 | 170 | Failed |
| fixture 3 | 170 | 85 | Failed |
| fixture 4 | 15 | 240 | Failed |
SHA-256 / 45ca43d3f84c92258bb2b67663e51314a94e7946a1390878f0a7622fe29582af
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(old, new, mask):
return (old & (255^mask)) | (new & mask)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(240, 15, 15)), 255)
check('fixture 2', solve(*(170, 85, 0)), 170)
check('fixture 3', solve(*(170, 85, 255)), 85)
check('fixture 4', solve(*(0, 255, 240)), 240)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | 255 | 255 | Passed |
| fixture 2 | 170 | 170 | Passed |
| fixture 3 | 85 | 85 | Passed |
| fixture 4 | 240 | 240 | Passed |
SHA-256 / e6551e8e092b972dbf4f15990c9c8d0e2f2425f716086e487c7e4f785c4fea5d
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:41.342043+00:00.
Case digest / 7833d9e871212d1f24a31943b5e7a594c4ba13cbc32c1c49ce09a823e265c682