Profile Picture

Reverse Engineering Chaos Through Blackholes

1. What do I mean by "chaos"?

Chaos surrounds us; it’s ubiquitous. Just consider the second law of thermodynamics, which asserts that everything tends toward disorder. Whether in our personal lives through imbalances, tragedies, or simply the daily pressures of work, chaos is a thread that connects us all. We may not experience chaos at the same time, in the same way, or in the same place, but inevitably, it will appear, as surely as sparks fly upward.

Reflecting on my own life and the challenges I’ve faced over a lengthy career in various roles—Linux Administrator, Development Manager, Developer, and now Team Lead—I sought to apply a new dimension of thought to these challenges. What am I not seeing? What can I learn better? So, I turned my gaze to outer space and the most powerful chaotic entity in our known universe: black holes. If this entity epitomizes all things disorganized, disruptive, and destructive, what can I learn from its design and nature? More importantly, how can I apply those lessons to the chaos that surrounds us? This introspection led me to black holes.

2. Terminology

Let's build up to what a blackhole is by going through some grounding in terms of terminology that we will use later.

Gravity

Gravity: The force that attracts objects with mass towards one another. In black holes, gravity is incredibly strong, distorting space-time.

Space-time: Space-time is the four-dimensional fabric that combines space and time, shaping how objects move and interact under the influence of gravity. Or said differently, space-time is often referred to as the fabric of space because it combines the three dimensions of space and the one dimension of time into a single, interconnected framework that can be warped by mass and energy.

Blackhole

Blackhole: A region of space where the gravitational field is so strong that nothing, not even light, can escape from it.

Singularity: The singularity of a black hole is a point at its very center where gravity is so strong that it crushes all matter into an infinitely small space with infinite density.

Accretion Disk: is a swirling ring of gas, dust, and other material that forms around a black hole

Event Horizon: The boundary surrounding a black hole beyond which no light or other information can escape.

Tidal Forces: Tidal forces are the differences in gravitational pull on different parts of an object, stretching it when near a massive body like a black hole.

Spaghettification: The process by which an object would be stretched and elongated as it falls into a black hole due to extreme tidal forces. Your head and your feet would experience different forces as your feet would get pulled into long strands spaghetti-like that would stretch you towards the singularity.

Hawking Radiation: The theoretical radiation predicted by Stephen Hawking that black holes can emit due to quantum effects, potentially causing them to lose mass and evaporate over time.

  1. Quantum Effects:

    • Near the event horizon of a black hole, quantum mechanics predicts that particle-antiparticle pairs can spontaneously form.
  2. Particle Pairs:

    • Normally, these pairs annihilate each other quickly. However, at the event horizon, one particle can fall into the black hole while the other escapes.
  3. Energy Loss:

    • The escaping particle takes energy away from the black hole. This energy loss appears as radiation emitted by the black hole.
  4. Black Hole Evaporation:

    • Over a very long time, this process causes the black hole to lose mass and energy, potentially leading to its eventual evaporation.

Relativity

Special relativity: (1905) Einstein’s theory dealing with the physics of objects moving at constant speeds, especially near the speed of light, and how time and space are relative.

General relativity: (1915) Einstein’s theory describing how gravity affects the fabric of space-time, predicting phenomena like black holes (mass and energy)

Minkowski

Minkowski diagram: is a space-time diagram used in special relativity to visualize events. It typically includes two axes: time (vertical) and space (horizontal).Light cones represent the paths light would take, forming a 45-degree angle with the axes.

Penrose diagram: also known as a conformal diagram. Is a way of representing spacetime that simplifies the structure of infinity to a finite distance, allowing the entire infinite spacetime to be depicted in a finite diagram. This very similar to a picture of the earth, Mercator diagram, where the sizes of the continents are obscured or compromised so the angles can be protected. The intent is to allow for navigation and moving around the earth as a ship for example. In the Penrose, it is the same concept but to the effect where infinity is compromised (reduced) so we can reason about infinite spacetime.

3. Quiz of Misconceptions?

Fall

