well, I'm already giving up.
can't understand why some of my tricks work with simple kixtart test script but inside this highly controlled udf, they don't.