The premise of the miniseries Devs is straightforward: Amaya, a company that specializes in quantum computing, invents a top secret prediction algorithm, kills an employee in an effort to protect that invention, and makes an enemy of the victim’s lover and coworker. The first episode features a gilded computer fortress, espionage, a murder, and a staged suicide, pulpy elements suggesting popcorn thrills and cyberpunk frenzy. The reality is much stranger: Devs is really about deities and the theologies we embrace to appease them.

Devs is writer and director Alex Garland’s second tale of Silicon Valley delusions. His directorial debut, 2014’s Ex Machina, explored the development of a gendered AI being, Ava, whose sentience is tested by her creator, Nathan, and Caleb, his unwitting employee, who believes he has won a special contest. The film takes place far outside Silicon Valley, at a remote compound owned by Nathan, who is the CEO of a search engine company, but it’s defined by the tech industry’s promethean ambitions. As Nathan and Caleb speak casually of creating and assessing life, they come across as intelligent but self-important, a dynamic that Ava uses to plot her escape.

Devs takes place in the Valley itself. It opens with a foreboding profile of Amaya CEO Forest (Nick Offerman), who’s introduced alone in darkness, followed by a montage of San Francisco’s glittering landmarks and jarring snapshots of the city’s horrific income disparity. Those poles merge when Amaya employees Lily (Sonoya Mizuno) and Sergei’s (Karl Glusman) commute to work: Before the couple can exit their apartment building, they must step past a homeless man who sleeps on their stoop.

But then, as the Amaya-branded charter bus that transports them glides out of the city and into the surrounding redwoods, Garland’s portrayal of the Valley shifts again, from the sociological to the occult. Ensconced in the verdant Bay Area hills like the lair of a Bond villain, the Amaya campus is scenic and glamorous—except for a gargantuan bust of a little girl that towers over the buildings and trees, her hands raised as if she’s praying or dancing. The strangeness intensifies when Sergei is promoted to work in “Devs,” the software development arm of Amaya that focuses on the company’s clandestine predictive algorithm (also named Devs). The team is housed in a facility located in a clearing that’s deeper in the woods than the main campus. The path through the trees is lined with glowing lights that form halos around the redwood trunks, and the entrance is lined with iridescent obelisks that sparkle in the California sun. As Sergei enters this sanctum and rides a levitating platform to his workstation, Amaya acquires an increasingly magical hue. This is the heart of Devs: science, the surreal, and the thin line between them.

The show is Garland’s first foray into television, but it’s continuous with his previous work as a screenwriter and director. Its closest analog in his filmography, which spans works like the zombie film 28 Days Later (2002) and the dystopian police thriller Dredd (2012), is 2018’s Annihilation. Like that hallucinogenic adaptation of Jeff VanderMeer’s sci-fi book, Devs starts with the familiar and moves deep into the uncanny. The show is variously a drama, a thriller, and horror, constantly molting its skin. Garland seems to favor genre because he can set up traditional narrative structures and fill them with trapdoors—beckoning viewers in, then flipping a switch.

The first misdirection is the main character. Though Sergei is the focus of the initial episode, he’s killed by its end, and the circumstances of his death prompt Lily to question Amaya’s quaint veneer. A member of the company’s encryption department, Lily is questioning and cunning. She speaks and moves slowly, dwelling on her words and constantly frowning. When Amaya covers up Sergei’s death as a self-immolation and even furnishes a convincing video of the suicide, Lily is suspicious, a skepticism that structures the show. For every obstacle Amaya throws in her path, she responds with a unique solution, inciting a game of cat and mouse that involves cons, hacking, and escape from a mental ward.

She’s well-suited to a story critical of the tech industry: brainy yet ordinary, crafty but fallible, frightened but not paranoid. Compared to brooding sci-fi heroes like Elliot Alderson of Mr. Robot, who is a savant hacker and exclusively wears black hoodies, or John Anderton of Minority Report, who is a master detective and escape artist, Lily isn’t a virtuoso. Her defining trait is her detachment from the myths and illusions of Silicon Valley, a disposition that grounds her decisions as she’s drawn deeper into Amaya’s designs. Through Lily, the show highlights the lives beyond the technocracy, even at the epicenter of its innovations.

Devs follows a decade filled with critical looks at the tech industry. From the roasting of Mark Zuckerberg in The Social Network to Anna Wiener’s memoir Uncanny Valley to Boots Riley’s fuming send-up of Silicon Valley callousness in Sorry to Bother You, tech culture has become a standard milieu for parsing modern anxieties about corporate power, personal privacy, and social inequality. Devs channels these tensions, but tweaks their vernacular. While the show can be watched as a David and Goliath tale, in which an aggrieved woman goes to war with an egomaniacal man and the ruthless capitalist machine at his disposal, Garland is largely disinterested in allegory. For him, politics and philosophy are embedded in science and technology itself. Accordingly, the conflicts of the series flow from the quantum mechanics at the heart of the story.

In particular, Garland traces the consequences of a religious embrace of the many-worlds interpretation of quantum mechanics. In that version of quantum theory, all possible iterations of an event can and do happen, and our experience of an event is just one branch on an infinitely expanding tree. This interpretation posits that all events are reducible to their underlying physics—meaning they are deterministic—and Forest and his chief programmer, Katie (Alison Pill), test that theory by using the Devs algorithm to recreate and then observe the past with pristine clarity, eventually peering into the future as well.

