The Ghost in writer-director David Lowery’s “A Ghost Story” is an honest-to-goodness old-school ghost: white sheet, eye-holes, the whole bit. The first time he appears, it’s a great visual gag. An unnamed man (played by Casey Affleck) has recently died, and is laying under a sheet on a slab at the morgue, where his unnamed wife (Rooney Mara) has just identified his corpse. Lowery holds a still shot of the body for about a minute, letting the somberness of the occasion settle in. Then the sheet rises up, and starts walking around.

It’s hard to explain exactly what “A Ghost Story” is. It’s definitely not a comedy, although that first manifestation of The Ghost is very funny, and there a few other laugh-out-loud moments. (At several points in the film The Ghost communicates telepathically with a neighboring spirit, and their conversations are hilariously bland.) The best way to describe at least the first half-hour of “A Ghost Story” is to say that it’s like a highly arty version of the Hollywood blockbuster “Ghost,” as the main character returns to haunt his true love. But the movie doesn’t stay in that vein of meditating on grief and loss. About a third of the way through, it takes a dramatic turn. And then, toward the end, it turns yet again.

The sad, sedate first half-hour may test some viewers’ patience. Lowery uses the opening scenes to establish the relationship, showing his still-living protagonist cuddling and passive-aggressively bickering with his wife. Then the man dies, and once The Ghost sets up camp in his old house, “A Ghost Story” shifts to long, dialogue-free scenes of the woman coming to grips with what happened, before gradually feeling her pain subside — all while unaware of the white lump that’s slowly following her from room to room. Sometimes her life seems to move along almost too quickly. And at other times, Lowery spends five minutes filming his actress eating most of a full-sized pie. The writer-director of “Ain’t Them Bodies Saints” and “Pete’s Dragon” has made his oddest and most experimental film yet, one that’s unafraid of silences and inaction. (The film even features a few seconds of literal paint drying.)

A Ghost Story - Still 1But then life goes on. Without giving away too much of what little plot there is, The Ghost does eventually finds himself observing changes he’d never anticipated when he drifted his way back home. The second half of “A Ghost Story” has a lot in common with Richard McGuire’s graphic novel “Here,” which follows the history of a single plot of land through different eras, as the people and their furniture shuffle in and out. The most important character in this film turns out to be the house, which at first seems like the typical location for a low-budget art-piece, but later reflects Lowery’s grander vision for a story about the impressions we make on each other, and the legacies we leave behind.

That vision is apparent also in the movie’s visual effects, which range from the lo-fi — like that sheet, which gets subtly grubbier year by year—  to the downright cosmic. Lowery seems open to giving this picture whatever it needs, be it digitally manipulated montages that indicate the passage of time, or a long speech from a houseguest (played by Will Oldham) who rants eloquently about humanity’s delusions of permanence.

“A Ghost Story” has the structure and rhythm of a musical suite, with Lowry working variations on the same themes, the same characters, and the same location. The result can be lyrical and poetic, or more naturalistic and minimalist. In both cases, “A Ghost Story” is absolutely mesmerizing, with an anything-goes quality that’s endlessly fascinating. Any movie that can turn a walking joke like The Ghost into a figure of genuine pathos is a movie that earns every long pause, and every sudden leap. [A-]

Click here for our complete coverage from the 2017 Sundance Film Festival