Basically, I have two scenes in my project and the Engine simply freezes when I boot the Editor and it tries to open them. I can "circumvent" this issue by renaming the .TSCN file of the scenes. This will make Godot open the project with no issue, simply prompting me to fix the dependencies or say that "Can't open file xxx.tscn. The file could have been moved or deleted". It can even open the "broken" scenes afterwards and edit them without any problem!!! However, the moment I go back and fix the names of these TSCN files and Reload the Current Project, it will go back to freezing.

I don't know how to even begin to debug this, because Godot isn't producing any log file that I can use. I'm not sure how could this be, but perhaps the scenes have something corrupt in them somehow, or maybe its just a 4.0 bug that I can't seem to replicate on a new project (I tried).

My repository is located here: https://github.com/Th-eo/Proto
It's built using Godot v4.0.beta2.official [f8745f2f7].
If it freezes, go to res://data/entitites/ and rename the Player.tscn and Entity_Base.tscn files to something like "aPlayer.tscn" and "aEntity_Base.tscn" so Godot can't load them immediately.

Any help welcome. It's slowing down development a lot.

Not fixed but update:
I might have been able to locate the crash in this shader: https://github.com/Th-eo/Proto/blob/main/code/entities/PaletteSwap.gdshader
I'm reverting to an earlier commit and the moment I apply it, I can't Reload the project (doing it simply to locate the issue and it worked). WHY is a shader causing the engine to not be able to load the project?
Another Update:
Engine can open, but the moment I switch to my Entity_Scene scene in the editor, it will freeze/crash, again since introducing the shader into it.

    Jarro I'm not sure how could this be, but perhaps the scenes have something corrupt in them somehow, or maybe its just a 4.0 bug that I can't seem to replicate on a new project (I tried).

    Or maybe you have a circular reference going on in there somewhere?

      Does the shader run in the editor when loading the scene? I don't know. It looks like the shader is dividing a float (0) by some negative number.

      I don't know about the current godot, but the old godot would have an error dividing a zero in the shader. GDScript can handle this, but I think the shader is different.

      Megalomaniak Could you elaborate? I don't know what a circular reference is or how I could sort it. Thank you! 😃

      Jarro WHY is a shader causing the engine to not be able to load the project?

      Probably because godot tries to display shaders in the editor. If the shader is doing something toxic, the editor won't handle it any better than running the program. Debugging shaders isn't likely to be trivial -- I suspect you'd have to override the gpu driver, which would be different for each driver. Maybe you should try something specifically aimed at shaders like this.

      It might also help you to use godot from the command line, though that still won't let you debug a shader. You can edit any part of a project with a regular text editor, it's just not as easy.

        duane I think the shader itself might not be the culprit. I have now tried with a different Shader and came upon the same issue. It would be a coincidence that two different shaders might be creating the same type of crash no? I'll try to make an example project to isolate the issue... Both run fine in editor at other times, but randomly corrupted these scenes at some point.