A post-collapse nation-state on this world lost control of its robotic war machines
There is no genocidal AI, just a lot of automation that allows the machines to maintain themselves (and replenish their numbers) without sapient oversight
And a glitch that the machines to no longer recognize friend from foe
Due to this, the land is uninhabitable.
Unable the flee offworld during the Long Night, the natives survived at sea
Their ships and drifting structures slowly agglutenized into massive floating cities. As long as they don't stray too close to land, the warmachines do not take an interest in them.