A.I. was a pet project never fulfilled by the late Stanley Kubrick, who, according to rabbinic legend explicated by Steven Spielberg, was keen as far back as the 1980s on making a picture about a machine built boy programmed to feel real love, and his effect on real humans faced with the unnerving implications of loving a machine back. (Kubrick's inspiration: ''Super Toys Last All Summer Long,'' a science fiction short story by Brian Aldiss first published in Harper's Bazaar in 1969.) Actually, Spielberg recounts, the older man used to discuss the possibility of the younger man directing -- ''a Stanley Kubrick production of a Steven Spielberg film'' -- and prepared extensive storyboards. And so, presumably, it's those archives and remembered ''phone a friend'' conversations that inform the content of the screenplay Spielberg eventually wrote himself.
But it's Spielberg, all Spielberg, who chose Haley Joel Osment to embody the proto roboboy, David, and to shape our sentimental response based on Osment's famous default expression of sad gravity, a phiz Dickens could love. And it's Spielberg, Hollywood's foremost shaper of baby boomer nostalgia, who gives Osment lines of dialogue that are utterly Spielbergian in their distillation of ''boyhood in America'' rootlessness: ''Mommy, will you die?'' ''I want Mommy to love me more.'' ''My brain is falling out.'' (Re that last: Who knew David was familiar with the work of Soupy Sales?)
It's a tribute to Osment's very real talent that he manages to ditch the saintliness forced on him in the execrable ''Pay It Forward,'' and it's clear that the young actor is not just playing a variation on the Very Special Boy role that made him a star in ''The Sixth Sense,'' either: Osment has a sophisticated understanding of the shifts between the circuitry of ''mecha'' (i.e., mechanical robot) and ''orga'' (i.e., organic human) responses.
It's a tribute to Spielberg, too, that we can practically see the director biting a knuckle, holding back from bursting into the visual equivalent of ''When You Wish Upon a Star.'' In scenes at home with the new mother (Frances O'Conner) who David is imprinted to love, the ambivalent father he calls ''Henry'' (Sam Robards), and the couple's jealous biological son (Jake Thomas), the director and his brilliant longtime cinematographer, Janusz Kaminski, blur, distort, and fade the borders and palette of domesticity, sacrificing the golden American innocence look and lighting Spielberg adores so much.
Osment's David is Spielberg's stand in. Kubrick's rep, on the other hand, is the revved up ''love mecha'' Gigolo Joe, played to hell by Jude Law with glittering hysteria and a sheen by turns clammy and sexy. While David yearns to pedal home to Mommy, Joe knows with inhuman sureness that he's programmed for a cold, vertiginous, Mommyless world of violent Kubrickian sensation. Joe is the kind of amoral animatron of the future that inspired Kubrick to do some of his most fantastic work; he's a golem, the anti-Spielberg.
And he's the most ravishing invention in all the considerable inventiveness of ''A.I.'' In scenes where Law and Osment work together, everything dead on and weirdly off about this dense and challenging movie combusts, an enactment of the clashing artistic instincts of two strongwilled filmmakers. ''They made us too smart, too quick, and too many,'' Joe tells David, as the brilliantine hard hustler and the lamb's wool soft boy closely encounter a Flesh Fair (in which mechas are rounded up, tortured, and destroyed), tour the sex crazed Rouge City, and hit rock bottom in an eerily gorgeous, underwater Manhattan.
There aren't many at all like Spielberg and Kubrick, directors willing to lasso dreams (that's Steven) and nightmares (that's Stanley) or die trying. ''A.I.'' is a clash of the titans, a jumble, an oedipal drama, a carny act. I want to see it again.