apu: Add new DSP56300 emulator with JIT execution engine#2801
apu: Add new DSP56300 emulator with JIT execution engine#2801mborgerson wants to merge 3 commits intoxemu-project:masterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the DSP56300 emulation by integrating a high-performance JIT engine alongside the existing C interpreter. The core architecture has been redesigned to support seamless runtime switching between these engines, preserving VM state and snapshot compatibility. This enhancement aims to improve audio processing efficiency and accuracy, while also providing users with control over the chosen DSP execution method through new configuration options. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new DSP JIT (Just-In-Time) compilation engine for improved audio processing performance, configurable via a new use_dsp_jit option. The DSP emulation architecture has been refactored to support multiple backends (C interpreter and JIT) through a common DSPOps interface and a unified DspCoreState structure for VM state synchronization. This includes updating APU state tracking to use microseconds and a frame_work_acc_us metric, abstracting DSP cache invalidation, and integrating DSP state synchronization with VM save/load operations. Debugging macros have been removed, and the DSP DMA logic has been enhanced to include dma_read_count for more accurate DMA completion timing. The C interpreter's DSP core has been simplified by removing unused interrupt types and debug-related fields from its state, while the JIT backend provides a Rust-based implementation with memory region mapping and state synchronization logic.
This comment was marked as resolved.
This comment was marked as resolved.
|
Once available for test
|
161b4eb to
691b91f
Compare
|
Audio Loop that happens in Night Caster series and other games still occurs on the JIT engine |
|
Midi behaviour also not improved seem less heavy that interpreter but still causes broken audio and games to lock up #579 |
|
From my preliminary tested performance improvements range from about 60% to 100% based on utilization metrics. and maxing utilization doesn't seem to be a concern based on my hardware. Will do some testing on low end hardware but couldn't see any regressions from what I tested. Also audio crackling seem way less to mostly fixed but only anecdotal to take with pinch of salt. |
|
From 20+ games I tested only game which doesn't run at full speed with JIT was Sega GT Online. Also using Savestates for sega GT Online while another disk is loaded caused an assertion. |
|
Also had performance issues in v-rally 3. not sure what cause it high utilisation even with Jit engine after a while performance stablized but need to be look at as some reason performance dropped to single digits. |
|
I recorded so gameplay comparison but not sure if I post it TLDR: Fixes performance slowdown due to dsp.
Fixes Audio Utilization cracklingDoesn't fix cracking issues on ea games which seems to be tide to frame-rate, which based on regression issues #2790 and #2096 Other than performance improvements didn't fix any outstanding audio assertion/bug Lastly do you recent performance regression some game weren't included do regression make comparison not useful, as well so of the performance differences might been due to recent regression. |
691b91f to
da295bc
Compare
da295bc to
c684244
Compare
c684244 to
ad4da7c
Compare
- Fixes a few bugs in the existing C interpreter - Adds a state abstraction layer to switch between engines at runtime and maintain snapshot compatibility
ad4da7c to
c3301e1
Compare


TODO: