Y-axis layer shifts with recent Marlin on Ender 3
Buried in a bug tracker entry for a seemingly unrelated issue, I found what seems to be the solution:


  @johanmga, I've discovered the velocity jumps here come from using "classic jerk" computations, and happen whether or not s-curve acceleration is enabled.
  
  Try uncommenting //#define JUNCTION_DEVIATION in Configuration_adv.h; that will disable classic jerk and use the junction deviation math instead.
  
  Also for reference, issue #12403 is actively tracking the layer shift issue (please comment there too if you have more information on problems/solutions), and #12540 is has more information on classic jerk vs. junction deviation.


https://github.com/MarlinFirmware/Marlin/issues/12491#issuecomment-443464603

It seems that the "classic jerk" code no longer works and produces erroneous motion to the steppers under some conditions (dependent on G-code contents), whereas the Ender 3 default configuration file is still using it.

With the default JUNCTION_DEVIATION_MM of 0.02, things worked right away, but printing was so slow that I could plausibly attribute it working just to the slowness.  But increasing it up to 0.1 via the menus got the speed closer to what I'm used to, and it's still printing with no layer shifts.

I've posted my results in the tracker in hopes that they'll lead to discovery of the root cause: https://github.com/MarlinFirmware/Marlin/issues/12403#issuecomment-519305409

Another issue on the tracker seems to have more detail:

https://github.com/MarlinFirmware/Marlin/issues/12540#issuecomment-442793326