Files
zhifu gao 3610b759ce test: numerical regression harness (frozen golden vs ggml/VAD/CIF/CTC output) (#3003)
* test: numerical regression harness (frozen golden vs ggml/VAD/CIF/CTC output)

Adds tests/ — runs each runtime tool on a fixed 6 s clip and diffs against frozen
golden output, catching regressions in the ggml graphs, the FSMN-VAD state machine,
the CIF predictor and CTC decode.

- tests/run_regression.sh: auto-detects which tools are built; VAD model is auto-fetched
  (1.7 MB), ASR GGUFs tested when present or with RUN_FULL=1 (downloads from HF).
  Non-zero exit on any mismatch. BIN_DIR/MODELS_DIR overridable.
- tests/sample.wav (~6 s) + tests/golden/*.txt: golden captured on Linux x86-64 with the
  f16 GGUFs from FunAudioLLM/*-GGUF.

Verified locally: all present tools PASS; default mode fetches VAD + skips absent models.

* test: golden as text (binaries now detok in-process; merge after in-binary-detok)

* test: fix sensevoice golden (correct transcription text)
2026-06-20 16:12:24 +08:00

884 B

Regression tests

Run each runtime tool on a fixed clip (sample.wav, ~6 s) and diff the output against the frozen golden in golden/. Catches regressions in the ggml graphs, the FSMN-VAD state machine, the CIF predictor and CTC decode.

Run

# from runtime/llama.cpp/, after building (cmake --build build):
./tests/run_regression.sh              # VAD (tiny model auto-fetched) + any tool whose GGUF is already local
RUN_FULL=1 ./tests/run_regression.sh   # also download the ASR GGUFs from Hugging Face and test every tool

BIN_DIR / MODELS_DIR override where binaries and GGUFs are found. Exit code is non-zero if any test fails; tools with no binary or no model are skipped.

Golden

Captured on Linux x86-64 (the reference platform) with the f16 GGUFs published at FunAudioLLM/*-GGUF. Update a golden file only with a deliberate, reviewed output change.