[Bug + Patch] Synchronous HID rumble + Hub::source locking causes 200-1200ms frame stalls with DualSense/DS4 #272
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound#272
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@giangero1 on GitHub · 2026-12-01 07:57 UTC · original
foxhound version:
593067c8(bug still present up to297f58ae—crates/victory-hle/src/modules/gameinputunchanged since45e2dec8)GPU / CPU / RAM / Windows: RTX 3070 8 GB / Ryzen 7 5800X3D / 32 GB DDR4 / Windows 10 (19045)
Launcher settings (resolution, DLSS, Frame Generation, VRAM limit): Series S, 1080p, DLSS Performance, FrameGen OFF,
VICTORY_HOST_WAVE=32,VICTORY_POOL_SMALL=1,VICTORY_TEXTURE_ROOM_PERCENT=75,VICTORY_CARD_ROOM_FOR_TARGETS_MB=1024,VICTORY_CARD_WINDOWS_MB=256,VICTORY_HELPER_PRIORITY=1What happens, and when:
During gameplay sections with continuous controller vibration (DualSense USB
054c:0ce6), title worker threads repeatedly stalled insidehid.dll(NtQueryInformationFile/NtDeviceIoControlFile), dropping frame rate to8–16 FPSwith237–1230.4 msworst frame spikes (2–5>100 ms per second) and55–274 msGPU starvation (12–42%GPU busy):hid.rs:Pads::rumblecallsHidD_SetOutputReporton the same synchronousCreateFileW(..., 0, ...)handle thathid-padholds in a blockingReadFile, serializing every rumble report behind the next input report (~4.55 msmeasured vs ~0.045 mson a separate write handle).gameinput.rs: Liveset_rumbleruns synchronously on title worker threads while holdingHub::sourceMutex and triggers periodic HID enumeration /XInputGetStatepolling.Isolated 1-commit fix (2 files only, built off
593067c8):github.com/giangero1/VIctory-RTX3070-8GB@8f6597604bcrates/victory-hle/src/modules/gameinput.rsandcrates/victory-hle/src/modules/gameinput/hid.rs:write_handlefor DualSense/DS4 output reports on an8 mscoalescinghid-rumblewriter thread (immediate(0, 0)stop; caches rejected non-gamepad HID collection paths).set_rumblevia a non-blockingRumbleMailbox(gameinput-rumble) without lockingHub::source, keeping syntheticFakeunit tests synchronous.cargo xtask policy(292 files ok),cargo clippy --workspace --all-targets --locked -- -D warnings, andcargo test --locked -p victory-hle gameinput(25 passed; 0 failed).After-fix measurements (same scene & settings):
Frame pacing in sustained-rumble gameplay went from
8–16 FPS(237–1230.4 msmax,55–274 msGPU idle gaps) to24–26 FPS(36.1–46.2 msmedian,66.5–67.1 msmax,0frames >100 ms, GPU94–98%busy with1.0–2.3 msqueued gaps).Log excerpt (before vs. after):