Skip to content

Round-4 parity fixes + epics-rs 0.22 bump (release 0.5.3) - #3

Merged
physwkim merged 23 commits into
mainfrom
chore/bump-epics-0.22
Jul 10, 2026
Merged

physwkim merged 23 commits into
mainfrom
chore/bump-epics-0.22

Conversation

@physwkim

Copy link
Copy Markdown
Owner

A regression release. A workspace-wide upstream-parity audit (silx / PyDM /
adl2pydm + MEDM C) found that three of the fixes published in 0.5.2 were
themselves wrong, and turned up ten further divergences from the reference
behaviour. All sixteen R4 findings are now closed — 13 fixed at source, 1
withdrawn as not-a-defect, 2 recorded as deliberate divergences.

Inventory: doc/parity-review-2026-07-03.md.

The 0.5.2 regressions

VolumeRaycaster users should upgrade.

  • R4-7 (c4cf5c3) — the "Beer–Lambert" opacity correction divided by the
    step count, an exponent carrying no world distance, so every ray
    accumulated the same transmittance whatever chord it crossed. A uniform
    volume rendered as a flat silhouette, and at the default 256 steps the
    correction was exactly the identity. The exponent is now dt / dt_ref with
    dt_ref = |extent| / 256, a world distance.
  • R4-8 (8be7bb6) — the premultiplied 3-D texture stored rgb · a in 8
    bits, and the shader must divide the coverage back out to recover the
    straight colour. At coverage a that product resolves the quotient only to
    steps of 1/a: an authored (255, 128, 0) voxel at a = 3/255 read back as
    (255, 170, 0); at a = 1/255 no hue survived. The texture is now
    Rgba16Float. This doubles the volume texture's VRAM — see the CHANGELOG
    under Changed.
  • R4-9 (dd1ffbb) — remove() freed a texture two same-id views share by
    design, silently blanking the survivor; a dropped view released nothing. The
    texture is now claim-counted and lives exactly as long as the views holding
    its id.

The rest

  • R4-1 (a1b680f) Alt+Wheel zooms X only, Shift+Wheel zooms Y/Y2 only.
  • R4-2 (78b11e4) every view-limits commit runs silx's checkAxisLimits
    repair, through one owner. Closes R1-3's family.
  • R4-3 (b53d26c) middle-button drag pans in every interaction mode.
  • R4-4 (d8b5fb5) Reset-Zoom disables when neither axis autoscales.
  • R4-5 / R4-6 (eeca82c, 0fa3d00) the Histogramnd half-open
    admission rule, now one bin_index owner shared by the colormap-dialog
    histogram and the scatter binned-statistic grid.
  • R4-11 / R4-12 (976c39c) calc:// re-emits on a child connection
    change and no longer retriggers on alarm/metadata churn.
  • R4-16 (3f9660e, d3f1e19) a dialect=medm expression reading operand
    I or J re-evaluates on an alarm status / severity change, and only when
    it reads them. ChannelState::status was added to carry the wire status both
    plugins already receive.
  • R4-14 / R4-15 (fb21fb6, 33dee07) embedded-display children take
    the host screen's colormap; an arc with no path spans 90°.
  • R4-13 withdrawn — not a defect. Verifying it is what surfaced R4-16.
  • R4-10 recorded as a deliberate divergence: PyDM's initial-evaluation gate
    is order-dependent, and importing it would reopen the CI flake c020401
    closed.
  • 4a49b2b bumps epics-ca-rs / epics-base-rs / epics-pva-rs to 0.22.x.

Note on the review itself

Two findings were wrong as written, and verifying them before fixing is what
found the real defects. R4-13 claimed dialect=medm never binds operands G–L;
it already did — but checking the operand set against MEDM's
setDynamicAttrMonitorFlags surfaced R4-16. R4-8 claimed the low-alpha error
came from gain = sa_c / s.a amplifying quantization and that the defaults
were unaffected; both false, and the restated defect is unconditional and more
severe than the one reported.

