Not wanting to curse Charlie Kaufman with too much praise, I’m tempted to say that his nonexistent twin Donald is the best American screenwriter since Preston Sturges. Donald won’t let the comparison upset him. As you may recall from Adaptation, he is not the type to fret about living up to his reputation, or anything else; and besides, he’s nonexistently dead, having been murdered in the last reel of his only film. Let Donald be the genius; or say that some random puppetmaster is responsible for what Kaufman writes, controlling him from within as in Being John Malkovich; or pretend that his scripts, though outwardly witty and inventive, are in fact damnable instruments of violence, like Chuck Barris’s TV shows in Confessions of a Dangerous Mind.

Better yet, wipe all praise for Kaufman from your memory, after the example of his unforgettable new film, Eternal Sunshine of the Spotless Mind.

Even Sturges couldn’t have gotten away with that title. It’s from Alexander Pope: “Eloisa to Abelard,” a poem that previously worked its way into Being John Malkovich. In that Kaufman script, the puppetmaster performed Eloisa’s story for a streetcorner audience, and got popped on the nose for his trouble. In Eternal Sunshine of the Spotless Mind, Kaufman’s character Clementine (Kate Winslet) aspires to the pristine oblivion that Eloisa desires; and like Eloisa–like Kaufman’s character Joel (Jim Carrey)–she, too, gets popped on the nose (figuratively speaking), not by any outside force but by her own “loose soul unbounded.” Pretty fancy stuff, for a sci-fi romantic comedy.

The sci-fi element is a new medical procedure, performed out of a suspiciously shabby second-floor office somewhere on Long Island. Clementine visited this clinic after breaking up with Joel, so she could have him erased from her memory. Upon learning that she dumped him so radically, the outraged Joel now decides he’ll do the same to her. “Is there any risk of brain damage?” he asks during his consultation. “Technically speaking,” the doctor replies, “the procedure is brain damage.” To make the patient more comfortable (or to save on office rent?), the actual erasing is done at night in the victim’s home, by a couple of slacker technicians whose behavior, in other movies, would be construed as felonious entry and assault. Although some computers are in evidence, the main equipment turns out to be a metal helmet that resembles a colander, and that makes the supine, unconscious Joel look like a little boy playing Flash Gordon.

The methods to which Joel has resorted may seem crude and desperate, but they’re nothing compared with his behavior. As the action shifts to the inside of his mind (where much of the movie will now play out), you watch him live again through a series of fast-fading moments with Clementine, each of which turns out to be dominated by his own nastiness. The walls of rooms fly apart around him, faces melt into unformed wax, rows of book covers turn a uniform white; and as these things vanish, so too does Joel’s memory of his brutal coldness toward Clementine, his unforgivable insults. The effective target of the brain-wipe, apparently, is not the pain that she caused him, but his knowledge of the suffering he inflicted on her. It’s no wonder, then, that he begins softening toward her, as guilt loosens its grip; and when, by way of plot complication, the dreaming Joel hears his technicians talk about Clementine, it’s no wonder that their spookily echoing voices move him to resist the procedure.

Now one track of the story is taking place inside Joel, as he struggles to hold on to a memory of Clementine; and one track takes place in the world outside, where Clementine puzzles over a residue of feeling that keeps troubling her, a nameless and unaccountable spot on her mind. This set-up provides Kaufman with the challenges he revels in (don’t ever let him sucker you into a game of three-dimensional chess); but it also offers an occasion for the more fundamental movie pleasures. Kaufman himself takes advantage of the structure by delivering thrills in the Lonedale Operator tradition, with Joel involved in a prolonged chase sequence and Clementine starring as the feisty gal-in-peril. For Michel Gondry, the film’s director (and a co-author of its story), the script serves as a great excuse for a magic show (among my favorite tricks: the Amazing Shrinking Joel, crouched under a kitchen table at age 4). And for a couple of quick-change artists like Winslet and Carrey, the screenplay is an invitation to perform, perform, perform.

Winslet is especially chameleonic, since Clementine is changeable even when she isn’t popping in and out of Joel’s memories and fantasies. She’s a lush young woman of variable hair color, sometimes walking around under something called “Blue Ruin,” sometimes wearing a shade that goes with her name and favorite sweatshirt. Carrey’s Joel, by contrast, is a somber, inward type, who wraps dark clothes around his meatless frame and hides his eyes behind an awning of loose hair. If you’re stuck with an image of Carrey as hyperactive goofball, you will find his performance here to be astonishingly nuanced and restrained. In fact, you’ll make that discovery even if you’ve got a clearer idea of him, and know how well he can tap into both vulnerability and an intense spitefulness.

