This is based off of Paul Merrell's Model Synthesis work [0]. Boris The Brave had a good writeup of the core of the algorithm [1].
Max Gumin focused on just the constraint solver and added a "minimum entropy heuristic", popularized the work and coined the term "wave function collapse", as the way the solver worked was evocative of (a naive view) of how quantum mechanics solves systems [2]. Gumin's repo also has many other resources of implementations and descriptions [3].
I've published a paper on an extension that adds in a type of backtracking to both the "WFC" portion of the solver and the modify in blocks portion of the solver, which can be found in [4], for those interested.
[0] https://paulmerrell.org/model-synthesis/
[1] https://www.boristhebrave.com/2021/10/26/model-synthesis-and...
[2] https://github.com/mxgmn/WaveFunctionCollapse
[3] https://github.com/mxgmn/WaveFunctionCollapse?tab=readme-ov-...