(Dayna Smith/For The Washington Post)

It’s approaching 5 a.m., and the thoughts racing through my sleepless head are not suitable for a newspaper section whose favorite four-letter word is food.

I’m on my third attempt at making bubble tea, and my tapioca pearls, after lounging in a large low-heat pot for more than four hours, have finally deigned to turn translucent and slightly gray. The problem is, they’re still nowhere near the shade of black required. Personally, I’m ready to beat them black and blue and call it a night.

How did I find myself in this kitchen nightmare? All I wanted to do was make genuine Taiwanese bubble tea, the kind in which the richly steeped tea is the forward flavor, not those powders, syrups and jellies that so often pass for fresh fruit in the sweet smoothie interpretations of the drink. But I first needed to learn how to make the “bubbles,” or boba, the dark tapioca pearls that I love to Hoover up with a wide-mouth straw.

The first person I contacted was Thanh Tran, matriarch of the Lai family, the Vietnamese clan behind the iconic Four Sisters restaurant in Merrifield and the Song Que deli in the Eden Center. Tran says she might have been the first one to introduce bubble teas to the Eden Center, not long after she spotted the drinks-you-can-eat during a Southern California trip some 12-plus years ago. “That’s why she wanted to open up the deli in the first place,” says daughter, Lieu Lai, one of the four sisters.

If Tran is a pioneer, she’s also practical. She warned me away from making my own bubble tea. “Too hard,” she told me through her son Thuan, who runs Song Que, where you can order a wide variety of bubble drinks. Tran instead suggested she show me how to make che chuoi, a traditional Vietnamese dessert with tiny tapioca pearls, bananas and coconut milk.

I would take Tran up on her offer, in part because I understand the importance of tapioca in Asian desserts, whether Vietnamese honeycomb cake (banh bo nuong), Thai tapioca pearls with young coconut flesh (saku piak maphrao awn) or Cantonese taro-and-tapioca-pearls tong sui, one of many “sugar soups” that can be served at the end of a meal.

Still, even with Tran’s warning, I couldn’t get those tapioca pearls out of my brain. I’ve long been fascinated with bubble tea, an accidental invention that has solidified into a global phenomenon. It has spread far beyond its place of origin — Taiwan in the late 1980s — and now passes the lips of people on almost every continent, inspiring all sorts of variations along the way (such as bubble tea fruit smoothies without a drop of tea — or a slice of fresh fruit, for that matter). Even McDonald’s sells bubble teas now, in Germany, of all places. The teas also have their own detractors, who warn of potential carcinogens in tapioca pearls or the high calories concealed in those bubbles.

Warnings notwithstanding, I charged ahead with my plan and sought the assistance of Diana Shen, a Taiwanese native who more than 10 years ago tried to open her own bubble tea bar in the District, on the second floor of a Chinatown restaurant. The project ultimately fell through, a casualty of quarreling owners, even though she had already bought all the necessary equipment. A decade later, Shen is one of the few local bubble-tea makers willing to share her methods, given she doesn’t have to worry about passing along trade secrets, such as any subtle flavors a shop might add to its cooked bubbles.

At the Vienna home of her friend Dorothy Brown, Shen offers her own warning: Don’t buy the tapioca pearls that need only five minutes of stove-top cooking; those bubbles, she says, sacrifice texture for expediency. “Everybody will be very excited by that: ‘Oh, five minutes!’” Shen notes. The trouble, she adds, is that the bubbles will be like “bad-quality chewing gum.”

Shen relies on tapioca pearls that she special-orders. She calls them “fresh” pearls. Precooked, these pearls sport a light-tan complexion, as if they were Cocoa Puffs that know when to come inside during the hot midday sun. They smell like maple syrup, and if you press an uncooked pearl between your fingers, it will easily crumble. Shen tells me that I should be able to find these bubbles at Asian supermarkets, such as Great Wall in Rockville.

At the sprawling Great Wall, I can’t locate fresh pearls. I spot the five-minute bubbles, even a rainbow-colored variation of the quick-cook pearls. I find tapioca flour and dried white pearls that are as hard as ball bearings. A customer-service rep at Great Wall informs me that the store sells only the dried white pearls and their speedy little cousins. So I buy the dried ones, along with a bag of five-minute bubbles and a container of wide-mouth straws. (Days later, I should note, Shen found the fresh pearls at the Eden Supermarket in Falls Church.)

That is when the nightmare begins. The first time I tried to cook the driedpearls, I quit after three hours when too many of them stubbornly stayed white. What’s more, because of the protracted cooking period, the pearls seemed to release as much starch as they retained, laminating my poor saucepan with a thin layer of translucent goo.

After reviewing my notes from Shen and conducting more online research on cooking tapioca pearls, I modified my technique. I boiled the pearls longer before turning down the heat, hoping that was the key to unlocking their color change. It wasn’t. Nor was covering the pot for the entire cooking process, a tactic I employed on my third and final attempt, thinking that steam might play a role. That did nothing, either. Long before that third batch had failed, I feared the worse: These pearls were all wrong for the job.

I called some professional bubble-tea makers and explained my situation. “It’s a tough product to master,” says Linda Neumann, co-owner of Teaism, where bubble tea has been available for years. But she doesn’t cook the bubbles herself, so she turned me over to Ruben Hernandez, general manager at Teaism’s store in Old Town Alexandria. He cooks the pearls.

“It took a little while” to perfect the bubbles, Hernandez says. “Sometimes they were hard. Sometimes they were a little mushy. . . . It’s not that easy. It takes a little practice.”

Like two other bubble-tea makers I interviewed, Hernandez has never used the hard, white Asian supermarket pearls to make his drinks. The bubbles he favors are the same kind Shen had shown me earlier: the caramel-colored pearls that crumble with the slightest pressure. Hernandez prefers a brand called Tea Zone, available in six-pound vacuum-sealed bags on online shopping sites. The ingredient list for Tea Zone bubbles ventures beyond the basic tapioca flour and water of the hard, white pearls; it also includes caramel, maple syrup flavoring and potassium sorbate, a preservative.

The freshness of the pearls and their added color clearly affect the cooking process and the bubbles’ ability to turn black. Shen explains that fresh bubbles can turn dark in as little as 20 minutes. The trade-off for such accelerated cooking is that these pearls are fragile. You must drop them straight from the package into boiling water. “If you put them in cold water, they will melt,” Shen says.

When I got my hands on fresh bubbles — a cup-of-sugar favor from Song Que — I felt like a prep cook who had just discovered the Cuisinart. What I couldn’t muster after four dreadful hours at the stove — black pearls with a proper chewy texture — I could now create in a matter of minutes. And with none of the saucepan goo.

The only question I had left was the classic one of every home cook: How do I know when my ingredient is properly cooked? In other words, how will I know when my pearls have achieved that right, perfect texture? After all, when I cooked the five-minute bubbles out of sheer curiosity, I must admit they tasted fine to me — at least the first time I made them. They were both soft and chewy. (The second time, they were like pencil erasers.)

For my last question, I turned back to my mentor, Diana Shen. She explained the Taiwanese concept of “QQ,” which means, roughly, “bouncy.” When you test your pearls as they cook, you want bubbles that generate a certain bounce in the mouth as you bite into them.

I found that bounce not only in my bubbles but also in my step, as I finally was able to steep some high mountain oolong tea, shake it together with ice and sweetened condensed milk and pour the creamy mixture over a small pile of beautiful, chewy and black tapioca pearls.