In a far-flung future, human interaction is heavily regimented and controlled. The society of Yoon Ha Lee’s Ninefox Gambit is founded on a complicated and intricate form of social mathematics; “the calendar” is the structure that allows the hexarchate to retain power. The calendar works by requiring citizens to agree to an inflexible set of beliefs, which by turns create the reality they all exists within. Challenges to the calendar—known as heretical calendars—are swiftly and brutally subdued. Large groups that believe something other than what the majority believes directly challenge the power of the hexarchate. Lee’s outlandishly ambitious debut novel tangles mathematics, physics, and faith in fascinating ways, fleshing out a world in which the rules are rigid and the interactions between and within six major factions control everything.

After a battle in which she defeats the heretics through highly individualistic and creative means, Kel Cheris is marked out by the leaders of the hexarchate for her expansive knowledge of mathematics and assigned to take control of a politically fraught conflict: the hexarchate charges her with taking back the Fortress of Scattered Needles, which has been captured by heretics. The fortress is in a piece of coveted space, and the hexarchate wants it back. In order to better her chances at success, Cheris chooses to ally herself with an undead general, Shuos Jedao, whose consciousness has been stored in a computer for decades. Jedao is greatly feared, having killed hundreds, including his own forces. But he is also a brilliant tactician, and has served as the hexarchate’s most deadly tool since his capture. Cheris heads into battle with Jedao inside her head, using his knowledge and skills to recapture the fortress without losing herself to either Jedao’s influence, the machinations of the heretics, or to the politics of the hexarchate itself.

Confused yet? The learning curve on Ninefox Gambit shouldn’t be underestimated, although readers with a solid foundation in hard science fiction will have an easier time parsing the narrative. It’s a challenging story, tackling science fiction concepts we’re familiar with (spaceships and intergalactic war) while layering on purposefully obfuscated but compelling twists. The technology at the center of the narrative is hard to visualize, but once you get into a groove with the characters, everything falls into place, providing a solid anchor during the brain-taxing battle scenes. Although the setting and the world is unique, what truly drives the story forward is Cheris and Jedao’s relationship, and the schemes and motivations of the heretics, which unfold throughout the novel via letters sent by one of the agents living on the Fortress of Scattered Needles.

The story considers the costs of war from multiple sides, from the politicians whose search for power create the circumstances that make war inevitable, to the commanders who must unfeelingly weigh the loss of soldiers in order to gain a tactical advantage, and to those on the front lines. Lee is merciless when showing the aftermath of battle and the toll it takes on individuals and groups. The war to take back the Fortress of Scattered Needles is a game of engrossing strategy all on its own: half the fun is trying to puzzle out the ways in which Jedao and Cheris choose to fight with only scant resources, and puzzle out ways to use the heretics’ own tools against them.

Even with so much inventive storytelling and world-building on display, the best part of the book is the intricate relationship between Cheris and Jedao, slowly developed through a series of tense and arduous interactions that challenge both Cheris’s loyalty to the hexarchate and her decision to use Jedao as a resource. Jedao is equal parts compassionate and brutal, leaving Cheris unsure whether to trust him as he presents himself, or to trust the bloody legacy he left behind. They’re both remarkable characters, especially Cheris, whose empathy we see develop slowly over the course of the conflict, as her compassion and sense of justice are first hinted at and then carefully revealed. Jedao’s growth is more subtle, but we eventually learn enough to see why and how he made the choices he did. He is not only an effective foil for Cheris, but an embodied (more or less) critique of the hexarchate. Of course, the fact that he exists inside Cheris’s head, where only she can hear him, makes an already merciless narrative even more severe and desperate.

Cheris is trapped in a society that requires that any and all unpredictability be eradicated. Jedao was a trusted general until his unpredictability doomed him to slavery, to be used as a sentient tool of war. As they come together, they’ll both have to make choices, and Cheris’s will change everything—for herself, and Jedao—forever.

Ninefox Gambit is available June 14.