Interrupt Affinity

sometimes zwsetinformationthread deny the affinity of core 0 by using ThreadAffinityMask to fix it i had to use HKR, "Interrupt Management\Affinity Policy", DevicePolicy, 0x00010001, 4 HKR, "Interrupt Management\Affinity Policy", AssignmentSetOverride, 0x00000001, 1
is there reason for it ?

Why do you need this? In most cases, the operating system is the best entity to assign CPUs.

i use rdtsc as source of time i wrap the counter until its reach 584ghz the problem rdtsc is not multicore safe and zwsetinformationthread ThreadAffinityMask sometimes work sometimes doesn't i confirm Interrupt Management\Affinity Policy fix the issue

I'm sure you don't want design advice at this point ;), but I'm going to give it anyway.

Remember that the cycle counter is entirely derived from the motherboard crystals, which are often not as accurate as you would hope. If you're after long-term accuracy, you should be using a different source.

Acquiring high-resolution time stamps - Win32 apps | Microsoft Learn

There are many factors that affect the ability to collect accurate time stamps or do performance measurements. The good news is that Microsoft has done a good job of solving the problems within the capabilities of the hardware. You can attempt to solve some of those problems again, but it will be a lot of work and probably be less accurate than what you can get out of the box.