How does engine strength scale with hardware? Say I run Komodo on my 4-core machine. How much stronger would Komodo be if I used an 8-core machine? A 40-core machine? A 4000-core machine?

Is there a general relation for this? Also, does this scaling depend on which engine is used, and if so, why?
Multicore is important for chess engines, but it doesn't scale forever.


Up to certain depth, no matter how much hardware you have, you just don't have enough computational power
Yes. Scaling is heavily implementation dependent. For example, a simple mutex would make multithread programming much easier (any decent programmer will agree here), but that'd also make the engine run much slower than another engine runs without mutex locking.
40 cores machine will play stronger than an 8-core machine, although it's hard to state how much. A 4000 core machine should also play stronger than a 40 core, but it's harder to justify the costs for smaller Elo improvement.