Host tools#

Tools that run on a computer. None of them needs a board. The descriptions below are the tools’ own docstrings.

ocm_report.py#

Turns the session files from the SD card into one HTML report per drive and a summary for Dashy. See Dashboard.

    python3 tools/ocm_report.py /Volumes/SDCARD/obd dashboard/site
    python3 tools/ocm_report.py /Volumes/SDCARD/obd dashboard/site --watch 30

The input is the card's `obd` folder, its `sessions` folder, or any folder that holds sNNNNNN.csv files. For each
session the tool writes sNNNNNN.html (charts as inline SVG, no external requests), plus index.html, latest.html and
summary.json. If a sNNNNNN.ml.csv file is next to the CSV, the model's manoeuvre classes are drawn under the charts.
Only the Python standard library is needed.

gen_ml_params.py#

Writes the model headers main/ml_params.h and main/ml_params_rev.h from the shipped model folders. CI checks that both headers match.

  python3 tools/gen_ml_params.py ml/onboard main/ml_params.h                    CarMind E.V, names ML_*
  python3 tools/gen_ml_params.py ml/onboard/rev main/ml_params_rev.h MLR        CarMind R.E.V, names MLR_*

The header carries everything the firmware needs to build the model input and read its outputs exactly as the
model was trained: channel order, normalisation, which channels the model ever saw valid, window length, class
names and how to de-standardise the estimates. Re-run it whenever a model folder changes; CI checks both headers.

A model that also outputs "z" (the 64-value feature both heads read) gets an R.E.V section: the factory fuel head w0,
read from the .espdl itself (see est_fuel_row), and a prior id that ties learned state to this exact file.

check_docs.py#

Fails if a Markdown file links to a local file or image that does not exist, or if a shipped model’s export record does not match its files.

Host tests#

The firmware’s pure C parts build and run on a computer. make -C tests/host runs the main set. Named targets run one part each, for example:

Target

What it checks

make -C tests/host rev

CarMind R.E.V’s learners: fuel head, airflow constant, fill-up calibration, state file

make -C tests/host os

the OpenCarMind EdgeOS rules in main/os_core.c

make -C tests/host ai

the AI services’ release table under overload and the ladder order

make -C tests/host bat

the battery charge estimator against the Mac reference

make -C tests/host pair

the pairing rule with the switch off and on

make -C tests/host guard

the adapter fingerprint, both decision tables and the question

make -C tests/host clock

the clock jump guard

The fuzz tests in tests/fuzz run libFuzzer over the input parsers. See Contributing.