When I tell you that “Under the Silver Lake,” David Robert Mitchell’s seductive and disturbing Los Angeles head-trip noir, is basically a sustained homage to David Lynch, and that Mitchell achieves the exact look and mood and pace and vibe he’s going for, you may think that it’s the kind of movie you’re going to get excited about. To a degree, you should. But the comparison comes with a major qualifier: There are moments when “Under the Silver Lake” evokes David Lynch the tranced-out Hollywood Babylon yarn-spinner of “Mulholland Drive” — but mostly, it’s an homage to the Lynch who gnaws on the weirder fringes of the everyday-surreal, the Lynch of “Lost Highway” or even, at times, the reboot of “Twin Peaks.”

“Under the Silver Lake” is a down-the-rabbit-hole movie, at once gripping and baffling, fueled by erotic passion and dread but also by the code-fixated opacity of conspiracy theory. The movie is impeccably shot and staged, with an insanely lush soundtrack that’s like Bernard Herrmann-meets-Angelo-Badalamenti-on-opioids. When it’s over, though, you feel like you’ve seen a meta-mystery made by someone who spent too much time scrawling notes in the margins of his frayed copy of “Infinite Jest.”

The central character, played by Andrew Garfield, is a scruffy boyish 33-year-old dude named Sam, and from what we can tell he does absolutely nothing. He has no job or ambition, no semblance of a structure to his life. He’s about to be evicted (his overdue rent is due in five days), and he doesn’t even bother to fret about it, let alone try to come up with the money. He’s a passive agent, drifting through life. But that makes him the perfect candidate to become a makeshift detective, or maybe just a glorified voyeur.

Throughout the movie, Sam gawks and stares: at sinister nightclub parties, at the gorgeous sirens who surround and entice him, at the reality that keeps engulfing him in things too bizarre to make sense of. He lives in one of those decrepit East Side L.A. apartment complexes that’s covered in just enough plants and decay to look like it’s perched on the edge of a jungle, and like a benign perv version of James Stewart in “Rear Window,” he spies from his second story balcony: at his aging parrot-lady neighbor, who still goes topless; and at the entrancing young beauty with a dog who’s the film’s postmodern version of a Hitchcock blonde. Her name is Sarah, and she’s played by Riley Keough, who knows how to keep an aura of heat cloaked in an air of enigma.

I’ve long thought that Andrew Garfield would be the perfect actor to star in a biopic of Anthony Perkins, and in the early scenes of “Under the Silver Lake” he’s got a Norman Bates twitchiness about him. Covered in unkempt shaggy ’70s hair, he seems slightly out of it, lost in a sensual daze, and since one of the film’s motifs is that there’s a serial killer of canines on the loose (yes, someone is slashing dogs in L.A.), we wonder, for a while, if it could be him, especially when he gets on the phone with his mother, who starts yammering on about the glories of Janet Gaynor.

But Sam, for all his gawkiness, is no repressed nerd. He’s better at connecting with women than we’re first led to think, and when he communes with Sarah by getting stoned with her and watching “How to Marry a Millionaire” on TV, we’re eager to see where the connection will lead.

It leads to her vacating the apartment the next day, taking all her stuff and vanishing without a trace. Well, there’s one trace: a shoebox she left in the closet with a Polaroid and a few mementos. And a mysterious double diamond drawn on the wall. What does it symbolize? Sam has to know. He spies on the apartment and watches another young woman (played by Zosia Mamet) take the shoebox out, and from that point on Garfield’s performance just grows in furtive, screwy, compelling weirdness. His Sam embarks on a ramshackle odyssey through L.A. to find Sarah, but he’s really looking for an answer to a larger mystery — the meaning behind the surfaces of what he’s seeing.

“Under the Silver Lake” is a 21st-century mystery steeped in an Old Los Angeles view of the world: the city as a labyrinth of corruption in which sex, greed, and power suffuse the atmosphere but remain off the grid. This is a version of L.A. that goes back to Hammett and Chandler, to “Chinatown” and Altman’s “The Long Goodbye,” to “Mulholland Drive” and “Kiss Me Deadly” and “Inherent Vice.” But Mitchell has wedded the rot-beneath-the-palm-trees mystique with his own generational vision of corruption in the age of mass signifiers.

