Skip to content

AntHill.Harness: general scriptable sim + engine validation harness #353

Closed

Description

@nockawa

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.Harness or a shared scenario library.
  • Relationship to the existing Typhon.Engine.Tests suite — 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-t0 scenario knob.

Related

Activity

  1. self-assigned this
    on May 16, 2026
  2. added
    testing
    on May 16, 2026
  3. moved this to Ready in Typhon devon May 16, 2026
  4. moved this from Ready to In Progress in Typhon devon May 18, 2026
  5. nockawa commented on May 18, 2026

    @nockawa
    CollaboratorAuthor

    Approved implementation plan

    Full scope, branch feature/353-validation-harness. Design doc: claude/design/AntHill/ScriptableValidationHarness.md.

    Decisions

    1. public const AntCount/WorldSize kept as defaults — TyphonBridge gains an instance ScenarioConfig defaulting to them, so AntHill.Demo is unchanged.
    2. New dependency: YamlDotNet on AntHill.Harness.
    3. New test project: demo/AntHill/AntHill.Harness.Tests (NUnit) + Typhon.slnx entry.
    4. Worker sweep = in-process sequential runs for v1; child-process isolation deferred.
    5. WorldSize stays fixed at 20000 (compile-time const web).

    Acceptance Criteria

    1. ScenarioConfig in AntHill.Core; TyphonBridge accepts it (optional, defaults to today's consts); AntHill.Demo builds + runs unchanged.
    2. TyphonBridge internals (the _soldierPositions field init, workerCount const, worker buffers, spawn RNG seeds) driven by ScenarioConfig.
    3. TierMode.UniformT0 → all cells Tier0; Camera preserves the distance rings.
    4. --scenario <file.yaml> loads a schema-validated YAML scenario; malformed → loud failure + non-zero exit.
    5. workers: [16,32,64,128] expands into 4 sequential runs; each emits a distinctly-named .typhon-trace.
    6. Failure detection: exception/engine error → FAIL; wall-clock watchdog FAILs a stalled run; true-invariant assertions; non-zero exit on any FAIL.
    7. One invocation runs all sweep points; emits human-readable + JSON report.
    8. scenarios/anthill-500k-stress.yaml exists, validates, smoke-runs green.
    9. AntHill.Harness.Tests + full Typhon.Engine.Tests suite green.
    10. Code-review gate passes.

    Order: AC1/2 (config plumbing) → AC3 (tier mode) → AC4 (YAML loader) → AC5/6/7 (runner) → AC8 (scenario file).

  6. moved this from In Progress to Done in Typhon devon May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

testing

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions