feat: a signal switched off switches its dependent math channels off too
A derived channel cannot be computed from a signal nobody acquires: `Source` resolves to a
*channel*, and a disabled signal has none -- so a channel that reads one silently computed
nothing, which is what "all math signals depending on it do not compute anymore" looked like
from outside.
Rather than leave it enabled and blank, the channels that read the signal follow it off:
`disable_dependent_math_channels()` walks the graphs to a **fixpoint**, because one math
channel may name another, and the switch goes through the same path the pane's own toggle
uses -- `MathChannel::enabled` then `apply_math_channels()`, the single writer -- so the
pane's switches follow. Their traces leave the plots with the signal's, and the notice says
both halves.
The channels that do *not* read it are untouched, which is the assertion's other half:
[enable-all-probe] switched 'sine' off: traces_left=0 (want 0)
math_off=[math x2,math3] math_on=[math lp]
notice=''sine' is off: 1 trace left the plots; math off: math x2 and 1 more'
`math x2` and `math3` both source `sine`; `math lp` sources `noise` and stays on. The probe's
switch step now runs late enough that a math probe armed behind it has installed its graphs,
which is why the earlier reading was empty -- `app.math` had nothing in it yet, not
"no dependants".
Re-enabling the signal does not switch them back on, for the same reason it does not restore
the traces: that is the user's decision, and the rule is written down in
invariants-math-channels.md.
This commit is contained in:
1 parent
5eb20f3cdb
commit
b02419dee3
6 files changed
+92
-9
No files matched your search
@@ -291,3 +291,12 @@ the assertion: `finite` must be about `M` minus the hole share, and `finite=0` b
|
||||
which is the "modifying one expression invalidates all the others" report.
|
||||
`[math-probe] graph edit: stored_slots N -> M` reads it: M must be at least N -- the store keeps filling
|
||||
while the edit runs -- and never 0.
|
||||
|
||||
- **A math channel whose source is switched off is switched off with it.** `Source` resolves to a *channel*, so
|
||||
a derived channel cannot be computed from a signal nobody acquires: left enabled it would silently compute
|
||||
nothing, which is what "all math signals depending on it do not compute anymore" looked like from outside.
|
||||
`on_signal_switch()` disables the channels that read that signal -- **transitively**, since one math channel
|
||||
may name another -- through the same path the pane's own switch uses (`MathChannel::enabled` and
|
||||
`apply_math_channels()`), and takes their traces off the plots along with the signal's. The channels that do
|
||||
not read it are untouched: `[enable-all-probe]`'s `math_on=[…]` is the half that reads this. Re-enabling the
|
||||
signal does **not** switch them back on, for the same reason re-enabling does not restore the traces.
|
||||
@@ -1256,6 +1256,15 @@ switches one off **through its own acquire tick in the signal list** -- the tick
|
||||
is the shape `signal_tick_visible()` walks -- and reads the plots back. `traces_left=0` is the rule: a disabled
|
||||
signal leaves every plot rather than staying as a slot that draws nothing, and the notice is what says so.
|
||||
|
||||
The switch step runs late, so that a math probe armed *behind* this one has installed its graphs by then; the
|
||||
two halves after it are the other rule. `math_off` is the derived channels that read this signal -- they cannot
|
||||
be computed from a signal nobody acquires, so they go off with it -- and `math_on` is the ones that do not,
|
||||
which must be untouched:
|
||||
|
||||
```
|
||||
[enable-all-probe] switched 'sine' off: traces_left=0 (want 0) math_off=[math x2,math3] math_on=[math lp] notice=''sine' is off: 1 trace left the plots; math off: math x2 and 1 more'
|
||||
```
|
||||
|
||||
## `[math-probe] graph edit:`
|
||||
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user