Have you tried disabling SMT? And have you tried installing the latest microcode update? AMD has been having problems for a while, but I think they ought to have been fixed by now.
I, myself was thinking to acquire a Ryzen 5 1600 for a high performance programming desktop. I was thinking of running FreeBSD, it's sad to hear that it's glitchy.