I know that each core has its own set of registers. Does that include the AVX-512 mask registers k0 - k7? I am asking because I have a program with random data errors; it makes extensive use of mask registers, so if the mask registers are shared then that could explain it. Logically it seems that they must each have their own set of mask registers.
Yes, all registers are core/thread-private, part of the per-core architectural state that OSes must save/restore on context-switches between tasks. Just like RAX..R15 and ZMM0..ZMM31, segment registers, and so on.
As you guessed, AVX512 masking would be basically unusable under a multi-tasking OS if different threads or logical cores all shared the same architectural mask registers.
Also, in your hypothetical insane design, keeping the mask registers in sync between cores would be serious CPU-design challenge. It's vastly easier to give each core its own set of private registers. Communicating between cores at ~4GHz with single-cycle latency would be hard.