VolumeRaycaster has no silx counterpart — plot3d/items/volume.py ships
an Isosurface and a CutPlane, never a GPU direct-volume ray-caster. R4-7,
R4-8 and R4-9 were therefore found by holding the code to the physics its own
commit messages invoke and to its own documented contract, not to an upstream
line. tests/volume_opacity_physics.rs pins that physics as an analytic
golden.

Verification

cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo nextest run --workspace (2349 tests, all pass) and cargo test --doc --workspace all pass locally. Every fix has a demonstrated
fail-without-fix; the two preservation tests
(opacity_is_invariant_to_the_step_count,
medm_expr_reading_severity_ignores_a_status_change) are labelled as passing
against both old and new code.

physwkim added 23 commits July 9, 2026 09:17
epics-rs 0.22.1 is on crates.io; move the `ca`/`pva` backend deps from
0.21.x to 0.22.x. 0.22 carries the upstream fix that suppresses a
NativeTypeChanged event on first connect (the trigger behind the ca://
duplicate-initial-sample race), so the bug is now closed both upstream
and by rsdm's own on_connect gate. No API changes: builds clean, clippy
clean, all 423 rsdm tests pass, single epics-base-rs 0.22.1 copy in tree.
Round 4 of the Codex-style upstream-parity audit: 5 read-only agents
(A plot interaction, B items/colormap/fit, C plot3d+VolumeRaycaster,
D rsdm<->PyDM, E adl2rsdm<->adl2pydm+MEDM C), reference->Rust direction,
baseline 4a49b2b -- 64 commits after the R3 baseline 0a51e4e, none of
which had ever been parity-audited.

15 findings (High 0, Medium 9, Low 6). Three of them are defects the
last 64 commits introduced: R4-7 (the "Beer-Lambert" opacity correction
normalizes by step count, not path length, and is the identity at the
default steps=256), R4-9 (the per-id VRAM free blanks a live view that
shares the VolumeId), R4-10 (calc:// now publishes an initial value PyDM
withholds). All three were written to close a CI flake or a rendering
artifact, not against a reference.

Also recorded: silx has no GPU ray-caster at all, so VolumeRaycaster has
no upstream contract and R4-7/8/9 are reference-independent defects; the
Histogramnd upper-edge convention is inverted at two sites whose comments
and regression test assert the opposite of silx; R4-2 is R1-3's
un-swept sibling.

Doc-only, per the playbook: the inventory is committed before any fix
work so it survives regardless of whether the fix phase completes.
…epair (R4-2)

Every public view-limits entry point committed raw bounds: set_limits,
set_graph_x_limits, set_graph_y_limits and the toolbar Zoom-In/Out
(actions::control::apply_zoom) all funnel into set_limits_internal, which
wrote straight to the backend with no ordering swap, no degenerate
expansion, and no float32 clamp. silx runs Axis._checkLimits on X, Y and
Y2 inside every PlotWidget.setLimits (PlotWidget.py:2723-2730 ->
items/axis.py:145-154 -> _utils/panzoom.py:49-75), and clamps the toolbar
zoom path a second time in scale1DRange.

Fix the structure, not the cited line: set_limits_internal now owns the
repair and applies clamp_axis_limits to X, Y and Y2, so an inverted,
degenerate or float32-unsafe range cannot be installed by any caller and
the Transform precondition (min < max, positive under log) holds by
construction.

