If a person finds traces of madhy on his clothes after prayer, is his prayer valid or not? Yes, if a person finds something that breaks wudu after the prayer.
We say it depends on what he is certain of, what he thinks is most likely: did it happen during the prayer or before the prayer?
If he is convinced it happened then, he must repeat the prayer, unless he suffers from incontinence regarding that nullifier.
But if he is unsure, he does not know whether it happened during the prayer, before it, or after it, then we say the basic principle is purity.
That is because he entered the prayer in a state of purity, and the cause for that impurity occurred but its time is unknown, so he should not act on doubt and leave certainty. We say: act on certainty and ignore the doubt.
But if he suffers from incontinence, whether it is incontinence of madhy, wady, or even urine.
In that case, it does not harm him, even if it comes out during the prayer. He only needs to make wudu for each prayer, and there is nothing upon him. And Allah knows best.