How is average centipawn loss calculated when a mate is missed? As far as I know, to calculate the average centipawn loss, we calculate S1 - S0 for every move, where S1 is the evaluation (in centipawns) of the position before the move and S0 is the evaluation (in centipawns) of the position after the move.

Let's take this position as an example:

[Site "https://lichess.org/kuvnBssO"]
[Date "2018.07.20"]
[Round "-"]
[White "Kulkid"]
[Black "WaisKamal"]
[Result "0-1"]
[WhiteElo "2016"]
[BlackElo "2107"]
[Variant "Standard"]
[TimeControl "30+0"]
[ECO "D44"]
[Termination "Normal"]
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]
[SeUp "1"]
[StartPly "67"]

1. d4 d5 2. c4 Nf6 3. Nc3 e6 4. Nf3 dxc4 5. e3 { D44 Queen's Gambit Declined: Vienna Variation, Quiet Variation } Be7 6. Bxc4 O-O 7. Bd3 Nbd7 8. O-O b6 9. Re1 Bb7 10. a3 Bxf3 11. b4 Bxd1 12. Rxd1 c5 13. Bb2 cxd4 14. exd4 Qc7 15. Ne2 Rac8 16. Rac1 Qb7 17. Rb1 Rc7 18. f3 Rfc8 19. Ng3 h6 20. Ne4 Nxe4 21. Bxe4 Qb8 22. Bd3 Bf6 23. Ba6 Rd8 24. Be2 b5 25. Kf2 a6 26. Bc1 Nf8 27. Be3 Rdd7 28. Rdc1 Rxc1 29. Rxc1 Qd8 30. Rd1 Bxd4 31. Bxd4 Rxd4 32. Rc1 Rd2 33. Re1 Ng6 34. Ke3 f5 35. Kf2 Nf4 36. Kg3 Nxe2+ 37. Kf2 Qd4+ 38. Kf1 Qg1# { Black wins by checkmate. } 0-1


The given position is a mate-in-one (Qd4#). I missed this mate, and instead played f5, resulting in a position with an evaluation of mate-in-6. How will my centipawn loss be calculated for this move?
I cannot vouch for every engine available, but the general approach is, the mate is evaluated to something close to 15-bit integer, 32765 centipawns, and you get minus 1000 centipawns for every move-to-mate (to make it reasonable for the engine to sacrifice the queen (~900 cp) to delay the mate).

In your particular case, the original evaluation was 327.65 pawns, the mate-in-6 became something like 327.65 - 10.00 * 6 = 267.65 -- the numbers are not exact, and different engines may use slightly different approaches, but this one is the most common, I believe.