I replaced the upper nozzle guide, nozzle shaft and upper spray arm. I also replaced the pump gasket for good measure.
Top rack dishes had not been cleaning properly. I first removed the filter assembly to inspect the main pump from above. It was clogged but after cleaning and reassembly I observed that while middle and bottom spray arms were changing position, the upper spray arm was not. I confirmed that water was flowing through the upper spray arm by placing some empty yogurt pots on a baking tray on the top rack. The ones underneath the spray arm filled up.
I tried cleaning the spray arm by removing it and flushing it with water but that didn't help.
When spinning the upper arm by hand it tended to stop after a few turns so I wondered if the shaft had worn down and was creating too much friction for the nozzle to turn. So I ordered replacement upper nozzle guide, shaft and spray arm and tried them out. On the same order, I took the opportunity to replace the filter assembly (still a little clogged), the pump gasket (showing signs of wear) and some broken dish rack rollers.
After replacing all those parts, the upper spray arm was back to working order.