The teenage Russian phenom glided across the ice and thrust herself into figure skating history. Leaping and spinning at high speed Monday night, Kamila Valieva became the first female figure skater to complete a quad — a jump with four rotations — at the Olympics.

But if the systems in place to root out doping in global sports had worked correctly, she would not have been on the ice at all.

In December, Valieva, 15, had submitted a routine doping sample that a laboratory later determined included a banned drug. The results of the test were not returned for more than six weeks, though, and delivered only after Valieva had competed at the Beijing Olympics. This created an embarrassing spectacle in which a skater from a nation serving a multiyear doping ban for running a huge, state-sponsored doping scheme at a previous Olympics was allowed to compete on her sport’s biggest stage, only to be suspended the next day.