Note that the implementation described above uses the Arc Consistency 3 algorithm for the propagate step. It's often an order of magnitude faster to use AC4, as is done in the original WFC repo and in my implementation (https://github.com/BorisTheBrave/DeBroglie).