J{\'o}nsson and Tarski's notion of the perfect extension of a Boolean algebra
with operators has evolved into an extensive theory of canonical extensions of
lattice-based algebras. After reviewing this evolution we make two
contributions. First it is shown that the failure of a variety of algebras to
be closed under canonical extensions is witnessed by a particular one of its
free algebras. The size of the set of generators of this algebra can be made a
function of a collection of varieties and is a kind of Hanf number for
canonical closure. Secondly we study the complete lattice of stable subsets of
a polarity structure, and show that if a class of polarities is closed under
ultraproducts, then its stable set lattices generate a variety that is closed
under canonical extensions. This generalises an earlier result of the author
about generation of canonically closed varieties of Boolean algebras with
operators, which was in turn an abstraction of the result that a first-order
definable class of Kripke frames determines a modal logic that is valid in its
so-called canonical frames