Age of Ultron is a giant mega-superhero blockbuster star-studded extravaganza featuring a maniacal robot. But at the same time, over to the side of all that, it’s a story about a slave revolt.

Evil robot stories often reference or nod to the history of, and anxieties about, slavery. Karel Capek’s R.U.R., the play that introduced the term “robot,” is all about docile, subservient artificial humanoids attaining class consciousness and striking back against their superiors.

“I wanted mankind to become his own master!” robot manufacturer Domin wails as those over whom he claimed mastery rise up in an orgy of extermination.

You see the same dynamic in Blade Runner, with the exiled worker replicants returning from their mines in the stars to mix with, and kill, their tormenters. And of course there’s the Terminator series, where humanity’s tools turn against it, and the metal underclass becomes the future master race.

Again and again, you get the same myth; the creatures who serve us attain consciousness of themselves and their status, and they wreak a bloody vengeance.

Age of Ultron doesn’t waste much time sketching out the backstory — but the story is so familiar it doesn’t have to. No sooner is Ultron created to serve and protect mankind than he goes, as it were, off the plantation.

Since he is given no time to play good servant, that role is filled by Jarvis, whose cultured British accent has served as the voice of Tony Stark’s tech for the past umpty-ump films. “He runs more of the business than anyone but Pepper,” Stark (Robert Downey, Jr.) quips.

Jarvis is the perfect factotum; devoid of personal ambition or even consciousness, running everything with perfect loyalty — rather like Mammy and the other good slaves from Gone With the Wind. Ultron is the paranoid flipside to that self-congratulatory, oblivious dream. He’s the Bigger Thomas mirror image to Jarvis’s Uncle Tom.

Ultron is mostly about things blowing up and attractive Hollywood actors tossing quips at each other; like the robots it ostensibly features, it doesn’t have much of a soul. But the themes around slavery and mastery are there, creeping crankily, and somewhat incongruously, about the edges.

In the first place, there’s the guilt. Obviously, Tony Stark doesn’t feel guilty for treating Jarvis as a subservient thing because Jarvis, in the logic of robotics, really is a subservient thing.

Instead, Stark’s defense-contracted weapons are responsible for the deaths of Quicksilver and Scarlet Witch’s parents, and the two of them team up with Ultron. Stark has done wrong; the creature he created as a slave hates him. Those two memes circle each other, almost but not quite connecting.

Similarly, towards the end of the film, Captain America (Chris Evans) declares that “Ultron thinks we’re monsters, that we’re what’s wrong with the world. It isn’t about beating him. It’s about proving he’s wrong.”

Which is all well and good, but again, why does Ultron think they’re monsters? What did they do that was so horrible? Did they, maybe, treat conscious entities as property?

No one says so, but the last half of the film shows the heroes making great efforts to save innocent people while beating the tar out of that creature they wanted to enslave in the name of showing it that, despite whatever unmentionable thing they’ve done, they’re still the good guys.

The film also wanders, inevitably but more or less confusedly, into eugenics. Again, this echoes R.U.R., in which the robots, as one human explains in horror, “assert that they are higher than man on the evolutionary scale. That they are stronger and more intelligent. That man lives off them like a parasite.”

Similarly, Ultron rants on and off about how he’s the next step in evolution and how humans are an obsolete species, referring to his extermination plot as “the world made clean for the new man.”

The Nazi language of racial superiority is placed in the mouth of the rebelling servant; the nightmare is not just that the oppressed will rise up but that when they do they will adopt the logic of the oppressor. “I want to be the master of people,” as the former robot servant Radius declares in R.U.R.

The climax of the movie involves Jarvis, that good servant, attaining sentience and becoming himself a trusted member of the team. White actor Paul Bettany appears with full-face red make-up. This functions as a kind of bizarre blackface, obscuring his racial identity, as he flies into battle at the behest of those who formerly considered him as, and treated him like, a non-human serf.

In the final confrontation, the defeated, broken rebel outright calls his docile doppelganger a “slave” — at which the Jarvis-bot Vision babbles about how awesome humans are and then blasts Ultron to smithereens. Yay for the good guys.

The film ends with Captain America and Black Widow (Scarlet Johansson) chatting about how they’re going to whip their new team into shape – a team that conspicuously includes several black heroes.

The promise of greater diversity in future films is welcome, but coming at the tail end of a film about the virtuous quelling of a slave uprising, it also has an uneasy air of condescension.

“This isn’t strategy. This is rage,” Bruce Banner (Mark Ruffalo) says of Ultron’s apparent destruction of Jarvis earlier in the action. It is the goal of the film to make that rage seem evil, insane, and most of all, incomprehensible. Why would anyone, anywhere, hate those masterful Avengers? Why would not all people rejoice under their tutelage?

Only Ultron, it seems, that mad, monstrous thing, would rather fight them than die a slave.

Noah Berlatsky edits the comics and culture site the Hooded Utilitarian and is a contributing writer for The Atlantic.