chrisboyle / sgtpuzzles

Android port of Simon Tatham's Puzzles
https://chris.boyle.name/puzzles
Other
584 stars 166 forks source link

Keen crashes in outline_block_structure since DSF rewrite #609

Closed chrisboyle closed 1 year ago

chrisboyle commented 1 year ago

In Keen, outline_block_structure now always fails assert(n < 2*w+2) when drawing. This also happens upstream when attempting to print.

Unlike upstream, we always call outline_block_structure in normal drawing, as opposed to printing. This is because in night mode I wanted the block structure to be drawn in a slightly different colour.

This broke at 68d242c5 "Actually rewrite the dsf implementation" (located via git bisect).

chrisboyle commented 1 year ago

From throwing in some printfs, in the example I looked at, it now gets stuck tracing around the first chosen block forever. It also looks like this comment no longer holds:

    /*
     * For each block, we need a starting square within it which
     * has a boundary at the left. Conveniently, we have one
     * right here, by construction.
     */

...because dsf_canonify right above it did not choose such a square.

chrisboyle commented 1 year ago

I'm not sure I understand enough about DSFs and how Keen uses them to make any further immediate progress myself; the light may yet dawn but meanwhile I've emailed Simon.

chrisboyle commented 1 year ago

Thanks to Simon for a swift fix upstream in c5076be3 (now merged)