carsim-guide
VerifiedOperate and automate CarSim simulations from an agent, including safe output and parameter discovery, named Run Control execution contexts, structured overrides, isolated batch sweeps, dataset dependency inspection, control-mode selection, result validation, diagnostics, and version-aware CLI/Simulink/VS API routing. Use for executing, configuring, exploring, or debugging CarSim. Do not use for vehicle-dynamics theory alone, generic dataframe work, or unrelated simulators.
references/run-validation.md
View on GitHub# Run validation (core)
Two complementary layers, both core capabilities. Neither invents physics
adequacy: they prove the run executed as configured.
## Compile-time checks (before the solver)
`scenario_runner.verify_compiled` inspects the generated files and reports
structured errors: `TSTEP` (override.par) must equal `EXT_MODEL_STEP`
(simfile.sim); `DLLFILE` must pin the 64-bit solver; `PRODUCT_VER` must match
the pinned base version; the `WRT_` output list must be non-empty; the base
snapshot hash must still match the registry binding.
## Post-run checks
`validate_run.check_run(...) -> RunValidationResult(passed, issues, metrics)`
never raises. Issues carry `severity` (error / warning), a stable `code` and a
message:
- **errors** (fail the run): missing/empty `run.csv` or `run_echo.par`, stale
artifacts (mtime before run start), missing requested channels, non-numeric
or NaN/inf values, wrong sample count, time grid not strictly increasing on
the requested dt through TSTOP, echo parameter absent or mismatched,
movement threshold not met (when configured), solver stdout lacking
`Termination at simulation time`.
- **warnings** (pass with a note): `run_log.txt` absent (dataset provenance
not recorded).
`metrics` reports samples, final time, echoed parameter values and the
movement threshold. `validate_run(...)` is the compatibility wrapper: it
raises `ValueError` on the first error and returns the legacy metrics dict.
Echo validation uses exact `KEYWORD value` matches in `run_echo.par`
(rel 1e-6). It covers scalar keywords that echo line-by-line; keywords that
cannot be reliably extracted are reported as absent rather than assumed OK.
For table overrides, inspect the complete echoed table block and confirm the
result behavior. `SPEED_TARGET_TABLE` is a verified structured path; other
table families require confirmation in the target Run Control.
```python
from validate_run import check_run
result = check_run(run_dir, simulation, ["Vx", "AVz"], started_at=t0,
expected_parameters={"M_SU": 1250.0},
minimum_speed_mps=1.0, solver_stdout=stdout)
if not result.passed:
for issue in result.errors():
print(issue.code, issue.message)
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |