FAILURE MAP
← Case archive

FA-15161 / Numerics / Open access

Colex combination rank: colex origin offset · case 01

The exact colex combination rank result violates the stated contract at colex origin offset.

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

ROOT CAUSE

The colex origin offset step uses rank+1 instead of rank.

VERIFIED REPAIR

Use rank at the colex origin offset step.

Unsuccessful approach: The partial repair max(0,rank-1) still violates the colex origin offset invariant.

Case contract

Input strictly increasing selected nonnegative integers; zero-based colex rank=sum choose(a_i,i+1).

Why this case matters

Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a=x;rank=0
    for i in range(len(a)):
     top=a[i];bottom=i+1
     term=math.comb(top,bottom) if 0<=bottom<=top else 0
     rank=rank+term
    return rank+1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0], 0), ([1], 1), ([4, 5, 6, 7, 8], 125), ([0], 0), ([0, 1], 0), ([0], 0), ([1], 1), ([2], 2)], [([0], 0), ([0, 2], 1), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 3], 3), ([1, 2], 2), ([1, 3], 4), ([2, 3], 5)], [([1], 1), ([2], 2), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 4], 6), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7)], [([0, 1], 0), ([0, 3], 3), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 1, 2, 3], 0), ([0, 1, 2, 4], 1), ([0, 1, 3, 4], 2), ([0, 2, 3, 4], 3)], [([0], 0), ([2, 3], 5), ([0], 0), ([4, 5, 6, 7, 8], 125), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7), ([1, 5], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, solve(args), expected)
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
explicit oracle 010Failed
explicit oracle 121Failed
explicit oracle 2126125Failed
explicit oracle 310Failed
explicit oracle 410Failed
explicit oracle 510Failed
explicit oracle 621Failed
explicit oracle 732Failed

SHA-256 / ec2b9a2cc04a2337b175b51e4db075e98d41f2df549ccccbd125730ffaa2a548

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a=x;rank=0
    for i in range(len(a)):
     top=a[i];bottom=i+1
     term=math.comb(top,bottom) if 0<=bottom<=top else 0
     rank=rank+term
    return max(0,rank-1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0], 0), ([1], 1), ([4, 5, 6, 7, 8], 125), ([0], 0), ([0, 1], 0), ([0], 0), ([1], 1), ([2], 2)], [([0], 0), ([0, 2], 1), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 3], 3), ([1, 2], 2), ([1, 3], 4), ([2, 3], 5)], [([1], 1), ([2], 2), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 4], 6), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7)], [([0, 1], 0), ([0, 3], 3), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 1, 2, 3], 0), ([0, 1, 2, 4], 1), ([0, 1, 3, 4], 2), ([0, 2, 3, 4], 3)], [([0], 0), ([2, 3], 5), ([0], 0), ([4, 5, 6, 7, 8], 125), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7), ([1, 5], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, solve(args), expected)
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
explicit oracle 000Passed
explicit oracle 101Failed
explicit oracle 2124125Failed
explicit oracle 300Passed
explicit oracle 400Passed
explicit oracle 500Passed
explicit oracle 601Failed
explicit oracle 712Failed

SHA-256 / 477c9303d80b72f961e7d46e0896aa6be41525e53ec9b5a9f7b157f141f770fc

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a=x;rank=0
    for i in range(len(a)):
     top=a[i];bottom=i+1
     term=math.comb(top,bottom) if 0<=bottom<=top else 0
     rank=rank+term
    return rank
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0], 0), ([1], 1), ([4, 5, 6, 7, 8], 125), ([0], 0), ([0, 1], 0), ([0], 0), ([1], 1), ([2], 2)], [([0], 0), ([0, 2], 1), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 3], 3), ([1, 2], 2), ([1, 3], 4), ([2, 3], 5)], [([1], 1), ([2], 2), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 4], 6), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7)], [([0, 1], 0), ([0, 3], 3), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 1, 2, 3], 0), ([0, 1, 2, 4], 1), ([0, 1, 3, 4], 2), ([0, 2, 3, 4], 3)], [([0], 0), ([2, 3], 5), ([0], 0), ([4, 5, 6, 7, 8], 125), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7), ([1, 5], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, solve(args), expected)
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
explicit oracle 000Passed
explicit oracle 111Passed
explicit oracle 2125125Passed
explicit oracle 300Passed
explicit oracle 400Passed
explicit oracle 500Passed
explicit oracle 611Passed
explicit oracle 722Passed

SHA-256 / 0c2ae4845e6dbf9e82042ac37b0cd915c3593647bc697c4d98d15c3417095503

Verification & scope

A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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:39:23.972521+00:00.

Case digest / 5cbe5cb89f2359d24d35c2a96b57b2fd1989e5c52b0037d9dc4f04a498e1c596