This year’s New York Film Festival kicked off with a clear-cut Oscar favorite, Martin Scorsese’s “The Irishman,” and it continued Thursday night with another, more shocking contender: Adam Sandler.

You’re not dreaming. Billy Madison, Mr. Deeds, Happy Gilmore, Robbie Hart and the guy that sang “The Hanukkah Song” is doing the finest work of his career in “Uncut Gems,” a new crime comedy co-written and directed by Joshua and Benny Safdie. Pigs have flown, for Sandler is brilliant.

This is not a “Who’s that guy?” dramatic shift that funnymen often make in serious films, like Robin Williams as a bald creep in “One Hour Photo.” It’s simply that Sandler has finally found material suited to his talents that’s actually good — as a sleazebag New York diamond dealer whose life is one big bad decision.

His name is Howard, and he’s as ethical as a Chicago mayor. Loud, sweaty and obnoxious, Howard sells diamonds at high prices at his Midtown Manhattan shop, often to celebs such as Kevin Garnett. One day in 2012, he receives a shipment from Africa: a rare, rainbow-hued opal he believes is worth millions.

There is a certain magic to the rock. When Garnett stares into the shimmering stone, he’s transfixed. The Boston Celtics star needs to have it, so Howard trades the opal for Garnett’s championship ring, temporarily, until the basketball player can win the gem when it’s on the auction block.

That’s too easy, though. Like many a foul-mouthed, corrupt jerk before him, Howard owes a lot of people a lot of money. Looking to pay off his debts — and not get killed — he pawns off Garnett’s ring and bets with the money in hopes of getting the bling back with cash to spare.

The directors and Sandler really floor it through all of these events with a thriller’s tension — speaking at breakneck speed and dispensing swears like Skittles. But there is aplomb amid the f-bombs and wit beneath the “s – – t.” The script is very smart, the perfect length and every single character is extremely memorable, especially the women.

Idina Menzel plays Howard’s suffering wife, Dinah, who holds down the fort at the family’s New Jersey home, while Howard is off having sex with his young assistant Julia (Julia Fox) in his New York apartment. Both ladies are delightfully abrasive. There’s a quiet moment in which Menzel looks into Sandler’s eyes that had the audience in stitches. And Fox’s Julia almost hooks up with the Weeknd in a bathroom, causing an epic drunk couple tiff.

But it’s Sandler’s Howard that’s a superb comedic creation on par with George Costanza or Oscar Madison. When the actor focuses his near-nuclear supply of energy, as he does here, it’s an incredible sight. Kudos to him for putting his still-considerable weight in Hollywood behind adventurous projects like “Uncut Gems” instead of “Little Nicky.”

In 2019, the Waterboy has become a man.