Funny without cynicism, serious without pretention and ironic without sarcasm, David O. Russell’s “I Heart Huckabees” is ceaselessly surprising and delightful. The ensemble cast, blessed with true chemistry and an unerring sense of timing, is a joy to watch. “Huckabees” is a film like no other.

The film follows Albert Markovski (Jason Schwartzman), a poet and environmentalist on a quest to save a marsh from the evil Huckabees Corporation. Along the way, he tries to discover his infinite nature and unravel a coincidence involving a tall man from Ghana. However, no man can solve the riddles of the universe alone, so Markovski enlists the aid of existential detectives Bernard (Dustin Hoffman) and Vivian (Lily Tomlin).

The duo promise to answer all of Albert’s questions; all he has to do is allow them to follow him every hour of every day in order to better ascertain the root of his problems. Everything goes well until the bullying of unctuous Huckabees executive Brad (Jude Law) and the existential angst of rowdy firefighter Tommy (Mark Wahlberg) drive Albert into the arms of nihilist Caterine (Isabelle Huppert). Her bleak tutelage threatens to lead our hero astray.

“Huckabees” is a bizarre but strangely enjoyable mix of social commentary, stream-of-consciousness and slapstick. More often than not, the film seems like it was thrown together by a tornado sweeping through a junkyard (which, according to a recent New York Times article on Mr. Russell, isn’t far from the truth).

But by the film’s finale, the exquisite method to Russell’s madness becomes clear. The film is ceaselessly surprising and delightful. Blessed with chemistry and an unerring sense of timing, the cast is a joy to watch.

Schwartzman conveys a perfect mixture of sincerity and frustration in his eternally stressed-out Albert. He is as magnetic when trying to convince his colleagues that poetry readings are the key to the success of his environmental coalition as when he storms around muttering a Tourette’s-like stream of epithets at the world. His utter bafflement upon meeting the detectives is perfectly executed. “We’re not in infinity,” he points out. “We’re in the suburbs.”

Just as impressively, Law manages the difficult feat of being slimy, ruthless and somehow still sympathe tic. Though his character is unrepentantly manipulative and morally bankrupt, Law still convinces us that Brad is not entirely inhuman, especially by letting the cracks show at all the right moments. Naomi Watts does an equally good job as Dawn, Brad’s plastic girlfriend (and Huckabees’ spokes-model). She begins the movie as an empty-headed accessory to Brad’s glamorous life, but Bernard and Vivian’s teachings soon have her in an Amish bonnet screaming, “You can’t deal with my infinite nature!” at Brad’s retreating SUV.

Meanwhile, Wahlberg’s Tommy is charming and ingenuous in his pessimism. Wahlberg skillfully blends a rowdy, less-than-genteel exterior with scruffy sweetness. We can easily believe that this firefighter truly cares about petroleum pollution and is concerned to the point of distraction with the state of humanity. He is a genuinely nice guy, even though his idea of a good story to tell his little daughter involves the children in developing nations who worked in a sweatshop “to make mommy’s sandals.”

Hoffman and Tomlin, with their quirk and chutzpah, are undoubtedly the best part of the film. Their physical comedy skills alone — showcased in a scene where the pair haplessly run across a lawn, unsuccessfully dodging sprinklers — are enough to bring one to tears.

The cinematography of “Huckabees” is every bit as zany as its deliciously mad characters. Russell fearlessly dissolves parts of the screen into moving squares while his characters pontificate; he even turns his characters into cardboard-cutouts and hacks them up with machetes. Shots of Brad breast-feeding Albert may cross the line in some viewers’ minds, but they’re nothing if not bold.

The score from Jon Brion (“Eternal Sunshine of the Spotless Mind”) is a perfect complement to the film’s look. Eccentric, subtle and lovely, Brion’s harmonies perfectly tease out emotional subtext where it might otherwise have lain buried under absurdity.

“I Heart Huckabees” is comedy at its greatest, comedy that is beautiful and sad and hilarious. Not afraid to contemplate the occasional Big Question, Russell’s film makes us laugh as we ponder the ways in which we are all connected.