Clarkesworld Magazine Issue 118

Home > Other > Clarkesworld Magazine Issue 118 > Page 3
Clarkesworld Magazine Issue 118 Page 3

by Neil Clarke


  “Eternity,” whispered 10% Jesus, leaning to touch his damp forehead against mine, “is precisely like a melon. Repetitive! Forgetful. Is that why the Cardinal loves it so?”

  “Isaac?”

  I opened my eyes.

  “Isaac. Fishy-head.” Sara whispering.

  For a moment I thought I had arms and feet and tried to move them. Then I had tangled hallucinatory arms and feet that would not uncramp. Becca?

  In the dim nighttime hospital light, Sara introduced a new doctor, who leaned over me with a syringe. Soon I was high again, this time in a different way. The doctor and his assistant began to detach me from the larger equipment, began to load my tubes and bags into a cart. Sara explained that they had an experimental plan to re-embody me. I saw no St. Vincent nurses. I soared higher. Colors and sounds and tastes blurred into each other. New indescribably beautiful galaxies of consciousness were invented, and time stretched out to Hubble lengths—or so it seemed to me.

  I woke in an antique gas-powered ambulance, rumbling somewhere. I saw Abe, Sara, a piece of the new doctor. I held only a remnant of my previous high, and I longed to soar again. The ambulance stopped and idled.

  Abe looked nauseous. “The Church is looking for us, Dad,” he said. “The phones and AIs and webbed electronics are all off, so they can’t trace us.”

  My keyboard and voice synthesizer were gone. I looked at Sara.

  “Fifty-fifty,” she said. “Fifty-fifty. But that’s better than certain death.”

  A bug with shiny red wings crawled on the metal wall behind her.

  “Not death, Mom,” Abe said.

  Abe’s P.A.D. was on the seat by his thigh, where Sara and the doctor couldn’t see. Abe’s thumb was near the power button.

  “We need you,” Sara said. “We’re going to Oakland. Abe and I need you. You need to live, be a father again, a professor again. We need to walk in the mountains again. We need to sip espresso by a garden again, people-watching and making snide remarks. You need to help us remember Rebecca. We need to bake bread and drink wine at midnight.”

  I could feel my mood descending further, hallucinatory viscera twisting into my consciousness. A father to whom? To the ghost of Rebecca? To Abe, who would rather send me off? A husband why?

  The ambulance revved up, and their human bodies swayed with the ride. Sara threw words of life at me, but they hazed and fuzzed . . . ~ spinal splice . . . nanite stem cells . . . installed with growth casings the new apartment . . . short roll two Shattuck Line you learn . . . ~ Boo woo, boo boo wooh?

  Theory 6: You need suffering? You need la vida complicada?

  Theory 7: These beads are gonna be frickin indestructible. You are the future, Dad, my only faith, the only promise from the Halls of Power that I believe.

  I fixed my gaze on Abe’s power button. I flicked my eyes up, down, left, right—the cross. Up, down, left, right again. Looking at the power button, the thumb. The location tracking software. Abe will understand.

  Sara’s voice, too harsh: “Isaac, what are you doing?”

  Up, down, left, right.

  The world is graying . . .

  Abe’s thumb falls the decisive half inch, and the ten thousand satellite eyes of Heaven turn silently toward us.

  Rebecca cups a brown bead in her right hand. We’re in the stone restaurant. 10% Jesus is sitting at a little wooden piano in the corner, rifling through a scruffy sheaf of sheet music Saint Peter has just given him. I lean down close toward Rebecca’s bead. Rebecca raises her hand, pressing the bead through my forehead.

  I’m on a glittering modern dance floor. Red lights pulse with the rhythms. A beautiful woman spins before me in flat shoes and green blooming dress, her brow furious with concentration, her gaze intense. She points her left forefinger toward me. She twirls and stops, twirls and stops, each time advancing a little closer, her eyes coming round to fix me more ferociously with each spin. Have I seen her before? S- S- Sarai? Who was I dancing with yesterday?

  A vortex of carbon-tube tropical fish erupts around us, swimming mid-air, twisting their fins. The woman steps suddenly, surprisingly near. For a long moment, her face and body are a tantalizing electric half-inch from mine. She raises a shoulder, lowers a hip, so close, without touching, and stares straight into my eyes. She leans forward and our bodies meet. How can I explain the tingle, the fizz that fills me—love’s first kiss, in that moment when you briefly know that the world has become perfect. The bass line surges and deepens. A greater joy than this, I could not imagine. Everything is glass except us at this moment, the lantern center.

  Then some fragments of memories I don’t understand—a picnic, two children dancing with a trophy, a man and girl playing cards.

  I am back in the stone restaurant.

  “Is that me?”

  I look around, and everything is dust. Humanity is long since extinct.

  I wake again. The hospital room is dark. Now there is a guard.

  The Cardinal’s two long fingers reaching forward. I feel them touch my eyes, ears, nostrils, lips, her unction oil wet on my face, wooden crucifix dancing as she leans, a bass line of thumping rhythms from the machines.

  She is chanting a Latin prayer. She presses her soft lips to my forehead and whispers, “Only what is corrupt and changeable dies.”

  Her red gown backs away and I see Sara’s face, not in person—she is only a thin vid on Abe’s P.A.D. ~ from, from? Jumpsuit orange.

  ~ the newsfeeds, Dad . . . said they’d give Mom leniency ~

  Abe is kneeling, shaking. Crying?

  ~ going to a better place, Dad ~

  Abe’s P.A.D. falls from his shaking hands. Flat slice of video-Sara rotating toward the floor, fish-slow. Something black covers my eyes and the noise of the slicer is suddenly loud ~

  One piece reflects on the unusual sensation of having one’s brain pulled apart. One piece gives a loving last thought to Rebecca and Sara and Abe. Another piece dances away, ecstatic, forgetting.

  These pieces do not know each other. Maybe one of them is me.

  About the Author

  Eric Schwitzgebel is a professor of philosophy at University of California, Riverside, and cooperating member of UCR’s Science Fiction and Technoculture Studies program. His short fiction has appeared in F&SF, Nature, Weird Tales, Unlikely Story, The Dark, and elsewhere. His most recent book (non-fiction, he hopes) is Perplexities of Consciousness with MIT Press. At his blog, The Splintered Mind, he posts regularly on issues at the intersection of philosophy, psychology, and speculative fiction.

  The Sentry Branch Predictor Spec: A Fairy Tale

  John Chu

  Introduction

  Once upon a time1, one single processor filled five whole rooms, one per pipeline stage. Myriad pinballs flooded through the processor and (so I’ve been told) you could chase them from one stage to another to see its machinations in action. The pinballs clicked, clacked, and crunched through gates and slammed into the maws of traps built into the walls of each room. At the end of one clock cycle, their maws snapped shut. The traps flipped over so that, instead of facing the end of one stage, they faced the start of the next. At the start of the next clock cycle, their maws opened and the traps spit out their pinballs then flopped back. As pinballs careened from stage to stage, the processor constructed its results in assembly-line fashion: fetch an instruction, crack open the instruction, do the operation inside the instruction, get data from memory, retire the instruction. Each stage did the same thing again and again while instructions marched down the pipeline.

  Over time, pinballs shrank into ball bearings. Ball bearings shrank into nanodots. Processors now fit on a fingernail, their gates, switches, and traps too small to see with the naked eye. Clocks cycled so quickly that the clicks, clacks, and crunches of a processor computing blurred into an ultrasonic hum. Meanwhile, designers and architects2 partitioned the work to fetch, decode and execute instructions into ever great numbers of ever shorter stages. Rather than just the five c
