“Chaos is order yet undeciphered,” reads a title card at the beginning of Denis Villeneuve’s “Enemy.” It’s a tone-setter for a film that examines personhood in unsettling ways.

Adam (Jake Gyllenhaal) is a glum history professor at a university. He returns from his lectures and dutifully makes love to his girlfriend Mary (Melanie Laurent). It’s a relationship that seems glued together out of comfort rather than passion.

A colleague recommends a film, which Adam picks up at a video store (if you can remember those). In watching the movie, Adam spots an actor in a bit part with more than a passing resemblance to himself. He first dismisses it as an interesting curiosity, but soon becomes obsessed with finding this man.

Villeneuve follows up his excellent — and similarly bleak — “Prisoners” in a reunion with star Gyllenhaal. He creates a slow-boiling thriller that increases tension until there’s almost no air in the room. There are certainly more than a few hints of Hitchcock, as well as the darker side of David Lynch.

Gyllenhaal is something of an underappreciated actor in my book, and as his dual characters come closer to discovering each other, he’s given range to both brood and explode. And brooding and exploding are Gyllenhaal’s forte. He gets great support from Laurent (“Beginners,” “Inglourious Basterds”).

The film is gorgeously shot by cinematographer Nicolas Bolduc, and features an evocative score that highlights the tension without being overbearing.

This brings us back to the “chaos.” “Enemy” is equal parts fascinating and frustrating. Viewers may find more “undeciphered” than “order” in its resolution — and some interestingly unresolved moments.

I gave a similar warning to the in-my-book excellent “Upstream Color” (now streaming on Netflix) and took some flak from some friends who later watched it. Consider that a warning.