Rated R for graphic nudity, language, sexual references and some violence. Open citywide. Check theatres for show times.

Sometimes a movie is so good you can’t stop thinking about it. You keep replaying its powerful emotional impact your mind, just as amazed days later as you were sitting in the theatre. Such a movie is Ex Machina, a thrilling, thoughtful, mysterious, and unbelievably tense look at humanity in the throes of creating artificial intelligence.

Caleb (Dublin-born Domhnall Gleeson) is a talented programmer at an enormous complex of the most wealthy tech guru on the planet. He’s just won a “lottery” to spend a week at the home of founder Nathan (Miami-raised Oscar Isaac). His home, which is really a sprawling research center, is located in a remote mountain hideaway, meaning there’s no escape except by helicopter. (The location is an actual hotel in Valldalen, Norway.) An I.D. card allows Caleb access to a few rooms, but all others are blocked.

Nathan pretends to be the hospitable host and encouraging mentor, but really he’s a hostile interrogator, mocking Caleb’s naivety and inherent niceness. In time Nathan reveals himself to be a ruthless monster, as depraved as he is brilliant. Caleb soon learns the real reason he’s been invited to the complex. He is supposed to do the Turing test on a beautiful, enigmatic female android named Ava (Swedish-born Alicia Vikander, who looks like the little sister of Natalie Portman and Keira Knightlley, meaning she’s so lovely you can’t take your eyes off her and of course, neither can Caleb. The Turing test, named after computer pioneer Alan Turing (The Imitation Game, 2014) is test, usually by language ability, test of how conscious a unit of artificial intelligence is. When a human interacts with a computer and the human doesn’t know the computer is a computer–then the computer is a success. Creating artificial intelligence that is as good as being human, is so difficult, and so incredibly awesome that, as Caleb comments, it’s the work of gods. The god in a machine, deus ex machina.

Enchanted by Ava’s beauty and her flirty ways (she even makes a joke, a high-level human achievement), Caleb falls in love with her despite the fact that her skin is synthetic and her arms and legs are composed of CGI wires. She lets him believe she’s in love with him and wants him to rescue her from Nathan before he “upgrades” her and wipes her memory clean. Mostly she wants to have what to her is the ultimate life experience, standing at a busy intersection in a city watching human beings hurrying to and fro.

Soon Caleb meets the other occupant of the complex, a young Japanese woman named Kyoko (Sonoya Mizuno). She speaks no English, Nathan tells him, so they can converse freely in front of her because she doesn’t understand anything they say. She’s seems brain-dead, ready to strip for sex or gyrate to wild dance music at the slightest hint. Nathan curses her at the smallest infraction but she doesn’t seem to mind his rages. Caleb is upset to see such disgusting anti-female treatment (and so is the audience), but he dare not intervene. We all begin to wonder if Kyoko is an abused woman—or—hmmmmm, possibly another android?

Caleb imagines that he is eventually getting the upper hand over Nathan when he hacks into the computers and finds old videos showing the true behind-the-scenes histories of the complex. Meanwhile the more he falls in love with Ava, the more he wants to help her escape. Blinded by love, he can’t see what we are beginning to sense – lies, lies, and more lies.

I can’t reveal anymore without ruining the story. Let’s just say that you will be on the edge of your seat all the time, that nothing is what it seems, and that the android is more human than we like to admit. Whatever you thought makes you human you’ll have to re-assess. And whatever you think about artificial intelligence, you’ll realize it’s not a question of if, but when.

Ex Machina is the fourth major feature film written by London-born Alex Garland. Three of his previous scripts are favorites of mine: Never Let Me Go, the film of Kazuo Ishiguro’s haunting futuristic novel (2010), the original script for Sunshine, a Danny Boyle-directed sci-fi tale of humans trying to re-ignite the sun (2007), and 28 Days Later, another original script for Danny Boyle about a handful of survivors of a world-wide plague ( 2007).

Ex Machina is Garland’s first feature film as director. With his own exquisite script to guide him, a trio of fine actors, and a fine team of cinematographer and set designers to help him out, Garland turns in a bravura directorial debut. I left the theatre weak in the knees, not just from the gut-wrenching ending, but from being witness to the blazing genius of new director/writer.

Marcianne Miller is a member of SEFCA (Southeast Film Critics Assn.) and NCFCA (North Carolina Film Critics Assn.) Email her at marci@aquamystique.com.