FA-15186 / Numerics / Open access
Combinadic unrank: increasing combination output · case 01
The exact combinadic unrank result violates the stated contract at increasing combination output.
ROOT CAUSE
The increasing combination output step uses out instead of out[::-1].
THE FAILURE
The increasing combination output step uses out instead of out[::-1].
Unsuccessful approach: The partial repair out[:-1][::-1] still violates the increasing combination output invariant.
Case contract
Input [k,r], k>=1 and r>=0; unique increasing combination of k nonnegative integers with colex rank r. Bounds: 1<=k<=5 and 0<=r<=49.
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):
k,r=x;out=[];ceiling=r+k+1
for j in range(k,0,-1):
a=ceiling-1
for _ in range(200):
if a<j or math.comb(a,j)<=r:break
a-=1
out.append(a)
r=r-(math.comb(a,j) if a>=j else 0)
ceiling=a
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 0], [0, 1]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([1, 1], [1]), ([1, 2], [2]), ([1, 3], [3]), ([1, 4], [4]), ([1, 5], [5])], [([2, 1], [0, 2]), ([1, 3], [3]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([1, 17], [17]), ([1, 18], [18]), ([1, 19], [19]), ([1, 20], [20])], [([2, 2], [1, 2]), ([1, 6], [6]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([1, 34], [34]), ([1, 35], [35]), ([1, 36], [36]), ([1, 37], [37])], [([2, 3], [0, 3]), ([1, 9], [9]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([2, 1], [0, 2]), ([2, 2], [1, 2]), ([2, 4], [1, 3]), ([2, 5], [2, 3])], [([2, 4], [1, 3]), ([1, 12], [12]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([2, 18], [3, 6]), ([2, 19], [4, 6]), ([2, 20], [5, 6]), ([2, 21], [0, 7])]]
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] | [0, 1] | Failed |
| explicit oracle 1 | [0] | [0] | Passed |
| explicit oracle 2 | [7, 6, 5, 3, 0] | [0, 3, 5, 6, 7] | Failed |
| explicit oracle 3 | [1] | [1] | Passed |
| explicit oracle 4 | [2] | [2] | Passed |
| explicit oracle 5 | [3] | [3] | Passed |
| explicit oracle 6 | [4] | [4] | Passed |
| explicit oracle 7 | [5] | [5] | Passed |
SHA-256 / 2a568ca04b2f07c21f26d849b26377bde5a48a49317e0119265c989c980bc80e
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):
k,r=x;out=[];ceiling=r+k+1
for j in range(k,0,-1):
a=ceiling-1
for _ in range(200):
if a<j or math.comb(a,j)<=r:break
a-=1
out.append(a)
r=r-(math.comb(a,j) if a>=j else 0)
ceiling=a
return out[:-1][::-1]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 0], [0, 1]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([1, 1], [1]), ([1, 2], [2]), ([1, 3], [3]), ([1, 4], [4]), ([1, 5], [5])], [([2, 1], [0, 2]), ([1, 3], [3]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([1, 17], [17]), ([1, 18], [18]), ([1, 19], [19]), ([1, 20], [20])], [([2, 2], [1, 2]), ([1, 6], [6]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([1, 34], [34]), ([1, 35], [35]), ([1, 36], [36]), ([1, 37], [37])], [([2, 3], [0, 3]), ([1, 9], [9]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([2, 1], [0, 2]), ([2, 2], [1, 2]), ([2, 4], [1, 3]), ([2, 5], [2, 3])], [([2, 4], [1, 3]), ([1, 12], [12]), ([1, 0], [0]), ([5, 49], [0, 3, 5, 6, 7]), ([2, 18], [3, 6]), ([2, 19], [4, 6]), ([2, 20], [5, 6]), ([2, 21], [0, 7])]]
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, 1] | Failed |
| explicit oracle 1 | [] | [0] | Failed |
| explicit oracle 2 | [3, 5, 6, 7] | [0, 3, 5, 6, 7] | Failed |
| explicit oracle 3 | [] | [1] | Failed |
| explicit oracle 4 | [] | [2] | Failed |
| explicit oracle 5 | [] | [3] | Failed |
| explicit oracle 6 | [] | [4] | Failed |
| explicit oracle 7 | [] | [5] | Failed |
SHA-256 / 9d1721190ea5495ff7949c6147a5dbd64d8a595fc0672b6eb47d694a9598d74a
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:24.117201+00:00.
Case digest / 0e4c4e765b09565c0152c3044cc4706fb03bf2d60fb76afb2ecd5bd89c3e35fd