report apu heap allocations that fail #1719
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1720"
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?
Imported from Marvisak/VIctory. Originally posted by imjustprism on 2026-11-24T21:17:46Z.
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
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T21:26:25Z.
Review: APPROVED
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— okClean diagnostics reporting failed APU heap allocations alongside system commit status, with unit test coverage. Looks good.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:36:41Z.
Review: COMMENTED
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:35:56Z.
Automated triage for the maintainers.
Merge candidate. When the host allocator or the device-address range refuses an APU heap block,
heap_alloc(audio.rs) now returns aHeapRefusal, and the callers (ApuAlloc,AcpHalAllocateShapeContexts) report it after dropping their locks. A host refusal goes to crashes.log through the newxmem::report_allocator_refusal, which shares its text with the existing commit-limit report. The HRESULT the title sees does not change. The lock order is fine: the HEAP guard is released on return, and CONTEXTS is dropped beforereport().Update after your reply: confirmed, the branch now merges cleanly with
main, so the #538 conflict is gone. CI passes.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by imjustprism on 2026-11-25T04:14:39Z.
the description is out of date on one point: #538 is merged and this branch is rebased over it, so the xmem.rs conflict it mentions is gone. it merges clean into main at
940d32fand ci is green.Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:30:28Z.
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
bef186b.cargo test --workspace --locked --no-fail-fast-> 694 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.