Issues with stepper drift on latest Klipper

One possible explanation for what is occurring here could be a difference in rise/fall times on the step pin and the direction pin. (The Manta M8P appears to have a level shifter on these pins that may have a faster fall time than rise time.) In that situation, it is conceivable that the stepper driver could observe a direction change before a step change, even though the code issues the step change first. The recent code optimizations to stm32h7 may have lowered the time between step and dir change to the point that this type of race is now statistically more likely.

This is just a possible theory - it could easily be something else.

I’ve put together some testing code at GitHub - KevinOConnor/klipper-dev at work-stepdir-20250507 . To test it, set step_pulse_duration: 0.000000200 in all [stepper_?] config sections and load the code with something like:

sudo service klipper stop
cd ~/klipper
git fetch https://github.com/KevinOConnor/klipper-dev work-stepdir-20250507
git checkout FETCH_HEAD
sudo service klipper start

If anyone does run this test, let us know the results (success or failure).
-Kevin