Rather than FIDE rules think of the rules of a game on chess.com (the rules that are nothing to do with the server are not part of the mathematical description and the clock would generally also be ignored in mathematical study).
That subset of the code of the server is essentially a set of mathematical rules of the game. It includes automated catching of triple repetitions and examples of the 50 move rule.
Yes, that's an example of the sort of compromise I was talking about, but it doesn't adequately represent all of the versions of chess I mentioned and I don't think the code is publicly available.
hi