how did john know that karkat was a boy in the "i am not a homosexual" pesterlog at the beginning of a5a2?
That was one of John’s last conversations he had with Karkat. John had talked to him several times before so he probably picked it up along the way.