TSparseArray visualizer doesn't work for arrays that use TInlineSparseArrayAllocator

The visualizer for TSparseArray in the Unreal.natvis file only works for TSparseArrays that use the default allocator. This is the section that we needed to add to visualize TSparseArrays that use TInlineSparseArrayAllocator (I added it above the general-case TSparseArray visualizer, but I don’t think the order matters):

 <Type Name="TSparseArray&lt;*,TInlineSparseArrayAllocator&lt;*,*&gt;&gt;">
  <DisplayString Condition="(Data.ArrayNum - NumFreeIndices) &lt;= 0 &amp;&amp; Data.ArrayMax == 0">Empty</DisplayString>
  <DisplayString Condition="(Data.ArrayNum - NumFreeIndices) &lt;= 0 &amp;&amp; Data.ArrayMax &gt; 0">Empty, Max={Data.ArrayMax}</DisplayString>
  <DisplayString Condition="Data.ArrayNum &lt;= Data.ArrayMax">Num={Data.ArrayNum - NumFreeIndices}, Max={Data.ArrayMax}</DisplayString>
  <Expand>
   <IndexListItems>
    <Size>(Data.ArrayNum &gt; 0 &amp;&amp; Data.ArrayNum &lt;= Data.ArrayMax) ? Data.ArrayNum : 0</Size>
     <!-- in some cases, the allocator will have a valid SecondaryData, even though the AllocationFlags indicate that it should be using InlineData -->
    <ValueNode Condition="(AllocationFlags.AllocatorInstance.SecondaryData.Data == 0) &amp;&amp; (reinterpret_cast&lt;uint32*&gt;(AllocationFlags.AllocatorInstance.InlineData    )[$i/32]&gt;&gt;($i%32) &amp; 1) &amp;&amp; (Data.AllocatorInstance.SecondaryData.Data != 0)">*reinterpret_cast&lt;ElementType*&gt;(&amp;(reinterpret_cast&lt;FElementOrFreeListLink*&gt;(Data.AllocatorInstance.SecondaryData.Data)[$i]).ElementData)</ValueNode>
    <ValueNode Condition="(AllocationFlags.AllocatorInstance.SecondaryData.Data == 0) &amp;&amp; (reinterpret_cast&lt;uint32*&gt;(AllocationFlags.AllocatorInstance.InlineData    )[$i/32]&gt;&gt;($i%32) &amp; 1) != 0">*reinterpret_cast&lt;ElementType*&gt;(&amp;(reinterpret_cast&lt;FElementOrFreeListLink*&gt;(Data.AllocatorInstance.InlineData)[$i]).ElementData)</ValueNode>
    <ValueNode Condition="(AllocationFlags.AllocatorInstance.SecondaryData.Data == 0) &amp;&amp; (reinterpret_cast&lt;uint32*&gt;(AllocationFlags.AllocatorInstance.InlineData    )[$i/32]&gt;&gt;($i%32) &amp; 1) == 0">"Invalid",sb</ValueNode>
    <ValueNode Condition="(AllocationFlags.AllocatorInstance.SecondaryData.Data != 0) &amp;&amp; (reinterpret_cast&lt;uint32*&gt;(AllocationFlags.AllocatorInstance.SecondaryData.Data)[$i/32]&gt;&gt;($i%32) &amp; 1) != 0">*reinterpret_cast&lt;ElementType*&gt;(&amp;(reinterpret_cast&lt;FElementOrFreeListLink*&gt;(Data.AllocatorInstance.SecondaryData.Data)[$i]).ElementData)</ValueNode>
    <ValueNode Condition="(AllocationFlags.AllocatorInstance.SecondaryData.Data != 0) &amp;&amp; (reinterpret_cast&lt;uint32*&gt;(AllocationFlags.AllocatorInstance.SecondaryData.Data)[$i/32]&gt;&gt;($i%32) &amp; 1) == 0">"Invalid",sb</ValueNode>
   </IndexListItems>
  </Expand>
 </Type>



Steps to Reproduce
In an IDE debugger, step through code that references a TSparseArray that uses TInlineSparseArrayAllocator and attempt to view the array’s elements. The list element visualizer won’t show the values.

Hi Ron,

Belated response, but this has been confirmed and a bug report has been submitted. If you would like to follow the progress you can track it here:

Best regards,

-Graeme