The function check_hugr_equality() (which is used as part of hugr validation to compare a hugr with the result of a serialization/deserialization round-trip) first calls canonicalize_nodes() on each hugr, and then compares them node by node. However, canonicalize_nodes() does not correct all irrelevant differences in node numbering.
Currently the validate() method works around this by using the json serialization instead of the model serialization. But when the model serialization is used instead, many of the tests fail because we end up comparing two hugrs containing Const and LoadConstant nodes that are numbered in a different order, and canonicalize_nodes() does not correct this.