Looking at this code, they saved one AND instruction and reduced a pipeline stall, but it seems like it would be harder for a future maintainer to understand, because not_received feels a bit less readable. I always think code that's easy for the computer to read and code that's easy for humans to understand are different things.
After writing my comment, I realized it came across as overly critical. But actually, I think this work is completely justified and beautiful. Honestly, it's at a level I couldn't achieve myself. I respect it.
Its like writing a thriller where you are the main operative, heroically saving the day with your skill, foresight and tenacity.
The problem is, it sets a rigid path far to early that you are unwilling to move away from, either because you had ambitions for those empty stubs, or because the obvious solution means admitting that you current $thing is not as successful as it should be.
The problem I have found recently is that it bleeds into the training set that LLMs to use to make software. our platform is pretty well defined and has excellent metrics and logging that come for free.
But the LLMs are creating Otel forwarders with custom NATs transport, even though we have all of that for free already (and in the agents.md)
Because the class/structure only has a single uint64 field, the compilers are likely to pass value in a single general-purpose register. I believe that’s unlikely to happen for a structure with bit fields.
If you target AVX2 or newer you also have BMI1 and BMI2, intrinsics like bextr and bzhi are probably faster than whatever codes compilers are generating for bit fields.
Binary compatibility of bit fields is a moot point, using them at the API surface across compilers or languages is not ideal. A structure with a single uint64 field is very compatible.