FA-10681 / Rendering state / Open access
State push deep copy · case 01
The saved state aliases a mutable color list and changes when current state changes.
ROOT CAUSE
The saved state aliases a mutable color list and changes when current state changes.
VERIFIED REPAIR
Use the stage contract: State maps names to flat lists and contains four-channel color. Save a snapshot, mutate a current color channel, and return the untouched full snapshot; do not mutate input.
Unsuccessful approach: Saving only color omits viewport and other render state from restoration.
Case contract
State maps names to flat lists and contains four-channel color. Save a snapshot, mutate a current color channel, and return the untouched full snapshot; do not mutate input.
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(state, channel, value):
saved=dict(state)
current=dict(state)
current['color']=list(current['color'])
saved['color']=current['color']
current['color'][channel]=value
return saved
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*({'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]}, 0, 9)), {'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]})
check('fixture 2', solve(*({'color': [0, 0, 0, 0]}, 3, 5)), {'color': [0, 0, 0, 0]})
check('fixture 3', solve(*({'color': [1, 1, 1, 1], 'other': [2]}, 1, 7)), {'color': [1, 1, 1, 1], 'other': [2]})
check('fixture 4', solve(*({'color': [4, 3, 2, 1]}, 0, 4)), {'color': [4, 3, 2, 1]})
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 | {'color': [9, 2, 3, 4], 'viewport': [0, 0, 8, 8]} | {'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]} | Failed |
| fixture 2 | {'color': [0, 0, 0, 5]} | {'color': [0, 0, 0, 0]} | Failed |
| fixture 3 | {'color': [1, 7, 1, 1], 'other': [2]} | {'color': [1, 1, 1, 1], 'other': [2]} | Failed |
| fixture 4 | {'color': [4, 3, 2, 1]} | {'color': [4, 3, 2, 1]} | Passed |
SHA-256 / a5a4617467018817e5c8226e7fec4bf38ad3df383d0857c775efc21c3f8abebe
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(state, channel, value):
return {'color':list(state['color'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*({'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]}, 0, 9)), {'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]})
check('fixture 2', solve(*({'color': [0, 0, 0, 0]}, 3, 5)), {'color': [0, 0, 0, 0]})
check('fixture 3', solve(*({'color': [1, 1, 1, 1], 'other': [2]}, 1, 7)), {'color': [1, 1, 1, 1], 'other': [2]})
check('fixture 4', solve(*({'color': [4, 3, 2, 1]}, 0, 4)), {'color': [4, 3, 2, 1]})
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 | {'color': [1, 2, 3, 4]} | {'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]} | Failed |
| fixture 2 | {'color': [0, 0, 0, 0]} | {'color': [0, 0, 0, 0]} | Passed |
| fixture 3 | {'color': [1, 1, 1, 1]} | {'color': [1, 1, 1, 1], 'other': [2]} | Failed |
| fixture 4 | {'color': [4, 3, 2, 1]} | {'color': [4, 3, 2, 1]} | Passed |
SHA-256 / cc53b05a9ba28ba8bee42b10c80343ff19d30ecf68bfe0d9cad5a6acfd35ed4b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(state, channel, value):
saved={k:list(v) for k,v in state.items()}
current={k:list(v) for k,v in state.items()}
current['color'][channel]=value
return saved
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*({'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]}, 0, 9)), {'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]})
check('fixture 2', solve(*({'color': [0, 0, 0, 0]}, 3, 5)), {'color': [0, 0, 0, 0]})
check('fixture 3', solve(*({'color': [1, 1, 1, 1], 'other': [2]}, 1, 7)), {'color': [1, 1, 1, 1], 'other': [2]})
check('fixture 4', solve(*({'color': [4, 3, 2, 1]}, 0, 4)), {'color': [4, 3, 2, 1]})
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 | {'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]} | {'color': [1, 2, 3, 4], 'viewport': [0, 0, 8, 8]} | Passed |
| fixture 2 | {'color': [0, 0, 0, 0]} | {'color': [0, 0, 0, 0]} | Passed |
| fixture 3 | {'color': [1, 1, 1, 1], 'other': [2]} | {'color': [1, 1, 1, 1], 'other': [2]} | Passed |
| fixture 4 | {'color': [4, 3, 2, 1]} | {'color': [4, 3, 2, 1]} | Passed |
SHA-256 / 9bcfbfb88a840b86abe1dcd6f55e083bbbb4c59e3428b55c7e5952750a37710f
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.242462+00:00.
Case digest / 575f5e80145395506e901cfb4dc28186143ab2d3912c3804eccc9f0bb854e9df