What I was doing was reporting each move as it occured, like:
position moves g1f3
position moves d7d5
position moves e2e3
position moves c8g4
This worked fine for Glaurung, as by not specifying
startposit must have just appended the moves to the existing ones. However for Fruit it would assume 'startpos' was missing thus every move reported was considered the first move.
So the solution is to send every move before requesting a new one like this:
position startpos moves g1f3
position startpos moves g1f3 d7d5
position startpos moves g1f3 d7d5 e2e3
position startpos moves g1f3 d7d5 e2e3 c8g4
Seems a little inefficient? I guess that the engines could do a string compare to check if this position command is just reporting one new move.
I've tested the new changes by letting Fruit and Glaurung fight it out:
It was just painful to watch - Fruit had to twist the knife by slowly promoting two pawns to humiliate Glaurung. No love lost between these two.
UPDATE: Dec 16th
I emailed Stefan Meyer-Kahlen at shredderchess.com and he confirmed that UCI engines are completely stateless and thus the correct behaviour is to send all the moves each time.