How nvlabs/alpasim works
AlpaSim is a modular autonomous-driving research simulator. A researcher configures a run, the runtime schedules closed-loop rollouts, and policy, traffic, physics, controller, and sensor-rendering services provide successive simulation results for evaluation. The graph also preserves configuration/deployment, plugin extensibility, and log replay as distinct capabilities. README descriptions and the file tree support the broad service map; sampled excerpts confirm portions of runtime orchestration, controller invocation, and evaluation aggregation, but not every service call, so uncertain wiring is omitted.
Main entry points: event_loop.py Event loop · main.py Rollout worker · renderer.py Sensor rendering · runtime_evaluator.py Runtime evaluation
Components 21
Run setup
- Configuration and deployment
src/wizard/alpasim_wizard/wizard.py - Plugin registry
src/plugins/alpasim_plugins/plugins.py - Service contracts
src/grpc/alpasim_grpc/v0/runtime.proto
Simulation runtime
- Runtime daemon
src/runtime/alpasim_runtime/daemon/engine.py - Rollout scheduler
src/runtime/alpasim_runtime/daemon/scheduler.py - Rollout worker
src/runtime/alpasim_runtime/worker/main.py - Event loop
src/runtime/alpasim_runtime/event_loop.py - Scene loading
src/runtime/alpasim_runtime/scene_loader.py
Simulation services
- Driving policies
src/driver/src/alpasim_driver/main.py - Traffic simulation
src/trafficsim/alpasim_trafficsim/grpc/servicer.py - Vehicle physics
src/physics/alpasim_physics/server.py - Controller and vehicle
src/controller/alpasim_controller/system_manager.py - Sensor rendering
src/runtime/alpasim_runtime/services/renderer.py
Evaluation and replay
- Runtime evaluation
src/eval/src/eval/runtime_evaluator.py - Metric scorers
src/eval/src/eval/scorers/base.py - Result aggregation
src/eval/src/eval/aggregation/main.py - Log replay
src/runtime/alpasim_runtime/replay_services/asl_reader.py - Simulation logs
src/utils/alpasim_utils/artifact.py
Other components
- Researcher
- NuRec renderer
- Video-model renderer
Connections 21
- Researcher → Configuration and deployment: configures
- Configuration and deployment → Runtime daemon: starts run
- Plugin registry → Driving policies: registers models
- Runtime daemon → Rollout scheduler: submits rollouts
- Rollout scheduler → Rollout worker: dispatches jobs
- Rollout worker → Scene loading: loads scene
- Rollout worker → Event loop: runs rollout
- Event loop → Driving policies: requests trajectory
- Event loop → Traffic simulation: requests traffic
- Event loop → Vehicle physics: requests physics
- Event loop → Controller and vehicle: requests control
- Event loop → Sensor rendering: requests sensors
- Sensor rendering → NuRec renderer: renders with
- Sensor rendering → Video-model renderer: renders with
- Rollout worker → Runtime evaluation: evaluates rollout
- Runtime evaluation → Metric scorers: computes metrics
- Runtime evaluation → Simulation logs: writes artifacts
- Result aggregation → Simulation logs: reads logs
- Researcher → Result aggregation: reviews results
- Log replay → Simulation logs: reads recordings
- Service contracts → Runtime daemon: defines API