Repository navigation
hle,eh: reclaim partial physical frees, shard lazy VEH, harden dstorage/input/audio - #2004
raylitebull wants to merge 2 commits into
Conversation
|
Overlap note: full credit to #565 (@ZekkJJ) for retaining recent If #565 lands first, we will drop the reading-history hunks from #2004 and keep #2004 focused on its independent |
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
…ility - kernelx: keep plain XMemVirtualAlloc/physical fallbacks below the 40-bit VA ceiling via VirtualAlloc2 when available; stop large AllocateTitlePhysicalPages pools from stealing pre-committed coherent UMA; skip committing lazy/unmapped pages on read_physical_pages while ensuring lazy pages before writes; unmark freed lazy pages in FreeTitlePhysicalPages. (XMemIsToolsMemAvailable is already on main via xcl-dev#563.) - dstorage: refresh zero or stale (freed) physical page-table entries via read_own (xcl-dev#476/xcl-dev#509 safe) on write/read retry; extend the parallel decompression pool to handle physical-page destinations and supported BCPack requests. - gameinput & kbm: skip disconnected-pad XInput rumble stalls and deduplicate unchanged motor speeds; implement bounded reading history for GetNextReading / GetPreviousReading; extend XCL_PRESS_AT with triggers, sticks, LS/RS, and optional durations; add Z/C holdable bumper keys, require mouse capture and non-sizing for mouse buttons, and guard KBM mouse velocity against sub-0.5 ms zero-delta poll decay.
…x/mwaitx, and reuse XAPU/Opus buffers - kernelx: replace PHYS_BLOCKS counters with a per-page live bitmap (PhysBlock) for exact per-page liveness, double-free immunity, and immediate coalesced MEM_DECOMMIT + sparse::decommitted on partial FreeTitlePhysicalPages calls even while sibling pages in multi-GB pools stay live. Batch lazy::mark/unmark across map_pages and FreeTitlePhysicalPages. - kernelx/lazy: shard the lazy-page table across 16 contiguous 4 MiB stripes with atomic LAZY_COUNT / LAZY_COMMITTED_ANY fast paths so direct I/O checks and non-lazy faults avoid global RwLock contention and redundant VirtualQuery calls while parallel threads commit distinct regions concurrently. - eh: replace the global SEEN mutex in emulate_console_only with a lock-free AtomicU16 bitmask, and race-safely live-patch Monitorx -> nop;nop;nop and Mwaitx -> pause;nop (with atomic aligned u64 CAS + FlushInstructionCache and XCL_NO_PATCH_MONITORX=1 opt-out) so worker spin loops stop taking #UD traps. - opus & acphal: cache and reuse unique Media Foundation IMFSample/IMFMediaBuffer pairs across MftDecoder packets (verified via COM refcount); split XApu stream locks to per-stream Mutexes with bounded reusable PCM/float scratch buffers and lock-free AtomicU64 progress throttling.
|
Regression run for this PR: head main this PR: No device removals or crashes; 98 % of main's frames, 105 % of its peak commit. Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings: Written with Claude Code (Claude Opus 5.5) from runs on this machine. |
462a456 to
c57227f
Compare
|
Rebased and trimmed
Pushed |
Hardens HLE world streaming, physical-page reclamation, lazy VEH sharding, monitor/mwait patching, audio buffer reuse, and GameInput/KBM playability:
kernelx/lazy.rs:XMemVirtualAlloc/ physical fallbacks below the 40-bit VA ceiling viaVirtualAlloc2; stops largeAllocateTitlePhysicalPagespools from stealing pre-committed coherent UMA; skips committing lazy pages on reads while ensuring lazy pages before writes (uses existing upstreamXMemIsToolsMemAvailableinkernelx.rs).PHYS_BLOCKScounters with a per-page live bitmap (PhysBlock) for exact per-page liveness, double-free immunity, and immediate coalescedMEM_DECOMMIT+sparse::decommittedon partialFreeTitlePhysicalPagescalls.4 MiBstripes (kernelx/lazy.rs) with atomicLAZY_COUNT/LAZY_COMMITTED_ANYfast paths and batchedlazy::mark/unmark.dstorage.rs,dstorage/parallel.rs,dstorage/parallel_tests.rs):0x89240009prevention, usingread_ownso unmapped page arrays never fault per#509) and extends parallel decompression to physical-page destinations and supported BCPack requests.Monitorx/Mwaitx& EH (eh.rs):SEENmutex inemulate_console_onlywith a lock-freeAtomicU16bitmask and live-patchesMonitorx->nop;nop;nopandMwaitx->pause;nopvia atomic alignedu64CAS +FlushInstructionCache(opt-out viaXCL_NO_PATCH_MONITORX=1).opus.rs,acphal.rs):IMFSample/IMFMediaBufferpairs acrossMftDecoderpackets; splitsXApustream locks to per-stream mutexes with reusable PCM/float scratch buffers and atomic progress throttling (preserving#471'sChannel::connectclear).gameinput.rs,kbm.rs):GetNextReading/GetPreviousReadinghistory; extendsXCL_PRESS_ATfor triggers/sticks/durations; addsZ/Cbumper keys; gates mouse buttons on capture/non-sizing and guards zero-delta poll velocity decay (preserving#552's PlayStation HID fallback).Part of #1833.
What is in it
crates/xcl/src/eh.rs,crates/xcl/src/hle/{acphal.rs, dstorage.rs, dstorage/parallel.rs, dstorage/parallel_tests.rs, gameinput.rs, kbm.rs, kernelx.rs, kernelx/lazy.rs, opus.rs}(10files).Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly ontod63071a(c57227f).c57227fwas rebased and trimmed ontod63071a(dropping the duplicateXMemIsToolsMemAvailabledefinition after#563and integratingread_ownindstorage.rs::refresh_stale_pagesafter#509via pure git during a local test hold); queued for GitHub ActionsBuild and testand fresh AMD / NVIDIA verification.462a456(onto6567c5f) passedcargo check --workspace --tests,eh::tests(7/7),hle::acphal::tests(8/8),dstorage(30/30),hle::gameinput::tests(12/12),hle::kbm::tests(8/8),hle::kernelx::tests(37/37, 1 ignored),hle::kernelx::lazy::tests(3/3), andhle::opus::tests(14/14).Regression run
scripts/smoke.ps1pair and tests on rebasedc57227fvsd63071ahave not been run yet. AMD and NVIDIA reviewers are invited to verifyc57227fvsd63071a(includingscripts/smoke.ps1, DirectStorage streaming, and GameInput/KBM paths) and post results in the comments.Not tested
cargo check/cargo testsuite and 60 sscripts/smoke.ps1pair on rebased headc57227f, fullcargo test --workspacesuite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use
d63071a, and unit tests; the author reviewed the diff.