Friday, March 21, 2025

Debugging

Debugging is the process of correcting the mismatches between a formal system and reality, through acquisition and application of intimate knowledge of a system's implementation, intimate knowledge of the relevant part of reality and a reflective self-awareness surrounding both. Software running on a computer is a typical formal system, and that's what I will focus on. Similar principles apply to debugging electronics, mechanical systems and abstract mathematics.

Bugs are mistakes. Bugs are oversights. Bugs are fundamental misunderstandings. Bugs are Black Swans. Bugs are software. We can re-frame feature development in terms of the bug class of missing functionality. Therefore, the entirety of software development can be viewed as a process of debugging.

A bug, but not an issue

Every principle in software engineering must bow to making it work. Ergo, debugging is the work of software development.

Reality ain't no formal system

At least one program has no bugs: the program of zero length. It has no features. It’s the same in every language. It takes no time to execute and requires no memory. It has no dependencies. It requires no one to maintain it. But most programs have bugs. (Not all non-empty programs have bugs. I’ve seen some pretty robust “Hello, world” implementations.) 

Bugs are perversive because useful programs are formal models of parts of reality, and no formal model can fully encompass reality’s confounding infinite complexity. The software system that you're working on must take one more step toward reality: you have to fix a bug. Here's how:

  • Build knowledge of the system (like reading the code)
  • Build knowledge of the self (like bending your mind around the code)
  • Build knowledge of reality (often by talking to people)

Somewhere in the interplay of these three cords of knowledge lie the hiding bugs. Once found, the self can cause the system to accord better with reality.

Finding bugs

Programming is a paragon of rational thought, at least, until a bug appears. I have often had the feeling that a bug "defied the laws of physics;" even if the fact of the matter is that the rational computer system is really rational, debugging feels like an encounter with the irrational. Actually, to debug is to encounter one's own irrationality. Often the discovery of the root cause of a bug is a sudden experience where the irrationality reduces to a point: “Oh! Here’s the problem. The program transgresses reality in this one part.”

The substance of debugging is identifying where the bug is. In the difficult cases, the bug is not where you expect, so you spend hours pouring over the wrong piece of code. Bugs hide, but they cannot run. Therefore, you must approach a bug in your own code as if you are seeing an undergraduate's code for the first time. Do not assume. Be free of bias. Assuming competence is wrong. Assuming incompetence is wrong. Be open to anything. Sometimes you can spend all afternoon chasing the bug, only to find that the code is correct and the bug was in your understanding. That bug was in you. In most cases, the code is incorrect, but I consider that the locus of every bug extends to the debugger's mind. 

To find the elusive bug, get outside of yourself. Stop and do something else for a while. Relax. Describe the problem to someone else, even a toy monkey. Give up and go home. Take a warm shower. Read a journal paper. Meditate. Take a nap. Debugging is only a conscious process in the worst case.

The Hamming distance between success and failure is small. When you catch an elusive bug, sometimes—even usually—the fix is blindingly obvious, banally trivial and terribly short. Tiny bugs have a kind of post-hoc invisibility to them. Countless times I find that, an hour after fixing an elusive bug, I had forgotten what the root cause was! Isolate the exact code change that fixes the bug and put that change—and only that change—into a single commit and write a clear commit message “Blindingly obvious, banally trivial and terribly short fix for a highly elusive bug.” Then, rehearse what went wrong mentally to yourself, or write down: the presenting problem was X and I spent a long time looking at file Y but actually the root cause was a minor typo in file Z which was obvious in hindsight.

One-liner bugs cause millions of dollars of damage.

Hiding bug

A systematic approach to debugging?

Programming has every appearance of being a fully logical and systematic process. Could debugging be approached systematically, too? In The Debugging Mindset, Devon H. O'Dell has some great ideas on debugging systematically. He writes:

Through continued learning, malleable views of problems, and effective use of tools, you can become successful in debugging. Still, some insist that debugging is more of an art than a science. I think we can dispatch this idea entirely. It is clear that debugging requires learning, and the scientific method is specifically designed to yield new knowledge. The method, summarized: (1) Develop a general theory of the problem. (2) Ask questions leading to a hypothesis. (3) Form a hypothesis. (4) Gather and test data against the hypothesis. (5) Repeat.

And:

Forming a sound hypothesis is important for other reasons as well. Mental models can be used to intuit the causes of some bugs, but for the more difficult problems, relying on the mental model to describe the problem is exactly the wrong thing to do: the mental model is incorrect, which is why the bug happened in the first place. Throwing away the mental model is crucial to forming a sound hypothesis.

Approaching debugging from a systematic point of view is necessary, using tools is necessary and discarding bad mental models is necessary. Systematic debugging is necessary: if you can’t be systematic, then you probably can’t do software engineering at any level of competence. But I would still contend that debugging has artistic qualities. 

Consider this quote from the book “Free Play,” by improvisational violinist Stephen Nachmanovitch (p. 73):

In practice, work is play, intrinsically rewarding. It is that feeling of our inner child wanting to play for just five minutes more. 

This compulsive side of practice is especially easy to experience in the new art of computer programming. The program we write is itself a responsive activity, which talks back to us in real time. We get into a loop of conversations with the program, writing and rewriting it, testing it, fixing it, testing and fixing again until we get it right, and then we find more to fix. The same applies to practicing an instrument or painting or writing. When we’re really doing well and working at our peak, we show many of the signs of addiction, except that it’s a life-giving rather than a life-stealing addiction. 

To create, we need both technique and freedom from technique. To this end we practice until our skills become unconscious.

Once you’ve fully internalized a systematic approach to debugging, you might find that sometimes it doesn’t work! To overcome certain problems with systems, you have to enter the world of the meta-systematic, as David Chapman expounds here. For example, the senior software engineer must be ready to fix the meta-bugs, the problems in the way that an organization approaches software engineering. But even before that point, we have to face the non-systematicity that's intrinic to anything involving people.

Beautiful bug, not to be fixed


Software is about people

We write software for our customers! Customers, even if non-paying, are people. The larger context of any software system includes people. Often, we write software in teams larger than me, myself and I. Much of what constitutes "reality" for a software system is squishy human wetware.

The bug may be truly unfindable inside the source code of the program—even if you can get outside yourself enough to see the program for what it really is. You may not know enough about the users, the team, the organization. You may be blissfully unaware that your program is riddled with agonizing problems that hurt your users every day. Fixing bugs is a social process that involves talking to people.

The 10x engineer (if they exist) doesn't type ten times faster. But wise engineers develop a deep understanding of what people need and focus their effort on the most impactful bug fixes (which may be missing features). A lot of effort can be spent on coding / debugging that doesn't make much difference to the customer. It might be uncomfortable to leave the realm of the formal system, walk away from your desk and listen to people mumble their contradictory desires. But that's the riverhead of software value.

A ladder of debugging techniques

Bugs are so pervasive that any artificial limitation to debugging will eventually be a hinderance. Therefore, I accept debugging in all its forms, contingent on those forms producing desirable results (assuming we're not doing anything unethical along the way, of course). 

Instead of insisting that debugging should be systematic, or even more high-mindedly claiming that debugging should sometimes be meta-systematic, let's consider that all tools are ours to use in appropriate contexts. Here's a ladder classification of these techniques:

Each rung of the ladder goes meta to the previous rung. The higher rungs are more difficult to accomplish, but they add to the previous rung rather than replace it. 

There's a time and a place for asystematic debugging! When you're tired and frustrated and you just gotta do something, heck yes, comment out the line of code that throws the exception and run it again! Copy that answer from Stackoverflow. Ask the LLM to write your code! Hopefully, by the time you have completed a degree of formal training, you have other tools ready, too, because asystematic debugging won't reliably converge.

And after you've been programming for a decade, hopefully you've developed some kind of "taste" for software and an appreciation for the humanistic aspects. Hopefully, you've put a smile on someone's face enough times to know that that's what software's for.

Debugging infinity

The treadmill of debugging goes ever on. Fixing one bug causes or reveals another. We chase reality with our formal system of software, but we will never get there. I find the eternal parade of security bugs particularly bothersome, but they're really the tip of a deep, monstrous iceberg. We humans will always live with bugs. Bugs in software, bugs in law, bugs in society, bugs in our minds. 

But we keep on running, invigorated by the progress seen so far, joyful at the prospect of fixing one more bug. Make it work! Align the formal system just a little bit closer to reality, using every trick availble, by learning about the system, yourself and reality, for the benefit of people.


Not a bug, a feature

Appendix: an incomplete bestiary of debugging heuristics

  • Heuristic: you aren't looking at the bug! Unfortunately, you can only look in one place at a time, but this heuristic is to encourage you to look somewhere else.
  • Put a breakpoint at the start of main() and step through your whole program. Unfortunately, this approach takes a long time, but eventually you'll eventually be looking at the bug. Usually, when I try this, I get impatient and I end up letting the program execute past the bug. Maybe the realistic version is that you do a kind of random search through the program by guessing where the bug is and trying to stop shortly before the bug then step into it. Making multiple unsuccessful attempts to step into the bug is ok. It’s the one successful attempt that matters. 
  • Heuristic: software in layers (lasagna code). Bottom layer is physics, then silicon fab process, then mask level design, then gate level design, then processor architecture, then assembler code, then 'high level' language (e.g. C) [via a compiler], then sometimes 'higher level' languages (e.g. Python) [via an interpreter], then libraries, then application-specific abstractions, then application logic. Each layer is an abstraction with a certain amount of leakiness. If you're working in the application logic layer, then you will probably also need intimate knowledge of the application-specific abstractions. If you're working in an interpreted language, then you will probably need some knowledge of the workings of the interpreter. If you're working in a compiled language, then you will probably need some knowledge of the compiler. If you’re programming in Objective-C, then read the source code of the Objective-C run-time.
  • Bugs in the configuration. 
  • Bugs in the build process.
  • Heuristic: put abort() at the start of main(). If it doesn’t crash, then your program isn’t actually running. This really helps if you're running entirely the wrong program.
  • Reduce the program down to the minimal form that still reproduces the bug. Create a new branch and start removing code. Ruthlessly remove features and functions until you have the shortest possible program that still has the bug. Unfortunately, you still have to fix the bug, but now there’s less code to search through and puzzle over.
  • Human executed genetic programming.
  • Oblique Strategies: Prompts for Programmers
  • Debugging Zen, by Ben Ramsey


Escaping bug

Special thanks to Ed Blomquist for his comments on drafts of this essay.

Saturday, March 8, 2025

New Music: "The Colorful Path"

Wizard Peter’s first album takes us on an alchemical journey of creation, joy, horror and self-transformation. Check it out on Bandcamp!


Here we walk
The Colorful Path
Green to the left
Now red on our right
Blue and purple underneath

Betwixt virtue and villainy
There’s darkness all ‘round
Yet ye cannae mis-tread
With Wizard Peter
As your alchemical guide

As our footprints
(the inverse space)
Change the path
The path also does
Change our selves




Genesis



Tohu wa-bohu תֹהוּ וָבֹהוּ
Bewildered and astonished
All begins
χάος, nihil
Ma 間 et Śūnyatā
One divided by zero
The infinite plane
Swirling excitations
Of four fundamental fields
Ringing out 
Every direction
But definitely just
Forward in time
Eternally 
We are hiding between
Detailed initial conditions
Shrouded ‘neath
Liminoid depths
Alakazam! emerges
World and WIZARD
Shimmering star
Blinding shining
Serpent-slaying
Chaoskampf
Dirt below
Water around
Heavens above
I AM
W0RD
MEAN1NG
EXI2T3NCE
Life but a single flash
As first, so at last
O Sophia throw
Seven Archons
Hellward to
Eonic abyss
Await Hawking’s prophesy
Magnanimous final crunch
Or entropic
Universal heat death
Here ending galaxies 
Black holes
Evaporate
They say
“Play that again”
“Nay,” quoth
Lizard Pete
“It’s only 
Beginning”

French Suite No. 5 in G Major, BWV 816: VII. Gigue


Monday, March 3, 2025

Against spelling

 

Trust me, I once wrote a book before Chat GPT was invented.

As a wizard, I should be a hexpert on spelling. Obvz. But the strategist would know their enemy:

Scene one: the English language is in its infancy, the violence of German is met with the subtlety of Latin. Monks are copying the Bible in Latin, while the plebs spit their vile commerce with whatever words they can chew. Spelling is but a dream. Words are in anarchy, the pre-modern state of benighted, decadent, degenerate non-standardization. Creativity flows as the spoken becomes written.

Scene two: Garland invents the word dictionary, c. 1220. Writing is more of a thing. 1806, Noah Webster on one side of the Atlantic, the Oxford University Press c. 1884 on the other side. Spelling is formalized, albeit with competing numbers of the letter "u" depending on whether you're in the Americas or the British Isles. 

Scene three: spelling is industrialized. Gutenberg starts pressing the Bible to the page c. 1440 (in German). The common man learns to read, then the common woman, then even common children. Writing, printing!, becomes commonplace, widespread, malignant, a cancer growing its own way on the daughters and sons of Adam and Eve, banished by flame and sword from our natural state in Eden. Speaking to each other by ink and paper.

Scene four: There is but one way to spell each word (until you reach the other side of the Atlantic). The rise of the screen reveals a crack in the supremacy of the thin sheet of dead tree. Then, the screen reveals the Internet, a gawdy, brawling, bawling monster, cute in its infancy, but rising Cthulhu to an apotheosis beyond Zeus, Jesus, Allah and 1993's incarnation of the Buddha. Microsoft Word starts underlining belligerent spellings with red squiggly lines. Don't trust a program called "Word" to give you freedom in how you spell words. Calcification.

Scene four and a half: The widespread penetration of SMS short message service technology causes an equally-widespread mass psychotic panic in high school education when teens innovate the spelling of words with a barrage of abbreviations designed to squeeze their social lives into atoms of 160 characters. Twitter follows suits with the 160 character limit. Gamers intentionally obfuscate words (especially cuss words) with the digit-letter substitution code known as 1337. Innovation. Acronyms become words, lol. Dictionaries try vaguely to respond, with a mixture of resistance and vain attempts to maintain their status as authorities: in 2007, Merriam-Webster grants word-of-the-year status to "w00t". Water seeps through the cracks of the dam: the prescriptive view of language cannot hold back the onslaught of language-made-by-use. 

Scene five: T9 texting gives way to "predictive text", the Blackberry is released with a full keyboard in miniature, Steve Jobs announces a 3-in-one internet device, iPod and cellphone. The 160 character thing stops being so important. Twitter increases then removes the limit. The prescriptivists hold a back-room party, open the champagne and hang the message in big colorful paper letters, "Welcome back, sanity." Spelling is back on top. You can configure your keyboard to make you spell The Right Way, for the Right on either the left or the right side of the Atlantic.

Scene six: Open AI release a new not-search engine called Chat GPT. Generative pre-trained transformer. While most of the word is celebrating xor hand wringing about the birth of artificial intelligence, Chat GPT and its soon numerous copycats are writing irritatingly delightful, perfect prose. They are modifying our tone, our style. (M$ Word would also highlight some of your sentences with a green underline, the "grammar checker," which was pretty good at noticing when you fell pry to the dread "passive voice" but that was not a feature that was as widely copied as the red-underline spell checker.) Impeccable grammar and a bright, helpful, energetic tone is now available to every plumber, undergraduate student, saint, dandy and social media influencer. And, gosh, these large language models, they know so much, dahling. Independent thought puts on its dusty gray suit and catches the empty nine pm train to the mortuary. Correct spelling is assumed.

Scene seven: Not all is as it should be in the post-large-language-model world. Imagine a crack in the shield of utopia, with me, eh? When maverickness is a commodity, when the differently thinking are on top, when a golfing real estate exec is sitting plumly in the White House (for his sins, and ours). When every teenager in their parents garage is under the heavy cloud of having the potential to start a unicorn business. The wise shut their laptop lids, put their phones in the freezer (with or without the plastic bag) and wander out barefoot into the snow to hide among living trees (not yet made into paper for correctly spelled words). The person on the bus is invisible, not only because of the prosaic ugliness of their normal, non-make-up'd, non-photoshopped, non-Instagrammable realness, but mostly becausedears we're all looking at the Cthulhunet through our phonescreens.

And now: What if I told you, Matrix-pill-style, that the chocie was yurz? You have the keyboard, you tipe teh letterz. Spells are what you make them.

And it's t1me to get creativestyle. 

Mis-spellings typically signal carelessness, a vice. My modest suggestions are partially for distinguishing the wise old freethinking humankindess from the language from models of language. But they are also a mere thought on freedom of expression into the great meadows beyond the squiggly red underlines.

  • Take on the German approach of kitbanging words together via the omission of spaces.
  • Hyphenation is another typographic aid to the Überspeller. 
  • Everyone has a dictionary in their palm, so use that weird word. Everyone has a multilingual dictionary for every language in their hand, so use that foreign word. Even better, mash up that foreign word with an English one. 
  • Correct spellings when the deviant spelling obfuscates your message. Clarity is still (usually) a virtue.
  • Enjoy leetspeek, SMS-isms and whatever other alternatives you can find. Add these in like spices in the kitchen. The right amount, in the right place.
  • Spell in alternative ways when it elevates and electrifies words.
  • Spell with the spoken word in mind. Alternative spellings maybe map to alternative ways of speaking. Th-th-this gives you an idear.

The beaten path is now mechanized by LLMs. When you want to walk that way, why not take the bus and use the LLMs? When you want us to hear you, then what are you going to say -- and how are you going to spell -- differently? 

This spellfree dance is, of course, one big foolserrand, childsplay in the shad0w of the Sing-aling-a-ding-dongularity. But if you don't have to mechanize interaction with all your customers on your OnlyFans, tilt some election with fakenewspam, or you don't have to write an infinite number of advertisements, then maybe you can face the situation that humanwriting is like doing pottery at home, not "scalable," not optimized, not commercial-viable-with-VC-interest-for-your-unicornic-potential. Maybe it's just fun.

Saturday, July 8, 2023

New music: "Equations of Motion"

I released a new album of music! Get "Equations of Motion" on Bandcamp here. Also available on SpotifyApple Music and other music services.


Ilam Stone reaches kinetic integration with Wizard Peter in a journey from computer security through consciousness and meaningness to the absurd. Glitchy beats, twangy guitar lines and expansive synthesizer parts fill this instrumental album. 

(Who is Wizard Peter? Find out more at wizardpeter.com.)

Divide by Zero-Day 

The album opens with this rock song that connects distorted guitars with an almost-normal drum sequence that occasionally drops into glitch territory. The dread Zero-Day bug is one where developers have had no time to fix a computer security bug. Dividing by zero is mathematically not possible, so what should a computer (or human!) do when exactly that is requested? A whole universe might become of a divide-by-zero singularity!

Stranger Loops 

This piece started as a simple loop synthesized by the Make Noise DPO eurorack module. Then I added polychords on top of that. Douglas Hofstadter wrote a book called I Am a Strange Loop which has the thesis that consciousness (the "I") is the result of a loop between different levels of representation: 
In the end, we self-perceiving, self-inventing, locked-in mirages are little miracles of self-reference. (p. 363)
If I am a strange loop, then what of the person who I do not know, the stranger? Perhaps they are a "stranger" loop. And what of the "I" who reaches the conclusion "I am weird," the person who is themselves stranger than most. Also, perhaps, a "stranger loop."

Equations of Motion

The initial conditions and the equations of motion are enough to determine any future state in a billiard-ball universe. The Classical-Modernist-Reductionist view assumes this kind of determinacy for the world. Glitchy drums meet glitchy guitar and insane electronic percussion, trying to find the escape hatch into the flow of one of the possible wonderful Post-Modernities. 

Over 16 year ago, when I first heard Year Zero, I hardened my resolve to learn digital signal processing. "Equations of Motion" is not the only song on this album that draws inspiration from the final section of "The Great Destroyer."

80s Future

This piece is set in a deliberately misremembered past where we dream of an impossible mashup of unreal futures. Some neon dream that paradoxically includes a digeridoo that, in actuality, I found cracked at a Fair Trade blowout sale. What is this nostalgia that makes us imagine our desires for the future as if they were true conditions of the past? We are so über spun-around that time has become two dimensional. After the track itself, a secret track, too small to have a real name: a modular synthesizer solo. Perhaps another yet-to-be disguised as old. The working title of the coda was "...", the symbol of ellipsis.

Infinite Plane of Existence

Imagine the Platonic idea of an infinite 2D plane, where physics textbook examples can safely assume a frictionless surface: this is a type of nihilism where the fractal nature of reality is deleted for sheer convenience. This piece features twangy guitar reminiscent of Western movie soundtracks. Image a man with no name, but on the desert of an infinite plane.

Shadowork

This song began on the Octatrack, and partially for that reason, it came to be a part of Wizard Peter's live set at the New England Synth Fest in 2022. The song is about eating the shadow: the difficult and unpleasant work of finding better integrations for "problematic" aspects of oneself.

Gigglecore

This is another song that started on the Octatrack. It has samples of laughter and birdsong plus the industrial music bass and drums.

Venus Moons

Venus Moons started as a Pure Data reverb patch that grew out of Miller Puckette's example patch based on the part of the Ursa Major Space Station algorithm. A chain of free word association went something like this:

The reverb in this song is an instrument and the piece ends with a continuously droning reverb tail. This reverb tail crossfades into the final track, Visions. 

Visions

Visions is another piece composed on the modular that ignores several of the usual aspects of musical composition (like, pulse). It's absurd.  

But "absurd" no longer holds the force it once used to. When people were possessed by a grand unified system of meaning, a work of art could lie outside that system -- rendering that work meaningless, absurd. But today, society comprises of ever growing constellations of meaning systems, such that "outside the system" is actually merely "inside a different system." Therefore, the word "absurd" is now a puny reverberation of what it once was. "Absurd" has been reduced to "mirthful." 

Visions is a psychological journey, closer to a Charismatic spiritual vision than a Native American vision quest. It has no hard beginning. It's a dream; we appear in the middle with a beginning only implied by the hard assumption of causation. The ending comes with a big transient, the jolt awake. Then only echos of the dream remain, and then only briefly before all is forgotten.

As the final song, so the album. After the musically induced trance, silence returns, or the next track on the streaming service plays, or... 

The journey is complete. 

CREDITS

Composition, production & mixing by Peter Raffensperger aka Wizard Peter

Mastered by Bob Familiar at Sound Familiar Studios

The album art is a remix of a figure from "Philosophiæ Naturalis Principia Mathematica" by Isaac Newton.



Saturday, July 30, 2022

Conclusion to a series on faith, doubt and anti-metanoia

 Faith, Doubt and Anti-Metanoia series, conclusion.

Supernova remnant in the Large Magellanic Cloud. This image is in the public domain. My most important idea blew up on me. I’m learning to see what remains as wonderful.


I started out as a Christian. After a painful journey, I left Christianity (Part I has the personal story). The path out of Christianity involved intense thinking and reading. This blog post series has summaries of many works that I read, intermingled with my own commentary and opinions (Parts II, III, IV and V). Much of this writing was done in past years and I did not update all the places that have out-of-date opinions. In Part VI, I introduce meaningness.com, a work of David Chapman, which served the double purpose of helping me escape from nihilism and freeing me from the allure of adopting another total system of meaning. Now that I am “not a Christian,” what am I? I address my new identity in Part VII. I also had to escape from the latent nihilism that I had developed as the intellectual foil to Christianity and I speculate on how that could be done better in Part VIII. In Part IX, I consider some potential objections to my new approach to meaning. Finally, in Part X, I speculate on my future directions.


Because this blog usually appears in time order with the newest posts at the top, this post may be the first post of the series that you see. Reading in reverse order doesn’t make as much sense as reading chronologically. So here’s a concluding table of contents:


Faith, Doubt and Anti-metanoia series

These previous blog posts are given post-publication honorary inclusion status:


Reading guide

If you are a casual internet browser and you don’t know me personally, then I suggest that you start by reading meaningness.com instead of reading my posts. Then, come back and do your usual thing here. 


If you know me and you’re interested in learning more about me specifically, then Parts I, VI, VII and X are most relevant. 


If your interest is the Bible, then Parts II, IV and V are for you. 


If you’re confident in your disbelief of Christianity, then feel free to skip entire sections in Parts II to V. They may be tedious for you.


If you want to criticize me, then consider this work to be a mile set out for you to walk in my shoes. If you specifically want to bring me back around to Christianity, then I invite you to read every word in this series. If you want to come to me with a rebuttal, please also point out a typographical error as proof of your diligent reading.