FAILURE MAP
← Case archive

FA-12721 / Auction allocation rules / Open access

Equal-price buy and sell limits fail to cross · case 01

Equal-price buy and sell limits fail to cross.

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

ROOT CAUSE

The crossing relation is strict.

VERIFIED REPAIR

Implement the stated toy allocation contract directly: Return executable volume min(buy quantity, sell quantity) when buy limit >= sell limit, else zero. All inputs nonnegative integers.

Unsuccessful approach: Testing equality alone removes profitable strict crossings.

Case contract

Return executable volume min(buy quantity, sell quantity) when buy limit >= sell limit, else zero. All inputs nonnegative integers.

Why this case matters

Deterministic teaching model for reviewing auction allocation software; not a representation of any venue or financial advice.

1 / The failure

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

N = 1
observations = []
def solve(buy, sell):
    return min(buy[1],sell[1]) if buy[0]>sell[0] else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('equal limit', solve([10+N,3], [10+N,4]), 3)
check('strict cross', solve([12,5], [10,2]), 2)
check('no cross', solve([9,3], [10,3]), 0)
check('zero buy size', solve([10,0], [9,3]), 0)
check('zero sell size', solve([10,4], [9,0]), 0)
check('zero price', solve([0,2], [0,5]), 2)
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
equal limit03Failed
strict cross22Passed
no cross00Passed
zero buy size00Passed
zero sell size00Passed
zero price02Failed

SHA-256 / d674e4a65b856ef30640c56ce0717b5ff78014f114aea5e7e2553521712e957a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(buy, sell):
    return min(buy[1],sell[1]) if buy[0]==sell[0] else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('equal limit', solve([10+N,3], [10+N,4]), 3)
check('strict cross', solve([12,5], [10,2]), 2)
check('no cross', solve([9,3], [10,3]), 0)
check('zero buy size', solve([10,0], [9,3]), 0)
check('zero sell size', solve([10,4], [9,0]), 0)
check('zero price', solve([0,2], [0,5]), 2)
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
equal limit33Passed
strict cross02Failed
no cross00Passed
zero buy size00Passed
zero sell size00Passed
zero price22Passed

SHA-256 / a6f9e59fea0428f192ae535a7d9d234143db16523f435069c65ad041081d7867

3 / The verified repair

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

N = 1
observations = []
def solve(buy, sell):
    return min(buy[1],sell[1]) if buy[0]>=sell[0] else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('equal limit', solve([10+N,3], [10+N,4]), 3)
check('strict cross', solve([12,5], [10,2]), 2)
check('no cross', solve([9,3], [10,3]), 0)
check('zero buy size', solve([10,0], [9,3]), 0)
check('zero sell size', solve([10,4], [9,0]), 0)
check('zero price', solve([0,2], [0,5]), 2)
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
equal limit33Passed
strict cross22Passed
no cross00Passed
zero buy size00Passed
zero sell size00Passed
zero price22Passed

SHA-256 / 18c9e256594eb90cd8b73efdf25fc2e56272990d914cb5b84f98e0cddca13eb4

Verification & scope

Offline toy model with explicit integer inputs; no strategic behavior or real market execution. 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:59.435574+00:00.

Case digest / 8d58b9900bc8e6a457ddb6cd814c583d09d3ae7578c7c0e6ca0d767e459e1e70