FAILURE MAP
← Case archive

FA-9361 / Version constraints / Open access

Closed-open version range intersection: A zero upper bound is treated as absent · case 01

A zero upper bound is treated as absent.

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

ROOT CAUSE

The implementation substitutes if hi for if hi is not None, so a zero upper bound is treated as absent.

VERIFIED REPAIR

Use explicit None checks for upper bounds.

Unsuccessful approach: The attempted repair substitutes if hi not in (None, 0). Fixture 9 still yields (None, None) instead of (None, 0).

Case contract

Intersect all inclusive lower and exclusive upper bounds. None means unbounded. Return empty if lower >= upper, otherwise a bound pair.

Why this case matters

An offline model of closed-open version range intersection, suitable for testing build and release tooling without external services.

1 / The failure

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

N = 1
observations = []
def solve(ranges):
    lows = [lo for lo, hi in ranges if lo is not None]
    highs = [hi for lo, hi in ranges if hi]
    lo = max(lows) if lows else None
    hi = min(highs) if highs else None
    if lo is not None and hi is not None and lo >= hi: return 'empty'
    return (lo, hi)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([]), (None, None))
check('fixture 2', solve([(None, None)]), (None, None))
check('fixture 3', solve([(1, 8), (3, 6)]), (3, 6))
check('fixture 4', solve([(2, 2)]), 'empty')
check('fixture 5', solve([(4, 2)]), 'empty')
check('fixture 6', solve([(None, 3), (0, None)]), (0, 3))
check('fixture 7', solve([(0, 3)]), (0, 3))
check('fixture 8', solve([(0, None)]), (0, None))
check('fixture 9', solve([(None, 0)]), (None, 0))
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
fixture 1[None, None][None, None]Passed
fixture 2[None, None][None, None]Passed
fixture 3[3, 6][3, 6]Passed
fixture 4emptyemptyPassed
fixture 5emptyemptyPassed
fixture 6[0, 3][0, 3]Passed
fixture 7[0, 3][0, 3]Passed
fixture 8[0, None][0, None]Passed
fixture 9[None, None][None, 0]Failed

SHA-256 / c3051995298791c0a853403486d372034e97edb5ee5f5ec8f741b140d6c8110b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(ranges):
    lows = [lo for lo, hi in ranges if lo is not None]
    highs = [hi for lo, hi in ranges if hi not in (None, 0)]
    lo = max(lows) if lows else None
    hi = min(highs) if highs else None
    if lo is not None and hi is not None and lo >= hi: return 'empty'
    return (lo, hi)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([]), (None, None))
check('fixture 2', solve([(None, None)]), (None, None))
check('fixture 3', solve([(1, 8), (3, 6)]), (3, 6))
check('fixture 4', solve([(2, 2)]), 'empty')
check('fixture 5', solve([(4, 2)]), 'empty')
check('fixture 6', solve([(None, 3), (0, None)]), (0, 3))
check('fixture 7', solve([(0, 3)]), (0, 3))
check('fixture 8', solve([(0, None)]), (0, None))
check('fixture 9', solve([(None, 0)]), (None, 0))
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
fixture 1[None, None][None, None]Passed
fixture 2[None, None][None, None]Passed
fixture 3[3, 6][3, 6]Passed
fixture 4emptyemptyPassed
fixture 5emptyemptyPassed
fixture 6[0, 3][0, 3]Passed
fixture 7[0, 3][0, 3]Passed
fixture 8[0, None][0, None]Passed
fixture 9[None, None][None, 0]Failed

SHA-256 / 4401aff6512dd35b6b939c80b91bf86be5a150eca205e93c8c71fe4bfc20d5dc

3 / The verified repair

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

N = 1
observations = []
def solve(ranges):
    lows = [lo for lo, hi in ranges if lo is not None]
    highs = [hi for lo, hi in ranges if hi is not None]
    lo = max(lows) if lows else None
    hi = min(highs) if highs else None
    if lo is not None and hi is not None and lo >= hi: return 'empty'
    return (lo, hi)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([]), (None, None))
check('fixture 2', solve([(None, None)]), (None, None))
check('fixture 3', solve([(1, 8), (3, 6)]), (3, 6))
check('fixture 4', solve([(2, 2)]), 'empty')
check('fixture 5', solve([(4, 2)]), 'empty')
check('fixture 6', solve([(None, 3), (0, None)]), (0, 3))
check('fixture 7', solve([(0, 3)]), (0, 3))
check('fixture 8', solve([(0, None)]), (0, None))
check('fixture 9', solve([(None, 0)]), (None, 0))
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
fixture 1[None, None][None, None]Passed
fixture 2[None, None][None, None]Passed
fixture 3[3, 6][3, 6]Passed
fixture 4emptyemptyPassed
fixture 5emptyemptyPassed
fixture 6[0, 3][0, 3]Passed
fixture 7[0, 3][0, 3]Passed
fixture 8[0, None][0, None]Passed
fixture 9[None, 0][None, 0]Passed

SHA-256 / de0ccae071432a76da4d8357340efd69052fd91a4601bd470286d6fec79a1b49

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

Case digest / 2f8905bbfbe36f8bd6ee940f87a7512d60ac4941f7f16592ce95d8efee312d58