FAILURE MAP
← Case archive

FA-5086 / Method resolution / Open access

Cooperative diamond mro: Hardcodes B delegation to Root and skips A in reversed base order · case 01

Hardcodes B delegation to Root and skips A in reversed base order and changes the required Python-language result.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Hardcodes B delegation to Root and skips A in reversed base order. The executable reproducer isolates this operation from the rest of the contract.

VERIFIED REPAIR

Traverse the actual C3 MRO cooperatively, appending each visited class once. Leaf bases are A,B or B,A and both derive from Root; start chooses normal dispatch or super after a specified class.

Unsuccessful approach: The alternative still fails because it starts at A regardless of the declared base order.

Case contract

Traverse the actual C3 MRO cooperatively, appending each visited class once. Leaf bases are A,B or B,A and both derive from Root; start chooses normal dispatch or super after a specified class. Inputs use the finite Python types shown in the fixtures. An error string denotes the specified caught exception, not an unhandled process failure.

Why this case matters

Runs Python standard-library language operations in a deterministic local reproducer. Literal expected answers are authored independently. Related defects share an evaluation group to avoid benchmark split leakage.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(order, start):
    class Root:
        def trace(self): return ['Root']
    class A(Root):
        def trace(self): return ['A']+super().trace()
    class B(Root):
        def trace(self): return ['B']+Root.trace(self)
    def leaf_trace(self): return ['Leaf']+super(Leaf,self).trace()
    Leaf=type('Leaf',(A,B) if order=='AB' else (B,A),{'trace':leaf_trace})
    obj=Leaf()
    if start=='leaf': return obj.trace()
    if start=='after-leaf': return super(Leaf,obj).trace()
    if start=='after-A': return super(A,obj).trace()
    return super(B,obj).trace()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left-first diamond', solve('AB', 'leaf'), ['Leaf', 'A', 'B', 'Root'])
check('right-first diamond', solve('BA', 'leaf'), ['Leaf', 'B', 'A', 'Root'])
check('super after leaf', solve('AB', 'after-leaf'), ['A', 'B', 'Root'])
check('super A follows dynamic MRO', solve('AB', 'after-A'), ['B', 'Root'])
check('super B follows dynamic MRO', solve('BA', 'after-B'), ['A', 'Root'])
check('terminal next', solve('AB', 'after-B'), ['Root'])
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 fixtureActualExpectedOutcome
left-first diamond['Leaf', 'A', 'B', 'Root']['Leaf', 'A', 'B', 'Root']Passed
right-first diamond['Leaf', 'B', 'Root']['Leaf', 'B', 'A', 'Root']Failed
super after leaf['A', 'B', 'Root']['A', 'B', 'Root']Passed
super A follows dynamic MRO['B', 'Root']['B', 'Root']Passed
super B follows dynamic MRO['A', 'Root']['A', 'Root']Passed
terminal next['Root']['Root']Passed

SHA-256 / 8d304fab493e62c5f302f25dcd8f728a7947b93cd435511220074da5466f377a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(order, start):
    class Root:
        def trace(self): return ['Root']
    class A(Root):
        def trace(self): return ['A']+super().trace()
    class B(Root):
        def trace(self): return ['B']+super().trace()
    def leaf_trace(self): return ['Leaf']+A.trace(self)
    Leaf=type('Leaf',(A,B) if order=='AB' else (B,A),{'trace':leaf_trace})
    obj=Leaf()
    if start=='leaf': return obj.trace()
    if start=='after-leaf': return super(Leaf,obj).trace()
    if start=='after-A': return super(A,obj).trace()
    return super(B,obj).trace()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left-first diamond', solve('AB', 'leaf'), ['Leaf', 'A', 'B', 'Root'])
check('right-first diamond', solve('BA', 'leaf'), ['Leaf', 'B', 'A', 'Root'])
check('super after leaf', solve('AB', 'after-leaf'), ['A', 'B', 'Root'])
check('super A follows dynamic MRO', solve('AB', 'after-A'), ['B', 'Root'])
check('super B follows dynamic MRO', solve('BA', 'after-B'), ['A', 'Root'])
check('terminal next', solve('AB', 'after-B'), ['Root'])
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 fixtureActualExpectedOutcome
left-first diamond['Leaf', 'A', 'B', 'Root']['Leaf', 'A', 'B', 'Root']Passed
right-first diamond['Leaf', 'A', 'Root']['Leaf', 'B', 'A', 'Root']Failed
super after leaf['A', 'B', 'Root']['A', 'B', 'Root']Passed
super A follows dynamic MRO['B', 'Root']['B', 'Root']Passed
super B follows dynamic MRO['A', 'Root']['A', 'Root']Passed
terminal next['Root']['Root']Passed

SHA-256 / fd4913f9f60dbbbef1f0491b2d4eb117dbfff9c7b59488f6416214afc943e653

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(order, start):
    class Root:
        def trace(self): return ['Root']
    class A(Root):
        def trace(self): return ['A']+super().trace()
    class B(Root):
        def trace(self): return ['B']+super().trace()
    def leaf_trace(self): return ['Leaf']+super(Leaf,self).trace()
    Leaf=type('Leaf',(A,B) if order=='AB' else (B,A),{'trace':leaf_trace})
    obj=Leaf()
    if start=='leaf': return obj.trace()
    if start=='after-leaf': return super(Leaf,obj).trace()
    if start=='after-A': return super(A,obj).trace()
    return super(B,obj).trace()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left-first diamond', solve('AB', 'leaf'), ['Leaf', 'A', 'B', 'Root'])
check('right-first diamond', solve('BA', 'leaf'), ['Leaf', 'B', 'A', 'Root'])
check('super after leaf', solve('AB', 'after-leaf'), ['A', 'B', 'Root'])
check('super A follows dynamic MRO', solve('AB', 'after-A'), ['B', 'Root'])
check('super B follows dynamic MRO', solve('BA', 'after-B'), ['A', 'Root'])
check('terminal next', solve('AB', 'after-B'), ['Root'])
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 fixtureActualExpectedOutcome
left-first diamond['Leaf', 'A', 'B', 'Root']['Leaf', 'A', 'B', 'Root']Passed
right-first diamond['Leaf', 'B', 'A', 'Root']['Leaf', 'B', 'A', 'Root']Passed
super after leaf['A', 'B', 'Root']['A', 'B', 'Root']Passed
super A follows dynamic MRO['B', 'Root']['B', 'Root']Passed
super B follows dynamic MRO['A', 'Root']['A', 'Root']Passed
terminal next['Root']['Root']Passed

SHA-256 / 6a0ce6add744568ba0928b9161589df6f0436b32268797f5def5f8b8378c0975

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:45.890374+00:00.

Case digest / 24ed154fb21ac274f98278b740edc1cb76809a24981fac7776fbc6a27311d5bd