Repository navigation
Closed
Labels
testingTest coverage, test infrastructure
Description
Context
Phase B follow-up to #352 (the AntHill three-project restructure). Once AntHill.Harness exists as a console app on top of AntHill.Core, grow it from "the old profiler runner" into a general scriptable simulation + engine validation harness.
The goal: a tool that can be run autonomously (by Claude or in CI) to catch engine regressions and validate new development — drive the AntHill sim through defined scenarios and assert on the outcome.
Scope — capabilities to build
- Declarative scenarios — define a workload without code: entity counts, system/runtime config, tick count / duration, seeded RNG. Multiple scenarios definable side by side.
- Deterministic, reproducible runs — a fixed seed produces a bit-identical run; the harness pins every nondeterminism source it can.
- Per-scenario assertions — expected outcomes the run is checked against: tick-time budgets (p50/p99), entity-count invariants, zero dropped profiler records, zero exceptions, zero engine-rule violations.
- Baseline capture + diff — record a baseline run (timings, counts, key metrics); diff subsequent runs against it and flag regressions beyond a tolerance.
- Pass/fail exit codes — non-zero on any failed assertion / regression, so CI and automation can gate on it.
- Batch + report — run all scenarios in one invocation; emit a human-readable + machine-readable (JSON) report.
- Profiler integration — keep the existing
--trace/ CPU-sampling capture; let a scenario opt into producing a.typhon-trace.
Open design questions
- Scenario definition format — JSON/TOML config vs. C# scenario classes vs. both.
- Where baselines live and how they are versioned (per-machine timings are noisy — diff on counts/invariants strictly, on timings with tolerance).
- Whether scenarios live in
AntHill.Harnessor a shared scenario library. - Relationship to the existing
Typhon.Engine.Testssuite — the harness validates whole-sim behavior + performance, complementary to unit tests.
Note: the four design questions above are resolved in the design doc (Q1 YAML, Q2 split baselines, Q3 in-Harness, Q4 fully separate), plus a fifth — the AntHill sim's tier/fidelity is camera-driven, addressed via a
tierMode: uniform-t0scenario knob.
Related
- Depends on Restructure AntHill into AntHill.Core / AntHill.Demo / AntHill.Harness #352 (Phase A — the structural split).
- Design:
claude/design/AntHill/ScriptableValidationHarness.md
Activity
nockawa commentedon May 18, 2026
Approved implementation plan
Full scope, branch
feature/353-validation-harness. Design doc:claude/design/AntHill/ScriptableValidationHarness.md.Decisions
public const AntCount/WorldSizekept as defaults —TyphonBridgegains an instanceScenarioConfigdefaulting to them, soAntHill.Demois unchanged.YamlDotNetonAntHill.Harness.demo/AntHill/AntHill.Harness.Tests(NUnit) +Typhon.slnxentry.WorldSizestays fixed at 20000 (compile-timeconstweb).Acceptance Criteria
ScenarioConfiginAntHill.Core;TyphonBridgeaccepts it (optional, defaults to today's consts);AntHill.Demobuilds + runs unchanged.TyphonBridgeinternals (the_soldierPositionsfield init,workerCountconst, worker buffers, spawn RNG seeds) driven byScenarioConfig.TierMode.UniformT0→ all cellsTier0;Camerapreserves the distance rings.--scenario <file.yaml>loads a schema-validated YAML scenario; malformed → loud failure + non-zero exit.workers: [16,32,64,128]expands into 4 sequential runs; each emits a distinctly-named.typhon-trace.scenarios/anthill-500k-stress.yamlexists, validates, smoke-runs green.AntHill.Harness.Tests+ fullTyphon.Engine.Testssuite green.Order: AC1/2 (config plumbing) → AC3 (tier mode) → AC4 (YAML loader) → AC5/6/7 (runner) → AC8 (scenario file).
AntHill.Harness: general scriptable sim + engine validation harness #353