Essentially, what I've written is a souped-up version of a Rectangles solver. It's souped up in the sense of being non-deterministic, by which I mean that it can cope with a degree of uncertainty about where exactly the number in each rectangle is placed.
To begin with, I smear each number throughout the whole of its containing rectangle. The solver deduces as much as it can under those conditions (by ruling out as many possible-rectangle-placements as possible), and then gives up. When it gives up, its next step is to narrow down the possible positions of one of the numbers in such a way as to make an additional deduction possible. Then it deduces as much as it can again, and repeats. Eventually it reaches a point where it's able to fully deduce the position of every rectangle in the grid despite some of the numbers still having uncertainty in their position. Then I can choose randomly from the possible positions for any number that's still uncertain.
The upshot of all this is that I get to do a single solving pass and place all the numbers sensibly. All the other approaches I could think of involved having to solve the grid multiple times, adjusting the number positions each time to try to get closer to uniqueness. Or, even worse, the complete bogo-sort approach of repeatedly generating an entire grid and seeing if it ended up unique (which scales extremely badly, since as far as I can tell ambiguous sections crop up at a roughly constant rate per unit of grid area, so the larger the grid the longer you'll have to keep doing this for before getting a sensible puzzle).
The solver does get hung up some of the time and have to abandon the grid and start again, but even at the largest default setting it does that under 50% of the time so it's not too bad.
To begin with, I smear each number throughout the whole of its containing rectangle. The solver deduces as much as it can under those conditions (by ruling out as many possible-rectangle-placements as possible), and then gives up. When it gives up, its next step is to narrow down the possible positions of one of the numbers in such a way as to make an additional deduction possible. Then it deduces as much as it can again, and repeats. Eventually it reaches a point where it's able to fully deduce the position of every rectangle in the grid despite some of the numbers still having uncertainty in their position. Then I can choose randomly from the possible positions for any number that's still uncertain.
The upshot of all this is that I get to do a single solving pass and place all the numbers sensibly. All the other approaches I could think of involved having to solve the grid multiple times, adjusting the number positions each time to try to get closer to uniqueness. Or, even worse, the complete bogo-sort approach of repeatedly generating an entire grid and seeing if it ended up unique (which scales extremely badly, since as far as I can tell ambiguous sections crop up at a roughly constant rate per unit of grid area, so the larger the grid the longer you'll have to keep doing this for before getting a sensible puzzle).
The solver does get hung up some of the time and have to abandon the grid and start again, but even at the largest default setting it does that under 50% of the time so it's not too bad.