[1.15] Hanging During Rendering with Optifine and Render Distance >8
Kas-tle opened this issue · 5 comments
I reference this in #122, but I believe this is a separate issue. There are also some references to similar issues in #119, but due to the lack of logs produced I am unsure if this is a duplicate. When setting the render distance to above 8, with Optfine present and ReplayMod built up to commit 3f4156b on the 1.15 branch, hanging occurs dependent on the render distance and video length. Above a render distance of 12, hanging seems to occur consistently regardless of video length. Also had a friend test on a windows system with the same mods. I can provide their specs as well if needed. I am unable to provide any logs as this requires me to stop the process.
Relevant Video Settings:
- Renderdistance >12
Hardware Info:
- Intel i7-4770HQ
- Intel Iris Pro 1536 MB
OS/Fabric:
- macOS Mojave 10.14.6 (18G4032)
- Fabric Loader 1.15.2 0.7.9 build 190
Startup Arguments:
-Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
Installed Mods:
- Fabric 1.15 API 0.5.1 build 294
- Optifabric 1.0.0 beta 8
- OptiFine 1.15.2 HD U G1 pre13
- ReplayMod 1.15.2 2.2.0 b7 53 g3f4156b
Reproduction Steps:
- Install mods listed above with listed fabric launcher.
- Join a server or single player world with recording enabled.
- Escape the world or server and load the produced recording.
- Set render distance to a value above 12 chunks.
- Set 2 respective position and time key frames of any length apart.
- Start a render with default settings.
- Observe that Minecraft stops responding immediately after the render start.
I've tried for a good while but I'm unable to reliably get it to hang. I got it to hang once after a few tries (not sure if it's the same kind of hang as you got though), then immediately tried to do the same thing again but have been unsuccessful for at least 30 minutes now. Intensely staring that the respective code didn't help either.
How long did you wait when it started hanging before killing it?
Which render distance were you using while recording?
Could you test if it happens with all default settings except for increased render distance?
Since I appear to be unable to do so, could you use VisualVM to get me a few thread dumps of the game while it's frozen?
I took thread dumps through a normal render at 8 chunks and a hanging render at 16 chunks. For the 16 chunk render, I took thread dumps roughly every minute and allowed it to hang for 10 minutes before killing the process. The recording was taken on a flat single player world with mobspawning disabled. All settings were default with the exception of render distance, including shaders being off. Though the initial recording used in the dumps was made at a render distance of 16, I tested with taking the initial recording at 8 as well and the same indefinite hanging occurred. Please let me know if you need anymore info.
ThreadDumps.zip
Longest I waited before killing it was 10 minutes, which I believe is much longer than a 2 second clip would otherwise take to render. The render distance I originally recorded on was 16. If I left the render distance on this when starting the render, the hanging occurred. Bringing it down to 8 before starting the render seemed to stop this, and this was with otherwise default settings, and as I described for me as well, approaching 12 seemed to have varied results. I will again attempt to do this in a more standardized way, with a blank flat world and try to reduce any other potential variables. I will also get you the thread dumps when I am able to test again.
Thanks very much for the thread dumps.
I think I've got this replicated on a different machine now. However it's not actually hanging, it's just unreasonably slow to start (takes 12±3 minutes to produce the first frame for me, normal speed afterwards).
Could you please try to just keep it running in the background and see if it eventually gets going for you as well?
The thread dumps and your descriptions do match what I'm seeing, I just want to be sure you're actually having the same issue. So that when I solve this one, we can know that your issue is actually fixed and it's not just no longer reliably reproducible because of the different timing of the new build.
Edit: Hold that thought, seems to be very timing dependent, I added some debug messages and now it starts after just a few seconds, so it might just be that it has a random chance to break free each iteration (in which case you doing above test wouldn't say much).
Above commit should fix the issue I (and most likely you too) ran into.
It's a live-lock caused by a bug in OF's changes to vanilla which is triggered when there's a chunk within render distance which doesn't have another chunk in all four cardinal directions (i.e. edge chunks, basically guaranteed to happen when your render distance is greater than the server's view distance).
This would ordinarily be a complete lockup were it not for a (afaict otherwise benign) race condition in vanilla code which slowly (or rather quickly in the case of my dev machine or with the debug output) causes the lockup to dissolve.