FAILURE MAP
← Case archive

FA-15251 / Numerics / Open access

Restricted growth strings: block budget pruning · case 01

The exact restricted growth strings result violates the stated contract at block budget pruning.

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

ROOT CAUSE

The block budget pruning step uses v==0 instead of v>=B.

VERIFIED REPAIR

Use v>=B at the block budget pruning step.

Unsuccessful approach: The partial repair v>=B-1 still violates the block budget pruning invariant.

Case contract

Input length n (1..6), maximum blocks B>=1; return lexicographic restricted-growth strings a0=0, a_i<=1+max(prefix), using exactly B blocks.

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):
    n,B=x;out=[]
    def visit(prefix,m):
     if len(prefix)==n:
      if m+1==B:out.append(prefix)
      return
     for v in range(m+2):
      if v==0:continue
      visit(prefix+[v],max(m,v))
    visit([0],0)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 1], [[0, 0]]), ([1, 1], [[0]]), ([6, 7], []), ([1, 2], []), ([2, 2], [[0, 1]]), ([2, 3], []), ([3, 1], [[0, 0, 0]]), ([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]])], [([3, 1], [[0, 0, 0]]), ([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]]), ([1, 1], [[0]]), ([6, 7], []), ([5, 4], [[0, 0, 1, 2, 3], [0, 1, 0, 2, 3], [0, 1, 1, 2, 3], [0, 1, 2, 0, 3], [0, 1, 2, 1, 3], [0, 1, 2, 2, 3], [0, 1, 2, 3, 0], [0, 1, 2, 3, 1], [0, 1, 2, 3, 2], [0, 1, 2, 3, 3]]), ([5, 5], [[0, 1, 2, 3, 4]]), ([5, 6], []), ([6, 1], [[0, 0, 0, 0, 0, 0]])], [([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]]), ([4, 2], [[0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1]]), ([1, 1], [[0]]), ([6, 7], []), ([3, 3], [[0, 1, 2]]), ([3, 4], []), ([4, 1], [[0, 0, 0, 0]]), ([4, 3], [[0, 0, 1, 2], [0, 1, 0, 2], [0, 1, 1, 2], [0, 1, 2, 0], [0, 1, 2, 1], [0, 1, 2, 2]])], [([4, 1], [[0, 0, 0, 0]]), ([5, 1], [[0, 0, 0, 0, 0]]), ([1, 1], [[0]]), ([6, 7], []), ([6, 5], [[0, 0, 1, 2, 3, 4], [0, 1, 0, 2, 3, 4], [0, 1, 1, 2, 3, 4], [0, 1, 2, 0, 3, 4], [0, 1, 2, 1, 3, 4], [0, 1, 2, 2, 3, 4], [0, 1, 2, 3, 0, 4], [0, 1, 2, 3, 1, 4], [0, 1, 2, 3, 2, 4], [0, 1, 2, 3, 3, 4], [0, 1, 2, 3, 4, 0], [0, 1, 2, 3, 4, 1], [0, 1, 2, 3, 4, 2], [0, 1, 2, 3, 4, 3], [0, 1, 2, 3, 4, 4]]), ([6, 6], [[0, 1, 2, 3, 4, 5]]), ([1, 2], []), ([2, 1], [[0, 0]])], [([4, 2], [[0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1]]), ([5, 4], [[0, 0, 1, 2, 3], [0, 1, 0, 2, 3], [0, 1, 1, 2, 3], [0, 1, 2, 0, 3], [0, 1, 2, 1, 3], [0, 1, 2, 2, 3], [0, 1, 2, 3, 0], [0, 1, 2, 3, 1], [0, 1, 2, 3, 2], [0, 1, 2, 3, 3]]), ([1, 1], [[0]]), ([6, 7], []), ([5, 1], [[0, 0, 0, 0, 0]]), ([5, 2], [[0, 0, 0, 0, 1], [0, 0, 0, 1, 0], [0, 0, 0, 1, 1], [0, 0, 1, 0, 0], [0, 0, 1, 0, 1], [0, 0, 1, 1, 0], [0, 0, 1, 1, 1], [0, 1, 0, 0, 0], [0, 1, 0, 0, 1], [0, 1, 0, 1, 0], [0, 1, 0, 1, 1], [0, 1, 1, 0, 0], [0, 1, 1, 0, 1], [0, 1, 1, 1, 0], [0, 1, 1, 1, 1]]), ([5, 3], [[0, 0, 0, 1, 2], [0, 0, 1, 0, 2], [0, 0, 1, 1, 2], [0, 0, 1, 2, 0], [0, 0, 1, 2, 1], [0, 0, 1, 2, 2], [0, 1, 0, 0, 2], [0, 1, 0, 1, 2], [0, 1, 0, 2, 0], [0, 1, 0, 2, 1], [0, 1, 0, 2, 2], [0, 1, 1, 0, 2], [0, 1, 1, 1, 2], [0, 1, 1, 2, 0], [0, 1, 1, 2, 1], [0, 1, 1, 2, 2], [0, 1, 2, 0, 0], [0, 1, 2, 0, 1], [0, 1, 2, 0, 2], [0, 1, 2, 1, 0], [0, 1, 2, 1, 1], [0, 1, 2, 1, 2], [0, 1, 2, 2, 0], [0, 1, 2, 2, 1], [0, 1, 2, 2, 2]]), ([5, 5], [[0, 1, 2, 3, 4]])]]
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 0[][[0, 0]]Failed
explicit oracle 1[[0]][[0]]Passed
explicit oracle 2[][]Passed
explicit oracle 3[][]Passed
explicit oracle 4[[0, 1]][[0, 1]]Passed
explicit oracle 5[][]Passed
explicit oracle 6[][[0, 0, 0]]Failed
explicit oracle 7[[0, 1, 1]][[0, 0, 1], [0, 1, 0], [0, 1, 1]]Failed

