Four items from one workflow, committed together because their build and CI
wiring genuinely interleaves — nisps/CMakeLists.txt, run-all-tests.sh and
ci.yml each carry hunks from two of them, and the stage renumbering (1/5 ->
1/6) touches every line. Splitting would produce commits that do not build,
which is worse than a commit that does four things and says so.
S26 part 2 — the curve declaration now matches reality. params[].curve stays
the mode-wide DEFAULT; a voice_spaces entry may now be {name, curve_overrides}
declaring only the slots where THAT voice space deviates. The 6 modes with one
voice space are byte-identical. The values were derived MECHANICALLY by a new
codegen/curve-audit.ts that models the four idioms a p[N]*p[N] regex misses
(alias form, memlcelium's implicit-counter sq() lambda, loop-generated indices,
smooth_params_), inlines helpers, and RAISES rather than guessing when it
cannot reduce an expression. A drift gate cross-checks 1179 (voice space x
param) slots against engine source on every run and was proved to fail loudly
on three drift classes. Application stays in the engine: nisps/engines,
nisps/pipeline and nisps/core are untouched, generated output is pure insertion
(755 insertions, 0 deletions), and the rebuilt nisps.wasm was byte-identical.
S4 / 7.2 — firmware reads the active mode's driver config at mode start, and
mic/line is real. My brief assumed the engine owns this; the code disagreed and
the code was right. sound_analysis_midi's EngineT is NoOpEngine — the mic lives
on a separately-composed AnalysisEngine member — so engine-level wiring would
have compiled, passed every gate, and left the one mic mode on line input.
Hence a mode-level seam defaulting to engine().driver_config(). Separately,
DriverConfig's defaults (line_level 0, output_volume 1.0) had drifted from
memllib's actual 3/0.8 because nothing had ever read them; wiring them as-is
would have made every silent mode louder and its line input maximally
insensitive — a behaviour change disguised as plumbing. Now pinned by a test.
Also: GetSysClockSpeed() panic()s on unsupported sample rates and runs on the
first line of setup(), so sample_rate needed a fallback ahead of clock setup.
CI's firmware env list gains soundanalysismidi — it is the only mic variant and
nothing else compiles that path.
Plan 5e — telemetry is real. A loss_history C-API entry across the full 5-layer
chain lets the browser read the per-iteration loss the core already records.
The audit named one fabrication site; there were two — wasm-iml.ts's
synchronous train() published lossHistory: [loss] as well. A third, ctx.loss,
was not merely dead but actively synthetic (fallbacks of prev * 0.82 and a
literal 0.5, rendered by nothing) and is deleted. The firmware buffer stays
untouched, per the L25 call. EngineApi.lossHistory() reads spine state rather
than the MLP handle, because trainAsync() fits on the worker's mirror net and
the handle would give a subtly-wrong second answer.
Plan 5f — engine throughput is measurable. One source compiled twice (CMake
natively, emcc for WASM) so the targets compare directly and no WASM export is
added. Sequencers are driven into a working state, and every row prints its own
working-state evidence so a number produced by an idle engine is visible rather
than plausible. Reports, never asserts: a wall-clock threshold on shared
hardware is meaningless or flaky, same call as the firmware size job.
ALIGNMENT: the telemetry defect is deleted (built, not deferred); the
performance defect is rewritten to what is actually left — these are HOST
numbers, and nothing measures the RP2350 at 150 MHz, which is the target the
mission's constraint is about. Q4 (memllib ownership) and Q5 (legacy feedback
modes) are closed.
Corrections to my own earlier claims, both found by agents contradicting the
brief: manifold/ONBOARDING.md was NOT "now accurate" — its primitives list
still named five deleted primitives and cited a seededGradient() that does not
exist. And the parity harness misses the sequencer engines because it runs 128
frames while their sequencers evaluate every 400-500 samples, NOT because
all-params-0.5 fails to trigger them (it does trigger: 0.5 maps to ratio 2,
firing three times per bar). The fix is a longer window, not different params.
Gates: run-all-tests.sh ALL GREEN — 4/4 ctest, parity PASS, lint clean, curve
drift 1179 slots ok, 39 e2e (was 33). Firmware: 5 envs built including the mic
variant.
99 lines
4.1 KiB
Bash
Executable file
99 lines
4.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
||
# scripts/run-all-tests.sh — master local entrypoint that exercises every
|
||
# check the repo owns. CI (.github/workflows/ci.yml) does NOT invoke this
|
||
# script; it re-lists the same stages as discrete steps so failures are
|
||
# attributable per-step. Keep the two in sync when adding a stage.
|
||
#
|
||
# Stages (each fails fast):
|
||
# 1. C++ build + ctest → scripts/build-cpp-tests.sh
|
||
# 2. WASM build → scripts/build-wasm.sh
|
||
# 3. Parity check → scripts/parity-check.sh
|
||
# 4. Lint → scripts/lint-cpp.sh
|
||
# 5. Manifold tests → codegen golden + curve drift, then
|
||
# cd manifold && typecheck + build + bun test + playwright
|
||
# 6. Engine bench SMOKE → scripts/bench-engines.sh --smoke --native-only
|
||
#
|
||
# Stage 6 is REPORTING ONLY and deliberately tiny (~0.15 s, native only, no
|
||
# emcc). It exists so the benchmark cannot rot unnoticed the way an unbuilt
|
||
# firmware variant did, and so every full local run leaves a rough throughput
|
||
# table in the log. It does NOT gate: a smoke-sized run has a ±30% noise floor
|
||
# and a wall-clock threshold on shared hardware is either meaningless or flaky
|
||
# (same reasoning as the firmware flash/RAM CI job). For numbers you can
|
||
# actually compare, run scripts/bench-engines.sh on its own — it defaults to
|
||
# best-of-3 × 150 ms per engine on both targets and takes --compare.
|
||
#
|
||
# Flags via env:
|
||
# NISPS_SKIP_PLAYWRIGHT=1 skip the Playwright leg (useful in C++-only loops)
|
||
# NISPS_SKIP_WASM=1 skip WASM build + parity (no emcc available)
|
||
# NISPS_SKIP_BENCH=1 skip the engine-bench smoke report
|
||
# NISPS_LINT_STRICT=1 treat lint warnings as failures
|
||
# PLAYWRIGHT_BROWSERS_PATH respected (on the VPS point it at the snap-bun
|
||
# browser cache — see docs/specs/plans/BUILD-PLAN.md)
|
||
#
|
||
# Exit codes: 0 on full success, otherwise the failing stage's exit code.
|
||
|
||
set -euo pipefail
|
||
|
||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||
cd "$ROOT"
|
||
|
||
stage() { printf '\n=== %s ===\n' "$1"; }
|
||
|
||
stage "1/6 C++ build + ctest"
|
||
"$ROOT/scripts/build-cpp-tests.sh"
|
||
|
||
if [[ "${NISPS_SKIP_WASM:-0}" != "1" ]]; then
|
||
stage "2/6 WASM build"
|
||
"$ROOT/scripts/build-wasm.sh"
|
||
|
||
stage "3/6 parity check"
|
||
"$ROOT/scripts/parity-check.sh"
|
||
else
|
||
stage "2/6 WASM build (skipped: NISPS_SKIP_WASM=1)"
|
||
stage "3/6 parity check (skipped: NISPS_SKIP_WASM=1)"
|
||
fi
|
||
|
||
stage "4/6 lint"
|
||
"$ROOT/scripts/lint-cpp.sh"
|
||
|
||
if [[ "${NISPS_SKIP_PLAYWRIGHT:-0}" != "1" ]]; then
|
||
stage "5/6 manifold tests"
|
||
if ! command -v bun >/dev/null 2>&1; then
|
||
echo "[run-all-tests] bun not on PATH; skipping manifold stage"
|
||
else
|
||
(
|
||
# Codegen idempotence golden (C++ + manifold TS outputs), then the
|
||
# curve drift check: the schemas' declared per-voice-space response
|
||
# curves vs what nisps/engines/*.hpp actually computes.
|
||
cd "$ROOT/codegen"
|
||
bun install --frozen-lockfile 2>/dev/null || bun install
|
||
bun run tests/golden_test.ts
|
||
bun run tests/curve_drift_test.ts
|
||
)
|
||
(
|
||
cd "$ROOT/manifold"
|
||
bun install --frozen-lockfile 2>/dev/null || bun install
|
||
bun run typecheck
|
||
bun run test
|
||
bun run build
|
||
# The Playwright RUNNER goes through non-snap node: snap-confined
|
||
# bun cannot see host browser libraries (BUILD-PLAN gotcha).
|
||
# Ensure browsers are present. `--with-deps` is heavy; leave to CI.
|
||
node node_modules/.bin/playwright install chromium >/dev/null 2>&1 || true
|
||
node node_modules/.bin/playwright test
|
||
)
|
||
fi
|
||
else
|
||
stage "5/6 manifold tests (skipped: NISPS_SKIP_PLAYWRIGHT=1)"
|
||
fi
|
||
|
||
# Report-only. See the stage list at the top of this file for why it does not
|
||
# gate and why it is smoke-sized here.
|
||
if [[ "${NISPS_SKIP_BENCH:-0}" != "1" ]]; then
|
||
stage "6/6 engine bench (report only, does not gate)"
|
||
NISPS_BENCH_NO_BUILD=1 "$ROOT/scripts/bench-engines.sh" --smoke --native-only
|
||
else
|
||
stage "6/6 engine bench (skipped: NISPS_SKIP_BENCH=1)"
|
||
fi
|
||
|
||
stage "ALL GREEN"
|