lassic pipeline stages mentioned above, we divided the work into twenty stages or more3.

  The reason we do that is throughput. Even if it takes twenty cycles for an instruction to get through the pipeline, one leaves the pipeline every cycle. The shorter you make each stage, the faster the clock can cycle, the more instructions the processor completes every second, the better Sentry performs4.

  There is a cost, of course. Lots of costs, actually, but the one that matters here is this: the Sentry pipeline must be fed. It is a ravenous worm whose segments must stay filled. The worm slithers through memory consuming instructions, digesting them with data, and excreting their results. To get the correct results, it has to consume the correct instructions. If they were simply lined up one after another in memory, this would be simple. The worm would simply crawl through memory in a straight line.

  Unfortunately, the correct instructions lie on a path that zigs and zags. The possible paths are spread like a web in space. To find the correct path, the worm has to feel its way through memory, consuming instructions then be guided by their results. Branch instructions tell the worm where to go. The trick is that they won’t until they are digested. By then, though, the worm will have already consumed more instructions. It doesn’t wait to find out where it should go first. Remember, the worm must always stay sated. Whenever it goes down a wrong path, it has to back up then go again in the right direction. That wastes time. The more time it wastes, the fewer computations it makes. The thing to do then, of course, is make sure it never goes down a wrong path.

  Sentry’s Instruction Fetch Unit (IFU)5 has one job: steer the worm so that it always consumes the correct instructions. It is the marriage of Brady6, the branch predictor, and Ian7, the instruction cache. Every cycle, Brady places an address, where the worm should go, into a trap. It shuts at the end of a cycle, flips over to Ian, then spits the address out before flopping back over to Brady. Ian steers the worm then pushes the instructions at that address into the worm’s mouth. Being apoplectic to Ian8 is not an option. Brady always has to have something to say to him9.

  Once a branch instruction is digested, Brady does find out the truth of where to go, but that shows up too late to do anything besides correct his mistakes. The worm only ever tells him where he should have gone, not where he should go.

  Brady’s job, then, is really to divine the truth, to know where the worm should go before the worm figures it out for itself. How does he do it? He consults the three oracles. To do that, he must walk the three rings, one for each oracle. Nano-filaments guide him from segment to segment inside the worm. The rings are nested but they all meet at the trap that Brady uses to tell Ian where to steer the worm. This is where Brady’s journey starts and ends. He’ll encounter machines, monsters, and magic. And when he’s done, he’ll finally know what to say to Ian.

  Next Address Table (NAT)

  The first oracle dwells in the innermost of the three rings. To tell Ian an address every cycle, Brady has to make it all the way around the ring before the trap that sends the address to Ian shuts. Rugged walls soar on either side of Brady. An ever-shifting tangle of chutes latched to the walls block his way. nanodots flood through the walls, gears clack, and one end of a chute unhooks from the wall to his left. The chute swings. It whooshes over Brady and swerves around the other chutes. With a thud, it lands on some other crevice on the wall it’d left. The wall ripples with nanodots and the chute hooks itself back onto the wall.

  The walls and chutes together form NAT. What it does is remember for Brady. Just before he walked this ring, he told Ian an address. Let’s call it A. What NAT remembers is the next address Brady told Ian after the last time Brady told Ian address A. Where Brady steers the worm from A this time is where he steered the worm from A last time. He just has to find that address on the wall.

  Ducking chutes and grasping holds, he climbs the wall on his right. The lower portion of A is his guide. He follows it bit by bit, twisting left or right as he pushes his way towards the correct chute. He doesn’t use the whole address, just the bottom ten bits. If he used the full address to find the right chute, the trap that pushes his address to Ian would have closed and opened again before he got around the ring. He’d arrive too late to tell Ian anything.

  When he finds the right chute, he steps inside then slides. He is turned and tossed with the chute’s every curve until he slams into a crevice in the other wall. Within the crevice are two tokens that represent the next address. The crevice is too small to hold the full address. What it stores instead are the bottom bits of the next address and an index that will tell Ian which ITLB entry to look at to find the address’ top bits. ITLB lives in Ian’s domain and holding the top bits is just one of its jobs10. Ian must reconstitute the address before searching for the instructions that live there.

  Once Brady has those tokens, it’s a climb down to the floor then a sprint back to the trap where the ring starts and ends. The walls and the tangle of chutes cover the entire ring. He dodges every step of the way and, if it’s not too cold and the nanodots flow fast enough, he hits that trap just in time.

  There’s a faster way around this ring. The IFU Configuration Register (IFUCR)11 has a bit that opens up a ramp that leads to a tunnel below the wall. Inside the tunnel lives an adder. Brady tells the adder the address he told Ian and, in return, the adder tells Brady the sequential address. That is, where to go when the worm gets to slide straight ahead.

  What Brady tells Ian is actually the address of an instruction bundle. The worm consumes instructions not one at time but one bundle at a time. The whole of memory is partitioned into 32 byte lines (which hold 8 instructions strung together like beads) and 8K pages12. All the instructions in a bundle come from the same line. Ian ends bundles either at the end of line or right after a branch instruction. The adder always assumes Ian will break the bundle at the end of the line and give Brady a token for the line immediately ahead of the worm. For the other token, Brady just keeps the ITLB index he already has.

  The ITLB index tells Ian which page to fetch from. This means that every time the worm tries to slither from one page to another, Brady will steer wrong. He will have to back up, get the ITLB index for the page the worm is going into, then try again.

  The adder doesn’t predict very accurately. It assumes the worm should go straight ahead and the instruction stream is bound to have branches in it. Even when it doesn’t, the adder can still get it wrong. However, Brady can sprint through the tunnel and back up in plenty of time. Trade offs13.

  That said, is the NAT prediction accurate? More so than the adder, but not particularly. Its main job is to remember what better predictors have come up with. Those predictions can collide, though. Too many addresses can lead Brady to the same chute. Those addresses are probably all parts of completely different paths, but the chute can only take Brady to one crevice.

  NAT is the oracle Brady can visit within one cycle14. It’s how Brady can tell Ian an address every cycle. That’s why Brady has to visit two other oracles. Their predictions may correct the NAT prediction.

  Gshare

  The second oracle Brady visits hauls out the serious magic15. Gshare is the sort of thing my undergraduate logic design professor would have hrumphed at then dismissed as heuristics. She’s right, of course.

  Her solution for where to fetch from while you’re waiting for the truth to arrive was to have delay slots. Basically, you declare the actual branching doesn’t actually happen until some number of instructions after the branch instruction. The instructions between the branch instruction and when the branch takes effect are the delay slots16. To say any more about them is to make them more important than they are.

  Like NAT, Gshare operates under the principle of historiomancy: how the branch behaved last time is the how it will behave this time. Gshare just takes longer and consults way more history to divine a branch’s future. In particular, it curates and references PHR, BHT, and BTB.

  Pattern History Register (PHR) r
