From 5bb23e6a0acdac479395027adaad966f84d91957 Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Mon, 2 Nov 2026 12:06:45 +0100 Subject: [PATCH] probe: name the MathNode fields; the build baseline is now one warning Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- CMakeLists.txt | 2 +- docs/claude/verification.md | 20 +++++++++----------- src/ui_probe.cpp | 15 +++++++-------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9d82a14..76d822c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -39,7 +39,7 @@ The detail lives in `docs/claude/`. Read the files that touch the area you are e | File | What it covers | | --- | --- | | [build-and-run.md](docs/claude/build-and-run.md) | Configuring and building, the desktop-entry target, the command-line options, and the two vendored dependencies (`deps/plotter`, `deps/udpsclient`) including what was changed upstream and why. | -| [verification.md](docs/claude/verification.md) | How to run the headless self-check, the **two baselines every run is read against** (exactly three build warnings; no `Gtk-CRITICAL`), and the environment variable that schedules each probe. | +| [verification.md](docs/claude/verification.md) | How to run the headless self-check, the **two baselines every run is read against** (exactly one build warning; no `Gtk-CRITICAL`), and the environment variable that schedules each probe. | | [probe-readings.md](docs/claude/probe-readings.md) | The per-line reference for the self-check's output: what every probe and dump line means, the value it must read, and the defect a wrong reading names. | ### How the application is put together diff --git a/CMakeLists.txt b/CMakeLists.txt index eb8c066..f3a9785 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,7 +151,7 @@ add_custom_command( # The generated source carries each file as one C string literal, and a `.ui` is big enough to pass the # 4095-character minimum the standard requires a compiler to support: `-Woverlength-strings` fires on # generated *data*, not on anything anyone wrote. Silenced for this one generated file (the icon bundle -# is small enough per file never to need it), so the build stays at its three warnings. The manual is +# is small enough per file never to need it), so the build stays at its one warning. The manual is # no longer compiled in, so the help bundle's own warning is gone with it. set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/udpscope_ui_resources.c PROPERTIES COMPILE_OPTIONS "-Wno-overlength-strings") diff --git a/docs/claude/verification.md b/docs/claude/verification.md index e840516..8b86b8e 100644 --- a/docs/claude/verification.md +++ b/docs/claude/verification.md @@ -15,23 +15,21 @@ xvfb-run -a env UDPSCOPE_EXIT_AFTER_MS=8000 UDPSCOPE_ENABLE_ALL_MS=1000 \ Two baselines every run is read against. The UDPS runs must be **unchanged by the source-plugin work**: a UDPS self-check, number-normalised (`sed 's/[0-9.]\+/N/g'`), diffs empty against one taken before it. -A clean build emits **three** warnings and no more: two -`-Wmissing-field-initializers` on `MathNode::source` and one `-Woverlength-strings` on the icons' +A clean build emits **one** warning and no more: a `-Woverlength-strings` on the icons' generated GResource `.c`, whose blob is **9248** against C99's 4095-byte string-literal limit with the five action icons and the two app icons that remain (a note about a generated file, which GCC -itself supports). The *fourth* was the help pages' generated `.c` (**516044** bytes); the manual is -now a Mallard set installed for Yelp rather than a GResource compiled into the binary, so that -bundle — and its warning — is gone, and the baseline moved from four to **three**. Re-measure by -touching each `*.gresource.xml` under `src/` and rebuilding; a third `-Wmissing-field-initializers` -or any other warning is a finding. (The fifth warning that used to appear here was an unused -`output_built` in `math_probe()`; it was **deleted** as dead code — redundant with the -`output_after_add` already printed on the same line — which dropped the baseline from five to -four.) And an exit-dump run emits **no** `Gtk-CRITICAL` at all, nor any `Gtk-WARNING`: the dump's +itself supports). History: the help pages' generated `.c` (**516044** bytes) went when the manual +became a Mallard set installed for Yelp; an unused `output_built` in `math_probe()` was deleted as +dead code; and the last two, `-Wmissing-field-initializers` on `MathNode::source` in `math_probe()`, +went when the probe's `MathNode{MathOp::Gain, {}}` / `MathNode{MathOp::LowPass, {}}` named the +field (a partial brace-initialiser on `MathNode` re-adds one: `source` has no default member +initialiser). Re-measure by touching `src/icons/udpscope.gresource.xml` and rebuilding; any +second warning is a finding. And an exit-dump run emits **no** `Gtk-CRITICAL` at all, nor any `Gtk-WARNING`: the dump's `gtk warnings:` line counts GTK's own log (through a writer function — GTK is built with structured logging, so the handler API never sees its messages) and must read `0`; see [probe-readings.md](probe-readings.md). -An *incremental* build reads **one** of those three: the generated GResource `.c` is not recompiled +An *incremental* build reads **zero**: the generated GResource `.c` is not recompiled when only `src/` changed, so its `-Woverlength-strings` does not reappear. A third reading every run offers for free: **how many `[udpscope] buffer allocated:` lines it diff --git a/src/ui_probe.cpp b/src/ui_probe.cpp index bb334b2..d2a9bbc 100644 --- a/src/ui_probe.cpp +++ b/src/ui_probe.cpp @@ -467,7 +467,7 @@ gboolean math_probe(gpointer user) { MathChannel gain; gain.name = "math x2"; gain.enabled = true; - gain.nodes = {MathNode{MathOp::Source, name}, MathNode{MathOp::Gain}}; + gain.nodes = {MathNode{MathOp::Source, name}, MathNode{MathOp::Gain, {}}}; gain.nodes[1].in_a = 0; gain.nodes[1].gain = 2.0; gain.output = 1; @@ -476,14 +476,14 @@ gboolean math_probe(gpointer user) { MathChannel lp; lp.name = "math lp"; lp.enabled = true; - lp.nodes = {MathNode{MathOp::Source, late_name}, MathNode{MathOp::LowPass}}; + lp.nodes = {MathNode{MathOp::Source, late_name}, MathNode{MathOp::LowPass, {}}}; lp.nodes[1].in_a = 0; lp.nodes[1].fc = 20.0; lp.output = 1; channels.push_back(lp); // A third channel so the editor's new form row is built and synced on a baseline run. Assigned field - // by field: a partial brace-initialiser would add a fifth build warning. + // by field: a partial brace-initialiser would add a build warning. MathChannel dn; dn.name = "math denoise"; dn.enabled = true; @@ -1269,8 +1269,8 @@ gboolean mathwrap_probe(gpointer user) { MathChannel gain; gain.name = "math wrap"; gain.enabled = true; - // Field by field: a partial brace-initialiser would add a fourth build warning, and the baseline - // is exactly three. + // Field by field: a partial brace-initialiser would add a build warning, and the baseline + // is exactly one on a clean build. MathNode src; src.op = MathOp::Source; src.source = name; @@ -5843,9 +5843,8 @@ int noise_channel(App* a, const char* name) { // the older feature's proof, so the new channel stays out of the acquisition plan until they have // all run, and only the de-noise comparison is taken with it in. // -// Fields assigned rather than brace-initialised: a partial brace-initialiser on `MathNode` is -// what the two `-Wmissing-field-initializers` in this file already are, and the build baseline -// is exactly four warnings. +// Fields assigned rather than brace-initialised: a partial brace-initialiser on `MathNode` leaves +// `source` out and warns (`-Wmissing-field-initializers`), and the build baseline is one warning. gboolean noise_probe_setup(gpointer user) { App* a = static_cast(user); if (a->window == nullptr) return G_SOURCE_REMOVE;