core/pyproject.toml
Shay 34295e55ce perf(test-infra): pytest-xdist + module-scoped demo fixtures
Full lane wall-time: 6:35 → 2:25 (2.7× speedup).  No behavioral
changes; same 1933 passed, 2 skipped.

Three wins, biggest first:

1. pytest-xdist as a project dependency.

   ``pyproject.toml`` gains ``pytest-xdist>=3.6``.  ``cmd_test``
   injects ``-n auto`` for ``--suite full`` when xdist is importable;
   curated suites stay single-process because worker-spawn overhead
   is net-negative on the smaller suites.  Operator can override
   via passing ``-n <N>`` or ``--dist`` explicitly.

   Verified: ``core test --suite full -q`` prints ``bringing up
   nodes...`` and parallelises across the runner's CPUs.

2. Module-scoped fixture for run_demo() in test_learning_loop_demo.py.

   The 7 demo tests each previously called ``run_demo(emit_json=True)``
   from scratch — and ``run_demo`` itself runs the cognition lane
   twice via the replay-equivalence gate.  ~15s/file → ~3s/file.

   Module scope (not session) is intentional: pytest-xdist
   distributes by test, so a session-scoped fixture would still be
   re-evaluated per worker that picks up a test from this file.
   Module scope keeps the cost paid once per worker per file, which
   is the actual lower bound.

3. Module-scoped fixture for the teaching-loop bench.

   ``test_teaching_loop_bench.py``'s 5 tests previously each ran
   ``run_teaching_loop_determinism(runs=2 or 3)`` — 12 pipeline
   invocations across the file.  One ``runs=3`` invocation shared
   across all 5 tests covers every assertion: ~25s → ~7s.

For local iteration, ``core test --suite cognition -q`` etc. remain
fast (no xdist overhead).  The full-lane speedup is most visible
under CI / pre-merge runs.
2026-05-18 16:12:27 -07:00

49 lines
883 B
TOML

[project]
name = "core-versor"
version = "0.1.0"
description = "Versor Engine: cognitive field system on Cl(4,1) Conformal Geometric Algebra"
requires-python = ">=3.11"
dependencies = [
"hypothesis>=6.152.7",
"numpy>=1.26",
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
"pytest-xdist>=3.6",
"pyyaml>=6.0",
"ruff>=0.15.12",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-asyncio>=0.23",
"hypothesis>=6.100",
]
[project.scripts]
core = "core.cli:main"
[tool.setuptools.packages.find]
where = ["."]
include = [
"algebra*",
"alignment*",
"chat*",
"core*",
"field*",
"formation*",
"generate*",
"ingest*",
"language_packs*",
"morphology*",
"persona*",
"sensorium*",
"session*",
"vault*",
"vocab*",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]