If you want to follow that infamous article, you should really follow it all the way and more importantly understand what is said there. It was even explicitly mentioned that you would encounter stuttering if you didn't perform proper interpolation. I changed the last 2 methods of your player code to:
void Player::draw(sf::RenderWindow &rwin, float interp)
{
// Perform linear interpolation between last state and current state.
sf::Vector2f posInterp = pos * interp + lastPos * ( 1.f - interp );
self.setPosition(posInterp);
rwin.draw(self);
}
void Player::update(float dt)
{
// Save state before the last update before drawing.
lastPos = pos;
if (right == true && left == false)
{
xs += speed;
}
if (right == false && left == true)
{
xs -= speed;
}
if (!sf::Keyboard::isKeyPressed(sf::Keyboard::Right) && !sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
{
right = false;
left = false;
}
pos.x += clamp(xs, -6, 6);
xs /= fric;
// Get rid of floating point instability.
if( std::abs( xs ) < 0.4f ) {
xs = 0.f;
}
}
and the visible artefacts are gone for me. The difference between the original and my code are marked by comments. You need to perform proper linear interpolation between both states, not just an addition to the current one. If you just added the difference that was missing, of course the position would bounce back and forth depending on how much time is left in the update loop, and that depends on the synchronization between the FPS and your fixed delta leading to what you described on different systems.
To get rid of the "vibration" artefacts when slowing down, all you need to do is snap the movement down to 0 once it is under whatever threshold you choose. If you don't do that and continue to divide a floating point number, it will keep getting smaller and smaller and thus keep losing precision as well leading to those instabilities at the start. At some point it will be so small that even drawing that difference won't lead to any change which is why you only see it at the start of the "slowing down" phase.
You really have to consider whether having such a complicated simulation is worth the effort. This is really only necessary when you need deterministic reproducibility which is not the case in most games. Unless the simpler delta update variant leads to significant problems, I wouldn't overdo it and focus on more productive issues. And if you think that with this method, a simulation will be deterministic no matter what,
think again. As a hardware developer, I have experience dealing with floating point hardware, and trust me when I say that so many tricks are employed you should be happy that 1 + 1 = 2 although technically that is a lie as well. In the end, all I can say is that unless you are willing to go the whole nine yards, you shouldn't waste your time on these micro-optimizations.