Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jit sparse continuation #250

Merged
merged 13 commits into from
Nov 22, 2024
Merged

Conversation

LotP1
Copy link
Contributor

@LotP1 LotP1 commented Nov 15, 2024

More up to date build of the JIT Sparse PR for continued development.
JIT Sparse Function Table was originally developed by riperiperi for the original Ryujinx project, and decreased the amount of layers in the Function Table structure, to decrease lookup times at the cost of slightly higher RAM usage.
This PR rebalances the JIT Sparse Function Table to be a bit more RAM intensive, but faster in workloads where the JIT Function Table is a bottleneck. Faster RAM will see a bigger impact and slower RAM (DDR3 and potentially slow DDR4) will se a slight performance decrease.
This PR also implements a base for a PPTC profile system that could allow for PPTC with ExeFS mods enabled in the future.
This PR also potentially fixes a strange issue where Avalonia would time out in some rare instances, e.g. when running ExeFS mods with TotK and a strange controller configuration.

@github-actions github-actions bot added the cpu An issue with ARMeilleure, the JIT, or Hypervisor label Nov 15, 2024
@LotP1
Copy link
Contributor Author

LotP1 commented Nov 15, 2024

the 2 extra builds are up on the Discord server in the #testing-jitsparse channel.
the files were too big for github.

@LotP1
Copy link
Contributor Author

LotP1 commented Nov 16, 2024

pushed 2 new commits
you can now choose between GiantBlock (better for high end) and TinyBlock (better for low end) by using the LowPowerPPTC option in settings

Default (aka GiantBlock) is a bit weird to launch, it causes a bug we haven't fixed yet, but if you spam click the emulator window while it's starting the game it should successfully boot

@extherian
Copy link
Contributor

I have been unable to boot the giant block version by any means, clicking the emulator window just causes it to lock up.

@LotP1 LotP1 force-pushed the jit-sparse-continuation branch 2 times, most recently from f137331 to a5dca04 Compare November 18, 2024 21:55
@LotP1
Copy link
Contributor Author

LotP1 commented Nov 18, 2024

updated locales and rebased for Canary 1.2.42

@LotP1 LotP1 force-pushed the jit-sparse-continuation branch from a1ee5bf to 4a44c74 Compare November 20, 2024 14:52
@LotP1
Copy link
Contributor Author

LotP1 commented Nov 20, 2024

Rebased for Canary 1.2.47

@LotP1 LotP1 marked this pull request as ready for review November 20, 2024 15:05
@github-actions github-actions bot added gui Affects the Avalonia UI or translations. horizon Affects the Horizon OS HLE components. labels Nov 20, 2024
@LotP1 LotP1 force-pushed the jit-sparse-continuation branch from 4a44c74 to 95935b7 Compare November 20, 2024 18:51
@LotP1
Copy link
Contributor Author

LotP1 commented Nov 20, 2024

Rebased for Canary 1.2.48

GreemDev and others added 12 commits November 22, 2024 00:55
Updated the Branch to use TinyBlock by default.
In the next commit GiantBlock will be default with TinyBlock being used instead of LowPowerPTC is enabled.
The Sparse Jit Function Table sizes now depend on the LowPowerPTC setting. This means lower power devices won't be impacted as hard by the higher ram speed requirement of GiantBlock.
Also added functionality to the PPTC Initializer so it now supports different PPTC Profiles simultaneously, which makes switching between TinyBlock/LowPower and GiantBlock/HighPower seamless.
This also opens the door for the potential of PPTC cache with exefs mods enabled in the future.
Default (aka HighPower) currently has an Avalonia bug that causes a crash when starting a game, it can be bypassed be clicking the window multiple times durring loading until the window unfreezes.
When using GiantBlock the memory block used for filling SparseMemoryBlocks is now 4096 times bigger.
Cuts function table mapping times by a factor of about 5000
The emulator now always uses GiantBlock.
TinyBlock has been left in, but is unused.
The PTC InternalVersion is now included and the default PPTC profile os now called "default"
it's unused and doesn't need to be here, so it's getting reverted
this doesn't affect how the emulator runs as sparse only has 2 levels, but it functionally already supports more levels so the limit can be removed.
@LotP1 LotP1 force-pushed the jit-sparse-continuation branch from 4f58339 to fd81089 Compare November 21, 2024 23:55
@GreemDev GreemDev merged commit e653848 into Ryubing:master Nov 22, 2024
10 checks passed
@Goodfeat
Copy link
Contributor

