I found this online note- it described and fixed my problem.
from https://www.engine-codes.com/p2097_mazda.html
Tech Notes
Some 2007-2009 Mazda CX-7, 2007-2009 Mazdaspeed3, and 2006-2007 Mazdaspeed6 vehicles may experience hesitation or surging when accelerating after engine warm-up. These...
ENGINE/DRIVABILITY
Year/Make/Model: 2007 Mazdaspeed 3
Mileage: 207,000 miles
Location/Alitutude: Missouri Ozarks
Concern: Engine will not idle, or occasionally will hang on with a very rough idle, then die; when rolling slow in 1st or 2nd gear, gas pedal is VERY touchy and causes the car to...