Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug (Case 1358381) Addressables generates bundles that are not deterministic

Discussion in 'Addressables' started by Peter77, Aug 16, 2021.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    Unity 2019.4.20f1, Addressables 1.18.15

    Using Addressables to generate asset bundles, causes the generated asset bundles to be different, even though the content of the source data did not change.



    Reproduce
    1. Open attached project
    2. Open SampleScene
    3. Open "Window > Asset Management > Addressables > Groups"
    4. In Groups window press "Build > Clean Build > All"
    5. In Groups window press "Build > New Build > Default Build Script"
    6. Open folder "Library\com.unity.addressables\aa\Windows\StandaloneWindows"
    7. Copy samplescene_scenes_all*.bundle to a new folder and name it 1.bundle
    8. In Groups window press "Build > Clean Build > All"
    9. In Groups window press "Build > New Build > Default Build Script"
    10. Open folder "Library\com.unity.addressables\aa\Windows\StandaloneWindows"
    11. Copy samplescene_scenes_all*.bundle to a new folder and name it 2.bundle
    12. Change the Aspect ratio in GameView
    13. Change the Window Layout in the Editor
    14. In Groups window press "Build > Clean Build > All"
    15. In Groups window press "Build > New Build > Default Build Script"
    16. Open folder "Library\com.unity.addressables\aa\Windows\StandaloneWindows"
    17. Copy samplescene_scenes_all*.bundle to a new folder and name it 3.bundle
    18. Perform a binary compare on the three bundle files, under windows use "fc /b 1.bundle 3.bundle" on the command-prompt

    Actual
    The generated bundles have different hashes in their filenames.
    Running a file compare command against the generated bundles shows they are different.

    Expected
    Build System outputs bitwise identical bundles if the source content did not change.
     

    Attached Files:

    Artemko_one, emerge-sjh and Prodigga like this.
  2. tylo

    tylo

    Joined:
    Dec 7, 2009
    Posts:
    154
    I would not be surprised if this is a problem specific to having a bundle with a scene in it. Scenes are very sensitive to receiving changes as you use the editor, so that could be why the bundle is getting a different hash.

    I have also noticed this happening if you include a bundle with an explicitly added shader. Bundles actually contain compiled shader code, and it seems Unity is very sensitive and will cause bundles with unique hash names to happen even when it appears you changed nothing.
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
  4. Thermos

    Thermos

    Joined:
    Feb 23, 2015
    Posts:
    148
    Thank god. This bug has hunted me since the begining of using addressable.
     
  5. emerge-sjh

    emerge-sjh

    Joined:
    Oct 16, 2020
    Posts:
    14
    Can't wait for this to be fixed :)
     
  6. CineTek

    CineTek

    Joined:
    Jul 12, 2013
    Posts:
    98
    Peter77 likes this.
  7. unity_shane

    unity_shane

    Unity Technologies

    Joined:
    Jun 3, 2021
    Posts:
    106
    @CineTek, @Peter77 Hey there, sorry for the delay. It looks like this is actually an editor issue (i.e. not addressables) that addressables just happens to be affected by - it seems like it has to do with resizing editor windows inadvertently changing trivial UI data in the build leading to the hashes changing. I pinged the team responsible to see what their ETA on the ticket is and I'll let you know if they get back to me with anything concrete. In the meantime, while looking at the internal ticket, it looks like this issue may already not be present anymore on newer versions of the editor, so its possible that updating your editor version could fix the issue, although I'm not certain.
     
  8. timbokoppers

    timbokoppers

    Joined:
    Nov 14, 2016
    Posts:
    71
    @unity_shane, in which unity version *could* it be fixed? We are using 2020 LTS right now.. any hint?
     
  9. CineTek

    CineTek

    Joined:
    Jul 12, 2013
    Posts:
    98
    We are on Unity 2021.2.10f1 as 2020LTS was not stable unfortunately - our last build was also made with 2021.2.10f1
     
  10. Mad_Max_Sharecare

    Mad_Max_Sharecare

    Joined:
    Jun 1, 2020
    Posts:
    6
    Hi!

    Probably same/similar issue on my side:
    Remote catalog bundles and unityBuiltInShaders bundles differs depends on active scene in the Editor.
    Tried with Unity 2021.2.7f1 and Addressables 1.19.19.
    Test project and video attached.
    @Unity-shane , should I make a separate ticket and/or post?

    Thanks!!! ;) :)

    Addressables_Test_2.gif
     

    Attached Files:

  11. unity_shane

    unity_shane

    Unity Technologies

    Joined:
    Jun 3, 2021
    Posts:
    106
    @timbokoppers I can't say anything with certainty - it doesn't say on the internal ticket either beyond that it seemed like it might be fixed on an editor version that was being worked on in late 2021, so perhaps in one of the newer versions of 2021/2022? I wish I could give a more precise answer, but that's all I really have right now - I apologize.

    @Mad_Max_Sharecare That sounds like it's probably the same issue if my understanding of the bug is correct. It wouldn't hurt to post a bug report with this project included though just in case - it might help the editor team get a fix to this bug faster.
     
  12. Mad_Max_Sharecare

    Mad_Max_Sharecare

    Joined:
    Jun 1, 2020
    Posts:
    6
  13. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    Luckily, I have CI/CD setup. I build Addressables through command line, I won't open the Editor on that machine.