Terrain shaders keep recompileing

Everytime I paint a layer on a component on which it was not painted before it recompiles the shader and the terrain component turns to checker grey for that time. I would be ok with it if it would be a matter of seconds but instead it takes minutes and that every time!

I have a hard time to understand why that recompileing is required and how that is feasible to work with? Or is it a bug?

Also, that shader recompiling number is in the thousands while for other shaders it is mostly 2 diggits, why?

Edit: Just found out it also recompiles when I erase a layer from a component chunk and it even deleted layer info references! Seriously, how is this terrain painting feasible?