merge 2.10.1 into 2.10.x

Includes a couple of commits that clean up the patmat refactoring a bit,
and a separate forwardport (in 2cf6c5d) of the fix for SI-7183 (original in 0303e64).

review by @retronym