How are PGN ambiguities handled? How are ambiguities handled when writing the PGN when more than one piece of the same type can move into the same square?

[FEN "1R4QQ/R1R4Q/8/6pP/5P1P/8/NK1k4/1N1N4 w - g6 0 1"]


Note: It isWhite to move, with an en passant capturing square on g6.

What would happen if:


the top rook moves to b7?
one of the bottom rooks moves to b7?
the left pawn takes xg5?
the bottom right pawn takes xg5?
the top right pawn takes xg6 by en passant_?
the top left knight goes to c3?
one of the bottom knight goes to c3?


Edit (bonus question):


What would happen if any queen wants to go to g7?
From the specification:

A basic SAN [Standard Algebraic Notation] move is given by listing the moving piece letter (omitted for pawns) followed by the destination square. Capture moves are denoted by the lower case letter &quot;x&quot; immediately prior to the destination square; pawn captures the file letter of the originating square of the capturing pawn immediately prior to the &quot;x&quot; character.

And

In the case of ambiguities (multiple pieces of the same type moving to the same square), the first appropriate disambiguating step of the three following steps is taken:
First, if the moving pieces can be distinguished by their originating files, the originating file letter of the moving piece is inserted immediately after the moving piece letter.
Second (when the first step fails), if the moving pieces can be distinguished by their originating ranks, the originating rank digit of the moving piece is inserted immediately after the moving piece letter.
Third (when both the first and the second steps fail), the two character square coordinate of the originating square of the moving piece is inserted immediately after the moving piece letter.

1: Rbb7
2: Rab7 or Rcb7
3: fxg5
4: hxg5
5: hxg6
6: Nac3
7: Nbc3 or Ndc3
Note that this is simply how the specification is written. En passant captures should not be an edge case, but they are unlikely to be implemented correctly 100% of the time. You'll have to test your replayer to see whether it handles these cases correctly or not.