Does mac restart work reliably with restoring open applications and restoring states in every case? I'm new to mac, so far when restarting everything worked reliably as it did before and was more or less in the same state.

Can I as a dev lean on not loosing any state information when restarting? Can every application be restored completely and when does data loss occur ? Are there any known bugs ?

Before getting too comfortable with the feature I want to know how much I can rely on it to restore everything to the previous state, otherwise I will be more cautios with restarts, so I think this info is helpful for any dev using mac osx as a platfom to develop.
In practice you can't rely on it.

The hooks are there in the OS to allow perfect restoration but each app has to be written to keep track of its changes and most aren't. Often that is the correct design decision as it allow the app to start in a controlled state rather than work out all the possible changes.

If you want the same state don't log out just put the machine to sleep.