ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.88k stars 281 forks source link

Running Blue Revolver on VF2 leads to OOM #763

Closed ksco closed 1 year ago

ksco commented 1 year ago

Reproduce:

  1. Download [experimental] bluerevolver_v051_demo_linux.tar.gz from https://woofycakes.itch.io/blue-revolver-v05
  2. Uncompress it and run box64 bin/love64 bin/game.love (with gl4es and emulated SDL)

The game seems running fine, but memory usage will grow at a rate of 1GB/s until it gets killed. I already tried BOX64_DYNAREC=0, no help.

@xctan has run it on a native machine, and the memory usage is normal.

ptitSeb commented 1 year ago

interresting. I'll check, thanks for the details.

xctan commented 1 year ago

I tried this game with 0e14d42dcfc308fe011066c01394d72cbc8ee009 in qemu, the game crashed after entering gameplay (always press z without selecting other options), and the memory footprint was kept below 1 GB. image

ksco commented 1 year ago

https://github.com/ptitSeb/box64/commit/0e14d42dcfc308fe011066c01394d72cbc8ee009 is two more commits away from the latest main, I've tried, also leads to OOM. So not the last two commits, but QEMU and SBC do behave inconsistently on this...

ptitSeb commented 1 year ago

Not sure on RV64 as I haven't tried yet, but I fixed all issues running this game on ARM64. It's a bit slowish when lots of action is occuring, but I haven't analysed what is happening yet.

ksco commented 1 year ago

I'll check that later today.

ksco commented 1 year ago

It works on VF2, and it's slow too. But after playing for a while, it reported an error.

image
ksco commented 1 year ago

Seems it will report this error as soon as a bullet hits a target, looks like an opcode bug.

ptitSeb commented 1 year ago

Yeah, I don't have this on ARM64, it works fine. I played a couple of time and there was no errors.

ksco commented 1 year ago

Ok, I'll try fix the opcode bug.

xctan commented 1 year ago

I found this bug after running the game half an hour under cosim. The rounding mode should apply to the raw value, not the absolute one.

ksco commented 1 year ago

Cosim is awesome!

ptitSeb commented 1 year ago

That's strange, I think I saw that before, but it was ok because the sign bit was copied after the conversion.

xctan commented 1 year ago

BTW the gameplay is still slow at 1.8~7 fps, drastically dropped from above 30 fps in the menu.

xctan commented 1 year ago

And if the player is not shooting, the game runs at ~12 fps with much less danmaku.

ptitSeb commented 1 year ago

Yes, I noticed. I tried some analysis, but I'm still unsure what is going on. I think it's luajit that doesn't play nice with box64 Dynarec, but even that I'm unsure yet.

ksco commented 1 year ago

Should I leave this ticket open? The OOM issue is fixed.

ptitSeb commented 1 year ago

No, it should be closed. The performance issue is something completly different. It something that you can also see, more or less, with other JIT based engined, like Mono/Unity3D (with Terraria or Broforce for example). The solution is not clear yet, nor is the root cause of the slowdown...