I don’t care whether the judge is Chinese or American, any imposition of death by state apparati is a travesty and incompatible with socialism.
I would draw a distinction here. If the state's existence or authority is threatened, then the death penalty is valid, especially if it is a nascent socialist state. The preceding revolution and its survival would be more important than any one individual's right to life.
Once a revolution has attained stability and maturity, then the death penalty couldn't be justified. And of course, no death penalty issued by a capitalist state is ever justified.