SHA-256 / 95a92b2fa0d27cb2cc7b6d7a3be24c094c8e9c9272224d3fa6e737421efcafdd

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):
    n,B=x;out=[]
    def visit(prefix,m):
     if len(prefix)==n:
      if m+1==B:out.append(prefix)
      return
     for v in range(m+2):
      if v>=B-1:continue
      visit(prefix+[v],max(m,v))
    visit([0],0)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 1], [[0, 0]]), ([1, 1], [[0]]), ([6, 7], []), ([1, 2], []), ([2, 2], [[0, 1]]), ([2, 3], []), ([3, 1], [[0, 0, 0]]), ([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]])], [([3, 1], [[0, 0, 0]]), ([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]]), ([1, 1], [[0]]), ([6, 7], []), ([5, 4], [[0, 0, 1, 2, 3], [0, 1, 0, 2, 3], [0, 1, 1, 2, 3], [0, 1, 2, 0, 3], [0, 1, 2, 1, 3], [0, 1, 2, 2, 3], [0, 1, 2, 3, 0], [0, 1, 2, 3, 1], [0, 1, 2, 3, 2], [0, 1, 2, 3, 3]]), ([5, 5], [[0, 1, 2, 3, 4]]), ([5, 6], []), ([6, 1], [[0, 0, 0, 0, 0, 0]])], [([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]]), ([4, 2], [[0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1]]), ([1, 1], [[0]]), ([6, 7], []), ([3, 3], [[0, 1, 2]]), ([3, 4], []), ([4, 1], [[0, 0, 0, 0]]), ([4, 3], [[0, 0, 1, 2], [0, 1, 0, 2], [0, 1, 1, 2], [0, 1, 2, 0], [0, 1, 2, 1], [0, 1, 2, 2]])], [([4, 1], [[0, 0, 0, 0]]), ([5, 1], [[0, 0, 0, 0, 0]]), ([1, 1], [[0]]), ([6, 7], []), ([6, 5], [[0, 0, 1, 2, 3, 4], [0, 1, 0, 2, 3, 4], [0, 1, 1, 2, 3, 4], [0, 1, 2, 0, 3, 4], [0, 1, 2, 1, 3, 4], [0, 1, 2, 2, 3, 4], [0, 1, 2, 3, 0, 4], [0, 1, 2, 3, 1, 4], [0, 1, 2, 3, 2, 4], [0, 1, 2, 3, 3, 4], [0, 1, 2, 3, 4, 0], [0, 1, 2, 3, 4, 1], [0, 1, 2, 3, 4, 2], [0, 1, 2, 3, 4, 3], [0, 1, 2, 3, 4, 4]]), ([6, 6], [[0, 1, 2, 3, 4, 5]]), ([1, 2], []), ([2, 1], [[0, 0]])], [([4, 2], [[0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1]]), ([5, 4], [[0, 0, 1, 2, 3], [0, 1, 0, 2, 3], [0, 1, 1, 2, 3], [0, 1, 2, 0, 3], [0, 1, 2, 1, 3], [0, 1, 2, 2, 3], [0, 1, 2, 3, 0], [0, 1, 2, 3, 1], [0, 1, 2, 3, 2], [0, 1, 2, 3, 3]]), ([1, 1], [[0]]), ([6, 7], []), ([5, 1], [[0, 0, 0, 0, 0]]), ([5, 2], [[0, 0, 0, 0, 1], [0, 0, 0, 1, 0], [0, 0, 0, 1, 1], [0, 0, 1, 0, 0], [0, 0, 1, 0, 1], [0, 0, 1, 1, 0], [0, 0, 1, 1, 1], [0, 1, 0, 0, 0], [0, 1, 0, 0, 1], [0, 1, 0, 1, 0], [0, 1, 0, 1, 1], [0, 1, 1, 0, 0], [0, 1, 1, 0, 1], [0, 1, 1, 1, 0], [0, 1, 1, 1, 1]]), ([5, 3], [[0, 0, 0, 1, 2], [0, 0, 1, 0, 2], [0, 0, 1, 1, 2], [0, 0, 1, 2, 0], [0, 0, 1, 2, 1], [0, 0, 1, 2, 2], [0, 1, 0, 0, 2], [0, 1, 0, 1, 2], [0, 1, 0, 2, 0], [0, 1, 0, 2, 1], [0, 1, 0, 2, 2], [0, 1, 1, 0, 2], [0, 1, 1, 1, 2], [0, 1, 1, 2, 0], [0, 1, 1, 2, 1], [0, 1, 1, 2, 2], [0, 1, 2, 0, 0], [0, 1, 2, 0, 1], [0, 1, 2, 0, 2], [0, 1, 2, 1, 0], [0, 1, 2, 1, 1], [0, 1, 2, 1, 2], [0, 1, 2, 2, 0], [0, 1, 2, 2, 1], [0, 1, 2, 2, 2]]), ([5, 5], [[0, 1, 2, 3, 4]])]]
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 0[][[0, 0]]Failed
explicit oracle 1[[0]][[0]]Passed
explicit oracle 2[][]Passed
explicit oracle 3[][]Passed
explicit oracle 4[][[0, 1]]Failed
explicit oracle 5[][]Passed
explicit oracle 6[][[0, 0, 0]]Failed
explicit oracle 7[][[0, 0, 1], [0, 1, 0], [0, 1, 1]]Failed

SHA-256 / c35abddabb42feab0182c6cf5a5509b488f3ba4c362616f570359cd4bbbfa8d4

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):
    n,B=x;out=[]
    def visit(prefix,m):
     if len(prefix)==n:
      if m+1==B:out.append(prefix)
      return
     for v in range(m+2):
      if v>=B:continue
      visit(prefix+[v],max(m,v))
    visit([0],0)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 1], [[0, 0]]), ([1, 1], [[0]]), ([6, 7], []), ([1, 2], []), ([2, 2], [[0, 1]]), ([2, 3], []), ([3, 1], [[0, 0, 0]]), ([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]])], [([3, 1], [[0, 0, 0]]), ([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]]), ([1, 1], [[0]]), ([6, 7], []), ([5, 4], [[0, 0, 1, 2, 3], [0, 1, 0, 2, 3], [0, 1, 1, 2, 3], [0, 1, 2, 0, 3], [0, 1, 2, 1, 3], [0, 1, 2, 2, 3], [0, 1, 2, 3, 0], [0, 1, 2, 3, 1], [0, 1, 2, 3, 2], [0, 1, 2, 3, 3]]), ([5, 5], [[0, 1, 2, 3, 4]]), ([5, 6], []), ([6, 1], [[0, 0, 0, 0, 0, 0]])], [([3, 2], [[0, 0, 1], [0, 1, 0], [0, 1, 1]]), ([4, 2], [[0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1]]), ([1, 1], [[0]]), ([6, 7], []), ([3, 3], [[0, 1, 2]]), ([3, 4], []), ([4, 1], [[0, 0, 0, 0]]), ([4, 3], [[0, 0, 1, 2], [0, 1, 0, 2], [0, 1, 1, 2], [0, 1, 2, 0], [0, 1, 2, 1], [0, 1, 2, 2]])], [([4, 1], [[0, 0, 0, 0]]), ([5, 1], [[0, 0, 0, 0, 0]]), ([1, 1], [[0]]), ([6, 7], []), ([6, 5], [[0, 0, 1, 2, 3, 4], [0, 1, 0, 2, 3, 4], [0, 1, 1, 2, 3, 4], [0, 1, 2, 0, 3, 4], [0, 1, 2, 1, 3, 4], [0, 1, 2, 2, 3, 4], [0, 1, 2, 3, 0, 4], [0, 1, 2, 3, 1, 4], [0, 1, 2, 3, 2, 4], [0, 1, 2, 3, 3, 4], [0, 1, 2, 3, 4, 0], [0, 1, 2, 3, 4, 1], [0, 1, 2, 3, 4, 2], [0, 1, 2, 3, 4, 3], [0, 1, 2, 3, 4, 4]]), ([6, 6], [[0, 1, 2, 3, 4, 5]]), ([1, 2], []), ([2, 1], [[0, 0]])], [([4, 2], [[0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1]]), ([5, 4], [[0, 0, 1, 2, 3], [0, 1, 0, 2, 3], [0, 1, 1, 2, 3], [0, 1, 2, 0, 3], [0, 1, 2, 1, 3], [0, 1, 2, 2, 3], [0, 1, 2, 3, 0], [0, 1, 2, 3, 1], [0, 1, 2, 3, 2], [0, 1, 2, 3, 3]]), ([1, 1], [[0]]), ([6, 7], []), ([5, 1], [[0, 0, 0, 0, 0]]), ([5, 2], [[0, 0, 0, 0, 1], [0, 0, 0, 1, 0], [0, 0, 0, 1, 1], [0, 0, 1, 0, 0], [0, 0, 1, 0, 1], [0, 0, 1, 1, 0], [0, 0, 1, 1, 1], [0, 1, 0, 0, 0], [0, 1, 0, 0, 1], [0, 1, 0, 1, 0], [0, 1, 0, 1, 1], [0, 1, 1, 0, 0], [0, 1, 1, 0, 1], [0, 1, 1, 1, 0], [0, 1, 1, 1, 1]]), ([5, 3], [[0, 0, 0, 1, 2], [0, 0, 1, 0, 2], [0, 0, 1, 1, 2], [0, 0, 1, 2, 0], [0, 0, 1, 2, 1], [0, 0, 1, 2, 2], [0, 1, 0, 0, 2], [0, 1, 0, 1, 2], [0, 1, 0, 2, 0], [0, 1, 0, 2, 1], [0, 1, 0, 2, 2], [0, 1, 1, 0, 2], [0, 1, 1, 1, 2], [0, 1, 1, 2, 0], [0, 1, 1, 2, 1], [0, 1, 1, 2, 2], [0, 1, 2, 0, 0], [0, 1, 2, 0, 1], [0, 1, 2, 0, 2], [0, 1, 2, 1, 0], [0, 1, 2, 1, 1], [0, 1, 2, 1, 2], [0, 1, 2, 2, 0], [0, 1, 2, 2, 1], [0, 1, 2, 2, 2]]), ([5, 5], [[0, 1, 2, 3, 4]])]]
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 0[[0, 0]][[0, 0]]Passed
explicit oracle 1[[0]][[0]]Passed
explicit oracle 2[][]Passed
explicit oracle 3[][]Passed
explicit oracle 4[[0, 1]][[0, 1]]Passed
explicit oracle 5[][]Passed
explicit oracle 6[[0, 0, 0]][[0, 0, 0]]Passed
explicit oracle 7[[0, 0, 1], [0, 1, 0], [0, 1, 1]][[0, 0, 1], [0, 1, 0], [0, 1, 1]]Passed

SHA-256 / 782fcd41a6db6e6ada73590b16e51f3e747998b85e4405b41914de1d5b593ab4

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

Case digest / de860b729f6d65757de053d58fb0c7bc8cd4cfb54c206bf8469d32e886f9156a