Shania Twain left no doubt that her headlining gig Saturday night at the Stagecoach Festival in California was a special occasion. “To celebrate, I’m going to eat a big bag of potato chips,” she announced before the closing number of the show, her only currently scheduled one for 2017, admitting she’d been dieting up a storm to fit into her largely translucent black outfit. “You can relate, right?”

Saturday’s show was a coming-out of sorts for Twain, who already experienced a touring comeback — a Las Vegas residency in 2012-14, followed by a supposed farewell tour in 2015-16 — but who now is gearing up interest in a forthcoming album, her first of all-new material since 2002’s “Up!” To that end, she gave the 75,000-plus festival attendees a world premiere of a new single, “Life’s About to Get Good,” which isn’t set for official release until June, in advance of a planned September album.

“This is like a solo record experience for me. It was therapy,” she said, pressing the fact that she’d not only written the song by herself — unlike her run of hits with producer, co-writer, and then-husband Robert “Mutt” Lange — as well as alluding to the idea that she’s still reflecting upon issues related to that traumatic split, seven years after their divorce. “You’ve got to take the good and the bad, right? No pain, no gain.” Twain introduced “Life’s About to Get Good” as “really just a happy song,” and she was half-right: The principle focus is a feel-good chorus consisting largely of reiterations of the title phrase, bouncing along in an almost bubblegum ’70s-pop fashion. The verses, meanwhile, are determinedly darker, from the opening line, “I wasn’t just broken, I was shattered,” to the declaration that “it killed me that you’d give your life to be with her” and assertion that “it’s better to be loved, loved the way I should.”

The ballyhooed single premiere was nearly overshadowed by a couple of surprise guests Twain had in tow: newly minted country star Kelsea Ballerini and pop heartthrob Nick Jonas. After Ballerini joined in on “Any Man of Mine” — which Twain introduced as a song of “female assertion” — the young guest mentioned that upon their first meeting at an awards show recently, “She sang ‘Peter Pan’ (her recent it), and I cried.” Although Twain’s eternally sultry garb doesn’t necessarily shout “maternal,” Twain seemed to take a motherly attitude toward her two guests, saying of Ballerini, “You’re just so genuine… You’re a good girl. I like you.”

Although Jonas had previous covered Twain’s “I’m Gonna Getcha Good” as a member of the Jonas Brothers, he opted Saturday to participate in “Party for Two” (which was Twain’s last radio hit back in 2004 when it was released in separate duet versions with Billy Currington and Mark McGrath). “I must say one thing: Shania Twain is the reason I’m in music today,” he announced. Twain, for her part, said that Jonas “does impress me very much,” an inevitable segue to the next vintage No. 1 in her set.

Twain nearly had the day stolen out from under her by an appearance earlier in the Palomino tent by Willie Nelson, who chose to spend his 84th birthday performing at Stagecoach. Attendees jockeying for elbow room in the crowded tent might have wondered if there would be any on-stage acknowledgement of Nelson’s birthday. In the end, he started a crowd sing-along of “Happy Birthday” himself, filling in the “to me” parts. Whatever party might have been happening backstage, it included Neil Young, who suddenly showed up in the closing group-sing of “Will the Circle Be Unbroken” alongside side-tent performers like Margo Price and John Doe, even engaging in a spirited harmonica duel with Nelson’s usual mouth harp man, Mickey Raphael, after Nelson had left the stage.

The festival closes out Sunday night with a set by Kenny Chesney, one of fewer than a dozen shows the stadium headliner has on the docket this year.