The self-fulfilling nature of viewing choice as an illusion, and then later confirming it, imbues Forest and Katie with an inhuman dispassion. Forest, aloof and disinterested, powerful yet not paranoid, is a far cry from the standard tech overlord. He lives in a modest house without a fence or gates and wears dinky plaid shirts and jeans, scanning as down-to-earth. Katie, who is introduced at his side, has zero tolerance for error and ineptitude, yet she’s intensely serene. She channels Silicon Valley intelligence without the performative machismo or affected awkwardness; she wants to be right, not worshipped. Together the pair practice a cold form of nonintervention, declining to interfere as the events of the series beget car accidents, kidnappings, and torture. Fate (on the quantum level) is their religion and their piety is steadfast. For a higher cause, they relinquish their free will.

Garland plays with narrative forms through Lily’s pluck and suspicion, giving the series a peculiar, contradictory rhythm. In one scene, Lily and Jamie (Jin Ha), a heartbroken and downcast ex-boyfriend she’s enlisted to help her investigate Sergei’s death, are arranged around Lily’s  apartment at different points in time. They sit apart, enter and exit separately, and brood. Simultaneously, Lily and Sergei are positioned around the same space: They hug, kiss, and cuddle. Jamie insists he was smitten with Lily and blindsided by their breakup, but in this moment we see the distance between them is fundemental.

In another scene with the same visual conceit, Katie views different versions of the car accident that killed Forest’s wife and daughter, who the company is named after. The collisions play out simultaneously, showing multiple versions of Forest running to the scene of the accident as the cars swerve or impact in different ways, like some video game glitch. Only one scenario is fatal, however, highlighting how perfectly the accident played out. These time collages are a preview of the Devs system that gets honed later in the series, and they convey Garland’s unique relationship to science. As uncanny as it is to view the past in high-definition and as scary as it is for Amaya to possess such technology, it’s also impressive. Garland isn’t an apologist for Amaya’s abuses, but he doesn’t downplay the wonder of the company’s achievements.

That cautious reverence pays off in the form of the predictive algorithm system actually working. After starts and stops, toward the end of the series it becomes fully functional, granting Amaya the ability to view history exactly as it happened by applying determinism to GPS coordinates and setting the clock. The result is the ultimate archive of earth’s history and an unparalleled spying device. Housed in a cozy, theater-like room inside of the Devs HQ, the device works like an immersive scrying mirror, conveying the spookiness at the heart of cutting-edge science. “But I am scared we might be magicians” Forest says to Katie, his voice quaking with fear.

This outcome is striking because a longstanding trope in sci-fi is that devices or processes with flawed inventors are themselves flawed. This is the premise of most fictional forms of artificial intelligence, from Sonny in I, Robot to The Avengers’ Ultron. (And it is nearly always the premise of stories involving genetic engineering, as seen in Jurassic Park, Frankenstein, and The Fly.) In a sly nod to tech leaders often coming from sales or venture capital backgrounds,, Forest plays no role in the Devs system getting up and running (“He’s not a fucking genius, he’s an entrepreneur,” one character quips). More than a joke, this choice allows the narrative to pivot away from his neurosis as a grieving father and husband and consider the broader implications of Devs. As Devs programmers celebrate the tool and test it, an anxiety sets in. They have become gods and the power is horrifying. Determinism robs them of liberty and humanity.

In a masterstroke of plotting and irony, that breakthrough leads back to Lily, the rogue nonbeliever. When Katie and Forest use the algorithm to view the future, they find that they cannot see past a moment when Lily strolls into Devs, beginning a countdown to learn the fate of the company and the device itself. When that encounter inevitably happens, what’s dazzling is that Lily does not arrive as an avenging angel. Rather, she acts as a sort of quantum trickster, at once foiling Amaya’s schemes and enabling them, challenging the company’s mad science and proving it.

A key moment in the finale is Forest informing Lily that the “v” in Devs is roman, making Devs Deus, or deity in Latin. Forest introduces this trivia as a “private joke,” accenting how removed he is from the consequences of his ambitions. In his pursuit to reconnect with his daughter and wife at any cost, he turns the world into his instrument. In his view, everything Lily has endured is collateral damage. For Lily, the disclosure validates her resistance. If a deity is as constraining and controlling as Forest, it must be defied.

Corresponding to its themes, the series ends ambiguously. There’s no divine punishment for Katie and Forest’s tinkering, no reward for Lily’s courage. The Devs system does not explode or short-circuit or get unplugged. The government does not storm in with guns and hackers to save the day. Instead, the show concludes with Lily and Forest becoming quantum data, allowing them to repeatedly live out multiple versions of their lives. In the timeline we see, which is one among infinite possibilities, Forest is reunited with his daughter and wife and Lily reconciles with Jamie. It’s tragic and touching and fleeting—a very quantum ending.

This sort of finale elides the aftermath of a world containing a godlike algorithm and settles instead on something more conventional: twin portraits of grief. But the value of the more narrow conclusion is it posits that, like consumers, tech’s engineers and their loved ones are also exploited by the relentless drive for innovation. In Ex Machina, Garland packed this sentiment into an allusion to the quote “Now I am become Death, the destroyer of worlds,” the line from the Bhagavad Gita that Robert Oppenheimer uttered after witnessing the detonation of a nuclear weapon. In Devs, the technology and the destruction are different, but in the show’s panorama of losses personal, global, and ontological, “worlds” feels pointedly more plural.