Dynamic Topology Routing: Latest Implementation Findings
This page summarizes the current DyTopo implementation and the latest real run with
openai/gpt-5-mini workers and manager. Focus is on reproducible routing behavior,
reliability fixes, and practical output quality.
Code surface: dytopo/core.py, dytopo/embeddings.py,
dytopo/llm_adapters.py, dytopo/openai_client.py,
dytopo/prompts.py.
Latest Run Snapshot
Task: produce a concise API incident response runbook (triage steps, rollback criteria, postmortem template). DyTopo produced dense directed routing with strong inter-agent relevance scores, then manager halted after one round.
Representative edges:
critic -> developer (0.808),
critic -> tester (0.720),
developer -> tester (0.666),
researcher -> tester (0.644).
Full machine-readable trace: Open full trace (HTML) and raw JSON.
What Was Improved This Week
| Area | Change | Why it mattered |
|---|---|---|
| OpenAI transport | Added request timeout and output token cap in dytopo/openai_client.py. |
Prevents stuck runs and improves runtime predictability. |
| JSON robustness | Added one-shot repair retry for worker/manager parsing in dytopo/llm_adapters.py. |
Handles occasional malformed structured output without discarding the round. |
| Prompt control | Tightened field and length constraints in dytopo/prompts.py. |
Reduced truncation and parse failures in practical runs. |
| Embedding compatibility | Pinned a torch-compatible stack for MiniLM runs. | Restored stable 384-d embedding generation in this environment. |
Method Integrity
Single-Pass Rounds
Each worker runs once per round before any memory update.
Directed Routing
Edge j -> i exists only when sim(q_i, k_j) > tau_edge.
Deterministic Ordering
Incoming order by score desc then source id; global sigma(t) is deterministic.
Auditable Memory
Append-only blocks preserve provenance for each routed message.
Current Validation Status
Test suite currently reports 7 passed for routing correctness and parser reliability.
python -m pytest -q ....... [100%] 7 passed in 0.03s
Published Benchmarks
Correctness: HumanEval (shared tasks, same evaluator)
| Implementation | Tasks | pass@1 | Avg latency |
|---|---|---|---|
python_dytopo |
2 (HumanEval/25, HumanEval/132) |
0.0 | 164.6s |
dytopo_rs |
2 (HumanEval/25, HumanEval/132) |
0.0 | 173.8s |
Raw files: humaneval_py_vs_rs_n2.json and humaneval_py_vs_rs_n1.json.
Scope note: this correctness sample is small; expand to larger n for stable pass@1 ranking.
Runtime: Dynamic routing loop overhead
| Config | Python mean | dytopo-rs mean | Result |
|---|---|---|---|
tau=-1.0, 8 agents, 10 rounds, topk=3 |
17.76ms | 10.30ms | Rust ~1.72x faster |
tau=0.3, 8 agents, 10 rounds, topk=3 |
16.58ms | 8.25ms | Rust ~2.01x faster |
Raw files: dytopo_rs_vs_python_tau_neg1.json and dytopo_rs_vs_python_tau_0p3.json.
Reproducibility Commands
python -m pip install -e '.[dev]' python -m pip install -e '.[openai]' python -m pip install 'sentence-transformers==2.7.0' 'transformers==4.39.3' 'huggingface-hub==0.36.2' export OPENAI_API_KEY=... python -m dytopo.openai_run \ --task "Produce a concise on-call incident response runbook for a failing API service, including triage steps, rollback criteria, and a postmortem template." \ --t-max 1 --tau-edge 0.2 --k-in 3 --use-minilm
Interactive Routing Playground
Deterministic in-browser toy matrix to inspect how tau_edge and k_in alter topology.
This page is intentionally single-file and static for easy GitHub Pages publishing. Findings reflect repository state as of February 12, 2026.