is it possible to implement switching between the new and old jit compilation method?

@LotP1
Copy link
Contributor Author

LotP1 commented Nov 28, 2024

is it possible to implement switching between the new and old jit compilation method?

No.
I am aware that some games are currently having issues with the new JIT Sparse feature, like SSBU, and i am actively looking into fixing those issues at the moment in #319.

@LotP1 LotP1 deleted the jit-sparse-continuation branch November 28, 2024 09:49
@Goodfeat
Copy link
Contributor

Goodfeat commented Nov 28, 2024

No.

Very sad, I'll try to come up with something then. Unfortunately, despite the fact that this update subjectively makes games more stable, the update hits the performance for older systems.

@GreemDev
Copy link
Member

No.

Very sad, I'll try to come up with something then. Unfortunately, despite the fact that this update subjectively makes games more stable, the update hits the performance for older systems.

Performance on older systems is not something we care about.

@LotP1
Copy link
Contributor Author

LotP1 commented Nov 28, 2024

No.

Very sad, I'll try to come up with something then. Unfortunately, despite the fact that this update subjectively makes games more stable, the update hits the performance for older systems.

Yeah we know that, but the goal of Ryujinx is to work the best out of the box so we'd rather not make a million options, and this should only affect DDR3 and very slow DDR4 systems which aren't that common anymore.
You can still run with the old JIT Function Table by using the Software setting for memory management, but idk if that would give you a performance boost.

@GreemDev
Copy link
Member

You can still run with the old JIT Function Table by using the Software setting for memory management, but idk if that would give you a performance boost.

It wouldn't; Software memory mode is a massive performance hit.

@KeatonTheBot
Copy link
Contributor

No.

Very sad, I'll try to come up with something then. Unfortunately, despite the fact that this update subjectively makes games more stable, the update hits the performance for older systems.

Performance on older systems is not something we care about.

@LotP1 @Goodfeat Primarily, no. Performance shouldn't be the focus of an accuracy-based emulator, but opportunities to increase performance shouldn't be frowned upon unless it sacrifices accuracy. IMO: Accuracy first, then performance improvements if possible. That's not always feasible, but they shouldn't be written off.

@GreemDev GreemDev mentioned this pull request Dec 10, 2024
GreemDev added a commit that referenced this pull request Dec 19, 2024
More up to date build of the JIT Sparse PR for continued development.
JIT Sparse Function Table was originally developed by riperiperi for the
original Ryujinx project, and decreased the amount of layers in the
Function Table structure, to decrease lookup times at the cost of
slightly higher RAM usage.
This PR rebalances the JIT Sparse Function Table to be a bit more RAM
intensive, but faster in workloads where the JIT Function Table is a
bottleneck. Faster RAM will see a bigger impact and slower RAM (DDR3 and
potentially slow DDR4) will see a slight performance decrease.
This PR also implements a base for a PPTC profile system that could
allow for PPTC with ExeFS mods enabled in the future.
This PR also potentially fixes a strange issue where Avalonia would time
out in some rare instances, e.g. when running ExeFS mods with TotK and a
strange controller configuration.

---------

Co-authored-by: Evan Husted <gr33m11@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpu An issue with ARMeilleure, the JIT, or Hypervisor gui Affects the Avalonia UI or translations. horizon Affects the Horizon OS HLE components.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants