You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add on-target (QEMU) Xtensa conformance test suite (#55)
Adds `tests/qemu/`, which runs the RFC 8251 decoder-conformance vectors
on an emulated ESP32-S3 under `qemu-system-xtensa`. This exercises the
Xtensa LX7 assembly built with xtensa-gcc, which the host suite
(`tests/conformance/`) never compiles.
**How it works**
- The 12 `.bit` vectors are embedded in the app image and decoded on the
emulated S3 at 1 and 2 channels.
- Raw int16 PCM streams out UART1 (to a host file via `-serial file:`)
one frame at a time, so device RAM stays flat. UART0 carries only
per-decode markers (`@@VEC` / `@@EnD … bytes=N status=ok`).
- On the host, `compare.sh` carves the PCM file by the `@@END` byte
counts and runs `opus_compare` against the references.
A raw binary side-channel (vs base64 over the console) keeps stray logs
out of the stream and runs ~2x faster. Semihosting would be faster
still, but ESP-IDF gates its semihosting VFS on a JTAG debugger that
QEMU doesn't present.
**Build variants**
- `esp32s3` — float decoder (S3 default); exercises `mathops_lx7.c`.
- `esp32s3_fixed` — layers `sdkconfig.fixed.defaults` to exercise the
fixed-point path and `fixed_lx7.h`. Same image, so `run-image.sh` /
`compare.sh` are unchanged.
**CI**
The QEMU job is slow and only matters when the on-target image can
change, so a `changes` job diffs the base and runs it only when
`lib/opus`, `patches/`, `cmake/staging.cmake`, `tests/qemu/`, or the
workflow changed. Wrapper-only changes skip it (the host suite covers
those); a skipped job reports `skipped`, which branch protection counts
as passing. To force a run, add the `ci-run-qemu` label, which re-runs
only the QEMU job. Detection uses plain `git diff` and fails safe if the
base commit is unreachable.
**Running**
```bash
tests/fetch_vectors.sh
tests/qemu/run-qemu.sh # float
tests/qemu/run-qemu.sh --env esp32s3_fixed # fixed-point
```
0 commit comments