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.
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | 1 | 0 | Failed |
| explicit oracle 1 | 2 | 1 | Failed |
| explicit oracle 2 | 126 | 125 | Failed |
| explicit oracle 3 | 1 | 0 | Failed |
| explicit oracle 4 | 1 | 0 | Failed |
| explicit oracle 5 | 1 | 0 | Failed |
| explicit oracle 6 | 2 | 1 | Failed |
| explicit oracle 7 | 3 | 2 | Failed |
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | 0 | 0 | Passed |
| explicit oracle 1 | 0 | 1 | Failed |
| explicit oracle 2 | 124 | 125 | Failed |
| explicit oracle 3 | 0 | 0 | Passed |
| explicit oracle 4 | 0 | 0 | Passed |
| explicit oracle 5 | 0 | 0 | Passed |
| explicit oracle 6 | 0 | 1 | Failed |
| explicit oracle 7 | 1 | 2 | Failed |
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | 0 | 0 | Passed |
| explicit oracle 1 | 1 | 1 | Passed |
| explicit oracle 2 | 125 | 125 | Passed |
| explicit oracle 3 | 0 | 0 | Passed |
| explicit oracle 4 | 0 | 0 | Passed |
| explicit oracle 5 | 0 | 0 | Passed |
| explicit oracle 6 | 1 | 1 | Passed |
| explicit oracle 7 | 2 | 2 | Passed |
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