What I love best about Eternal Sunshine of the Spotless Mind is the way Joel abandons that spitefulness in the end, if only provisionally, and Clementine lets herself settle down for once, so the two can share a persuasive, deeply moving moment of forgiveness. I also love how this ending prompts you to return, in your own memory, to the daringly lengthy prologue to the film, re-evaluating the meaning of its dialogue and key events. You revisit something Clementine had said to Joel–“Right now, I’m glad you’re nice”–and you understand it in a devastatingly new way. You recall how Joel had found a dent in his car, and you now see the justice of the note he left for the driver in the next parking space. Joel himself didn’t see it; when he scrawled “Thank you” on a scrap of paper, he was merely being sarcastic, in a hopelessly passive way. But a dent is a kind of memory set in metal; and by the end of the movie, you know why Joel has reason to feel grateful for this one.

I’m grateful, too. Thank you, Donald Kaufman. Thank you.

I sometimes wonder if David Mamet, too, has a nonexistent twin, who turns out screenplays so the real brother can work in the theater. However enjoyable Mamet’s films may be–the best of them, including the new Spartan, are thoroughly entertaining–they never risk his emotions, or the viewer’s, as the plays do. Maybe hard experience has taught him to ratchet down his ambitions when he makes a film. (The fate at the box office of his one truly nervy picture, Homicide, could not have been encouraging.) Or maybe he’s found that film works best for him when it conveys the showier, more public side of his preoccupations, as it does in Spartan.

It has long been one of Mamet’s conceits that the Code of Manhood is actually written down somewhere. The rules may be inscribed unintelligibly in a numismatics catalogue, as in American Buffalo, or laid out usefully in the Boy Scout Handbook (see The Edge). In Spartan, the rules are printed on a little card that one generation of soldiers passes on to the next. Mamet appreciates how a guy might venerate such a totem; he knows the Code of Manhood still runs the world, and he wants you to feel its allure. Past a certain point in the story, though, he also sees to it that Hard Guy Number One, now thoroughly disillusioned, uses the code as a cigarette wrapper.

Hard Guy in this case is a secret agent commando extreme ops killing machine who always does what it takes. How smart of Mamet, as director, to give the role to Val Kilmer, who is in his own way an equally can-do type. You expect Kilmer to bring to the assignment his extraordinary physical grace; the surprise is that he delivers so many of the lines in his upper vocal register, almost dreamily at times, as if to suggest that this cold professional is not so much emotionless as emotionally underdeveloped. When challenged to think (a rare occurrence), Hard Guy can even become testy–which is as much slack as the character needs for the plot to proceed.

The President’s daughter is missing. (You sense that Mamet had to hold himself back from capitalizing the whole sentence.) Hard Guy Val has only a little time to find her, employing his audience-pleasing methods of disguise, deception and gung-ho brutality. The action, though intricate, clips along briskly; nobody (Mamet included) has any time for pretension, and so you’re completely engaged. Beyond that, nothing needs to be said about the appropriately titled Spartan–except that the pivotal role belongs to an infuriated woman (Linda Kimbrough). Her message to Val, which turns around the whole movie, will set off an echo for anyone who has followed Mamet’s film career. Perhaps you will remember these words from his screenplay for The Verdict, spoken by another hurt, contemptuous woman: “Who are these men?”

For the most recent in his long series of stunts, Lars von Trier chalked some building footprints onto the floor of a soundstage, added a bare minimum of props and flats and then shot an entire feature in the transparently artificial town he’d created. The name of the place, and the movie, is Dogville, a title that evokes both the stuntmaker’s cynicism and his old Dogme 95 tricks.

Nicole Kidman, as game and smashing as ever, stars as a mysterious fugitive, who at first is refused shelter in the 1930s Colorado town but then is taken in, grudgingly, thanks to the insistence of the would-be writer and moral-rearmament crusader Tom Edison (Paul Bettany). There is rising action (the townsfolk come to love her) and falling action (they begin to use her most cruelly, as generally happens to the heroines of von Trier’s sadomasochistic fantasies). The movie breaks the usual pattern only in having a bang-bang denouement; someone must always play the victim in a von Trier production, but this time there’s a last-minute change in cast.

I don’t deny that von Trier has talent. He kept me staring in fascination at the story he was unfolding. So what, I thought, that he knows nothing and cares nothing about the real America. But then came the closing horse laugh. The film ends with a montage of Depression-era photographs–irreplaceable documents of human suffering and resistance–accompanied jokily on the soundtrack by David Bowie’s “Young Americans.”

To paraphrase a celebrated review by François Truffaut: Lars von Trier despises you. Despise him back.