arborist/bench/fixtures/5s
russell@unturf.com 7b7ac3867d
ticket #000032: combinatorics@v1 π* (pure-integer counting kernel)
A new π* kernel that canonicalizes pure-integer counting
expressions and FAILS CLOSED on any input whose result isn't a
non-negative sp.Integer. Tighter domain than algebra-symbolic@v1,
which already accepts the same input surface but happily returns
symbolic / negative / non-integer outputs.

Distinguishing feature versus algebra-symbolic@v1:
  algebra-symbolic@v1: binomial(n, k) → "binomial(n, k)" (symbolic
                       passthrough)
  combinatorics@v1:    binomial(n, k) → PiStarError (fail-closed
                       on free-symbol output)

  algebra-symbolic@v1: binomial(Rational(1,2), 3) → 1/16 (rational)
  combinatorics@v1:    binomial(Rational(1,2), 3) → PiStarError
                       (output not Integer)

Boundary kept explicit: binomial(-3, 2) = 6 IS accepted because the
output is an integer 6. The fail-closed rule is on output shape
(Integer ≥ 0), not input range. Documented as
test_generalized_binomial_negative_args_accepted_when_integer.

Output format: plain decimal literal (b"10", b"5040"). Composes
with arithmetic@v1 for byte-identical agreement with the rational
route (b"10/1") so the multi-modality witness (#000028) can pin
equivalence-class agreement when both routes fire on the same
question.

Allowed surface (via SymPy primitives): binomial, factorial, ff /
rf (falling/rising), catalan, bell, partition, stirling, plus
arithmetic compositions over those primitives
(3*binomial(5,2) + factorial(4) = 54).

Coverage:
- 43 unit tests including binomial symmetry C(n,k)=C(n,n-k),
  Pascal's rule C(n,k)=C(n-1,k-1)+C(n-1,k), the C(n,k) =
  factorial(n)/(factorial(k)·factorial(n-k)) identity,
  fail-closed paths (symbolic/negative/non-integer/relational/
  parse), round-trip idempotence, composition with arithmetic@v1.
- 10 syntax + 12 semantics bench fixtures, 100% pass.
- bench/batteries/base.py PHASE_1_CARRIERS gains "combinatorics".
- Makefile bench-5s-combinatorics target.

All gate on pytest.importorskip("sympy") so a sympy-less suite
stays green. Full make test: 1537 passed / 28 skipped.

Sequencing rationale honored: this kernel lands FIRST so that
#000033 (claim-pack pillar VII for combinatorics) can bind its
records to the tighter integer kernel from day one — avoids
rebind churn on pi_star_ref fields.
2026-05-09 13:20:29 -04:00
..
semantics-algebra-symbolic-v1.jsonl ticket #000030 Phases 1+2: algebra-symbolic@v1 + calculus-derivative@v1 2026-05-09 12:35:18 -04:00
semantics-arithmetic-v1.jsonl pi_star: arithmetic@v1 + logic-kernel@v1 graduate — math gets logic's coverage 2026-05-08 09:16:19 -04:00
semantics-calculus-limit-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
semantics-calculus-series-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
semantics-code-v1.jsonl pi_star: code-py-ast@v1 graduates from stub — first non-text canonicalizer 2026-05-08 08:50:07 -04:00
semantics-combinatorics-v1.jsonl ticket #000032: combinatorics@v1 π* (pure-integer counting kernel) 2026-05-09 13:20:29 -04:00
semantics-function-sampled-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
semantics-linear-algebra-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
semantics-logic-v1.jsonl pi_star: arithmetic@v1 + logic-kernel@v1 graduate — math gets logic's coverage 2026-05-08 09:16:19 -04:00
semantics-tabular-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
semantics-time-series-v1.jsonl pi_star: time-series-quantized@v1 graduates + Substrate docs section 2026-05-08 09:33:19 -04:00
semantics-v1.jsonl bench: ticket #000021 Phase 1a — 5S/5T harness skeleton + seed fixtures 2026-05-07 16:57:45 -04:00
semiotics-v1.jsonl bench: land #000023 + #000024 + #000025 (Phase 1a/1b — Dav1DPrometheus suite) 2026-05-07 20:14:44 -04:00
syllogism-v1.jsonl bench: land #000023 + #000024 + #000025 (Phase 1a/1b — Dav1DPrometheus suite) 2026-05-07 20:14:44 -04:00
syntax-algebra-symbolic-v1.jsonl ticket #000030 Phases 1+2: algebra-symbolic@v1 + calculus-derivative@v1 2026-05-09 12:35:18 -04:00
syntax-arithmetic-v1.jsonl pi_star: arithmetic@v1 + logic-kernel@v1 graduate — math gets logic's coverage 2026-05-08 09:16:19 -04:00
syntax-calculus-limit-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
syntax-calculus-series-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
syntax-code-v1.jsonl pi_star: code-py-ast@v1 graduates from stub — first non-text canonicalizer 2026-05-08 08:50:07 -04:00
syntax-combinatorics-v1.jsonl ticket #000032: combinatorics@v1 π* (pure-integer counting kernel) 2026-05-09 13:20:29 -04:00
syntax-function-sampled-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
syntax-linear-algebra-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
syntax-logic-v1.jsonl pi_star: arithmetic@v1 + logic-kernel@v1 graduate — math gets logic's coverage 2026-05-08 09:16:19 -04:00
syntax-tabular-v1.jsonl fan-out: 5 π* graduations close the registry chapter 2026-05-09 13:04:43 -04:00
syntax-time-series-v1.jsonl pi_star: time-series-quantized@v1 graduates + Substrate docs section 2026-05-08 09:33:19 -04:00
syntax-v1.jsonl bench: ticket #000021 Phase 1a — 5S/5T harness skeleton + seed fixtures 2026-05-07 16:57:45 -04:00
synthesis-v1.jsonl bench: land #000023 + #000024 + #000025 (Phase 1a/1b — Dav1DPrometheus suite) 2026-05-07 20:14:44 -04:00