emembers whether each of the ten most recent branches was taken or not. It’s a segmented snake. Taken branches twist its segments in one direction while non-taken branches twist them in the other. Branches enter through the tail, shift along the body, then leave through the head. As PHR meets branch after branch, switches clatter and traps rock back and forth on their hinges. The traps slingshot dots from their maws to their neighbors’. With each new instruction bundle, PHR wriggles and writhes. Its shape remembers the path of Sentry’s journey through memory.

  Branch History Table (BHT) remembers what happened to every branch Brady has met. It’s a grid of 1024 arrows, each one mounted on its own base and shaft. When a branch is taken, its arrow swings further to the left. When it isn’t, its arrow swings further to the right. Backstops prevent arrows from swinging too far in any direction. An arrow can only tell you one of four things about its branch: strongly taken, weakly taken, weaken not taken, or strongly not taken.

  Branch Target Buffer (BTB) remembers where taken branches told Brady to go next. Each address lives in the base that supports the corresponding BHT arrow. When Brady learns where a branch takes him, not only does its arrow swing to the left but the base shudders as it swallows that address.

  Brady has two cycles to run around the Gshare ring. In the first cycle, he wrestles PHR. It shudders under his grasp as an incoming branch ripples through its body. He weaves the bottom ten bits of the current fetch address through the ten PHR segments. In the second cycle, the now trussed PHR guides him to the correct arrow in BHT.

  Which arrow is the correct arrow depends both on where the branch is in memory and the path Brady fetched to get there. What Gshare predicts isn’t just the result once a branch is digested. It’s actually predicting which path the worm will take through memory. Historiomancy says where we went from here the last time we fetched down this exact path is where we will go this time17. The instruction stream is chaotic. Reaching this branch by some other path may take us to some other place. Also, weaving the address and PHR segments together spreads branches throughout the BHT. This makes it less likely that more than one branch will land on the same arrow. It makes it more likely that the history Brady consults will actually be for the branch it’s trying to predict.

 

‹ Prev