K-decompositions and 3d gauge theories