Reading this maze
Latch and return starts at row 4, column 5. Of the 42 grid positions, 29 are paintable and 13 are walls. The start is already painted; the other 28 tiles remain to be reached.
The diamond at row 2, column 4 toggles gate A at row 4, column 3 on every entry. Start right and stop at row 4, column 6. Use the closed gate as a stopping point on the verified route. Re-entering the diamond can close or reopen the return passage. The first slide covers 2 of 29 target tiles.
The verified opening crosses 1 tiles before stopping. A breadth-first search proves a 22-slide finish from this exact starting board; that is a reference target, not a move limit. You may revisit any painted tile.
Switch A is a diamond; gate A has bars when closed and a dashed outline when open. Entering the switch toggles it immediately, including during a slide. If you get trapped, undo or restart; Hint checks the current gate and painted-floor state.