Strike a good balance between fast shader compiles and leaving enough CPU cores for the game to run on. This is somewhat needed even with the low priority stuff, and I found that these numbers tend to do a reasonable job, it's certainly not perfect in all situations but in geneal we want to prioritize compiling shaders over minimizing the (temporary) performance hit anyway.
Reserve some threads for latency-critical high-priority shaders. The idea is that if the app binds a shader that hasn't been compiled by any of the workers yet, we can add it to a high-priority queue and immediately start working on it to minimize the inevitable stutter, even if all other threads are busy. Without this, some games (such as Elex 2 on Nvidia) would hang for extended periods of time just waiting for shaders to build.
How was this worker count calculation formula devised? Was it by trial and error?
https://github.com/doitsujin/dxvk/blob/caf31033d711460e86781b16a4d9b0f41fa9e817/src/dxvk/dxvk_pipemanager.cpp#L100