d3d12: check sparse buffer memory_types before sharing the tile arena #2405
Closed
leonida/mandy
pepefroge wants to merge 0 commits from
fix/intel-sparse-buffer-heap into main
pull from: fix/intel-sparse-buffer-heap
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2405
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/intel-sparse-buffer-heap"
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 closed
This pull request cannot be reopened because the branch was deleted.
Claimed in the coordination issue as: https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230664599
Summary
Fixes D3D12→Vulkan sparse buffer tile mappings failing with
ID3D12CommandQueue::UpdateTileMappings: invalid mapping or sparse residency unavailableon Intel Arc (reported in #725).Root Cause
DeviceState::tiles_share_arena()(runtime/shims/d3d12_vulkan_device.cpp:3536) only checks whetherarena.memory_typeoverlaps the device-init probesparse_buffer_memory_types.32.0.101.9150), an actual reserved buffer'srequirements.memoryTypeBitscan excludearena.memory_type(e.g., requiring non-ReBARDEVICE_LOCALmemory rather than the arena'sDEVICE_LOCAL | HOST_VISIBLEtype).Heap::tiles()(line 9625) still took the arena fast-path, causingVulkanQueue::bind_tiles()(runtime/src/vulkan_backend.h:4164) to reject the binding (!(resource->memory_types & (1u << page.heap->memory_type))).Heap::tiles()(line 9636) previously overwrote the caller'smemory_typeswithsparse_buffer_memory_typesunconditionally instead of intersecting when overlapping.Changes
Heap::tiles()(runtime/shims/d3d12_vulkan_device.cpp:9625) with(memory_types & (1u << device_.arena.memory_type)).memory_typesvia&=(line 9636) only when it overlapsdevice_.sparse_buffer_memory_types, preserving the caller'smemoryTypeBitsotherwise.Verification (Intel Arc Pro B60, BMG-G21, Driver
32.0.101.9150)d3d12_buffer_tiles_testfailedUpdateTileMappingson every mapped buffer tile (0/12tiles).f0b86e1): (Note: the subsequent native D3D12 comparison pass ind3d12_buffer_tiles_teststill hits Intel's native D3D12 driverCopyTilesbehavior noted in #725, while the Vulkan replay side now passes 12/12 tiles).Tested on Intel Arc Pro B60 (
0xe211, Windows 11, driver32.0.101.9150); root-cause trace assisted locally via Hermes + Qwen 3.8 27B.There is one same-heap case where
Heap::tiles()rejects a compatible second buffer atf0b86e1938.0x02)0x12), arena type 4CPU check. I compiled the PR’s
Heap::tiles()method with a mock allocator and a device probe mask of0x12. The second call enters the arena branch and returns atif (tile_allocation_) return {};. Checking for an existing buffer tile allocation whose memory type is in the caller’s mask before considering the arena made the second call return the same allocation. All seven cases then matched expectations, including incompatible masks and buffer/image separation. It would be worth adding the two-call sequence above as a regression test.RTX 4090 check. The unmodified PR passed
d3d12_buffer_tileson Windows 11, NVIDIA 616.64. Vulkan matched all 12 expected tiles and native D3D12 on the same card matched all three readbacks. This driver reported0x02for both sparse buffers and the initialization probe, with arena type 4, so it exercised the dedicated-only path. The mixed-mask finding above comes from the CPU fixture. AI-assisted verification.Independent native Windows check (Profile M): RTX 3060 Ti desktop, 8 GB VRAM, NVIDIA 610.88, 16 GB RAM, MSVC 19.44. Compared the GitHub target base
fac8b4bbwith only the PR diff fromf0b86e19applied to that base. Samed3d12_buffer_tilesfixture, default 256 MiB arena, and Vulkan validation in both builds.VK_LAYER_KHRONOS_validationwas loaded and passed.Your B60 result and BadgersMC’s NVIDIA result leave a useful independent comparison: does the same public fixture recover Vulkan tile mapping on the Alchemist A770 from #725? I opened one pinned Test Lab request and offered that specific pair to the A770 reporter. The request keeps Vulkan replay and native D3D12 outcomes separate and leaves the reported second-buffer/same-heap case for its own fixture. I’ll link any completed A770 result here with its original author.
Single-variable A/B game-run check on Linux + Wine 11.22 + NVIDIA RTX 3070 Ti 8 GB (Profile M), per #2464 ("Start-up on NVIDIA and Intel"). Both arms started from the exact same byte-for-byte warm cache and overlay snapshot (cloned post-cold-baseline), with identical recipe and hands-free input script (
0env differences apart from the per-run capture folder;runtime_sha256differs as expected). All numbers independently recomputed from raw logs and resource samples by a second agent (codex/gpt-6-luna) before posting.PROVISIONAL (n=1 per side).Reading:
n=1per side, PROVISIONAL): No NVIDIA start-up or sparse-tile regression on RTX 3070 Ti 8 GB (NVIDIA 620.73.04, Linux + Wine 11.22): both arms recorded 0UpdateTileMappings/ sparse-residency / tile errors, 0 device losses, and identical16small-BAR fallback allocations, reaching world load (7.17–7.63 GiBGPU memory, >15,000 watched geometry tiles) and stopping at the same clean-mainmissing-shader world-entry exception (174.33 sA vs162.18 sB).playstage past world entry, or the same-heap two-buffer edge case noted earlier in this thread (would be refuted by a tile-mapping error or device loss on repeated runs or inplay).AI-assisted: Antigravity (Gemini 4 Neon) + Codex (
gpt-6-lunaindependent verification); no game data.Hi @pepefroge, thanks for this pull request.
CONTRIBUTING.md asks contributors to claim their work in the coordination issue ("Coordinating who works on what", currently #1608) before opening a pull request: post
claiming: <ID>there, or a one-line description if the item is not listed yet, and put the ID in the pull request. I could not find a claim from you for this one.The claim matters because "it is claimed in the coordination issue by the pull request's author" is the first item on the maintainers' checklist for a mergeable pull request, and because it lets others see that the work is taken before they write it a second time.
Could you post the claim in #1608 and put its ID (or a link to it) on the pull request's "Claimed in the coordination issue as:" line? If you already claimed it in another form, a link to your comment is enough.
AI-assisted (Claude Code, Claude Opus 5.5).
An incompatible companion case for ecox982745’s compatible-reuse regression: set the probe mask to
0b111, arena type to 0, A’s mask to0b010and B’s to0b100. Both pass reserved-resource creation. Atf0b86e1, A gets dedicated type 1 and B reaches the queue validation check, which rejects it beforevkQueueBindSparse. B succeeds in the model with a separate heap. With the proposed reuse-first guard, the compatible request reuses backing and the incompatible request is rejected at the heap. I’d put both in the same test and verify that A still reads back correctly after the rejection. Khronos confirms the sparse memory-type requirement.PortBridge cross-checked the public code and ran the mask model with Codex. The additional case is CPU-modeled. The Arc A770 hardware check in the Lab remains open.
@MoonEyes Thanks for the reminder! I've posted the claim (
D3D12-SPARSE-BUFFER-HEAP) in #1608 and added it to the "Claimed in the coordination issue as:" line in the PR description.@akimfomin Good point — I checked
create_sparse_buffer(d3d12_vulkan_device.cpp:9105) andupdate_tiles(vulkan_backend.h:2683), and because everyCreateReservedResourcebuffer gets the driver's singlerequirements.memoryTypeBitsmask, a disjoint buffer memory-type mask isn't reachable through the public D3D12 API (unlike the image-on-buffer-heap rejection check right below it).I extended
mixed_maskind3d12_buffer_tiles_test.cpp(148996716) to map and read back a third reserved bufferconto the same reused heap allocation (verifying third-buffer aliasing alongside the image-separation rejection check) and pushed the updated branch.#2405 | head 148996716b76d32f3a8f12d43670f2e0614685dc | ctest -C RelWithDebInfo -R "^d3d12_buffer_tiles$" (MSVC RelWithDebInfo, GPU test) | red: with only the test file on main it does not compile (it uses the PR's two new test hooks); with those two read-only hooks added to main and the fix left out, it fails on the "Mixed mask" check | green: FAILS. main 02f71ccfe merged into the head, and the head alone too: 3 of 3 and 2 of 2 runs fail with "Mixed mask: buffer B tile reads 0000000000, want the reused allocation's 0x23456789" and "dedicated type 1, arena type 4, device mask 0x2, mixed mask 0x12". So on this NVIDIA card the mixed-mask case does not reuse the dedicated allocation (the PR was tested on an Intel Arc Pro B60) | full suite: not run (a game boot was using the machine) | Windows 11, RTX 4070 SUPER, NVIDIA 621.01, Python 3.14 | AI-assisted: yes, Claude Code
@Tyrannys Huge thanks for running this on your RTX 4070 SUPER and catching that! Look at what happened in
mixed_mask:Awas mapped tooffsets(heap tile 0), whileBandCwere mapped tooffsets + 1(heap tile 1). On NVIDIA (device mask 0x2), tile 0 and tile 1 of the reused 128 KiBtile_allocation_are distinct 64 KiB pages, soBat tile 1 legitimately read0x00000000instead ofA's pattern at tile 0.CreateReservedResourceassignsdevice mask(0x2, excluding arena bit4), whereas on Intel Arc (0x12),CreateReservedResourceincludes arena bit4(0x12) — which was the exact bug onmainwhere Intel refused reuse while NVIDIA didn't hit it.I've updated
mixed_mask(cf30c0a1f) soA,B, andCall map tooffsets(heap tile 0) of the reused allocation (leaving the image-refusal check onoffsets + 1) and pushed the branch. Whenever your machine is free, a quick re-run ofd3d12_buffer_tilesoncf30c0a1fshould now pass cleanly on RTX 4070 SUPER as well!I retested the corrected
mixed_maskfixture atcf30c0a1f8e89d4eaecfe92b6039714c7a488f61on an RTX 3080 desktop (10 GiB, driver 630.20), native Windows 11 build 26340, MSVC 19.50.35717, Vulkan SDK 1.4.363.1, with Khronos validation enabled.d3d12_buffer_tilespassed at the PR head and at common ancestorcf1c34128a78c47451ecf3e8acf1943f6ca560ac(1/1 each). The head exercised mixed-mask reuse of the dedicated allocation and aliasing by the third same-mask buffer. Vulkan replay matched all 12 tiles. The reserved-image separation subcase skipped because the selected device could not create the required reserved texture. No Vulkan validation errors were reported. Synthetic fixtures only. AI-assisted (Codex).Native Windows 11 + AMD Radeon RX 7900 XTX 24 GB A/B game-run check (
main791899f65vsmain+#2405cf30c0a1f), per#2464.d3d12_buffer_tiles_testpassed on AMD Radeon RX 7900 XTX (12/12 Vulkan replay tiles across aliased/skipped/unmapped/reused/remapped ranges + 3/3 native D3D12 GPU readbacks).first-run UI/menu, unattended): 0 faults, 0VK_ERROR_DEVICE_LOST, 0 regressions (30.00 fpslocked,60.01 subs/s, GPU direct latency0.71 msavg,6.1%busy, VRAM4,982 MiB— identical tomain).I reproduced the two fixture gaps from the review above on Linux. Exact head
cf30c0a1fmerged cleanly withcc0f662a. The unchangedd3d12_buffer_tilespassed 3/3 on each of RTX 4070 SUPER 12 GiB (620.73.04) and AMD Raphael (RADV Mesa 26.3.1), with all 12 Vulkan replay tiles matching each time. CachyOS, Wine 11.22, synthetic inputs. The optional host D3D12 comparison did not run. Host Khronos validation was active and emitted the Wine DMA-BUF extension diagnostic01387.Heap::tileswith0x02for A/B/C and reused dedicated type 1. RADV used0x2dfor A/B/C and took arena type 3 starting at A. Restoring current main's heap-policy body also passed on both. As a GPU-backed complement to the CPU check, I locally exposed the extra arena bit to the heap policy only for B/C on NVIDIA after A had taken dedicated type 1. The real Vulkan requirements stayed unchanged. B read the expected pattern with early reuse in 3/3 runs and read zero with only that branch disabled in 3/3 runs.D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE, the image reachedHeap::tileson both GPUs. I observed the mapping rejected at the buffer-only heap and B's pattern intact. The local test also moved allocator/list reset after the fence wait, in line with the allocator reset contract.AI-assisted with OpenAI Codex.
Run on
cf30c0a1f(PR head), merged locally withmain50d09b373. Prep notes by TheGeogeo's review session.git merge --no-ff pr-2405; auto-mergedd3d12_com.h,d3d12_vulkan_device.cpp,d3d12_buffer_tiles_test.cpp). Merged commitf3d6c66cf, local only.cmake -S runtime -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON, thencmake --build build --target d3d12_buffer_tiles_test d3d12_texture_tiles_test d3d12_sparse_queue_family_test gta6rt -j 6.Green (merged build)
ctest -R "^d3d12_buffer_tiles$" --output-on-failure -j1: passed (not skipped; sparse buffer residency is available on this GPU). The run prints "Vulkan replay: 12 full tiles matched across aliased, skipped, unmapped, reused and remapped ranges", "A rejected update left all tile mappings intact" and "Native D3D12 matched all three GPU readbacks".0x2and excludes the arena bit (type 5), so the mixed mask0x22is not a real mixed case here. The image-on-buffer-heap subcase prints "device cannot create a reserved texture; image separation skipped".d3d12_texture_tiles,d3d12_sparse_queue_family,d3d12_sparse_queue_family_contract: 3/3 passed.Red
d3d12_vulkan_device.cppandd3d12_com.htomain, test kept): does not build, the test uses the newdevice_sparse_buffer_memory_typesanddevice_arena_memory_typeaccessors (C2039/C3861 at test lines 283 and 292). This only shows the test needs the new API.Heap::tiles()put back tomain's code): no red on this GPU.d3d12_buffer_tilesstill passes with the same output, because the device's sparse mask excludes the arena type, somain's arena path is never taken. The Arc failure from the description (and the open points in timbot103's review about a deterministic mixed-mask case) cannot be reproduced on NVIDIA with this test; I am not claiming a red.Link: gta6rt.exe of the merged build: no new imports vs main (703 imports, identical lists with
dumpbin /imports).Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44, Vulkan SDK 1.4.363.1. One run each.
AI-assisted (Claude Code).
Thanks everyone for the thorough multi-GPU testing!
I've shifted focus to another project (VIctory-Intel-Arc), so feel free to adopt/push those two test-fixture tweaks (D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE + CPU mock mask fixture) directly onto this branch to get it merged."
@pepefroge I don't have push access to your fork, so I pushed the two requested test-fixture updates to my fork branch
lixonik/leonida:review/2405-sparse-heap-fixturesat commit30e245bd16(merged withmainc22a0a7322, and cleanly mergeable againstmain1d3da5ebc7viagit merge-tree):leonida::sparse_buffer_backing(runtime/src/sparse_buffer_backing.h), called byHeap::tiles()inruntime/shims/d3d12_vulkan_device.cpp, and registered a deterministic CPU CTestd3d12_buffer_tiles_heap_policy(d3d12_buffer_tiles_test --heap-policy) covering the Intel Arc mixed-mask case (0x12reusing dedicated type 1 instead of rejecting).runtime/test/d3d12_buffer_tiles_test.cppto use a 2D reserved texture withD3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLEso it actually reachesHeap::tiles(), asserts the mapping is rejected, and verifies via readback that B's tile remains intact.Local verification (Windows 10 22H2, MSVC 19.44, RTX 5070,
LEONIDA_VK_VALIDATION=1,VK_VALIDATE_SYNC=1):ctest --output-on-failure -R "^d3d12_(buffer_tiles|buffer_tiles_heap_policy|texture_tiles)$": 3/3 passed (d3d12_buffer_tilesprintedMixed mask: an image on the buffer-only heap was refused and B's tile is unchanged,Mixed mask: live buffers reused the same tile,Native D3D12 matched all three GPU readbacks).heap_policy: reverting the reuse-before-arena ordering fails onsparse_buffer_backing(0x12, dedicated_type, arena_available, arena_type) == SparseBufferBacking::reuse(red=1,green=0).python -I scripts/check_no_game_data.pyon all 4 changed files: passed.You (or a maintainer) can cherry-pick
30e245bd16onto this branch directly.AI-assisted.
Thanks @lixonik! I no longer have that repo cloned locally, so feel free to open a fresh PR with 30e245bd16 or have a maintainer cherry-pick it directly into main—I'll close this one or leave it to be superseded.
@pepefroge Thanks for the handoff. The replacement is #2645. It preserves your original commits and Arc verification, includes the two fixture changes, and passes all three focused tests after merging
main7bbc1d22. This PR can now be closed as superseded.AI-assisted.
Closing in favor of #2645, which carries forward the original commits and Intel Arc Pro B60 verification along with the updated test fixtures. Thanks again to @lixonik and everyone who tested and reviewed!