mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4860] [Engine] resident: register the complement slice by slice on WDDM (opt-in STRATA_RESIDENT_PIN_MODE=register) #5218
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5218
Loading…
Add table
Add a link
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4860
Author: @thestigma
Created: 10/31/2026
Status: 🔄 Open
Base:
main← Head:pr-resident-register📝 Commits (1)
fea1c56[Engine] resident: register the complement slice by slice on WDDM (opt-in STRATA_RESIDENT_PIN_MODE=register) + STRATA_KV_HOST_REGISTER on Windows + a fully registered complement is not partial📊 Changes
3 files changed (+123 additions, -6 deletions)
View changed files
📝
include/strata/core/expert_source.hpp(+3 -0)📝
src/core/expert_source.cpp(+82 -5)📝
src/core/layer.cpp(+38 -1)📄 Description
Problem.
--resident-expertspins the cache complement as ONEcudaHostAlloc(Mapped|Portable)(expert_source.cpp,pin_cache_complement). On Windows two limits bite, and neither is the pool:cudaHostAllocandcudaHostRegistersucceed at 23 GiB and fail at 24 GiB with 58 GiB RAM free — while cumulative 1-GiB pins reach 45.0 GiB (46.0 fails), exactly theIDXGIAdapter3NON_LOCAL budget (47268 MiB, one global pool shared by all adapters incl. desktop D3D charges). The folklore "50% of RAM" is this per-allocation ceiling, not a pool rule.page-locking refused (out of memory); trying pageable memory— silent degradation to CPU staging with ~22 GiB of pool still free.Related:
STRATA_KV_HOST_REGISTER's register arm is compiled out on_WIN32(layer.cpp) although DETAILS.md promises it on any system; and a fully REGISTERED complement is markedcomplement_partial_(the exemption only covered the paced arm), soSTRATA_EXCHANGE_ROTATEsilently stays off in a registered lane.Change (opt-in; default path byte-identical).
STRATA_RESIDENT_PIN_MODE=registerpins the complement through the arena's ownPinnedArenawith slicedcudaHostRegister— slice bounds at each layer's first complement blob (no blob straddles a boundary), per-slice device aliases (ArenaExpertSource pattern), whole-arena registration aliased too.cudaHostAlloc/ malloc+working-set+VirtualLock/STRATA_PARTIAL_PINarms stay as fallbacks; teardown goes through thePinnedArena.kv_host_allochonoursSTRATA_KV_HOST_REGISTER=1on Windows.complement_partial_ = registered && (partial_pin < bytes).Validation (measured on the hardware above, engine 0.1.55 + prototype commit):
resident 14.17 GiB, pinned 14.17 GiB; complement registered slice by slice ... cudaHostRegister PORTABLE ok.43 slices pinned (20 GiB); locked 2518 MiB via working-set minimum + VirtualLock./healthon a register-mode lane.Mapped|Portable(measured 2026-10-24, engine 0.1.48 prototype).Limits. Registered bytes still charge the WDDM non-local pool (the existing
STRATA_ARENA_PIN_GIB=autoDXGI cap applies);QueryVideoMemoryInfo.CurrentUsageis per-process, so the pin-budget guard cannot see other processes' pins — multi-lane boxes can still exhaust the pool (separate known issue). Opt-ins only; no default behavior changes.Refs. #243 (sliced pin budget — same mechanism, this extends it to the resident complement), #1237 (stage-buffer pinning, complementary), #1571 (complement working-set spike), #31 (WDDM copy-engine pathology).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.