I've updated the visualizer to support structured buffers and the article has a new section explaining the rules. This also allows checking whether a cbuffer and an equivalently declared C struct have identical memory layout (with some restrictions on platforms and C types used).
Ever had issues figuring out the memory layout of a constant buffer in HLSL? I wrote an article explaining the packing rules since they are very unusual. It also includes a layout visualizer for your own custom cbuffers to play around with.
https://maraneshi.github.io/HLSL-ConstantBufferLayoutVisualizer/

HLSL Constant Buffer Packing Rules & Layout Visualizer
Learn HLSL constant buffer packing rules and visualize the memory layout of your own custom cbuffers!