The race condition happened when two pass managers ran on two different modules but modified/read the global variables.
To address this, I considered using singletons and freestanding functions to allow getting/setting HardwareLimits and RegisterEncoding, or making it local to the pass. I chose the latter and made it a member of WaitcntsBrackets, to minimizes the amount of global state.