[PD] regression testing WAS Re: [psql] object hand-holding

Mathieu Bouchard matju at artengine.ca
Mon Dec 24 19:30:09 CET 2007


On Mon, 24 Dec 2007, Martin Peach wrote:
> Mathieu Bouchard wrote:
>> In most tristate electronics, the third state is WAIT,
> In digital electronics the third state is high-impedance, that is, it is not 
> driven high or low. However, a device reading a Hi-Z output will 
> itself always output either 0 or 1 and has no way of telling that it 
> is connected to a Hi-Z output,

No, I'm not talking about the high-impedance state, especially because it 
can't be read easily. The other kind of tristate is at a higher level than 
that and is implemented as "dual-rail" wires: 10 = false, 11 = true, 00 or 
01 = wait. This is useful for making clockless devices.

Clockless devices are interesting because they can very gradually adapt to 
the "weather": if you remove the heat sink it will automatically slow 
down, and if you dip it in liquid nitrogen it will very much accelerate, 
without any clock, any thermometre, any power management device, etc..

In clockful devices you usually don't have that many WAIT lines, so it 
does not make sense to count them as a 3rd state. Instead, a 8-bit bus 
would have 257 states (2^8 + 1) using 9 wires, and so on, but even then 
they are used as little as possible, and bunch of delays are hardcoded and 
missed deadlines make the CPU crash or do weird things (I've *seen* it in 
a Pd patch once!).

> Probably using a watchdog timer is the best way out: if the result isn't in 
> after a reasonable delay, assume it's not going to happen, something like:

Most of the time, your [delay] is enough, and that's what I meant too. 
Sometimes the problem will also involve 100% CPU spent handling the same 
event, e.g. bang [until] without anything else, and so [delay] won't work 
at all. Sometimes it could be a [delay 0] within the test (or component 
being tested) doing an infinite loop at the same logical time instead. 
Because [delay] can only handle logical times, it won't be able to trap 
it. But I think that those two latter cases are relatively rare, and if 
ever they are not that rare, or that they are very inconvenient when they 
happen, then we might want to use a watchdog more like pd's watchdog 
process.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada


More information about the Pd-list mailing list