Autocracy and surveillance are not requirements for socialism. Indeed FLOSS is basically communism for software of you think about it.
This community has a lot of China boosters who like to paint the country as some sort of idealised socialist utopia, but you're right: it's an autocratic surveillance state. As Free software is essentially incompatible with the demands of such a state, I wouldn't say it's compatible with China. That doesn't mean it's incompatible with socialism though.