Source Code (the movie)
Welcome to the September issue of Hacker Chronicles!
I'm pausing the review of I, Robot short stories for a month to not make this a one trick pony newsletter. This month we're instead diving into the movie Source Code and how to recreate a scene from memories and sensor data.
Enjoy! /John
Writing Update
I'm deep into my Draft 0 revision and this week I crossed the 90k word line! An amazing milestone. My wife and I celebrated our ten-year anniversary last weekend and popped a bottle of champagne. I might just have to pop another one tonight.
Just look at that green color of the progress bar:
Review of Source Code
Image from Wikipedia.
The movie Source Code came out in 2011. It was written by Ben Ripley "on spec" which means he wrote it speculatively, hoping someone would make a movie out of it.
Despite its very hacker fiction:y title, it's not heavy on hacking or even software. But it is imaginative in what may be possible in the intersection of computers, memories, and artificial intelligence.
Trailer: YouTube
Hacker Rating
Hacker Realism: ⭐️ ⭐️
Hacker Importance for the Plot: ⭐️ ⭐️
Hacks: ⭐️
Spolier alert: You got it, spoilers ahead.
Opening Scene – Sean
U.S. Army Captain Colter Stevens (Jake Gyllenhaal) wakes up on a train speeding through suburbia.
Facing him in the seat across is a beautiful woman (Michelle Monaghan) who seems to know him, but he doesn't recognize her. He ultimately learns that her name is Christina and she calls him Sean. He says he is not Sean but a helicopter pilot on mission in Afghanistan. Christina thinks he's acting weirdly.
Stevens observes his surroundings, utterly confused. We see several things happen – a woman spills coffee on his shoe, a man looks sick and goes to the restroom, and another man is mean to the conductor because the train is ten minutes late.
Stevens is asked for his ticket and the woman helps him find it in his breast pocket.
He goes to the restroom where he sees himself in the mirror and realizes he's someone else.
The train closes in on central Chicago where it meets with another train on the opposite track. Both trains explode.
The Bomb
Stevens wakes up from dying on the blown up train. He's strapped in a chair in a closed space, like a cockpit or capsule. He talks about his mission and his unit in Afghanistan.
A screen comes to life and there's a woman in uniform talking to him. Her name is Goodwin (Vera Farmiga).
Stevens's confusion is racing and Goodwin takes him through exercises with playing cards to get him focused. She tells him to "Find the bomb and you'll find the bomber." She mentioned that he will go eight minutes back, just like last time.
Stevens is thrown back to the same train scene. He talks to himself about the pretty woman being a deliberate distraction. He thinks it's a simulation. He remembers the forthcoming explosion and starts asking people and observing more closely what's going on.
He thinks that the explosion came from behind and checks plausible hiding places. He finds the bomb behind a ventilation panel above the sink in the restroom. It has a cellphone attached for remote control. On the phone's display, under "Images," are listed "History.swf" of 9kB with a Flash logo, and "Image0002.jpg" of 45kB.
Stevens realizes he needs to find the controlling device. He tells all passengers he's a security person and they need to turn off all electronic devices. A couple of male passengers ignore or question him. He hits a guy who refuses to close his laptop.
The bomb goes off again.
The Mission
Stevens is back in the capsule, talking to Goodwin. She gets permission to brief him. The train explosion outside Chicago has already happened for real and killed everyone onboard. They believe the explosion was a first in a series of terrorist attacks to come. Any delay in finding the bomber puts innocent civilians at risk.
Stevens tells Goodwin the location of the bomb and that it had a cellphone detonator.
Goodwin shares that there were 52 calls connected to the closest cell tower, disconnecting at the time of the explosion. The train passing just as the bomb went off was a freight train carrying materials that compounded the explosive force. The bomber timed it for exactly when the trains met and thus had to be able to see them moving.
With this new information, Stevens goes in again.
He focuses on the sick guy who enters the restroom where the bomb is. That guy gets off the train on the last stop before central Chicago. Stevens convinces Christina to get off with him and follows the sick guy to the train station's restroom. He harasses him, thinking he's the bomber. The man leaves for the platform again.
Stevens awkwardly sits down on the bench where the man waits for the next commuter train. The clock is ticking towards the explosion. Stevens steals the man's suitcase and rips it open to look for some kind of triggering device. The bomb goes off in the distance. The man rages over his stolen suitcase and Stevens ends up laying on the tracks after a fight. A train hits Stevens.
Saving Christina
When Stevens returns to the cockpit, there is no connection to Goodwin and it's freezing cold inside. He struggles to get the capsule powered up and working again.
The scene switches to where Goodwin sits, trying to connect to Stevens. Dr. Rutledge (Jeffrey Wright) seems to be the Director of this program and Goodwin's boss. He hands out orders on how to revive the connection: "Just keep sending strings out, see if he hooks onto something."
The connection eventually comes back and Stevens tells Goodwin that he managed to save Christina. He has discovered that there is a budding romance between Christina and Sean, and he's acting the Sean part for those eight minutes.
Goodwin tells him there is no way to actually save Christina since she's already dead: "She survived, but only inside the Source Code. None of them can be saved."
Stevens demands to be properly briefed. "What is the Source Code?"
Rutledge reluctantly appears on screen and explains that the Source Code is a machine that reconstructs the past using dead people's residual memories. The brain retains electric current for a little while after death and short term memories of eight minutes before. Stevens happens to have a "synaptic match" with a man called Sean Fentress who was on the train, and is now reliving the last eight minutes of that man's life over and over to find who planted and triggered the bomb.
Rutledge says saving Christina doesn't matter. The only thing that matters is preventing the second attack in Chicago.
Wanting to Live
Stevens goes back to the train scene and figures out who the bomber is through a wallet deliberately left behind. The man leaving it planted it as false evidence of himself dying in the explosion. Stevens gets Goodwin enough information to prevent the second bombing in real life and the mission is over.
When Stevens talks to Goodwin to figure out his own role in Source Code, he is told that he himself died two months ago in Afghanistan. However, his brain and parts of his body were saved and is now connected to the Source Code system.
He asks Goodwin to let him go back once more and try to save Christina and all the people on the train. If he succeeds, he wants to be disconnected and die for real. He is granted this and goes in and prevents even the first bombing from happening. At the end of the eight minutes, he kisses Christina on the train. The frame freezes.
Note: The movie doesn't actually end here. But it really, really should have ended here. It's a beautiful scene. Timeless, with Christina and Sean happy in one last kiss, unaware of how there is nothing left for them.
I'm so bummed by the actual last few minutes of the movie that I refuse to cover them here.
Thoughts
Normally when I do a hacker review, I share my thoughts plot point by plot point, digging deep into anything hacker related. But I'll do it as one consolidated set of thoughts this time since the movie only has big picture hacker relevance.
What this movie comes down to is replicating eight minutes of real life in a way that you can interact with. The input data is only what human brains have remembered. The rest has to be filled-in convincingly, and accurately if it's going to be used for a crime investigation.
Why Source Code?
It may be that the title is just cool sounding, from a time of rising awareness of software and programming as keys to the internet revolution. The Source Code system is referred to as "a computer program" and we see screens with technical content but that's about it.
But it could also be a metaphor for ground truth, for the DNA of something ultimately happening in the real world. The fact that Stevens can render it over and over while making slight alterations would then mean he's making changes to the source code.
Reading Memories
Being able to turn human brain signals into imagery on a computer screen is popular in fiction. A prime example is Minority Report which I reviewed last year (both the book and the movie). There, the precogs' visions of the near future provides evidence of crimes about to be committed.
Facial composites have been used since 1959. Here's the composite sketch of D. B. Cooper, who hijacked an airplane in 1971:
Image from Wikipedia.
To create one, an eyewitness is asked about the perpetrator's individual facial features in isolation. Eyes, nose, eyebrows, lips. The features were originally printed on transparent sheets and superimposed on one another to create a composite. That system was called "Identikit." It's an example of trying to extract an image from a brain.
Newer such systems have emerged from academic research. The witness is exposed to groups of full faces and asked how well they match the perpetrator's. The system converges towards an composite image.
With such a system we're getting fairly close to modern training of computer models. You could imagine the witness serving as an oracle calling good or bad on samples. But no human would stand hours and hours training a model so we'd have to connect directly to the brain somehow. It's not super far fetched that we could get an output signal from a brain as to whether or not it recognizes the image data presented. The resulting models could be used to fully animate the memories once you combine them with models of how humans move and interact.
If you add multiple witnesses and perspectives, you could possibly recreate a scene and be able to move around in it. The drawback would be that humans' memories are fuzzy and our tendency to remember things as more rosy than they were.
Enter sensors and cameras. Today's smartphones and people constantly taking photos means that many scenes will have unbiased data to compensate for humans' bias. Unless a hacker has skewed the sensor data to hide the truth.
This makes me recall the Swedish startup Narrative with clip-on cameras taking snapshots throughout your day. The venture didn't pan out but the website is still up (insecure connection only): http://getnarrative.com/.
Predicting Human Behavior
In the movie Source Code, Stevens is not only able to review memories but also change the remembered reality. Maybe not completely but enough to investigate the bombing. This means that the computer driving it needs to be able to predict and replicate human behavior.
For instance, Stevens is acting Sean and has no way of knowing how the real Sean would behave. Christina changes what she does based on Steven's (really Sean's) changes, to the point where she agrees to get off the train.
A significant amount of compute is already being used to predict human behavior in real life. It's the basis of a lot of targeted advertising online. You may be shown an ad because a computer model has decided that you are likely to want the product, can afford it, and are ready to buy it now.
Predicting commong human behavior is one thing. You can do it by learning from a huge population and we can see through generative AI today how incredibly well computers can mimic humans. But there is an element of regression toward the mean to such learning. Generative AI gives us a combination of human behavior, not one human's behavior.
Predicting an individual human's behavior is something else. If we are to simulate someone like Sean, Christina, or the bomber, the model would have to be of those humans or at least of a subset of humans acting in the same ways as they. In such tightly scoped modeling, the trickiest thing would be behavior that the human doesn't want to expose. Like someone doing criminal things. Stevens is able to interact directly with the bomber in the movie, while that man is working to kill thousands.
The fact that Source Code at least lets you think about such things and doesn't fall flat as soon as you examine it is a testament to a great script.
Currently Reading
I'm reading The Trident Deception by Rick Campbell. It's to some extent a modern version of Hunt for Red October.
US law requires me to provide you with a physical address: 6525 Crown Blvd #41471, San Jose, CA 95160