Chapter 28: Exploit?

Name:Magic is Programming Author:
Chapter 28: Exploit?

With his soul's urgent problem dealt with, Carlos emerged from his meditations, opening his eyes and turning his attention outward again, to find Amber playfully experimenting with her new spell. She spoke the incantation, and a fork from their breakfast tray zipped across the room to clatter against the far wall, before falling down to the floor.

"Aww. It didn't hit point first like I wanted it to. Not good for throwing weapons." Despite the disappointment in what she said, Amber was smiling and almost bouncing on her seat in excitement.

Carlos smiled and nodded to her. "I'm glad you're having fun. Did you activate any synergy links?"

"Yes! Well, kind of. Not having the right synergy between spells database and mana manipulator was bothering me, so I fixed that. Instead of meditating on a spell concept until I have it so perfectly right that it condenses on its own, I gather a piece of mana and push the concept into it. Learning a spell goes a lot faster that way."

"Hmm." Carlos hesitated briefly. "I'm concerned that a spell you learn that way might be flawed, inefficient or less effective, from not having the concept exactly correct."

Amber nodded, unperturbed. "I considered that too, but the mana pushes back on concepts that aren't quite right. It actually helps me figure out the precisely correct concept faster, because it gives me more feedback on what is still wrong. When I finish, I don't actually need to push for the concept to merge into the mana I gathered for it."The inaugural upload of this chapter took place via N0v3l-B1n.

"Ah. That's good, then. I'll do that one next. First, though, I should tell you about the problem I found and how to fix it."

Soon, Amber and Carlos had each duplicated each other's work on fixing up their souls, and Carlos had learned the rest of levitation with record speed. The new applications of his reflex improver and mana manipulator to the process of learning spell words cut the time required down to about half of what it used to be. The levitation spell had a pair of new wrinkles in how a parameter's value was determined, but those were barely speed bumps to him. Firstly, the baseline amount of force to lift with was set to match the target's weight instead of being a fixed value. Secondly, the amount of force could be adjusted by his intent for as long as the spell lasted.

A spoon floated in the air in front of Carlos, rising and falling as he directed it, and he idly tapped it with a finger to set it spinning. With nothing but open air to slow it down, it would keep spinning for a long time if he let it. It was also slowly drifting to the side in the direction that he'd tapped it, and though he could raise and lower it just by mentally focusing on his intent to do so, a full minute of attempting to stop either its spin or its drift in the same manner had no effect at all. The purely vertical direction of the spell's exertion of force was apparently an inherent and immutable aspect of the effect. Not too surprising, considering its keyword translated as "lift".

"Hmm." Carlos glanced toward the floor as another thought occurred to him. Could the lift force be adjusted to a negative value, making it push down instead? He focused on the idea of lowering it, and the spoon obligingly descended, but still not even as fast as a simple gravity-fueled drop would go. He reached out his hand and took hold of the spoon, holding it in place and feeling for its apparent weight, while experimenting with his conceptualization of intent. All adjustments he'd tried so far were relatively minor, changing the lifting force by only a fraction of the spoon's actual weight, but now he wanted to decrease it by an amount actually larger than the spoon's weight.

He tried focusing on pushing the spoon down, but the spell simply did not respond to that at all. He focused on reducing the lifting force by greater and greater amounts, and the spoon felt less weightless in his hand, but that was all. He frowned, thinking. Reducing force felt like the wrong approach; it was a concept with an inherent limit at zero. In the incantation, the force was defined as the mathematical addition of a measured weight and a modifier controlled by his intent. When he reduced the lifting force, technically what he was doing was making that modifier negative. What he wanted was to make it more negative. Much more.

Carlos focused on that concept of a large negative modifier in the math, and pushed that into his active connection to the spell, and he felt something new in response. The spell's mana had outright ignored his attempts to control spin or horizontal motion, but for this he felt... resistance? His new intent matched the framework of the spell's structure, but at the same time would have a result directly opposite of what the spell was normally intended to do.

At that realization, Carlos paused to consider. Intent based constraints on spell behavior might guard against potential bugs, assuming that the analogy of spell incantations to computer programming was as fully applicable as it seemed, and the consequences of a buggy spell were unpredictable and might be severe. Discarding such a safeguard could cause problems later. On the other hand, breaking such constraints could give him capabilities he wouldn't otherwise have, that might be useful and important tools.

Then again, there have been some astounding whoppers of oversights that went unnoticed for a long time in highly sophisticated software made by expert professionals. The infamous Heartbleed bug came to mind. So, there was precedent for such a mistake despite otherwise high quality professional work. Even if that were the case, though, relying on it would be risky. The hypothetical maintainers of this hypothetical world simulation might notice and patch the bug, and he'd suddenly lose his greatest tool without warning.

