Life isn't exactly working out for Edwina, a quality assurance analyst at a New York City startup. She's sick of her co-workers, worried about her soon-to-expire work visa, and weary of her mother criticizing her weight and urging her to move back to Malaysia. But at least she has her husband. Until she doesn't.

Edwina's struggles form the basis of Edge Case, the debut novel from YZ Chin. It's an excellent book that tackles a number of topics — misogyny, racism, love and estrangement — and does so beautifully.

Edge Case opens with Edwina putting in another's day work at AInstein, a tech company that's working on an artificial intelligence-powered robot programmed to tell jokes to people "who needed some joy in their lives—the bedbound, the lonely, those who woke up each day wondering how to spend their hours." She'd started her gig at the company with excitement, but that faded when she realized she was the startup's only woman employee. "The problem was that as a group, the tone was set by the two or three guys who seemed to think women were ill-equipped by nature to do certain things, like coding," she explains. "The others did nothing to rein in the 'jokes' or the snide condescension dressed up as 'constructive feedback,' the holiest of communion in tech startups."

When she returns home, her husband, Marlin, isn't there. She's not exactly shocked; he'd been acting erratically ever since the death of his father months before, and had taken in interest in esoteric New Age-y beliefs: "My last memories of my husband are of him shouting accusations at me and going on about ghouls from an unseen world, an occult-looking crystal in his hands. Supposedly it let him communicate with spirits, and supposedly those spirits warned that he must distance himself from me."

When Edwina eventually finds Marlin crashing at his friend's apartment, he spurns her, accusing her of cheating on him in a past life. She can't reconcile her husband with the man she fell in love with, the man with whom she spent joyful Sundays making creative vegetarian versions of popular foods. Meanwhile, she's forced to endure her hostile, sexist work environment; calls from her passive-aggressive mom in Malaysia; and racist comments from a series of strangers. And her work visa is expiring soon, leaving her to face the possibility of life with her mother in her home country: "By next year, what shade would I stand under, what clothes would I wear, what food would I eat? What language would I be speaking? Who would I reach for, bolting up from a nightmare at the edge of dawn?"

Chin, a former software engineer, knows that computers and novels are both full of (metaphorical) moving parts, and that one misstep can derail the whole thing. (As Chin writes, "Edge cases are rare situations or use cases that engineers might miss when they write code, resulting in ugly bugs.") And there are a lot of moving parts in Edge Case; Chin puts Edwina through her paces, giving her several obstacles to try to conquer or at least evade.

A lesser novelist might get tripped up. But Chin doesn't; she succeeds, and makes it look easy. Much of that is due to her expert portrayal of Edwina, a fully formed character who can't seem to catch a break. Chin allows Edwina to persevere when she can and despair when she must; the moments when she's overwhelmed are genuinely heartbreaking. (One scene, in which Edwina impulsively decides to abandon her vegetarianism with the help of an order of McDonald's chicken nuggets, is tough to read, but beautifully wrought.)

Chin proves masterful at examining family dynamics. Edwina's relationship with her mother — "a crafty and sophisticated weaver of narratives who only wished to motivate me via elaborate tales of past lives" — is a fraught one, but Chin doesn't fall into the trap of casting the mother as a nagging busybody; she comes across as a real person dealing with grief of her own. Edwina's marriage to Marlin is similarly realistic; Chin portrays the couple's dissolving relationship in a (sadly) believable way.

Chin does a wonderful job exploring the social issues at play as Edwina and Marlin navigate life as would-be immigrants in Trump's America. Edwina is forced to deal with a series of microaggressions that escalate into just aggressions — a coworker's drunken flirting crosses the line, and a police officer harasses her about her papers before making a racist "joke." And Marlin's new belief system, which threatens to destroy his relationship with Edwina, calls to mind another remnant of America under Trump — the families that have been broken up when one member becomes obsessed with QAnon conspiracy theories. That the situations are all realistic is what makes them horrifying; Chin asks her readers to reflect on their own complicity in the environment that makes these kinds of things par for the course for women and people of color.

Edge Case is a wonderful novel, smart but not showy, emotional but not sentimental. It asks us to examine a broken society that most of us have helped create, either by our actions or our apathy, and to consider what we'd do when someone we loved has changed irrevocably. It would be a massive understatement to call Chin a writer to watch; she's fully formed, beyond talented, and — crucially — an author of deep compassion.

Copyright 2021 NPR. To see more, visit https://www.npr.org.