This one still bothers me. Neither [0] nor [[]] is actually wrong in that case, but moreover, I'd expect that if we're using hlsl_deref_is_lowered() then it should look something like
if (hlsl_deref_is_lowered()) { // dump the offset } else { // dump the path }
rather than this else-if logic we have.
For the record, currently we are not writing `[[]]` for unlowered paths that have length 0, which I think is good to not overload the HLSL dump, so I think there is no need to change that behavior.
I agree that separating the lowered/unlowered cases first makes it more readable, albeit I put the unlowered case first because it is what happens first. If that makes sense.