@retroben It’s actually extremely hard to determine when a game is saving because some games use SRAM for additional RAM, which means it’s getting written to constantly. Thus, writing to file any time SRAM changes can be very bad for solid-state storage and could also be an issue on I/O-constrained platforms. We could try putting in some heuristics but that will inevitably have edge-cases and so on, particularly in the context of the number of platforms (both physical and virtual) that RetroArch supports.
However, we do have the settings > saving > SaveRAM Autosave Interval option, which will flush the SRAM to file periodically (the default is every 10 seconds). As long as a crash doesn’t happen within that 10-second window just after saving, everything will be kept.