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.
50 lines
1.8 KiB
Bash
Executable file
50 lines
1.8 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# scripts/build-cpp-tests.sh — configure + build the host C++ test suite.
|
|
#
|
|
# Output: nisps/build/{nisps_core_tests,nisps_dsp_engine_tests,
|
|
# nisps_modes_tests,nisps_golden_tests,nisps_parity_check,
|
|
# nisps_engine_bench}
|
|
#
|
|
# Adds CTest registration for the first four. The last two are standalone:
|
|
# parity_check is invoked by scripts/parity-check.sh (orchestrates native+WASM
|
|
# together), and engine_bench by scripts/bench-engines.sh (measures time and
|
|
# asserts nothing, so it has no pass/fail for ctest to report).
|
|
#
|
|
# Honours these env vars:
|
|
# CMAKE_BUILD_TYPE default Release; pass Debug for stepping
|
|
# NISPS_BUILD_DIR default nisps/build; override for clean builds
|
|
# NISPS_RUN_TESTS if "1", run ctest after the build (default 1)
|
|
#
|
|
# Returns nonzero on configure or build failure, or on test failure when
|
|
# NISPS_RUN_TESTS=1.
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
BUILD_DIR="${NISPS_BUILD_DIR:-$ROOT/nisps/build}"
|
|
BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}"
|
|
RUN_TESTS="${NISPS_RUN_TESTS:-1}"
|
|
|
|
# Pick a generator. Ninja is fastest; fall back to Make if unavailable.
|
|
GENERATOR="Unix Makefiles"
|
|
if command -v ninja >/dev/null 2>&1; then
|
|
GENERATOR="Ninja"
|
|
fi
|
|
|
|
echo "[build-cpp-tests] root=$ROOT"
|
|
echo "[build-cpp-tests] build_dir=$BUILD_DIR generator=$GENERATOR build_type=$BUILD_TYPE"
|
|
|
|
cmake -S "$ROOT/nisps" -B "$BUILD_DIR" \
|
|
-G "$GENERATOR" \
|
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
|
|
|
|
cmake --build "$BUILD_DIR" --parallel
|
|
|
|
if [[ "$RUN_TESTS" == "1" ]]; then
|
|
echo "[build-cpp-tests] running ctest..."
|
|
# CTest's default output is terse; --output-on-failure surfaces details
|
|
# only when something breaks. The progress flag keeps CI logs scannable.
|
|
(cd "$BUILD_DIR" && ctest --output-on-failure --progress)
|
|
fi
|
|
|
|
echo "[build-cpp-tests] done."
|