“Random Acts of Flyness” (HBO) is an ineffably wonderful late-night variety show—an urgent collage of short films and sketches that incorporates and commingles animation, documentary, confession, satire, music video, and magic-realist fantasia. It’s a comedy show, too, if you like your comedy black and self-aware, like funk introspecting its blues and sounding with vehement joy. It’s a gallery show, offering a gauntlet of video installations, each piece demanding meditation. It is, as Terence Nance, the show’s creator and occasional star, puts it in the series’s intro, a “show about the beauty and ugliness of contemporary American life.”

Take the first episode, titled “What Are Your Thoughts on Raising Free Black Children?” It opens with Nance eating asphalt after an adverse encounter with a police cruiser, then revisits the scene again and again to resonate against its larger examinations of race and power. Or take the second episode, which focusses on masculinity and related pathologies, and which features a bilingual musical about machismo and homophobia, an arcade gun game in which the player aims at hollering harassers, and interviews with trans people about their self-images. The farce of “Flyness” is exactly as brutal as the short film it includes about state-sponsored violence: the montage juxtaposes documents of police violence—as captured on cell phones, dashboard cameras, and CCTV—with a carefree vocalist extolling festive times over a jauntily bland orchestra. Though none of the encounters seem to be lethal, the montage still plays like an unnerving highlight reel of “pigs shooting down brothers in the instant replay.” It’s as if the singer is the Man, warbling a carol to celebrate open season on civilians. In its small-screen Afro-surrealism, it ranks as an heir to Donald Glover’s “Atlanta”; in its building of provocative art from confrontational politics, it is a fine companion to Boots Riley’s film “Sorry to Bother You,” which likewise expresses nauseatingly grim social analysis in giddily imaginative form.

Some of the excellent density of “Random Acts of Flyness” owes to the show’s fond explosions of visual noise and its recontextualization of stock effects. As in his 2012 movie début, “An Oversimplification of Her Beauty,” Nance uses the textures of media technology—evocations of analog glitches and antiquated playback devices—to convey the processes of developing thoughts and to disturb conventional flows of information. He uses test-card color bars, sizzles of radio static, and laugh tracks that jeer like mobs to gain texture. One segment plays like an accursed videocassette. “Everybody Dies!” is a morning children’s program hosted by the Grim Reaper (Tonya Pinkins), who wears a black robe and carries a scythe and clobbers a black boy in a garbage bag with a cast-iron skillet. A toy xylophone twinkle-twinkles the melody of “Ah, vous dirai-je, Maman”; lyrics include “Kids, you know that you will die / No matter how hard you try.” Death herself is weary, and this public-access-level set, with its lonely mirror ball and backdrop of golden tinsel, is her hell. “Help me,” she screams, before a “Technical Difficulties” card blots her out.

Another short film distills race theory into a spoof commercial. “Do you suffer from white thoughts?” Jon Hamm asks in an ad for “White Be Gone.” (A thought cloud indicates “All lives matter?” as an example of a white thought.) In character as himself in a testimonial, Hamm urges “victims of whiteness” to medicate themselves with a consciousness-raising topical ointment—but he stumbles over lines that might indict him, a Chomsky-reading liberal, as the beneficiary of political power. He wants to be let off the hook, but the show is invested, here and elsewhere, in inducing a certain amount of squirming in its mirrors. The segment spools deeper into metafiction and eventually eats its own tail: it ends with Nance at his desktop computer, where an assistant director sends an autocritique in instant messages: “It seems to me that as ARTISTS we should be addressing whiteness less . . . and affirming Blackness more.”

Elsewhere, there’s “Black Thought’s Black Thoughts,” in which The Roots’ m.c. dispenses pensées (imagine Jack Handey righteously thriving as a philosopher-king in Chocolate City) and a segment in which Nance attempts to reclaim the word “blackface.” The bits chime enigmatically against other moments scattered through the episode—White Be Gone, for example, is a product with a pronounced resemblance to greasepaint. The title “Random Acts of Flyness” gestures towards the experimental tradition of chance operations, indeterminacy, and associative thinking. The show flows with the freedom of dream logic and analyzes its visions obliquely, on its own terms.