Search Unity

Question About Highlight SIMD Scalar vs Packed option of Burst Inspector

Discussion in 'Burst' started by CarlosAI, May 24, 2023.

  1. CarlosAI

    CarlosAI

    Joined:
    May 9, 2023
    Posts:
    71
    Hello everyone,

    I haven't seen any differences after enabling the option "Highlight SIMD Scalar vs Packed" in Burst Inspector.
    Maybe I miss something, so I come here to ask.

    upload_2023-5-24_11-24-27.png


    My Unity version: 2022.2.20f1
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,882
    I would expect to see a difference when you change the code of a function so that some of the instructions change from scalar to packed operations or vice versa.
     
  3. Per-Morten

    Per-Morten

    Joined:
    Aug 23, 2019
    Posts:
    119
    It might be that there aren't any mix of instructions in your assembly code, alternatively, the different in tint isn't super obvious, so it's easy to miss unless you see packed vs scalar code next to each other.

    Here it's off:
    upload_2023-5-24_7-10-12.png
    Here it's on: (notice all the instructions ending with ss being a brighter tint)
    upload_2023-5-24_7-10-32.png
     
    CarlosAI likes this.
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,882
    Wow, what a „highlight“! :)
    This inspector really needs some color settings in Project Settings.
     
    Enzi likes this.
  5. CarlosAI

    CarlosAI

    Joined:
    May 9, 2023
    Posts:
    71
    Thank you, the difference in color is very subtle. I had to look closely to notice it.
     
  6. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    962
    How about bold?
     
  7. Per-Morten

    Per-Morten

    Joined:
    Aug 23, 2019
    Posts:
    119
    I personally would prefer it to be just a bit more distinct color (alternatively, let us choose colors), but not too much really. Granted, I have this turned on all the time and I'm kinda used to the difference now, so I'm biased :p.

    I think bold would be too eye drawing, also I'm unsure if it would work, because there's currently more than just 2 colors.
    upload_2023-5-26_6-38-17.png
    vmoshdup, vmulps, and vadss/vmulss all have different colors.

    I suggested this highlight feature a couple of years ago*, and in that suggestion I somewhat suggested 3 main "categories", scalar SIMD instructions, packed SIMD instructions and "infrastructure" instructions. AFAIK vmulps is packed, vaddss is scalar, vmovshdup is infrastructure.

    I would guess that the reason we don't have a completely different color, but rather different tints is that the point of the difference in color is to be able to more easily do a SIMD smell test. Seeing that you have a mix of different category SIMD ops rather than exactly what category an operation is.

    * https://forum.unity.com/threads/burst-inspector-suggestions.1102819/
     
    Last edited: May 26, 2023