There are some ignorantly constructed mining things which try to use the for humans 'difficulty' number for actual important usage. There be dragons. (Among other things, errors related converting block hashes to 'effective difficulty' have been blamed for miners discarding valid blocks in the past).
...
It is my understanding difficulty is "the number of bits in the resulting hash". This is a very nice and fairly defined number in my opinion.
Thats not correct, nor would it be very useful: if it was a straight leading zero bit check difficulty could only change in huge doubling/halving increments which could not adequately control the rate of blocks.
Yeah, I guess mine is one of those thingies
I'm not sure how could I manage to miss this so long... is it just me or this sounds like I can just
memcmp it against hash?
I assume the situation at network level is really etter defined in that regard. Between stratum and the pool operators manipulating difficulty multipliers I am very confused.
It seems you are assuming that "difficulty" is primative and that things like "target" are calculated from it. In fact, target is primative and it is the compact form of target, called the "bits" field which is changed by the protocol every 2 weeks and is stored in the header of every block. As gmaxwell said, "difficult" is just for the humans.
It is the only thing I get from stratum servers (let me tell you I don't have high regard for protocol). I can indeed see some computations I am familiar with. I would probably have to really consolidate this information.