[HLE] Fix POSIX condition variable semantics (#113) (#223)

* [HLE] Trigger AGC graphics events by filter instead of exact ident (#173)

The PM4 EVENT_WRITE packet carries a 6-bit hardware EVENT_TYPE, but the
guest registers AGC events via sceAgcDriverAddEqEvent with a full guest
eventId. These two values are not the same numbering scheme, so the exact
ident lookup in TriggerRegisteredEvents never matched and the AGC
interrupt thread hung forever.

Add TriggerRegisteredEventsByFilter, which wakes every graphics event
registration on every queue. This is a compatibility workaround for
issue #173 while the real PS5 mapping remains unknown.

Includes unit tests covering the mismatched ident/eventType case.

* [HLE] Fix POSIX condition variable semantics (#113)

Remove PendingSignals from PthreadCondState. POSIX condition signals are edges,
not semaphore credits - a signal with no waiter must have no effect. The previous
implementation persisted signals, causing lock inversions and predicate bypasses.

Changes:
- Remove PendingSignals property and TryConsumePendingSignal method
- Remove pending signal consumption logic from PthreadCondWaitCore
- Remove PendingSignals increment from PthreadCondSignalCore
- Add regression tests verifying POSIX-correct behavior

Fixes #113
This commit is contained in:
Jack Del Aguila
2026-07-15 16:24:05 -05:00
committed by GitHub
parent ad92ab30fd
commit 1be009ce40
5 changed files with 285 additions and 41 deletions
+6 -2
View File
@@ -2741,8 +2741,12 @@ public static class AgcExports
ctx.TryReadUInt32(currentAddress + sizeof(uint), out var eventTypeRaw))
{
var eventType = eventTypeRaw & 0x3Fu;
var triggered = KernelEventQueueCompatExports.TriggerRegisteredEvents(
eventType,
// The guest registers AGC events with a full eventId, but the command buffer
// only carries a 6-bit EVENT_TYPE. Those two values are not the same numbering
// scheme, so exact ident matching never wakes anything. Trigger every graphics
// event registration instead (workaround for issue #173).
var triggered = KernelEventQueueCompatExports.TriggerRegisteredEventsByFilter(
KernelEventQueueCompatExports.KernelEventFilterGraphics,
eventType);
if (tracePackets)