3.1 What would happen if you fell into a blackhole?

  • If you fell into a black hole, you’d experience extreme tidal forces stretching you out (spaghettification) as you approach the event horizon, the point of no return. Time would slow down for you compared to outside observers, making you appear to freeze at the horizon. Once inside, you’d continue falling towards the singularity, where gravity becomes infinitely strong, and space-time curvature is infinite, like an ultimate crash point where all known physics breaks down. This journey into the black hole would be a one-way trip with no escape.
  • Another theory is that you would hit some kind of fire wall, and just explode.
  • Either way, you die.

Explode

3.2 A blackhole is a vacuum

  • A blackhole is not a vacuum. A vacuum by definition is empty space. A blackhole on the other hand as witnessed by accretion disk contains matter and gases, facing extreme pressure of gravity.

4. Chaos in Software Development

4.1 Lesson: Chaos has a Hidden Order

Poller

4.1.1 The Elegant Solution Gone Bad

If there is one clear guarantee, it is that in whatever role you are in, you will face a situation that presents a problem impacting someone, yet on the surface makes no sense or is complex and potentially challenges reason. Developers commonly encounter this when troubleshooting software defects. I faced one such situation with our high-throughput, highly multi-threaded monitoring architecture. We were polling over 12,000 devices and extracting about 60 billion data points a month, using nearly 40 MySQL servers to gather real-time metrics about machine health so we could notify customers when their machines were in jeopardy.

Unfortunately, we hit an issue where we were losing data for new devices with long names because we used the device name, customer name, and date as table names for storing data. MySQL has a table name limit of 64 characters. I implemented a fix, which was just three lines of code to generate a hash of the name. It felt like an ideal, simple, and highly effective solution. I was so proud. All testing indicated it worked and integrated beautifully across our systems. It went live, and the process was smooth. I had followed the system through two proven examples, and I now had confirmation it had worked. YAY!

A week later, the key nodes responsible for flushing data to the database from memory broke. They refused to flush any data to our databases, effectively breaking our data persistence layer. I spent hours trying to reproduce or understand the problem, reading and re-reading the code. Nothing made sense. The code was largely untouched. I sat down with the team and walked them through the problem. I spoke to our Director, a seasoned developer with over 20 years of experience, and he too was stumped. I re-read the code repeatedly, even reviewing my change. Three lines to generate a hash couldn't possibly be the problem. We were so confused. I started developing conspiracy theories about what was happening, delving into the internals of the GC, looking for bugs in the JVM, you name it. Reason didn't apply, so I was now delving into the land of the impossible.

Eventually, we made a judgment call to contact the author of the persistent layer who had immigrated. We granted him access to the systems, and in a few hours, he found the problem and gave me a call. The first thing he opened was my three lines of code. I hadn't put a lock around the three lines of code; simplistically, it wasn't thread-safe.

4.1.2 Black Holes Have a Hidden Order

When I think about black holes, I envision an unimaginable force of destruction—able to swallow planets and destroy galaxies. They are the epitome of chaos. But just like the chaos that resulted from my seemingly illogical code change, there is an actual hidden order. A system of dysfunction still based on the realities and physics of our world.

If we were physicists studying black holes, how would we even begin to understand them? How could we think about their nature and design, and more so, if their singularity collapses into infinity, how can we even think about its effects, draw theories, and conclusions? How do we reason about them? But even chaos has a hidden order. And we don't have to make up new rules to govern our understanding; special and general relativity are sufficient. In fact, this problem was solved earlier. Let's revisit our Penrose Diagram.

4.1.3 Penrose Diagrams

Penrose

Penrose diagrams assist in understanding the causal structure of black holes and are a powerful tool in theoretical physics. They simplify the infinite regions, visualize the causal structure, analyze interior regions, study black hole dynamics, and help understand global properties.

Mercator

What are Penrose diagrams? Well their like mercator projections. You know the picture of the continents. As you know, they have several incorrect distortions, one of which is large land masses stretched out at the poles. Why is this done? To preserve the angles for navigation. So to the Penrose diagrams are able to take the complexity of blackholes and provide insights around it's causal structure, it's infinite regions and much more. If you review the diagram, you will see, on a finite space, it collapses infinity. It creates an infinite future vertically, a infinite past at the bottom, infinite space that moves from right to left.

4.1.4 Even Blackholes have a hidden order

Referring back to my experience with those simple 3 lines of code that caused disaster. There was an order to the chaos that initially looked in-comprehensible. As we look at blackholes, despite physicists continual struggle to understand it's chaos, in roads have been made with leaps by Sir Roger Penrose to push the field forward with Penrose Diagrams. In all this, and even in our own lives, there is a pattern of taking the realities and constraints of what we know, and applying it to the unknown. We shouldn't start with chaos, with the unknowns, but start from the realities of what we do know slowly breaking down and navigating the chaos. To every chaos, there is an order. A system, and it's not beyond the realms of our reality.

"No problem can withstand the assault of sustained thinking"

5. Chaos with Soft Skills

5.1 Lesson: Don't be afraid of chaos

Hawking

5.1.1 A Brief History of Time

This is not so much about black holes but a lesson in one of the most intriguing theories surrounding them, proposed by Stephen Hawking in 1974. Hawking Radiation predicts that black holes decay, combining two previously separate realms of physics: Quantum Mechanics and General Relativity.

However, not long ago, there was an article on Forbes where another PhD physicist completely dismantled the theory. Since then, there has been much debate about its correctness and legitimacy. Some even say that Hawking Radiation is nothing more than a theory or narrative Hawking put together as a way to help readers of his book "A Brief History of Time" understand black holes better, suggesting that real physicists know the truth.

5.1.2 Lesson

Regardless of the debate, Stephen Hawking took a bold step in putting forward this theory. Remember, he released this along with his book "A Brief History of Time" in 1974, when there was no internet or large language models, and black hole theory was significantly less advanced. He knew it was controversial because it challenged established views around general relativity and quantum mechanics. Whether to be hailed as an Einstein or much later an idiot, he put forth his theory.

Often, as technical people, ideas, potential solutions, and designs may be lost because of what is established and a lack of belief or confidence. Solutions should be judged on their merit and put forth with conviction. They should not be lost because we fear what is, or are enveloped by a lack of confidence in our own insights.

“True innovation often requires the courage to challenge the impossible. Embrace your ideas and let them shine, for they may shape the future.”

6. Chaos in Life

6.1 Life through the lens of your chaos

Batman

6.1.1 Hosting Company Experience

I joined a hosting company with great expectations. In fact, the architect took a liking to me and believed I could help him transform the business to a service-oriented architecture or TOGAF. Unfortunately, instead of collaborating with others and him, I tried to solve difficult problems alone, thinking I alone was sufficient for success. My efforts soon led him to incorrectly micro-manage me, and our relationship started to deteriorate. He had his own personal demons, and I wasn't helping, and soon he tried to force me out of the company. I feared him. Thankfully, I was offered a rotation to another team. Eventually, despite his best efforts to transform the organization, he ended up leaving. But that's not where the story ends. It ends with me struggling to escape the darkness of that experience. I was so hurt, I felt so incompetent, and in every interaction in that organization, I applied that lens. I felt everyone around me thought I was a fraud, useless and ill-equipped. Reaching this epiphany took a bit of work, but the place I was in was dark like a black hole; that one event caused an infinite collapse, further and further into darkness.

6.1.2 Lesson

A black hole is a dark unknown. Its event horizon is the first contact with its power and destruction. As mentioned when we covered spaghettification, on entry, there is no escape. No information escapes, not even light itself. Its darkness is all-encompassing. Today, you may be faced with a similar challenge or have been through one. The darkness can be overwhelming. Some event or situation has marred your ability to function optimally. Some set of circumstances has damaged your brand, reputation, or confidence in yourself.

My advice to you is, don't be scared of the dark. Sometimes you may try your best to push against the inevitability of the event horizon. It's an impossible task. Light and information never escape. All that's left is to push through the darkness, accept what is, learn from it what you can, and follow the infinite. Don't allow the lens of past experiences, pain, or darkness to destroy today.

Embrace the dark, and rise up. Deshi Basara, Deshi Basara!