>>10918964The difference in the number of particles on each side DOES constitute a macrostate variable through the measurable difference in pressure.
To make this fact clear, consider the gas container in the pic shaped like a dumbbell, with large bulbs on either end and a very thin connecting tube that only a few gas molecules will typically pass through at a time. The set of microstates in which there are many more molecules on the left than the right constitutes a macrostate with a measurable pressure difference on one side than the other. The set of microstates in which there are equal numbers of molecules on either side constitutes a macrostate of even pressure. These macrostates have different entropies, and a spontaneous change from the even macrostate to the uneven macrostate would constitute a negative entropy fluctuation, from which useful work could hypothetically be extracted.
The issue is that you're going to be waiting a very long time for such a thing to occur with any respectable number of molecules, and on those timescales you will also have fluctuations in your energy extraction device that end up losing you energy, much like the Brownian ratchet.