The following article contains spoilers for “Once Upon a Time … in Hollywood.”

At the Cannes Film Festival in May, on the night before Quentin Tarantino premiered his new film “Once Upon a Time … in Hollywood,” I ran into the Sony Pictures chairman Tom Rothman. Tarantino had already asked the press not to spoil any of the surprises in the sprawling film they were about to see, but Rothman couldn’t resist one little tease.

“This movie,” he told me with a significant grin, “has the greatest. Ending. Ever!”

Since the film is ostensibly building toward the gruesome, real-life murder of the actress Sharon Tate (played by Margot Robbie) by the followers of the cult leader Charles Manson , Rothman’s hint of a crowd-pleasing ending was a bit of a curveball. Then again, Tarantino has always been eager to mess with the historical record if it makes for a better movie, as he did with the twist ending of “Inglourious Basterds,” where a troupe of fictional characters kills Hitler and his cabal to wrap up World War II far ahead of schedule.

So what exactly goes down at the end of “Once Upon a Time … in Hollywood”? And what are people making of it so far?

[Read A.O. Scott’s review of “Once Upon a Time … in Hollywood.”]

First, it’s important to note that while the film is set in 1969 Hollywood and features both Tate and the Manson family, it’s really more about Rick Dalton (Leonardo DiCaprio) and Cliff Booth (Brad Pitt), two aging Hollywood players trying to hold onto what little purchase they have left in the industry. Dalton is a faded TV star who’s been reduced to guest appearances and spaghetti westerns, and Booth is his loyal stuntman, whose job is becoming obsolete as Dalton’s offers dry up.