ci(fpga): PR-M.3 — wire T-6 drift cosim into regression + CI deps

Adds the T-6 independent reference drift cosim (PR-M.1, c30be89) as a
gated regression check so any future hand-edit drift in NCO_SINE_LUT,
fft_twiddle_*.mem, or DOPPLER_WINDOW_COEFF surfaces on every run.

run_regression.sh: new "Independent Reference Drift (T-6)" check after
the RX-B autocorrelation block in Phase 3. Plain `python3` (no path
sniffing). Distinguishes three states from the script's exit code +
markers:
  rc=0,  PASS markers -> PASS (counts toward `passed`)
  rc=2,  no markers   -> SKIP (counts toward `skipped`)
  rc!=0, FAIL markers -> FAIL (gates the regression)

compare_independent.py: detects missing numpy/scipy at startup and exits
with code 2 plus a [SKIP] marker pointing at `uv sync --group dev`.
Without that, an environment without scipy crashed mid-script and the
regression captured a partial 3-of-13 PASS count.

pyproject.toml: scipy>=1.13 added to the dev dependency group (used by
fpga_reference.doppler_window_ideal() for analytical Cheby ground truth).

.github/workflows/ci-tests.yml: fpga-regression now installs Python
3.12, sets up uv, runs `uv sync --group dev`, and activates the
resulting .venv before bash run_regression.sh. Without the activate
line the runner's system python3 (no scipy) would resolve first and
the drift check would [SKIP] in CI.

Verified locally:
  with venv:    Drift PASS (13 checks), Tests: 43 passed / 0 / 0
  no scipy:     Drift SKIP (msg points at install cmd), 42p / 0f / 1s
This commit is contained in:
Jason
2026-05-01 18:53:09 +05:45
parent 36234fe0e3
commit db6b220f92
4 changed files with 89 additions and 3 deletions
+20 -2
View File
@@ -69,7 +69,10 @@ jobs:
working-directory: 9_Firmware/9_1_Microcontroller/tests
# ===========================================================================
# FPGA RTL Regression (25 testbenches + lint)
# FPGA RTL Regression (testbenches + lint + cosim helpers)
# Python deps (numpy, scipy) come from the dev group in pyproject.toml
# and are installed via uv so the run_regression.sh cosim and T-6 drift
# check have everything they need.
# ===========================================================================
fpga-regression:
name: FPGA Regression
@@ -78,11 +81,26 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v5
- name: Install Python cosim deps (numpy + scipy)
run: uv sync --group dev
- name: Install Icarus Verilog
run: sudo apt-get update && sudo apt-get install -y iverilog
- name: Run full FPGA regression
run: bash run_regression.sh
# uv-managed venv lives at ./.venv; activate so run_regression.sh's
# plain `python3` resolves to it. Without this the cosim helpers
# would fall back to the runner's system python (no scipy) and the
# T-6 drift check would emit [SKIP] instead of running.
run: |
source ../../.venv/bin/activate
bash run_regression.sh
working-directory: 9_Firmware/9_2_FPGA
# ===========================================================================