@neauoire I am sure there is. Reminds me of some work a friend of mine did many years ago. He was testing a graphics pipeline with several threads and... the results were mostly counter-intuitive.

Since your computer likely also use threads for UI etc. The cores likely benefit from doing "two things at (almost) once".

There is at least some memory management involved, for getting the code into the CPU, and moving data around means "waiting" for the CPU.

So
thread_count = 2*cores - os_thread_count
seems like a good hypothesis to me.