Like the Soviet Union in the 1970s, China is coming to the end of a long labor-force boom and hoping that an orgy of investment will keep the old magic going while stabilizing its fraying frontiers.