FA-4396 / Mapping semantics / Open access
Map update right precedence · case 01
The operation returns a result or retained state that violates this contract: Update existing keys from the right map while retaining left insertion positions and appending new right keys.
ROOT CAUSE
Reversing update operands gives stale left values precedence and changes insertion order.
THE FAILURE
Reversing update operands gives stale left values precedence and changes insertion order.
Unsuccessful approach: Skipping existing keys prevents required overwrites.
Case contract
Update existing keys from the right map while retaining left insertion positions and appending new right keys. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.
Why this case matters
A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x, y=None):
a=dict(y); a.update(x); return list(map(list,a.items()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overwrite and insert', solve({'a': 1, 'b': 2}, {'a': 3, 'c': 4}), [['a', 3], ['b', 2], ['c', 4]])
check('empty left', solve({}, {'a': 1}), [['a', 1]])
check('empty right', solve({'a': 1}, {}), [['a', 1]])
check('None overwrite', solve({'a': 1}, {'a': None}), [['a', None]])
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 |
|---|---|---|---|
| overwrite and insert | [['a', 1], ['c', 4], ['b', 2]] | [['a', 3], ['b', 2], ['c', 4]] | Failed |
| empty left | [['a', 1]] | [['a', 1]] | Passed |
| empty right | [['a', 1]] | [['a', 1]] | Passed |
| None overwrite | [['a', 1]] | [['a', None]] | Failed |
SHA-256 / b81b36bc4b74f8db334ce779cdcf46e96dc2cc4ac8adc90e62b8769f2e4aeb0f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x, y=None):
return [[k,v] for k,v in x.items()]+[[k,v] for k,v in y.items() if k not in x]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overwrite and insert', solve({'a': 1, 'b': 2}, {'a': 3, 'c': 4}), [['a', 3], ['b', 2], ['c', 4]])
check('empty left', solve({}, {'a': 1}), [['a', 1]])
check('empty right', solve({'a': 1}, {}), [['a', 1]])
check('None overwrite', solve({'a': 1}, {'a': None}), [['a', None]])
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 |
|---|---|---|---|
| overwrite and insert | [['a', 1], ['b', 2], ['c', 4]] | [['a', 3], ['b', 2], ['c', 4]] | Failed |
| empty left | [['a', 1]] | [['a', 1]] | Passed |
| empty right | [['a', 1]] | [['a', 1]] | Passed |
| None overwrite | [['a', 1]] | [['a', None]] | Failed |
SHA-256 / 79647244a0cd48e3747d60be48388a6057dc733fa65682dbbed32b7fbeb4991d
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:37:38.546669+00:00.
Case digest / e6bdf77a2d7c9fd23f2aebd27b209f509dd0cb2b53f2669ecf45945a0e87f3bc