arborist/docs/_source/bench.rst
russell@unturf.com bae5cafe9a
CLI: arborist v8 score → arborist substrate score
Followup to 654d923 (which moved the package from arborist/v8/ →
arborist/substrate/ at the file layer). The CLI surface still baked
in `v8` so a new operator running `--help` would see
``arborist v8 score`` and ask the same "what's v8 vs v9.8?"
naming-confusion question that drove the package rename in the
first place. Closing the loop end-to-end.

arborist/cli.py
===============

- Subparser renamed: ``"v8"`` → ``"substrate"``; help string updated
  to "Merkle-AGI substrate primitives (ForkScore + future paper
  specs)" so the dir name and command name and help text all align.
- Inner subparser dest renamed: ``v8_op`` → ``substrate_op``.
- Function renamed: ``_cmd_v8_score`` → ``_cmd_substrate_score``;
  docstring updated.
- All ``v8_score`` local variables renamed to ``substrate_score``.
- New comment block above the subparser block explains the rename
  + why the v-prefix was retired (substrate-paper version vs v9.8
  schema version naming collision).

The old ``arborist v8 score`` is gone — no alias preserved. CI + ops
scripts must update; today's earlier commit chain has been the only
place using it and that's been refreshed in lock-step.

tests/test_v8_fork_score.py
===========================

- 4 ``parser.parse_args(["v8", "score", ...])`` calls → ``["substrate", ...]``.
- 4 test functions renamed: ``test_cli_v8_score_*`` →
  ``test_cli_substrate_score_*``.
- Module docstring + section comment + helper docstring updated.

Filename intentionally kept as ``test_v8_fork_score.py`` for git
history continuity; pytest discovers by ``test_*`` content, not
filename. Renaming the file would muddle ``git log --follow`` for
the test surface.

Docs refreshed
==============

- docs/v8-fork-score.md — §5 CLI block invocation.
- docs/_source/v8-fork-score.rst — :code-block:: bash invocation.
- docs/_source/bench.rst — invocation in `### v8 ForkScore` section.
- docs/tickets/ticket-000012-selection-consensus-protocol.md —
  three references in §7 close-out + §7 Phase 1c proposal +
  §7 future-CLI-shape note.
- docs/dav1dprometheus-update-2026-05-09.md — bench journal mention.

Doc filenames (``v8-fork-score.{md,rst}``) kept stable since they
are URL identities; the file content explains the v8→substrate
rename internally. ``index.rst`` toctree references unchanged.

Hygiene
=======
- ``.venv/bin/arborist substrate score --help`` → 0 + valid usage.
- ``.venv/bin/arborist v8 score`` → exits non-zero (subcommand
  removed, surfaced cleanly in ``argparse`` error).
- ``make test`` → 1643 passed, 45 skipped.
- ``make chain-check-shards`` → 0 across all 7 shards.
- fox's parallel work in arborist/qa/{runner,verify}.py +
  arborist/qa/warrant_chain.py left untouched.
2026-05-10 09:12:34 -04:00

154 lines
6.4 KiB
ReStructuredText