And if he was right and was not in a computer simulation? Then that mana had to come from somewhere. Mana was a limited resource, and if "create more mana without limit" were something mana could do then surely someone would have exploited that to conquer the world already, right?

Come to think of it, could he detect where this bit of extra mana had come from? Carlos focused his mana sensor on the levitation spell's mana, and on the area around it, but aside from sensing how much was there, all he got was a vague sense of unease so mild he wondered if he might be imagining it. He momentarily switched the spell to pushing down again, just long enough to get a glimpse of its mana supply increasing again, but still shook his head in frustration. He'd sensed something happening, but couldn't make out any details. He needed a more developed mana sensor. He needed more soul development in general, really. They both did.

Carlos sighed, and mentally put the problem aside. He would study it later, when he was properly prepared with tools advanced enough to actually detect the details he needed. And he would do it carefully. Very carefully. ...Maybe he could explore more about ways to trigger it, though? That feeling of objection and wrongness from the spell's mana was impossible to not notice, and very different from its reaction to ideas that just won't work. As long as he refrained from overriding the objection, he'd never actually trigger the exploit.

The "throw" spell Amber had picked was an obvious candidate for another way to trigger this negative mana use exploit. It was another spell that applied a specified force to an object, so the same principle of specifying a negative force should work. Or so Carlos thought, until he read the spell incantation. It didn't actually have a "force" parameter to the effect at all, just direction. After some thought, he realized this was because it just spent all the spell's power, all the mana supplied for it to use, all at once in a single momentary shove.

He went back to the levitation spell, and considered. First, to gauge whether there even were any firm safeguards at all against this exploit, he should try the most direct and blatant way to do it: hard coding a negative force value into the spell. He called the levitation spell he'd already learned to mind, mentally substituted the entire force parameter value with the number negative 10, and... Nothing. The mana he gathered for learning this alteration of the spell simply did not react to it. There was no feeling of resistance, or objection. The bond between concept and mana just didn't even begin to form. Carlos sighed in relief. He had apparently found some obscure corner case, not a wide open gaping hole in the system.

Next up, could he take out the math and baseline amount of lift from the force value? That would make a spell that would wait for him to will it to action before it would do anything at all. Carlos learned that variation of the spell easily, and cast it on the table knife that was still resting on their breakfast tray. He mentally pushed at the spell to lift the knife up, and it took him a few seconds to ramp up enough to actually raise it off the tray. He let it gently fall back down, and then focused on the idea of a negative force just like he had before... And the spell outright ignored that instruction, just as completely as if he'd tried to make it push horizontally.

So, reasoning through his results, Carlos could pull mana from nowhere, or rather from somewhere or something worryingly unknown, with certain requirements:

The spell had to have a numerical magnitude parameter of some kind.A negative magnitude had to be meaningful for it.He had to set the magnitude value as an adjustable mathematical formula that normally had a positive value but could legitimately be decreased.He had to specifically conceptualize the decrease in mathematical formulaic terms.And he had to ignore and override an unnerving feeling of profound wrongness.

Carlos thought back and reviewed some of the other spells Trinlen had talked about before settling on the set he'd written down for them. Telekinesis, flight, the classic fireball, and many more. Trinlen had dismissed most of them for requiring too much mana, but he had also set aside some for being too complex for novices. Telekinesis, for example, was actually a combination of effects with several adjustable parameters that the caster had to coordinate in tandem to produce the desired result, and Trinlen wanted to be there to supervise when they started practicing it. Carlos wasn't sure whether the acknowledged troublemaker actually thought they needed supervision for it, or if he just wanted to witness their initial mistakes for his own amusement, but either way he didn't want to quibble about it with possibly their best potential teacher.

In any case, Carlos had noticed that more advanced spells tended to have greater flexibility. If you wanted to reverse the direction of your flight spell that could move you in any direction, you would naturally change the direction parameter, not try to set it to a negative speed. For all the spells he could think of where the concept was even applicable, the effect of a negative magnitude could be achieved more naturally by changing another parameter instead, plus most of them wouldn't have the math formula trick needed to bypass the normal block against negative values. It might have other limitations too, maybe even only working with levitation's lift effect.

He felt tension releasing from his shoulders and arms as he relaxed, suddenly feeling a lot less nervous. He was still very concerned about what he'd discovered, but the requirements for making it even possible were obtuse enough that probably few other people knew about it, or even no one at all. Amber's confusion about the idea of a negative force was especially promising in that regard, if her knowledge of such things was meaningfully representative about this world's knowledge of physics.

Carlos stretched, and looked around the room. He noticed the sunny spot from the sun shining through the window had moved considerably, and was getting close to the window. He looked back and forth between the window and the bright area on the floor, contemplating the angle that implied for where the sun was, and what time that meant it was now.

"Uh, Amber? I think we'd better get going. It's approaching noon if I'm not mistaken, and we need to get back to Varlinden."