Last fall, the internet witnessed a rare phenomenon: the meteoric, memeified rise of a brand new star, catapulted into mononymic ubiquity thanks to a single 2½-minute movie trailer.

But M3GAN isn't your average girl — she's a lifelike, powerful robotic doll equipped with machine-learning capabilities that makes a Tamagotchi look like child's play. Say hello to your newest horror movie obsession (and be prepared for the ensuing Halloween costumes), in the delightfully bonkers "M3GAN," from James Wan and Akela Cooper, the minds behind the delightfully bonkers "Malignant."

Director Gerard Johnstone smartly delivers Wan and Cooper's script with the treatment it deserves, as a straightforward horror flick that doesn't blink while simultaneously jabbing the audience in the ribs.

"M3GAN," more often than not is a comedy before it's a horror movie, opening with a guffaw, teasing the audience with a laugh before a jarring smash to violence and trauma. The unique tone is anchored by star Allison Williams, who has surprisingly become one of our best horror leading ladies, bringing her signature brand of eerie camp to such films as "Get Out," "The Perfection" and now "M3GAN." Her skillful intentional affectlessness renders her characters slippery, difficult to pin down into preordained binaries of good and evil.

In "M3GAN," Williams is a Dr. Frankenstein type, playing Gemma, a toy designer with a savant-like skill for robotics. She's toiling over a Purrpetual Petz prototype for her demanding boss at Funki Toys, David (a superb Ronny Chieng), when she receives the call that her sister and brother-in-law have died in an accident and she's to assume guardianship of her niece, Cady (Violet McGraw). Career-oriented Gemma isn't quite sure how to connect with a kid, and so she revives her scrapped project, M3GAN (played physically by Amie Donald and voiced by Jenna Davis) as a sort of pal for her lonely, grieving niece.

It's alive! And she's spectacular, especially according to Cady, who quickly grows fond of the attentive M3GAN once they imprint on each other. Gemma rushes M3GAN and Cady into a demo for David, and while blithely ignoring warnings from Cady's therapist about potential attachment issues, Gemma and Funki are soon planning an announcement to the public about the high-tech, high-dollar toy that just might replace actual parenting. But neither M3GAN nor Cady likes to share their toys, and M3GAN's "learning protocol" is far more advanced, and unregulated, than Gemma anticipates.

"M3GAN" plays on the ideas that are brought up time and time again in techno horror — about our over-reliance on and misplaced trust in machines and technology, whether or not they move or speak with echoes of humanity. But "M3GAN" also introduces a new element to the mix: parenting horror. What kind of "learning protocols" are parents implanting in impressionable beings without fully understanding themselves?

The jump-scares in the fun, funny thrill ride that is "M3GAN" elicit more giggles than groans, but there are also intriguing connections being made on "M3GAN's" motherboard, behind the glossy surface. If HAL 9000 could see M3GAN — and her dance moves — now, he'd indeed be proud, and M3GAN has more than earned your trip to the theater, and her status in the meme folder.

'M3GAN'

3 stars (out of 4)

Rated: PG-13 for violent content and terror, some strong language and a suggestive reference.

Where: In theaters Friday.