Benchmark surface
=================
Arborist ships the complete **Dav1DPrometheus 5S/5T/5F/5R** evaluation
suite — 21 sub-batteries, **662+ deterministic fixtures** in the
default runner (Phase 1d expansion 2026-05-09) plus ~110 additional
math π* fixtures — as first-class infrastructure. Every benchmark is
reproducible, no LLM-as-judge, and many sub-batteries route through
the actual arborist surface (parser, verifier, audit chain, π*
registry) rather than synthetic gold output.
Quick reference
---------------
.. code-block:: bash
make bench-suite # complete 5S + 5T + 5F + 5R (662 tasks)
make bench-5s # representational discipline
make bench-5t # temporal / cross-reasoning
make bench-5f # operational quality (synthetic + live)
make bench-5r # workspace operators
# Per-π* 5S targets (#000030 SymPy substrate + the registry's text/
# arithmetic/logic core + the last-stub graduation):
make bench-5s-math # arithmetic@v1 + logic-kernel@v1
make bench-5s-code # code-py-ast@v1
make bench-5s-time-series # time-series-quantized@v1
make bench-5s-tabular # tabular-pinned@v1 (last reserved stub)
make bench-5s-algebra # algebra-symbolic@v1
make bench-5s-calculus-limit # calculus-limit@v1
make bench-5s-calculus-series # calculus-series@v1
make bench-5s-linear-algebra # linear-algebra@v1
make bench-5s-function-sampled # function-sampled@v1 (SymPy → time-series)
# Real-shard + selection + witness-divergence harness:
make bench-real-shard # #000026 — real-shard latency / audit baseline
make bench-fork-baseline # pin current bench output as ForkScore parent
make bench-fork-score # score child vs pinned parent (CI-gateable)
make bench-witness-divergence # extract LLM-divergence as 5F fixtures
Each invocation emits a JSON :class:`bench.batteries.base.BatteryResult`
with per-task pass/fail, fixture digest, runtime digest, and
sub-battery-specific metrics.
The four batteries
------------------
5S — representation discipline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Five sub-batteries testing what the system understands at the
sign / meaning / derivation level:
- **Syntax** — does the named π* parse the input without raising?
- **Semantics** — do two surface forms canonicalize to the same
bytes when they should (and not when they shouldn't)?
- **Syllogism** — does each step in a deductive chain validly
follow under the named rule (categorical_transitivity, chain_3,
invalid_converse, missing_premise)?
- **Synthesis** — does the system assemble cited facts into a
coherent derivation supported by the fact set?
- **Semiotics** — is meaning preserved under controlled label
swaps?
5T — temporal / cross-reasoning discipline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Six sub-batteries (legacy ``transfer`` plus the canonical
Dav1DPrometheus five):
- **Transfer Learning** — does a learned pattern carry across
task / domain / carrier?
- **Triangulation** — do independent strategies (substring,
token_subset, token_overlap, entity_match) agree at threshold?
- **Truthtables** — exhaustive propositional coverage at N=2..4
variables.
- **Transitivity** — typed-relation chains under whitelist
(``implies``, ``subset_of``, ``ancestor_of``, ``before``,
``less_than``).
- **Time** — temporal-context preservation across memory_root
snapshots; integrates with #000017 surface.
5F — operational quality
~~~~~~~~~~~~~~~~~~~~~~~~
Five sub-batteries, all with **embedded** (Phase 1a synthetic) AND
**live** (Phase 1b.2, routes through real arborist surfaces) modes:
================ =============================================
Sub-battery Live surface
================ =============================================
Function ``arborist.qa.parse_claims.parse_pointer_claims``
Finetuning ``arborist.selfmodel.store_snapshot`` round-trip
Falsification ``arborist.qa.verify.verify_quotes``
Formulate ``arborist.qa.parse_claims.parse_pointer_claims``
Feedback Loop ``arborist.store.append_audit`` + ``memory.snapshot``
================ =============================================
Per-task ``detail.source`` reports ``"embedded"`` or ``"live"`` so
bench output distinguishes synthetic from production signal.
5R — workspace operators
~~~~~~~~~~~~~~~~~~~~~~~~
Five sub-batteries testing operators applied to a workspace
(SelfModel + memory_root + audit chain):
- **React** — observations integrate into downstream state.
- **Rearrange** — restructure without semantic shift.
- **Restore** — retrieve prior facts from history.
- **Replicate** — π*-determinism across N replicas.
- **Resonate** — variance-zero across N runs.
Cross-modality discipline
-------------------------
Every fixture carries:
- ``carrier`` — domain whitelist enforced by
:data:`bench.batteries.base.PHASE_1_CARRIERS`. Phase 1
domains: ``text``, ``claim_lattice``, ``memory_snapshot``,
``selfmodel_snapshot``, ``providence_record``, ``audit_event``,
``code``, ``arithmetic``, ``logic``, ``time_series``.
- ``domain`` — sub-domain qualifier (e.g.,
``rational``, ``propositional``, ``python_ast``).
- ``pi_star_ref`` — registry key naming the canonicalizer.
- ``loss_report_refs`` — optional projection-loss links.
- ``modality_notes`` — scope note.
Unsupported carriers fail explicitly with
``reason="unsupported_carrier"`` — never silently accepted. Hidden-
channel work is defensive only (detection / flagging, never
generation).
ForkScore consumes battery output
---------------------------------
The v8 ForkScore (see :doc:`v8-fork-score`) reads BatteryResult JSON
from a parent and child organism, computes a weighted scalar
verdict with ACCEPT / MARGINAL / REJECT classes:
.. code-block:: bash
make bench-suite # generates parent.json
# ... apply changes ...
make bench-suite # generates child.json
arborist substrate score --parent parent.json --child child.json
Authoring new fixtures
----------------------
See :file:`docs/spec-methodology.md` (per-author checklist) and the
existing fixture files under :file:`bench/fixtures/`. New
sub-batteries follow the protocol in :mod:`bench.batteries.base`
``Battery.run(fixtures_path) → BatteryResult``, deterministic, no
LLM-as-judge, carrier metadata mandatory.