Skip to content

scripts/tau_sweep.py: hardcoded archetype_mix forces --agents 200 (validation error otherwise) #1

@hinanohart

Description

@hinanohart

Symptom

tau_sweep.py accepts --agents N but errors when N != 200:

$ python scripts/tau_sweep.py --seeds 5 --steps 200 --agents 50 --workers 6 --grid default
...
ValueError: archetype_mix sums to 200, but n_agents=50; they must be equal.

The archetype_mix array inside _build_config() is hardcoded to total 200, but --agents is a free parameter.

Workaround: --agents 200 works correctly.

$ python scripts/tau_sweep.py --seeds 5 --steps 200 --agents 200 --workers 6 --grid default
# → completes in 22.5s, prints τ=0 → 3.351, τ=0.05 → 1.275, τ=0.1 → 0.378 (cliff replicated)

Suggested fix

Three options:

  1. Scale archetype_mix to match n_agents — multiply each archetype's count by n_agents / 200, round, fix any rounding remainder by adding to the largest bucket. Most flexible.

  2. Reject --agents for tau_sweep, document the fixed N=200 — drop the CLI flag, hardcode n_agents=200 inside the script, update --help accordingly. Simpler, matches what already happens.

  3. Better error message — at minimum, the validation error should say "tau_sweep.py uses a fixed archetype_mix of size 200; use --agents 200 or remove this flag" rather than the cryptic dataclass __post_init__ error.

I'd go with option 2 unless you actually want to vary N for power analysis.

Repro

git clone https://github.com/hinanohart/dostosim
cd dostosim
pip install -e ".[dev]"
python scripts/tau_sweep.py --seeds 5 --steps 200 --agents 50 --workers 6
# → ValueError
python scripts/tau_sweep.py --seeds 5 --steps 200 --agents 200 --workers 6
# → 22.5s OK

run_ablation.py does not have this issue — it scales correctly with --agents.

Discovered while

Trial-running OSS in self-review (2026-04-28). Goal was to demonstrate measure-zero submanifold thesis (τ=0 cliff) at low cost; small --agents would have been faster, but the fixed N=200 made the demo take 26.5s instead of ~5s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions