Repository navigation
report apu heap allocations that fail - #1720
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (Windows 11 x64, Rust 1.98.1 MSVC):
cargo test -p victory-hle— 96 passed, 0 failed (includingallocator_refusal_report_names_apu_heap_and_system_commit)cargo clippy -p victory-hle --all-targets— 0 warningscargo xtask policy— ok
Clean diagnostics reporting failed APU heap allocations alongside system commit status, with unit test coverage. Looks good.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Static review only: this crate is Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.
APU heap refusals are now reported with their cause: HeapRefusal::NoDeviceRange (size+align) warns, HostAllocator delegates to report_allocator_refusal which writes crashes.log — and report() is called with no lock held, which matters if the refusal path can run under the heap lock. Please confirm no caller holds the heap mutex when report() runs.
88a3228 to
7a99074
Compare
7a99074 to
bef186b
Compare
|
Automated triage for the maintainers. Merge candidate. When the host allocator or the device-address range refuses an APU heap block, Update after your reply: confirmed, the branch now merges cleanly with Generated by Claude Code |
|
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at |
Leave the allocator diagnostics tests together, including upstream Marvisak#1720. This moves the existing test unchanged so both additions merge without touching the allocator or rewriting the published PR branch.
when the host allocator refuses an apu heap allocation, ApuAlloc returns E_OUTOFMEMORY and nothing is written anywhere. the title in #289 does not check that result and crashes a moment later on a write near null, so the crash log points at the title instead of at the cause. the refusal now goes to crashes.log with the size and the system commit, the same way the commit-limit report in xmem does, and a request that no device-address range fits gets a warning. both are reported by the caller after its locks are dropped. what the title sees does not change.
checked live: running the title in a job object with a 7.1 GB per-process commit cap reproduces #289, and crashes.log then starts with the refused allocation (about 401 MiB) and the commit numbers. only the report text has a unit test, the host allocator cannot be made to return null in one. clippy both ways, cargo test --workspace (343 passed) and xtask policy on windows 11.
#538 does the same for XMemVirtualAlloc and XMemAllocDefault and touches the same part of xmem.rs, so the two will conflict. #528 and #237 also touch ApuAlloc.
refs #289