Child’s Gay: Young Turing kept his sexuality under wraps.

The horrors and heroics of World War II birthed a million stories, most of which involve brave infantrymen risking their lives to save the world from fascism. Fewer of those stories involve mathematicians, but maybe they should. The Imitation Game is the compelling real-life tale of how Alan Turing (Benedict Cumberbatch) cracked a Nazi code considered by many to be unbreakable, and in the process created the world’s first computer, called at the time a “universal machine.” Later in life, he was arrested for indecency—Turing was gay—and sentenced to hormone therapy. He committed suicide at the age of 41, a decade after winning us the war.

The Imitation Game is occasionally too conventional a film for its thoroughly unconventional hero, but the novelty of the untold story and its brilliant lead performance are a winning equation. Turing is no typical war hero. The opening scenes find the brilliant but standoffish young mathematician from Cambridge summoned to a government building to interview for the top-secret war effort. Surprisingly, Turing has no love for country, but he jumps at the opportunity only for the sheer challenge of it.

That Turing will succeed is never in doubt—they made a movie about it, after all—but his bigger challenge is finding a way to get along with the other academics on his team, whose support he needs when his bosses start to get impatient. With help from his confidante and colleague, Joan Clarke (Keira Knightley), he must learn the fine art of being friendly. It’s a hard-earned lesson; on the other side of Turing’s brilliance is a prickly, antisocial personality that is, in many ways, the real mystery of the film.

Director Morten Tyldum systematically reveals the traumas of Turing’s childhood, when he was aware of his sexual identity but forced to hide it and sublimated his pain into his schoolwork. Through its many flashbacks, the film arrives at a satisfying nexus of his personal and professional lives: The man was good at discovering the secrets of others because he had so many of his own.

All of which makes Cumberbatch the logical, perhaps only, actor for the role. Turing is just a short leap from the actor’s iteration of Sherlock Holmes for the BBC; both characters are brilliantly analytical and socially inept, and their certitude creates a strange and undeniable charisma. While Cumberbatch only skims the depths of Sherlock’s psyche, he probes deep into Turing’s, portraying both his hard edges and sensitive soul with a deep commitment to emotional truth. It’s the serious and affecting performance that his fans have been waiting for.

The film, a tidy treatment of what was presumably a very complicated life, can’t quite match it. At times, there is too much Oscar-bait aesthetic in Tyldum’s direction and Graham Moore’s screenplay, and not nearly enough creative abandon, a charge leveled at another British biopic that is hunting for awards this season, The Theory of Everything. Of course, there is nothing wrong with a film that seeks broad-based appeal, but you might leave The Imitation Game wishing it were as bold as its hero.

The Imitation Game opens Dec. 11 at E Street Cinema and Bethesda Row Cinema.