Parsing timing at the 'end of a short rest' is a red herring
Both the units of time and the sequencing rules in the game are abstractions, put in place for when the things happening are conflicting and / or contingent. If you have multiple characters and opponents in a combat, you are trying to represent a situation in which events are simultaneous. But in order for everyone to have a turn, and because what you are able to do may be affected or prevented by what someone else just did, we have initiative rules. Everyone is acting simultaneously in the six-second combat round, but we agree on initiative order to resolve their actions.
Similarly, you could have just one character involved in a time period, but their actions occur simultaneously with environmental effects so that the order of resolution on their turn matters.
In cases where there is no conflict and no contingency, however, the order of resolution doesn't matter. When multiple characters in a party finish a short rest at the same time, we don't roll initiative or invoke Xanathar's in order to see which PC gets to roll their HD first. There is no conflict and no contingency involved - RAW perhaps the cleric regains hp before the barbarian, but since in practice everyone agrees on the outcome we don't bother to determine which happened first, we just let both happen.
So this question is not actually about what happens first (attunement or spending hit dice), but rather about whether there is a conflict there. Obviously the player would like to gain the benefits of both, and in particular would like to have Genji already attuned to the periapt when he spends his HD. Were it up to the player, the attunement would happen first; there is contingency, but no conflict. The DM could simply permit this, in which case there is no conflict and we can just assume that it happens. If the DM does not want this to happen, that is the conflict that needs to be resolved. It is DM vs. player interest that is in conflict, not two events triggered by the same 'end of short rest' time period.
So why doesn't the DM want this to happen?
There are lots of reasons the DM might not want to permit this; perhaps they consider it abuse of the idea of attunement which binds a magic item to a specific character. Perhaps they find it hurts immersion by disrupting the narrative of slowly recovering from wounds over the hour and makes it seem like a character hits the rest button at the end of the hour and suddenly pops up fresh. Perhaps they simply worry that if the periapt can be shuttled between characters to always aid the one who most needs it, the power of the item has become more than they considered and it is unbalanced, or it will create a source of tension among the players over who needs it more and thus disrupt the social contract.
Any DM considering disallowing the same short rest to both attune to and use the periapt should first spend some time examining why they don't want to allow it - what negative effect they think it will have on play. They will then be better able to provide a ruling that specifically addresses their concerns.
It is not a yes / no answer
Fortunately, a DM has considerably finer-scale options than simply allowing or not allowing this to work. A close reading of the rules for rest here is helpful (emphases mine):
A short rest is a period of downtime, at least 1 hour long, during which a character does nothing more strenuous than eating, drinking, reading, and tending to wounds.
Notice that a short rest is at least an hour long; that is the minimum. A DM is entirely within RAW to have the party wait an hour and then declare that they are not fully rested yet - they still need another 30 minutes, another hour, or so forth. Indeed, the only limit on how long a party might need for a short rest is that it shouldn't exceed the time required for a long rest. Further, a short rest is awarded to a character on an individual basis, not to a party. Thus, a DM is within RAW to say that one character needs one hour to obtain the benefits of a short rest bust another requires two hours.
Once this is realized, the DM has a flexible 'sliding scale' to apply. For a DM who considers it most important to maintain the mystique of magic items, it is easy to say 'the intensity of effort required for attunement ('focused on only that item') means that you are not healing during the process; yes, you can attune and heal in the same short rest, Genji, but that short rest will take you two hours to complete.'
A DM who wants to maintain the narrative of rest as time spent doing restful and curative things can say, 'Yes, Genji, while you are attuning your body is resting, but you are not eating or dressing your wounds. You gain the benefits of a short rest after 90 minutes, and you can only spend half the HD you would otherwise be allowed - if you want more than that you have to rest even longer.'
A DM who wants to maintain a tradeoff between optimization and in-game activity can say, 'Yes Genji, you can both attune and then use the periapt for HD, but you'll need an extra ten minutes of downtime while the mage gets to ritual cast and the rogue is scouting - why don't you go get the pizza and you can join in when you get back?'