flatudp: vector rows as channels or as a waveform, a re-openable source, probes for both
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a523bc2bd9
commit
e3bc1f72f3
10 files changed
+446
-100
No files matched your search
@@ -1913,46 +1913,61 @@ the one `[e1608] handshake with ...: Connection refused` line, `stream: ... sign
|
||||
```
|
||||
[flatudp] codec: ok=1
|
||||
[flatudp] datagram of 22 bytes, expected 21, check the signal list
|
||||
[flatudp] stream: connected=1 signals=4 names=Trigger,Ia,Cnt,Wave expect=Trigger,Ia,Cnt,Wave frames=3735 rate=1000.000 ok=1
|
||||
[flatudp] channels: count=4 expect=4 ok=1
|
||||
[flatudp] continuity: ch0_breaks=0 ch1_breaks=0 ok=1
|
||||
[flatudp] wrong size: count=3 message='datagram of 22 bytes, expected 21, check the signal list' ok=1
|
||||
[flatudp] stream: connected=1 signals=7 names=Trigger,Ia,Cnt,Wave[0],Wave[1],Wave[2],Wave[3] expect=Trigger,Ia,Cnt,Wave[0],Wave[1],Wave[2],Wave[3] frames=368 rate=1000.000 ok=1
|
||||
[flatudp] channels: count=7 expect=7 ok=1
|
||||
[flatudp] continuity: Trigger_breaks=0 Ia_breaks=0 Cnt_breaks=0 Wave[0]_breaks=0 Wave[1]-[0]_breaks=0 ok=1
|
||||
[flatudp] wrong size: count=4 message='datagram of 22 bytes, expected 21, check the signal list' ok=1
|
||||
[flatudp] capture button: present=1 sensitive=1
|
||||
[flatudp] state: valid=3735 wrong=3
|
||||
[flatudp] silence: connected=0 model_connected=0 ok=1
|
||||
[flatudp] resumed: connected=1 frames_before=4990 frames_after=7147 ok=1
|
||||
[flatudp] state: valid=3683 wrong=4
|
||||
[flatudp] silence: connected=0 model_connected=0 after_ms=4300 ok=1
|
||||
[flatudp] resumed: connected=1 frames_before=401 frames_after=410 ok=1
|
||||
```
|
||||
|
||||
`UDPSCOPE_PROBE_FLATUDP=2500` (the first lines; counts vary) and `UDPSCOPE_PROBE_FLATUDP_GAP=8000` (the last two)
|
||||
run as `--source flatudp` against `tools/mock_flatudp.py` with the options in `verification.md`. The second line is
|
||||
the source's own stderr message, printed once per distinct wrong size, not a probe line. The `continuity` line
|
||||
above is the scalar-list run (`Trigger,Ia,Cnt`, big endian); the mixed-list run with `Wave:int16[4]` reads
|
||||
`continuity: skipped (...)`. With no sender the stream lines read `connected=0 ... frames=0 ... ok=0`, `continuity`
|
||||
is skipped and the capture button reads `sensitive=0`: a reading, not a failure. A run without `--bad-every` reads
|
||||
`wrong size: count=0 ... ok=0` for the same reason.
|
||||
and, for the waveform-only list `Wave:int16[4]w`:
|
||||
|
||||
- `codec: ok=1`: the `signals` text round-trips, a hand-built 24-byte datagram decodes to the hand-computed
|
||||
values in both byte orders (`uint8` 254, `int16` -2, `float32` 1.5, `uint64[2]` 1 and 4294967298, `int8` -1)
|
||||
and the validity rules refuse what they should. It needs no source, so `--source probe` shows it too.
|
||||
`ok=0` is a codec defect: a swapped byte order, a wrong width or a rule that does not fire.
|
||||
- `stream: ... ok=1`: the model's signals are the list's rows in order, at the declared rate. `names` out of
|
||||
order is a decode that mixed rows; `rate` of 1000 against a different declared rate is a `sampling_rate`
|
||||
that did not reach the model (the ring and the decimation are then sized for the wrong cadence).
|
||||
- `channels: count=4`: one channel per signal. A vector signal is **not** one channel per element: the model
|
||||
reads its `count` values as consecutive samples of one channel, as for a UDPStreamer block signal.
|
||||
- `continuity: ch0_breaks=0 ch1_breaks=0`: consecutive samples of the mock's first two signals step by 1 and
|
||||
by 2 modulo 100. A break is a lost or reordered datagram, a batch flushed with the wrong number of samples,
|
||||
a wrong byte order or ingest decimation that is not 1:1. It is skipped for a list with a vector row: the
|
||||
model spans each frame by its largest element block, so the scalar channels of a mixed list are padded
|
||||
with zeros (`Frame::value` reads 0 out of range) and a continuity check on them would read nearly every
|
||||
step as a break.
|
||||
```
|
||||
[flatudp] stream: connected=1 signals=1 names=Wave expect=Wave frames=3737 rate=4000.000 ok=1
|
||||
[flatudp] channels: count=1 expect=1 ok=1
|
||||
[flatudp] continuity: wave_breaks=0 ok=1
|
||||
```
|
||||
|
||||
`UDPSCOPE_PROBE_FLATUDP=2500` (the first lines; counts vary) and `UDPSCOPE_PROBE_FLATUDP_GAP=1500` (the last two)
|
||||
run as `--source flatudp` against `tools/mock_flatudp.py` with the options in `verification.md`. The second line is
|
||||
the source's own stderr message, printed once per distinct wrong size, not a probe line. With no sender the stream
|
||||
lines read `connected=0 ... frames=0 ... ok=0`, `continuity` is skipped and the capture button reads
|
||||
`sensitive=0`: a reading, not a failure. A run without `--bad-every` reads `wrong size: count=0 ... ok=0` for the
|
||||
same reason.
|
||||
|
||||
- `codec: ok=1`: the `signals` text round-trips (including a `w` row and a bracketed count of 1 on a waveform), a
|
||||
hand-built 24-byte datagram decodes to the hand-computed values in both byte orders (`uint8` 254, `int16` -2,
|
||||
`float32` 1.5, `uint64[2]` 1 and 4294967298, `int8` -1), so do a `float64`, `uint16`, `int32`, `uint32` and
|
||||
`int64`; `decode_channels` puts a `channels` vector in `count` columns and a waveform in one; and the validity
|
||||
rules refuse what they should (a waveform of count 1, a waveform mixed with another row or of another length,
|
||||
257 channels). It needs no source, so `--source probe` shows it too. `ok=0` is a codec defect: a swapped byte
|
||||
order, a wrong width or a rule that does not fire.
|
||||
- `stream: ... ok=1`: the model's signals are the list's channels in order, each at its declared rate: `rate`
|
||||
for a scalar or a `channels` element (named `Name[k]`), `rate * count` for a waveform. `names` out of order is a
|
||||
decode that mixed rows; a rate that is not the expected one is a `sampling_rate` that did not reach the model
|
||||
(the ring and the decimation are then sized for the wrong cadence; a waveform at `rate` instead of `rate * 4`
|
||||
has a time axis 4 times too long).
|
||||
- `channels: count=7`: one channel per `SignalInfo`, which is `channel_count(rows)`: a scalar 1, a `channels`
|
||||
vector `count`, a waveform 1 (its `count` values are consecutive samples of that one channel).
|
||||
- `continuity: <name>_breaks=0 ...`: the mock's row k carries `(i * (k + 1) + e) % 100`, so consecutive samples
|
||||
of a channel from row k step by k + 1 modulo 100 (`Trigger` 1, `Ia` 2, `Cnt` 3, `Wave[0]` 4), and `Wave[1]-[0]`
|
||||
is the same-sample difference of two elements, which must be 1. A break is a lost or reordered datagram, a
|
||||
batch flushed with the wrong number of samples, an element mapped to the wrong channel, a wrong byte order
|
||||
or ingest decimation that is not 1:1. A waveform list reads `wave_breaks`: samples step by 1 inside a
|
||||
datagram and by `2 - count` into the next, at a phase the probe finds from the first such step and then holds;
|
||||
a non-zero count is a block of the wrong length or one that dropped samples. (Before the `channels` form, a
|
||||
mixed list showed ~400 breaks here: a scalar next to a vector was zero-padded to the vector's length.)
|
||||
- `wrong size: ok=1`: wrong-size datagrams were counted and the message names the received and expected size.
|
||||
The message must also be the only stderr line of its kind: one per distinct size, however many arrive.
|
||||
- `capture button: present=1 sensitive=1`: the kind reports datagrams, so the capture UI is live (contrast
|
||||
`[source-kinds]`, where the probe kind leaves it disabled). With no stream it reads `sensitive=0`.
|
||||
- `silence: connected=0 model_connected=0`: 2 s without a valid datagram raised `Disconnected`. `connected=1`
|
||||
is the timeout not firing, wrong-size datagrams refreshing the silence clock (they must not), or the mock's
|
||||
gap not covering the probe (see the timing note in `verification.md`).
|
||||
- `silence: connected=0 model_connected=0 after_ms=...`: 2 s without a valid datagram raised `Disconnected`
|
||||
(`after_ms` is the wait from the stream coming up to the drop; it only reads the gap's start in the app's
|
||||
clock). `connected=1` is the timeout not firing or wrong-size datagrams refreshing the silence clock (they
|
||||
must not); `never connected` is a stream that never came up before the probe gave up after 20 s.
|
||||
- `resumed: ok=1`: `Connected` was raised again and frames resumed. `connected=0` here means the source never
|
||||
recovered after the sender came back.
|
||||
|
||||
|
||||
Reference in new issue
Block a user