move constraint checking to gen task