Directed by Alex Garland, "Ex-Machina" is a thriller starring Oscar Isaac, Domhnall Gleeson and Alicia Vikander. (  / A24 Films)

To most speculative fiction fans, Alex Garland is best known as the novelist behind “The Beach” and the screenwriter behind “28 Days Later” and “Never Let Me Go.” With “Ex Machina,” Garland makes an impressive debut as a director, spinning an unsettling futuristic thriller with the expertise and exquisite taste of a seasoned veteran.

Among Garland’s virtues is an impeccable sense of how to get a story moving: Within the first few minutes of “Ex Machina,” we’ve met Caleb, an eager young computer programmer played by Domhnall Gleeson, and observed his overjoyed reaction at winning a week-long stay at the secluded estate of his legendary boss, Nathan (Oscar Isaac). Traveling by private helicopter over acres of lush forests and waterfalls, he asks the pilot when they’ll get to Nathan’s property, only to be informed they’ve been flying over it for the past two hours.

Nathan, who invented a Google-like search engine called Blue Book, lives like a New Age mad mountain king, ensconced in a pristine modernist aerie set into the rock face of a hillside. Anyone would be dazzled, and Caleb is doubly thrilled when he learns why he’s been summoned: Out of hundreds of Blue Book employees, he has been chosen to conduct a “Turing test,” in which he is tasked with matching wits with an artificial intelligence machine Nathan has constructed, in order to judge whether it possesses genuine human consciousness.


Nathan (Oscar Isaac), left, invites Caleb (Domhnall Gleeson) into his world in “Ex Machina.” (A24)

Of course, the Turing test is also known by another name. But if Nathan had asked Caleb, “Have you heard of the ‘imitation game’?” that would have invited an unwelcome digression about last year’s Academy Awards race. Garland effectively erases any and all memories of the Alan Turing biopic, instead calling on references as wide-ranging as “Alice in Wonderland,” “Frankenstein” and “Apocalypse Now” to create an absorbing, often disquieting contemporary parable. It complicates matters at first only somewhat — but then a whole lot — that Nathan’s A.I. comes in the form of a pretty animatronic woman named Ava. Played by the Danish actress Alicia Vikander with sensitivity and precise, balletic movements, this metal-limbed beauty blurs the lines between artifice and authentic emotion in ways that will ultimately do a number on both Caleb and her charismatic, manipulative inventor.

Filmed in a spectacular private home and neighboring eco-hotel in Norway, “Ex Machina” has been handsomely designed, the leafy, green natural environment coexisting in Zenlike balance with the glass, steel and blue-glowing neon of Nathan’s lair and laboratory. His head shaved and sporting a generous beard, Isaac embodies his cerebral-hipster alpha male with a carefully calibrated mixture of warmth and menace: One minute he’s bro-ing down with Caleb, the next he’s an inebriated, belligerent bully. (And in one delightfully surreal sequence, he’s giving “Saturday Night Fever”-era John Travolta a run for his money on the dance floor.)

As the audience’s proxy, Gleeson brings just the right amount of naivete and openness to a character who becomes so unsure of what’s real that he resorts to extreme methods. There are more than a few dollops of body horror in “Ex Machina,” which winds up veering into pop revenge pulp. But even at its bloodiest, the film succeeds at ratcheting up the mood of quiet unease, provocatively engaging everything from intimacy, identity and agency to such hot-button issues as corporate surveillance, sexual orientation and male privilege. The fact that so many questions can be addressed by way of a tautly constructed triad — and that each of the three principals is such a clearly delineated, vivid character in his or her own right — is a testament to Garland’s original concept, the lucidity of his execution and to the superb actors who bring it to such chillingly convincing life. “Ex Machina” is a smart, exceptionally stylish head trip.

R. At Angelika Film Center Mosaic and
ArcLight Bethesda. Contains graphic nudity, profanity, sexual references and some violence. 110 minutes.