An rg sweep of the family found two bypasses beyond the cited sites, both
routed through the owner here:

  - set_graph_y_limits(YAxis::Right) wrote plot.y2 raw
  - set_graph_y_limits(YAxis::Extra(n)) wrote ax.range raw (repairs
    against the extra axis' own scale)

The two hand-rolled clamp_axis_limits calls in set_x_log/set_y_log existed
only because the setter did not repair; they are removed (the axis is
already Log10 at that point, so the owner's clamp is identical). Distinct,
left alone: the drag path in plot_widget.rs rejects invalid ranges via
is_valid instead of committing them, core/plot.rs' reset/zoom_back paths
already clamp (the R1-3 fix), and sync.rs propagates already-repaired
values between synced plots.

Tests are one per invariant boundary, not one per story
(tests/view_limits_repair.rs): inverted, degenerate-zero, degenerate-
positive, float32 overflow, y2 bypass, extra-axis bypass, and 1000
repeated toolbar zoom-outs saturating at the float32 window. All 7 fail
without this change and pass with it. Closes R1-3's family.
…4-11, R4-12)

`calc://` polled `Channel::stamp()` to decide when to recompute. But `stamp`
bumps on *every* state change, so a CA child's alarm-deadband (DBE_ALARM) or
units/precision/limit (DBE_PROPERTY) callback -- both of which publish via
`StateWriter::update` with no value change -- tripped the trigger and
republished. For an accumulator expression (`prev_res + A`) that double-counts
on every alarm-only callback: a correctness defect, not a cosmetic one. PyDM
binds only `connection_slot`/`value_slot` on its calc children
(`calc_plugin.py:84-89`), so alarm severity and ctrl metadata never reach its
recompute.

`stamp` is the wrong primitive: it means "any state change" and it collapses.
Replace it rather than gate it. The loop now drains a per-child
`Channel::subscribe_values` queue:

  - R4-12 closes by construction. `update` posts no value event, an invariant
    already pinned by `channel.rs::update_does_not_emit_a_value_event`.
  - R4-11 closes: per-child connection state is tracked, and any change
    re-emits the last computed value (PyDM `callback_conn` ->
    `_send_update(self.connected, self._value)`, with `receive_new_data`'s
    None skip). Previously only the `connected` flag flipped, with no value
    event.
  - The `u64::MAX` sentinel from c020401 is deleted. A value event that lands
    before the last child connects now waits in the queue instead of
    collapsing into a counter, so the edge cannot be lost for any
    child-connect vs poll-tick interleaving.

R4-10 (rsdm evaluates on the first all-connected tick where PyDM withholds) is
kept as a deliberate, documented divergence: adopting PyDM's gate re-opens the
flake c020401 closed, because PyDM's own initial calc value is order-dependent
with children that publish at connect. Recorded in the inventory doc.

`channel_pair` is promoted to a crate-internal `#[cfg(test)]` helper so the
calc tests can drive a child that posts an alarm/metadata-only update -- no
`loc://` child ever does.

Tests are one per trigger-model boundary: alarm-only update must not
republish; child connection change must re-emit; a value arriving before all
children connect must still trigger. The first two fail against the old
trigger logic; the third guards the behaviour the sentinel used to provide.
rsdm: 426/426 pass, clippy clean.
`Histogramnd` rejects a coordinate at or above `g_max` unless
`last_bin_closed` is set (`histogramnd_template.c:186-222`), and
`ColormapDialog.computeHistogram` does not set it
(`ColormapDialog.py:1288`). `compute_histogram` folded the range-max
sample into the last bin with `.min(nbins - 1)`, and its degenerate-range
branch counted every sample into bin 0 — silx has no such branch and
drops them all.

Replace both with one rule: `bin_index` returns `None` for anything
outside the half-open `[xmin, xmax)` extent, so the degenerate extent
needs no special case and the last bin has no dual meaning. Bin
arithmetic now multiplies before dividing, as C does.

`HistogramColorBar` and `ColormapDialog` consume `compute_histogram`, so
both are closed by this. `actions::analysis::pixel_intensity_histogram`
is a distinct, correct site: its silx source passes
`last_bin_closed=True` (`actions/histogram.py:279`).

Tests are per boundary of `bin_index` (below/on lower edge, either side
of an interior edge, just below/on/above the upper edge, non-finite,
degenerate extent). 5 of the 6 fail against the old binning.
`scatter.py:499-501` calls `Histogramnd` without `last_bin_closed`, so a
point on either axis' upper edge is rejected, not folded into the last
bin (`histogramnd_template.c:186-222`). `binned_statistic` clamped
`c >= cols` / `r >= rows` into the last bin, and gave a degenerate extent
a unit bin so its points were counted into bin 0 — silx reports a zero
bin size there (`scatter.py:504-507`) and counts nothing.

`BinnedStatistic::pick` already used the strict upper bound via
`grid_cell`, so counting and picking disagreed about the max point.

Route both axes through `histogram::bin_index`, now `pub(crate)`: silx
calls one `Histogramnd` for both sites, so the admission rule has one
home here too. `scale` becomes `span / n_bins` unconditionally, matching
the bin size silx derives from the edge array; `grid_cell` already
rejects a zero scale.

`actions::analysis::pixel_intensity_histogram` stays inclusive — its
silx source passes `last_bin_closed=True` (`actions/histogram.py:279`).

Tests are per boundary: closed lower edge, each axis' open upper edge
alone, the corner, and a degenerate extent. 4 fail against the old
binning; `high_level::scatter_binned_statistic_mode_means_and_nan_empty`
encoded the same corner point and is updated to pin the extent with a
dropped point.
`parseArc` seeds the block with `createDlArc(NULL)` (`medm/medmArc.c:277`),
which sets `begin = 0` and `path = 90*64` (`medmArc.c:258-259`) — angles
are stored in 1/64°, so an `arc` block with no `path` draws a 90° sweep.
`emit_arc` defaulted `span_deg` to 360.0, converting every such block
into a full disc.

PyDM agrees with MEDM here: `adl2pydm` omits `spanAngle` when `path` is
absent (`output_handler.py:559`) and `PyDMDrawingArc` seeds
`_span_angle = deg_to_qt(90)` (`drawing.py:1271`).

The `sample.adl` fixture has exactly such an arc, so its committed
golden module had frozen the wrong default; regenerated.
…verity (R4-16)

`976c39c` narrowed the calc trigger to child *value* events, which is the
PyDM contract (`calc_plugin.py:84-89` binds only value/connection slots).
The MEDM dialect does not share it: operands `E`–`L` are record metadata,
so an expression reading `J` must re-evaluate when the first record's
severity moves — and severity arrives with no value event.

MEDM arms exactly that monitor and no other. `setDynamicAttrMonitorFlags`
(`utils.c:4621-4630`) sets `monitorValueChanged` on the main record under
`V_CALC`, adds `monitorSeverityChanged` only when `calcUsesSeverity(calc)`
and `monitorStatusChanged` only when `calcUsesStatus(calc)`, and never
monitors `hopr`/`precision`/`lopr` (H/K/L). The pre-`976c39c` stamp poll
retriggered on all of them; the value-only rule retriggered on none.

`calc_uses_operand` ports MEDM's scan verbatim — the letter in either
case, not preceded by an ASCII letter, so `sin`/`min`/`nint`/`pi` do not
read as operand `I`. The status half has no rsdm counterpart: the same
missing EPICS status code that pins `I` to `0.0`.

`Evaluator::Medm` now carries `first_child` (previously recomputed inside
`eval_medm` on every evaluation) and `watch_severity`, both decided once
at connect as MEDM decides them once at `setDynamicAttrMonitorFlags`. The
PyDM dialect keeps the value-only trigger by construction — no metadata
operands, so no watch.

Tests: `J` re-evaluates on a severity-only `update` (fails without the
watch); a non-`J` expression republishes nothing on severity or precision
churn (preservation test for R4-12, passes either way); and one case per
boundary of MEDM's letter scan.
`parseCompositeFile` reads the child `.adl`'s `display` block and its
`"color map"` block with `parseAndSkip` — both are discarded — and parses
the child's elements straight into the parent `displayInfo`
(`medm/medmComposite.c:687-707`). Every `clr`/`bclr` index in an embedded
file therefore names the **host** display's palette. Only the child's
`file` block survives: `medmComposite.c:684` copies its version number,
which selects the old-format attribute rolling.

`emit_embedded_display` called `parse_in_dir`, which builds the child's
own table from its inline `"color map"` (or its `cmap` fallback) and bakes
it into every child widget's colour at parse time.

Give the colour table a single owner: `Builder::color_table` holds the
top-level display's, and `parse_embedded_in_dir` resolves an embedded
document against it. Since the host table is never overwritten by a child,
this holds at every nesting depth — as it does in MEDM, where the same
`displayInfo` is passed down.

`examples/embed_child.adl` shows the sharper half of the bug: its
`text update` carries `clr=3`, which its own 3-entry palette does not
have, so the old code emitted no colour at all. The host palette's index 3
is `0000ff`; the regenerated golden now says so.
silx `_onWheel` (`PlotInteraction.py:1905-1917`) lets Shift/Alt *override*
the per-axis zoom flags when keep-aspect is off: Alt zooms X only, Shift
zooms Y and Y2 only, both chords zoom both. The axes menu advertises these
bindings in its labels (`tools/menus.py:55-57`). rsplot's wheel handler
never read `ui.input(|i| i.modifiers)`, so both chords zoomed both axes.

The selection is a pure rule, so it lives in `interaction.rs` with the
other interaction rules, as `wheel_enabled_axes`. Because the modifiers
override rather than intersect the flags, a disabled axis still zooms
under its own chord — which is why this cannot be folded into the flag
lookup.

Box zoom is a distinct, correct site: `_getAxesExtent`
(`PlotInteraction.py:390-397`) reads only `getZoomEnabledAxes()` and never
the modifiers. Left as is.

Tests: one case per branch of silx's selection, including keep-aspect
beating every modifier and the both-disabled no-zoom case. Fails without
the override.
silx's `ItemsInteraction` sets `dragButtons=(LEFT_BTN, MIDDLE_BTN)` and
routes MIDDLE to `Pan.beginDrag` (`PlotInteraction.py:1190-1192,
1365-1367`). `ZoomAndSelect`, `PanAndSelect` and `DrawSelectMode` all
inherit it, so middle-drag pans even while the primary drag is spoken for
by box zoom, ROI drawing or mask painting. rsplot read `Middle` only to
emit `mouseClicked`; the gesture panned nothing.

Like the secondary pan, it is not pre-empted by a marker drag — only the
item-drag branch competes with the primary pan.

The other half of R4-3 — silx reserving the right button for click/context
(`clickButtons=(LEFT_BTN, RIGHT_BTN)`), where rsplot also pans — is left
as is. It is a deviation this repo already records
(`doc/parity-roadmap.md:1175`, where the ROI gating contract depends on
it), and the secondary click still opens the context menu on release.
Removing it would be a user-visible change beyond this finding.

Tests: middle-drag pans in all five interaction modes, span preserved.
Fails without the binding.
… (R4-4)

silx `ResetZoomAction._autoscaleChanged` (`actions/control.py:83-95`) runs
`setEnabled(xAxis.isAutoScale() or yAxis.isAutoScale())` and rewrites the
tooltip per combination, naming the single autoscaled axis. The Home
button was drawn unconditionally with a fixed "Reset zoom" tooltip.

`reset_zoom_affordance` is the whole rule as one function, so the
enable/tooltip pair cannot drift apart. It reproduces silx's fourth row
verbatim: with neither axis autoscaling the tooltip reuses the both-on
wording rather than inventing a string, because the button is disabled and
the text is never read.

Tests: one case per combination of the two flags.
… count

The step-count correction rescaled each sample's coverage by
`REF_STEPS / steps`, an exponent carrying no world distance. The chord
transmittance then telescoped to `(1 - a)^steps` for every ray, so a
uniform volume accumulated the same opacity no matter how thick the slab
its ray crossed: the render was a flat silhouette. Measured centre red
for a 2/4/8/16-deep slab of alpha-2 voxels: `[225, 225, 225, 225]`.

Correct each sample from a reference *spacing* instead — a world
distance `dt_ref = |extent| / REF_STEPS`. The per-sample transmittance
`(1 - a)^(dt/dt_ref)` telescopes to `(1 - a)^(L/dt_ref)` over a chord of
length L: a function of the traversed thickness alone, still independent
of the sample count. REF_STEPS matches the widget's default `steps`, so a
ray crossing the full box diagonal at defaults renders exactly as before.

`tests/volume_opacity_physics.rs` pins both halves of Beer-Lambert
against an analytic golden. `VolumeRaycaster` has no silx counterpart
(plot3d ships only Isosurface and CutPlane), so the physics is the whole
contract. The thickness test fails against the old exponent; the
step-count test is a preservation test and passes against both.
…e survives

The 3D texture holds premultiplied RGBA so the hardware linear filter cannot
bleed a transparent voxel's colour into its opaque neighbour (1c68900). But
`fs_main` then divides the coverage back out — `gain = sa_c / s.a` — to rescale
the sample to its path-corrected coverage, and an 8-bit product `rgb·a` does
not carry the straight RGB well enough to survive that division. At coverage
`a` it resolves the quotient only to steps of `1/a`, so at the low coverages a
ray-march is built on the recovered colour collapses: an authored (255, 128, 0)
voxel at `a = 3/255` stored green `round(128·3/255) = 2` and read back
`2/3 = 0.667` against the authored `128/255 = 0.502`. A rendered slab of those
voxels composited green 145 where its hue calls for 110 — a 35-level shift, and
`a = 1` admits no hue at all (every channel reads 0 or 1).

Store the same premultiplied colour in `Rgba16Float` instead. f16 holds every
`c·a/255²` to ~0.05% relative, so the recovered RGB is exact to well under one
8-bit step at every coverage down to 1/255, while the filter still interpolates
associated colour. This doubles the volume texture's VRAM — the price of the
division, which is what makes the correction of R4-7 possible at all; the
alternative (straight RGBA8, premultiplied in the shader) is the same VRAM but
reopens the interpolation fringe.

`premultiply_recovers_the_straight_rgb_at_the_lowest_coverages` pins the
encoder at a = 1..255, and `low_coverage_voxels_composite_their_authored_hue`
pins the rendered composite. Both fail against the 8-bit product.
`VolumeRaycaster::remove` dropped the shared `VolumeGpu` entry outright, so a
view that gave up its volume also took the texture out from under every other
view holding the same `VolumeId` — a configuration `VolumeRaycaster::new`
explicitly documents ("two views sharing an id share the last-uploaded
texture"). The survivor kept painting, found no texture, and rendered nothing.
Symmetrically, a view that was simply dropped never released anything, pinning
its texture in `callback_resources` for the app's lifetime.

Both are the same missing invariant: nothing owned the entry's lifetime. Give
it one.

  Invariant: `scenes[id]` exists exactly while at least one live
             `VolumeRaycaster` holds a claim on `id`.
  Owner:     `VolumeRaycaster`. `new` acquires a claim; `remove` and `Drop`
             give it back; `set_volume` takes it again after a `remove`. The
             entry is created only by `acquire_volume_raycaster` and destroyed
             only by the `release_volume_raycaster` that reaches zero.

`set_volume_raycaster` no longer creates the entry (`entry().or_insert_with` →
`get_mut`), so an upload cannot resurrect an id whose last holder released it,
and the widget stores its `RenderState` — a bundle of `Arc`s — so `Drop` can
run the release without the caller remembering to.

Tested by claim-count boundary, not by scenario: `2 → 1` (`remove` while
another view lives: the survivor must still ray-march) and `1 → 0` (drop of the
last view: a fresh view taking the id must start empty). Both fail against the
unconditional remove — 0 red px and 92416 leaked red px respectively.
Marks R4-1/3/4/7/8/9/14 fixed with their commits and fix notes, restates R4-8
(its reported mechanism and scope were both wrong; the real defect is the 8-bit
storage of the premultiplied product, and it is unconditional), and records the
R4-9 invariant, owner, bypass audit and boundary tests.

Adds the fix-phase Review Log entry: 13 fixed at source, 1 withdrawn, 2
deliberate divergences; the two review findings that were themselves wrong and
what verifying them turned up; and that `VolumeRaycaster` has no silx
counterpart at all, so R4-7/8/9 are reference-independent findings held to
physics rather than to an upstream line.
Regression release. A workspace-wide upstream-parity audit found that three of
the fixes 0.5.2 shipped were themselves wrong — the volume ray-caster's opacity
correction carried no world distance, its premultiplied 8-bit texture could not
carry the straight colour of faint voxels, and its per-id `remove` freed a
texture other views were still rendering — and turned up ten further
divergences from silx / PyDM / MEDM. All sixteen findings are closed; see
doc/parity-review-2026-07-03.md.

`VolumeRaycaster`'s 3-D texture is now `Rgba16Float`, doubling its VRAM. That
is the cost of the division the opacity correction performs, and no 8-bit
format can carry it; the CHANGELOG says so under Changed.

All three crates bump in lockstep as always.
`ChannelState` had no alarm-status field, so the MEDM calc operand `I` bound a
constant `0.0` and `setDynamicAttrMonitorFlags`' `monitorStatusChanged` had
nothing to watch: `vis="calc"` with `calc="I"` — or any expression reading the
record's `STAT` — evaluated against a status that never moved. Both wire types
carry it (`epics-ca-rs` `snap.alarm.status`, `epics-pva-rs` `alarm.status`);
only rsdm dropped it on the floor.

`ChannelState::status` lands beside `severity`, written at the same two `ca://`
sites (`apply_alarm`, `apply_property_metadata`) and the one `pva://` site
(`apply_nt_metadata`), so a status change reaches the state wherever a severity
change already did. `eval_medm` binds operand `I` from it.

The monitor set becomes one owner rather than a flag per operand.
`MedmMonitors::of(expr)` is `calcUsesStatus`/`calcUsesSeverity` decided once at
connect, exactly as MEDM decides it once, and `MedmMonitors::sample` reads only
the monitored fields — an unmonitored one stays `None`, so it cannot differ
between ticks and cannot arm a recompute. The gate is the shape of the sample,
not a branch at the comparison.

Tested by monitor-set boundary: `I` monitored (status change re-evaluates),
`J` monitored but not `I` (status change must not republish — passes against
the old code too, a preservation test), neither monitored (severity, status and
precision churn all inert), and `MedmMonitors::of` against `sin`/`nint`, whose
letter-preceded `i` is not operand `I`. The first fails against the old
constant-`0.0` binding, the last against the missing `calcUsesStatus` scan.
The link list stopped at v0.4.2 — 0.5.0, 0.5.1 and 0.5.2 shipped without one,
and [Unreleased] still compared against v0.4.2. Every released version now has
its compare link and [Unreleased] tracks v0.5.3.
The MEDM per-operand monitor set is now complete: 3f9660e monitored severity
(operand J) but left operand I bound to a constant 0.0 because ChannelState
carried no alarm status. d3f1e19 added it, so I is bound and monitored, and the
two flags collapsed into MedmMonitors as their single owner.
CI tracks `stable`, which moved to 1.97.0 and failed all three test jobs on
code this branch does not touch. Three lints, none of them from the parity
fixes:

- `float_literal_f32_fallback` (42 sites, future-incompatible) — an unsuffixed
  `1.0` passed to a parameter taking `impl Into<f32>` infers as `f64` and falls
  back, which will become a hard error. Suffixed `_f32` at every site, including
  the `Stroke::new` in `adl2rsdm`'s codegen template so the generated
  `local_panel_screen.rs` golden still matches what the converter emits.
- `clippy::question_mark` in `fitting.rs` — a `match` whose `None` arm returned
  `None`.
- `clippy::byte_char_slices` in a `calc_plugin` test — `[b'o', b'k']` written as
  `b"ok"`.

Suffixes and the two rewrites only; no behaviour changes. `cargo clippy
--workspace --all-targets -- -D warnings` is clean on 1.97.0 and `cargo nextest
run --workspace` still passes 2349/2349.
@physwkim
physwkim merged commit b5c2258 into main Jul 10, 2026
4 checks passed
@physwkim
physwkim deleted the chore/bump-epics-0.22 branch July 10, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant