From ea943c12814adf910e77ee0a5f47fc167f08476b Mon Sep 17 00:00:00 2001 From: Mathias <06mathias6@gmail.com> Date: Mon, 21 Sep 2026 18:56:05 +0200 Subject: [PATCH] fix(import-guard): recognize polling progress boundaries (#895) --- .../Cpu/Native/DirectExecutionBackend.Imports.cs | 4 +++- tests/SharpEmu.Libs.Tests/Cpu/ImportLoopGuardBoundaryTests.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SharpEmu.Core/Cpu/Native/DirectExecutionBackend.Imports.cs b/src/SharpEmu.Core/Cpu/Native/DirectExecutionBackend.Imports.cs index fa6dfd9..0456569 100644 --- a/src/SharpEmu.Core/Cpu/Native/DirectExecutionBackend.Imports.cs +++ b/src/SharpEmu.Core/Cpu/Native/DirectExecutionBackend.Imports.cs @@ -1862,6 +1862,7 @@ public sealed partial class DirectExecutionBackend private static bool IsImportLoopGuardBoundary(string nid) => nid is "1jfXLRVzisc" or // sceKernelUsleep + "1j3S3n-tTW4" or // sceKernelGetTscFrequency (polling/time base query) "WKAXJ4XBPQ4" or // scePthreadCondWait "BmMjYxmew1w" or // scePthreadCondTimedwait "Op8TBGY5KHg" or // pthread_cond_wait @@ -1870,7 +1871,8 @@ public sealed partial class DirectExecutionBackend "lLMT9vJAck0" or // clock_gettime "-2IRUCO--PM" or // sceKernelReadTsc "4J2sUJmuHZQ" or // sceKernelGetProcessTime - "fgxnMeTNUtY"; // sceKernelGetProcessTimeCounter + "fgxnMeTNUtY" or // sceKernelGetProcessTimeCounter + "yH17Q6NWtVg"; // sceUserServiceGetEvent (non-blocking event poll) private void ResetImportLoopPattern() { diff --git a/tests/SharpEmu.Libs.Tests/Cpu/ImportLoopGuardBoundaryTests.cs b/tests/SharpEmu.Libs.Tests/Cpu/ImportLoopGuardBoundaryTests.cs index 30f9642..d29056f 100644 --- a/tests/SharpEmu.Libs.Tests/Cpu/ImportLoopGuardBoundaryTests.cs +++ b/tests/SharpEmu.Libs.Tests/Cpu/ImportLoopGuardBoundaryTests.cs @@ -30,11 +30,13 @@ public sealed class ImportLoopGuardBoundaryTests [Theory] [InlineData("1jfXLRVzisc")] + [InlineData("1j3S3n-tTW4")] [InlineData("WKAXJ4XBPQ4")] [InlineData("BmMjYxmew1w")] [InlineData("Op8TBGY5KHg")] [InlineData("27bAgiJmOh0")] - public void ExistingWait_ClearsExpiredHistory(string nid) + [InlineData("yH17Q6NWtVg")] + public void ProgressBoundary_ClearsExpiredHistory(string nid) { AssertBoundaryClearsExpiredHistory(nid); }