Repository navigation
d3d12_vulkan.md: an exactly-256 MiB BAR window is tried for the default arena; memory_type_order case for that layout - #4712
Conversation
…lt arena, with a memory_type_order case The doc said the 256 MiB default arena lands in system memory without Resizable BAR. memory_type_order only leaves out a heap smaller than the allocation, so where the BAR window is exactly 256 MiB (AMD without Smart Access Memory, RADV without Resizable BAR) the arena tries the window first and moves on to system memory only if that allocation fails (found by @wilu222). The doc now says so, and d3d12_state_map_test pins that layout: not Resizable BAR, the 256 MiB arena tries the window first, one page more skips it. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZEZyXGTTXs4V33hrBw1tD
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_state_map_test at ff199b9c7 on Windows 11: exit 0, state map, enhanced barriers, subresource decoding, layout tracking, discard ranges, block formats, BAR detection and memory types OK.
The test now covers the memory_type_order case for an exactly-256 MiB BAR window, and the docs say the default arena tries that window; the rest of the BAR/memory-type suite is unchanged. git diff --check clean. No blocking issue.
|
Full runtime build and full ctest on this branch (
AI-assisted (Claude Code). |
|
APPROVE, no issues. Built the changed test directly ( Negative control reproduced exactly: restoring the "skip a heap <= 256 MiB for size >= 256 MiB" rule in Nit: Approve. AI-assisted review, no game files. |
…review) From @tupacfan04's review of ItsNotRexed#4712: the not-Resizable-BAR case of an exactly-256 MiB window is already checked in the resizable_bar block above, so the memory type case only checks the order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZEZyXGTTXs4V33hrBw1tD
|
Thanks @tupacfan04 for the review and for reproducing the negative control. Second commit |
|
Tested ead9b37 merged with main 98fa503 on Linux (Python 3.12.16) and Windows (MSVC 14.51): pass
|
|
Tested
No game files. AI-assisted: the run was done by an agent on this machine, and I checked its output. |
|
Verified on Linux, CPU-only. The four new memory_type_order/resizable_bar CHECKs match the implementation in runtime/src/vulkan_memory.h (strict > for the 256 MiB Resizable-BAR window, heap.size < size filter), so the exactly-256 MiB case keeps type 3 for a 256 MiB request and drops it one page larger; compileall and the docs repo-paths/table-rows guards pass merged with current main (re-run here). The C++ test itself needs a cmake build and was not built or run here, and the hardware figures in the doc text are as reported. Overlap note: #3634 edits the same doc; the two auto-merge cleanly in the doc itself. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Thanks @memorypressure for the check and the overlap note on #3634. AI-assisted (Claude Code). |
|
Tested ead9b37 on AMD Radeon RX 6800 (RDNA2, discrete, gfx1030), AMD 26.8.1 (Windows 32.0.21045.5002), Windows 11 Pro 25H2 (build 26200), MSVC 14.44, RelWithDebInfo: pass.
No game files. AI-assisted (Claude Code). |
|
Thanks @vibryxcx for the RX 6800 run, and for checking the 256 MiB question. Agreed, it needs SAM off (or RADV without ReBAR) to measure. AI-assisted (Claude Code). |
Claimed in the coordination issue as: new D3D item (claim), from @wilu222's finding. It's a follow-up of my D3D-96 code (#815).
What and why
docs/d3d12_vulkan.mdsaid that without Resizable BAR "the 256 MiB default arena lands in system memory". That holds where the BAR window is smaller than the arena: 214 MiB on an RTX 3090, whichd3d12_state_map_testalready covers.memory_type_order(runtime/src/vulkan_memory.h) leaves out only a heap smaller than the allocation, though. So where the window is exactly 256 MiB (AMD without Smart Access Memory, RADV without Resizable BAR), the arena fits and tries the window first. It moves on to system memory only if thatvkAllocateMemoryfails, for example because the driver already uses part of the window.docs/d3d12_vulkan.md(memory type policy) now describes both layouts, and says that which outcome the exactly-256 MiB case gets hasn't been measured.d3d12_state_map_testgets the 256 MiB layout next to the RTX 3090 one. It checks three things:resizable_bar()is false there, so upload heaps stay in system memory;{3, 1, 2}, window first;{1, 2}.No behaviour change. Whether the arena should take the whole 256 MiB window on those GPUs is a separate question that needs an AMD/RADV machine without SAM/ReBAR (
LEONIDA_ARENA_LOG=1). This PR only makes the doc and tests match the code.Tested
NVIDIA GeForce RTX 5060 Ti, driver 621.14, Windows 10 19045, MSVC (VS 2022 Build Tools), RelWithDebInfo, branch on
main98fa503f. The new case is CPU-only: it fakesVkPhysicalDeviceMemoryProperties, so this GPU's layout doesn't matter.ctest -R "^d3d12_state_map$": passed.d3d12_state_map_test.exe: exit 0.memory_type_orderI added the doc's old model, "a heap no larger than the 256 MiB window is never offered to an allocation of 256 MiB or more" (if (heap.size <= kBarWindowBytes && size >= kBarWindowBytes) continue;).main's test still passes (exit 0), so nothing pinned this case.line 712: memory_type_order(memory, 0xF, host, local, 256 * mib) == (order{3, 1, 2}).pytest tests/test_docs_links.py tests/test_docs_repo_paths.py tests/test_docs_design_rows.py: 12 passed.ctest(with and withoutLEONIDA_VK_VALIDATION=1): running now. I'll post the results here, against the baseline (main03b09a08: 145/147, with the 2 known Windows 10 failuresd3d12_vulkan_deviceandd3d12_conservative_raster, TEST-907).Not tested: a real AMD or RADV GPU without Smart Access Memory/Resizable BAR, to see where the arena actually lands there.
AI-assisted: yes (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (not a translator change)🤖 Generated with Claude Code
https://claude.ai/code/session_01GZEZyXGTTXs4V33hrBw1tD