Days

Days

Days AGO, an exact safe-horizon network simulator whose Scalar, CPU, Metal, and CUDA backends produce byte-identical complete state.

Days simulates packet networks exactly and in parallel. Its executor, Days AGO (Adaptive Guaranteed Ordering), compiles a TOML scenario into a SimulationImage, splits the network into logical processes (LPs), and advances them concurrently in rounds bounded by a safe horizon. Lean proofs in lean/DaysExecutor/ show that round execution reaches the same result as serial execution in canonical event order.

Four backends run the same image:

BackendWhere it runs
Scalarone CPU thread; the reference oracle
CPUa multicore worker pool
MetalApple GPUs (not the M1 family)
CUDANVIDIA GPUs (built for sm_86, sm_89 and sm_121)

Every backend that accepts a scenario produces byte-identical complete state. A backend that cannot run a mechanism rejects the scenario at validation with a message naming the backend; it never falls back silently.

What Days AGO models

  • Topologies: fat-tree, torus, dragonfly, and custom graphs.
  • Transport: deterministic packet-distribution sources, closed-loop TCP Reno and CUBIC, and DCQCN with CNP.
  • Switches: FIFO, strict-priority, DRR, WRR, and exact-rational WFQ scheduling; TailDrop, ECN-threshold, RED, and RED-with-ECN admission; PFC.
  • Collectives: ring all-reduce and all-gather over TCP, with delay-only compute stages.

DCQCN and PFC run on all four backends. RED, collectives, and compute stages run on the Scalar and CPU backends; Metal and CUDA reject those scenarios at validation.

What makes it exact

  • Integer time and canonical order. Events carry integer-nanosecond time and a canonical key (time_ns, phase, origin_node, origin_seq); no floating point appears in simulation semantics.
  • Byte identity across backends. The CPU pool and each compiled device backend must reproduce the Scalar oracle's complete result byte for byte. Device backends omit only diagnostic-only observation planes, which the comparison excludes.
  • Refuse-or-run device capacity. The device planner derives every arena capacity from the image before execution. An attempt that runs out of capacity is discarded and retried with larger floors; nothing is dropped silently. The largest committed fixture, configs/benchmarks/lookahead/rq9_frontier_closed_k32.toml, has 262,144 closed-loop TCP flows.

Quick start

From the repository root, run the Scalar oracle on the smoke fixture. The last line it prints, record=days_result, fingerprints the complete result. Every other engine that accepts the scenario must print the same fingerprint; the TCP corpus gate checks this fixture on each available backend.

cargo run --release --bin days -- --engine scalar \
  configs/benchmarks/tcp/fattree_k4_tcp_cubic_f16_smoke.toml

The quickstart covers the CPU, Metal, and CUDA engines.

Legacy Days

The original actor-model simulator on the Nexosim runtime is frozen in legacy/ as the days-legacy crate and still runs. It is documented in its own section: Legacy Days.

Where to go next

On this page