Sam is hooked on a ‘zine called “Under the Silver Lake,” about the sordid events that his neighborhood was built on, and he hunts down the author of it: a recluse named Milo, who’s obsessed with the connections that no one else can see. He’s played by Patrick Fischler, the sensational actor who made such a startling impression on Season Two of “Mad Men” as the insult comic who reveals Don Draper’s adultery to Betty. Fischler, here too, makes his presence felt. He nails a certain solipsistic brand of paranoid L.A. history fetishist, the kind who’s going to piece together the hidden clues and find, at last, where the bodies are buried. (Very Black Dahlia.) For Milo, life has come down to the toy map in a kids’ cereal box. It contains all the clues you need! We look at him and think: Is he crazy or is he right?

“Under the Silver Lake” is full of hypnotic and arresting sequences, and throughout its extended running time you can feel David Robert Mitchell reaching for something. Call it a vision. This is his third feature as a writer-director, after the winsome and rather precious relationship drama “The Myth of the American Sleepover” (2010) and — his breakthrough — the small-scale horror hit “It Follows” (2014), which showcased Mitchell’s feeling for young actors and his talent for kinetic visual atmosphere but, in my opinion, was overpraised by critics. Its tale of a ghostly spirit that tracks one teen after another was a clever indie mashup of megaplex nonsense.

“Under the Silver Lake” is more ambitious and fascinating. It’s the first Mitchell film that truly held me, the first that feels like the work of a potentially major artist — which is probably why it was chosen for the competition at Cannes. But oh, is it ever in love with its own lyrical freakishness, its art-thriller grandiloquence.

It’s clear that Mitchell wants to create powerful movies, but in “Under the Silver Lake” he wants to do it by making a “statement.” (It has to do with how there’s no more mystery, so that we have to create it by finding and cracking hidden codes. Or something.) “Under the Silver Lake” gets its hooks in you, but it’s a good-bad movie: an academic stab at making the darkness visible. It’s an homage to the side of David Lynch that works better in theory than it does as flesh-and-blood cinema, and it may also remind you, at times, of “Southland Tales,” the three-hour pile of pretension that Richard Kelly made after “Donnie Darko.” Yet Mitchell is a more gifted filmmaker.

Sam, with the help of that cereal-box map (and, perhaps, his own deteriorating grip on sanity?), cracks a numerical-alphabetical code that leads him to the Griffith Observatory, where a smeary derelict named the Homeless King (David Yow) comes to meet him and lead him to a series of underground tunnels. And that’s just the beginning. The movie features a prostitution ring of young woman decked out to look like characters from pop culture (very “L.A. Confidential”); a stunning performance artist known as the Balloon Girl (Grace Van Patten); and a sequence that feels like something out of a dream, in which Sam is led to the home of The Songwriter (Jeremy Bobb), who turns out to be…the secret mastermind behind all pop music since the dawn of the counterculture. He wrote “Smells Like Teen Spirit” on the piano! So “rebellion” is just a sham.

For those of us who feel religious about pop music but never thought that it had all that much to do with rebellion, this is not exactly a sinister notion. But more to the point: What’s it doing in the movie? Mitchell wants to create an aura of generational nightmare, in which pop culture is carrying hidden meanings controlled from above. But it’s hard to tell if the film is embracing schizophrenic logic or just jumping the shark. Later on, we get to the bottom of the evil, and it has something to do with really, really rich men who want to live sealed away in bunkers. So that they can have sex whenever they want. So the ultimate debauched fantasy is to be imprisoned with groupies in a luxury hotel suite?

By this point, it’s clear that “Under the Silver Lake” is running on too many metaphors, too much cosmic self-importance. We want to see the movie add up, but it won’t — not really — and its refusal to do so is Mitchell’s way of rejecting the “audience-friendly” impulse. But audiences, as Mitchell is sure to discover, will have a way of rejecting you back. They don’t want to go down a rabbit hole that turns into a lost highway.