Chapter 27: Debugging

Name:Magic is Programming Author:
Chapter 27: Debugging

Early the next morning, Carlos woke to vigorous shaking, and grunted irritably as he opened his eyes to see Amber leaning over him with her hands gripping both of his shoulders. He waved her off and sat up, blinking a few times to clear his eyes. "Alright, I'm awake. Did something come up, or are you just eager?"

Amber's cheeks colored a bit, and she sheepishly shook her head. "Well... Just eager. But new spells! How could I not be eager to learn them? How are you not eager?"

Carlos yawned briefly and shook himself. "I am eager, just not used to waking up this early. Let me get... oh." He trailed off as Amber tossed a set of clothes at him, pointed at a covered tray of food on the nightstand, and pointedly turned her back.

A few minutes later, after hurriedly getting dressed and a rushed breakfast of eggs and bacon he'd barely tasted, Carlos sat on his bed facing Amber with several sheets of paper spread out between them, each one bearing the incantation of a different spell. Last evening's conversation with Trinlen had been eye opening about how critically important developing their souls to get more mana capacity would be. Most spells simply weren't possible with the amount of mana they had, or would have to be tuned down so far they'd be uselessly weak, but Trinlen had still managed to find some that they could use. He'd given them a couple to hold onto for later, too, but the main plan for future learning was for him to come to Dramos and teach them directly.

"So, which one do you want to learn first?" Carlos scanned over the spread pages, glancing at the spell titles written at the top but paying more attention to the blocks of formatted code he saw through the translation of his comprehension aid. Most of the structural elements were already familiar, with mainly just new effect functions and their parameters.

Amber leaned down and picked up one of the sheets near her. "This one: throw." Trinlen had said that spell would launch a chosen item in a chosen direction. With enough mana powering the spell, it could theoretically hurl a multi-ton boulder to crush a target miles away, but the mana they had available would only suffice to toss a half-pound rock twenty feet, and gently enough that it probably wouldn't even bruise anyone it hit. The only current advantage over throwing physically by hand was that they didn't need to touch the item, and could even throw something that was several feet away.

Carlos nodded and leaned down to make his own choice. "Ok. And I will learn... this one: levitation." Like throw, levitation could theoretically move multi-ton boulders with enough mana, but for the time being would be limited by their available mana to only move light objects on the order of a handful of gravel. It didn't impart any velocity, however, and maintained its effect for some time rather than expending its power all at once. Levitation would render the target effectively weightless, as though supported by an invisible force pushing up from below, exactly countering gravity. It could be adjusted to slowly raise or lower the object, but by default the spell would just hold it in place vertically - and would not affect horizontal movement at all.

Carlos skimmed through the spell's incantation - or should he just think of it as code? - looking for words or symbols he hadn't learned yet. There was the effect keyword, of course: `lift`. He decided to focus on that one first, leaving the parameters and their values for later. He didn't just start meditating on the meaning of an instruction to lift something, though. Some of the incomplete synergy links were about the process of learning a spell (or fragment thereof), and this was therefore an opportunity to fix those links.

His first target link to fix was between his spells database and reflex improver. The reflex improver was supposed to help form the correct conceptualization of a spell or fragment to add it to the spells database, so Carlos held back from consciously trying to form that concept himself, and instead mentally prodded his reflex improver with the word. The concept of pushing upward on something came to mind, but he hesitated about focusing on it. He wasn't sure whether the reflex improver had actually been involved, or if he'd just naturally thought of the definition he already knew for the word.

Carlos poked at his reflex improver again, a bit harder this time, and tried to assess what was going on in his thoughts. He shook his head, frustrated. It was really hard to examine the origins of his own thoughts, from his perspective inside those very thoughts. He paused, then chuckled under his breath. He was trying to introspect his thoughts, and that realization reminded him that his soul had an introspector. His soul's introspector couldn't examine his thoughts - at least, he didn't think it could - but it could examine the reflex improver and report what it was doing.

His introspector soon reported that his reflex improver was indeed pushing to bring the concept of lifting to mind, but something felt vaguely off, and the feeling was nagging at him. As he turned his attention to that, his introspector reported that his reflex improver was pushing that very feeling into his mind, and the feeling of offness grew stronger, displacing the concept of lifting that was still in the back of his mind. There was something wrong about how he was going about this. But what?

Several seconds later, a warning alert popped up in his mind's eye. Five inactive synergy links were gradually degrading. Four of them would still last a few weeks, but the one between his spells linker and reflex improver only had just under two days before it would break.

Before he could even wonder about why this mattered, since he was pretty sure his debugger could outright recreate those links if necessary, or about why one inactive link was degrading so much faster than the others, another warning alert popped up. A synergy link that was necessary for the current placement of his soul structures was inactive. His reflex improver was in the top slot, which required synergy links with everything, and its link with his spells linker was inactive. If that link broke, one or possibly both of the structures might be forcibly expelled by the repulsion between them as adjacent unlinked structures.

"Shit!" Carlos swore out loud at the discovery, his heart suddenly pounding in fear that he might lose a precious soul structure, or even two of them!

"What?" Amber sat calmly on her bed in front of him, looking at Carlos.

He took a deep breath, shook his head, and tried to relax. He still had most of two days to fix this, he reminded himself. He needed to calmly focus on finding a solution, not uselessly panic. And he had that time, with advance warning, precisely because he'd had the foresight to create a warning system for himself. "I'll explain later. Finish learning your spell for now." Carlos nodded to Amber, and closed his eyes to think and meditate again. She should have about the same time left for this problem as he did, so he could afford to take a little time thinking about potential solutions to explain along with the problem.

The obvious solution was, of course, to activate the specific synergy link in question. Unfortunately, it was inactive in the first place because the nature of its synergy was dubious, and he couldn't really be certain of successfully fixing it in time. The other possible solution was to move it to one of the eight slots arranged in a horizontal ring, which only required synergy links with their immediate neighbors, but he didn't have any empty slots available to move it into. Was it even possible to directly swap the positions of two soul structures, without any spare room to use as a temporary holding area?

Carlos firmed his resolve. He had to try. He focused on his debugger, instructing it to swap its own position with the position of his reflex improver, and it began reaching out to firmly grasp the other structure. He paused a moment to consider, but a quick check confirmed that this swap would resolve the issue if he could complete it. His debugger was between his introspector and his spells database, and his reflex improver had fully active links to both of those.

His debugger flexed, and began drawing on his mana pool, draining his mana reserves alarmingly quickly. In fact, his introspector alerted him that at this rate he would run out in less than a minute. Grimly, he focused on finishing the swap as quickly as possible, keeping an eye on his rapidly dwindling mana in case he needed to abort. Tension built between the structures he was trying to exchange, climbing higher and higher. After about thirty seconds of buildup, abruptly the tension released as the structures flew past each other in an instant and slammed into their new locations, and his entire soul vibrated for a few seconds before everything settled down into this new status quo.

His introspector popped up an alert. The formerly problematic synergy link would still break sooner than the other inactive ones because it had more already-accumulated degradation, but it would last a week and a half now, and its dissolution would pose no danger to any soul structure. The crisis was resolved.

Curiously, another alert also appeared in Carlos's mind, informing him that his debugger's new position improved its efficiency, due to the structure's focus on interacting with his other soul structures and the position having direct adjacency with all of them.

Huh. Maybe he should move his introspector to the bottom slot to improve its efficiency too.