Though it does explore the Manson killings, Once Upon a Time in Hollywood is most crucially a tale of fame won and then surrendered. It is about how the American film industry has always had the terrible power to create icons and then forget about them. As a director, Tarantino tends to refract his stories through his various pop-cultural obsessions, whether kung fu movies or Elmore Leonard novels, but this film is set in the actual Hollywood Hills and revolves around the actual moviemaking process. The result is a surprisingly funny and extremely melancholy hangout film, an elegy for a bygone era that reflects on how all art eventually loses its edge.

Buzz for Once Upon a Time in Hollywood has been dominated by the casting of Robbie as Tate and by Tarantino’s decision to delve into an infamous tragedy, down to casting look-alike actors to play Tate’s husband, Roman Polanski (Rafał Zawierucha), and Charles Manson (Damon Herriman). But don’t come to this film looking for cruel, frightening realism. Much like Inglourious Basterds (which took some liberties with the events of World War II), Once Upon a Time in Hollywood is a pastiche, history filtered through celluloid. It’s the kind of movie where Robbie-as-Tate can go watch a film and see the real Sharon Tate on-screen.

But Tate and her companions are ancillary to the main plot; Rick Dalton and his faithful stunt double, Cliff Booth (Brad Pitt), are the actual protagonists. If Tate is the rising star, then Dalton is yesterday’s news, an equally important cog in the Hollywood machine. After the audience is introduced to his Bounty Law glory days, Dalton takes lunch with a new agent, Marvin Schwarzs (Al Pacino), who informs him that he’s becoming a has-been, reduced to playing villains in TV pilots so that younger stars can beat him up and earn their bona fides.

If that’s all part of the life cycle of movies, then Cliff is the comfortable worker bee who’s just happy to be a part of things. As Rick has slid from leading-man status to day-jobbing, Cliff has gone from action stuntman to overqualified driver, chauffeuring Rick from set to set and otherwise doing odd jobs around his house in the Hollywood Hills. Pitt’s performance is the first reminder in years (since perhaps 2011’s Moneyball) that he’s the most charismatic movie star of his generation: This is effortlessly cool work, with an edge of menace, from a man who has gravitated toward more closed-off and brittle roles in recent years.

DiCaprio, who hasn’t appeared on-screen since he won an Oscar for The Revenant in 2015, is phenomenal, tapping into a vein of humor and self-awareness that has been lacking in some of his later work. There’s irony in seeing Hollywood’s biggest (and perhaps final) movie star playing someone who’s all washed up, but DiCaprio has been working in showbiz since he was a child—he’s someone who can understand the ways in which the industry builds people up and then tears them down. One of the film’s most enrapturing sequences sees Dalton on the set of a new TV show, led by an up-and-coming star (Timothy Olyphant). Dalton chats with a child actor who has just entered the industry, and her resolute professionalism—aided by his drunkenness—brings him to tears. The sequence is both humane and laugh-out-loud funny, perhaps a knowing nod from Tarantino at his own looming irrelevance (he swears he will direct only 10 movies before retiring, and Once Upon a Time in Hollywood is his ninth).