Merge yaps2: arm64 JIT transplant + test/perf/libretro infrastructure

Merges yaps2/main (github.com/yaps2/yaps2, c16b88cb7) into ARMSX2,
replacing the arm64 recompiler family with the yaps2 JITs and importing
the yaps2 testing, perf, and libretro infrastructure. Common ancestor is
upstream PCSX2 342db5152 (2026-06-19); git auto-merged all but 38 files.

Replaced (deleted in this merge, recoverable from history):
- arm64/aR5900*, aR3000A*, aVU* -> arm64/iR5900*/iR3000A*/microVU*-arm64:
  EE static-pin register file with lazy dirty tracking, dual-residence
  allocator, IOP block linking, native COP2 macro ops, inline unaligned
  fastmem, persisted VU program cache, call-ret shadow ring, VU0 spin
  fast-forward.
- MVU_DIFF shadow-run hooks in shared VU interpreter TUs (superseded by
  the offline vurunner JIT-vs-interp oracle).

Imported from yaps2:
- tests/ctest/core/recompilers: ~80 gtest suites (EE/IOP/VU differential
  harnesses, fuzzers, ABI digest tripwire, capture format pins) plus the
  gs_vertex_tests kernel oracle.
- pcsx2-vurunner / pcsx2-eerunner headless capture-replay runners.
- tools/perf counter-based A/B rigs, perf jitdump productionization,
  PmuCounters, clang-perf/clang-handheld presets.
- pcsx2-libretro core (ENABLE_LIBRETRO, default OFF; rename pending).
- GS vertex-kick fast path (GV series): TBL-based packed parse,
  register-resident kick, scalar-outcode cull, fused draw-rect/FindMinMax.
- Null renderer, VK_KHR_display direct WSI, swapchain PresentStats.
- SPU2 NEON mixer vectorization, EE timer read clamp (NFL 2K5 hang),
  IOP ioman signed-compare fix, assorted UB fixes.

Kept from ARMSX2 in the both-touched files:
- iOS dual-map W^X and fastmem-unavailable resilience (Memory, HostSys,
  vtlb). The split data/code area model is retained; both areas now take
  fixed VA hints so cached VU JIT code stays deterministic on Linux.
- Android thread-affinity model, VMState shutdown early-outs, all
  platform frontends, branding, CI, RetroAchievements identity/policy.
- GSDeviceVK: ARMSX2's push-descriptor decision logic (Mali crash gate,
  proprietary-vs-turnip Adreno split) merged with yaps2's descriptor-pool
  exhaustion recovery (flush + render-pass restart instead of dropped
  binds). Vendor feature policy is the union: Mali fbfetch policy with
  MediaTek/G57/Xclipse gates from ARMSX2; Adreno stencil/ROV/
  test-and-sample-depth hang avoidance and no_ps2_z_quantization from
  yaps2.

Build-system notes:
- The Qt debugger is now gated behind ENABLE_QT_DEBUGGER (default off on
  arm64) so handheld builds drop the KDDockWidgets dependency.
- GSDeviceNone and remaining yaps2 GS code were ported to the newer
  upstream GSTexture Usage-flags API.

The replaced backend's interpreter-fallback glue (intExecuteOneInst,
AndroidEEOpHist) and the EEDiffVerify runtime differ are retained for
now; dead pieces will be removed in a follow-up commit.
This commit is contained in:
Brian Degenhardt
2026-07-19 10:24:29 -07:00
417 changed files with 136123 additions and 24164 deletions
+37
View File
@@ -4,6 +4,7 @@
#include <chrono>
#include <vector>
#include "common/Console.h"
#include "common/Timer.h"
#include "common/Threading.h"
@@ -30,6 +31,15 @@ static u32 s_unskipped_frames_since_last_update = 0;
static Common::Timer s_last_update_time;
static Common::Timer s_last_frame_time;
// Session perf logging: a rolling emulog line every ~30s of presented
// frames, and a whole-session average at shutdown (LogSessionSummary).
// Gives every -logfile run a durable framerate record. Wall-clock based:
// paused time dilutes the session average but not the rolling lines.
static const float LOG_INTERVAL = 30.0f;
static Common::Timer s_session_timer;
static float s_log_accum_time = 0.0f;
static u32 s_log_accum_frames = 0;
// frame number, updated by the GS thread
static u64 s_frame_number = 0;
@@ -100,10 +110,24 @@ void PerformanceMetrics::Clear()
s_frame_number = 0;
s_session_timer.Reset();
s_log_accum_time = 0.0f;
s_log_accum_frames = 0;
s_frame_time_history.fill(0.0f);
s_frame_time_history_pos = 0;
}
void PerformanceMetrics::LogSessionSummary()
{
const double elapsed = s_session_timer.GetTimeSeconds();
if (s_frame_number == 0 || elapsed < 1.0)
return;
Console.WriteLn("PerfLog session: %llu frames in %.1fs wall = %.2f fps average",
static_cast<unsigned long long>(s_frame_number), elapsed,
static_cast<double>(s_frame_number) / elapsed);
}
void PerformanceMetrics::Reset()
{
s_frames_since_last_update = 0;
@@ -229,6 +253,19 @@ void PerformanceMetrics::Update(bool gs_register_write, bool fb_blit, bool is_sk
thread.time = static_cast<double>(delta) * time_divider;
}
// Rolling perf log (uses this window's frame count before it resets).
s_log_accum_time += time;
s_log_accum_frames += s_frames_since_last_update;
if (s_log_accum_time >= LOG_INTERVAL)
{
Console.WriteLn("PerfLog: %.1f fps | EE %.0f%% GS %.0f%% VU %.0f%% GPU %.0f%% | frame %llu",
static_cast<float>(s_log_accum_frames) / s_log_accum_time, s_cpu_thread_usage,
s_gs_thread_usage, s_vu_thread_usage, s_gpu_usage,
static_cast<unsigned long long>(s_frame_number));
s_log_accum_time = 0.0f;
s_log_accum_frames = 0;
}
s_frames_since_last_update = 0;
s_unskipped_frames_since_last_update = 0;
s_presents_since_last_update = 0;