I'm using a mask map to mark generic tile types to mask values. The mask map is independent which means a mask value can be different than the usual value for that tile type. I think it's actually required, because rooms and caverns are different yet they of course share common tile types so there is no way to link masks to tile types itself. When I look at how room masks are determined it's a small miracle that it actually seems to work - in its own way. Room generation is still a task that needs work to be done, mostly in interior design but also in big complex room types.