d3d12_vulkan_device_test: resource flags 0x200 and 0x400 go by the host's tight-alignment support (TEST-DEVICE-FLAGS-TIGHT-ALIGNMENT) #1222
Closed
leonida/mandy
MalexAson wants to merge 0 commits from
fix/device-test-resource-flag-hosts into main
pull from: fix/device-test-resource-flag-hosts
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!1222
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/device-test-resource-flag-hosts"
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: TEST-DEVICE-FLAGS-TIGHT-ALIGNMENT
What and why
d3d12_vulkan_devicefails on my PC atargument_mismatches <= 0after these three lines ofcompare_invalid_arguments, and everything else in the test matches the host:I first reported this as an Intel host quirk (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142087413). That was wrong for this PC: the Intel Iris Xe, the RTX 4060 Laptop and WARP all answer the same, so it is the D3D12 runtime,
D3D12Core.dll10.0.26100.5074 (Windows 11 24H2, build 26100.6584).What the flags are, from Microsoft's public headers and specification:
D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT. It first appears in DirectX-Headers v1.618.1 together withD3D12_FEATURE_D3D12_TIGHT_ALIGNMENT(54, oneD3D12_TIGHT_ALIGNMENT_TIER); the Windows SDK 10.0.26100 header has neither. DirectX-Specs (d3d/D3D12TightPlacedResourceAlignment.md) listsE_INVALIDARGfor the flag when the feature is reported asD3D12_TIGHT_ALIGNMENT_TIER_NOT_SUPPORTED.D3D12_RESOURCE_FLAG_VIDEO_PROCESS_3DLUT_ONLY, named in DirectX-Headers from v1.620.1 on.What hosts answer. The newer runtimes are the
D3D12Core.dllof Microsoft's Agility SDK (NuGetMicrosoft.Direct3D.D3D121.618.5 and 1.620.2), loaded by a probe and by a local build of this test that opts into them:E_INVALIDARGTIER_1NOT_SUPPORTEDE_INVALIDARGID3D12Device11toID3D12Device14. SoID3D12Device11on the host, the condition commit 31d279823 gave the two 0x400 cases, does not tell whether the host accepts the flag: the runtime has to know the flag and the driver has to reportTIER_1.D3D12_RESOURCE_DESC::Flags has unrecognized bits. The value is 0x400, and the unrecognized bits are 0x400.Flags can only have D3D12_RESOURCE_FLAG_VIDEO_PROCESS_3DLUT_ONLY set when D3D12_RESOURCE_DESC::Dimension is D3D12_RESOURCE_DIMENSION_TEXTURE3D(their debug layer), and accept it on a 3D texture. 10.0.26100.5074 accepts it on a buffer and on 2D and 3D textures. The 0x200 case had no condition at all.The layer's answers to the three cases are those of a newer runtime on a driver with tight alignment, and this pull request does not change the layer.
The change, in
runtime/test/d3d12_vulkan_device_test.cpponly:host_tight_alignment: the host answers feature 54 with a tier aboveNOT_SUPPORTED. The two 0x400 cases are compared on such a host, instead of on one withID3D12Device11. Windows 10 and Windows 11 23H2, which the old condition was written for, refuse the flag, so they cannot reportTIER_1and stay not comparable.host_knows_tight_alignment: the host answers feature 54 at all, which makes its runtime 1.618 or newer. The 0x200 case is compared on such a host. On an older host the case is now held to the recorded answer instead of the host's; on Windows 10 and 23H2 the two are the same (the case had no condition and the test passed there).Case::recorded: the layer's answer for a case, checked where the host is not comparable. The three cases have one (E_INVALIDARG,S_OK,S_OK). Until now a host that was not comparable checked nothing for a case, and one that happens to answer as a wrong layer does would have hidden it; the first negative control below is that situation.ID3D12Device11cases now says three.Tested
main58be9cdf8 (built at 6293c1c4f;runtime/is identical between the two), MSVC Build Tools 2026, Ninja, RelWithDebInfo, Windows SDK 10.0.26100.0. The test takes the layer's own adapter as its host, so each line is layer and host on the same GPU unless it says WARP.Host runtime 10.0.26100.5074 (in the box):
LEONIDA_VK_DEVICE=irisand=4060: exit 1, the three lines above, on both.not comparable on this host (ours ..., host ...). The same withLEONIDA_HOST_ADAPTER=warp.committed_resource_refusaltakes 0x200 and not 0x400, exactly as this host answers): exit 1 on both GPUs withours 0x00000000, recorded 0x80070057 (host 0x00000000, not comparable)for 0x200 andours 0x80070057, recorded 0x00000000 (host 0x80070057, not comparable)for the two 0x400 cases. Withoutrecordedthis run passes.Host runtime 1.618.5 (the test built locally with
D3D12SDKVersion/D3D12SDKPathexports appended; not part of this pull request). Every run on this runtime also prints two lines that this change neither causes nor touches,resource flag RAYTRACING_ACCELERATION_STRUCTURE on a buffer/on a texture: ours 0x00000000, host 0x80070057(the newer runtime wantsALLOW_UNORDERED_ACCESSwith that flag), so the exit code is 1 throughout. That is a separate matter and not part of this change. For the three cases of this pull request:TIER_1) they agree with the host. On the Iris Xe and with WARP as host (NOT_SUPPORTED) the two 0x400 cases fail,ours 0x00000000, host 0x80070057. So the old condition also fails on a current runtime wherever the driver has no tight alignment.not comparable, and 0x200 is compared and equal.0x200 on a buffer: ours 0x00000000, host 0x80070057,0x400 ...: ours 0x80070057, host 0x00000000twice); on the Iris Xe 0x200 fails as a compared case and the two 0x400 cases throughrecorded.Host runtime 1.620.2: the probe gets the same answers as on 1.618.5 for the three cases on all three adapters. The test itself stops earlier there, at
allocation_mismatches(among others a resource flag 0x1000 that this runtime accepts), which is also unrelated to this change.python -I scripts/check_no_game_data.py runtime/test/d3d12_vulkan_device_test.cpp: clean.ctest(only this test was built), an up-to-date in-box Windows 11 runtime, Windows 10, Windows 11 23H2, AMD, Linux and Wine (the comparison is skipped without a Microsoft host).GPUs tested: Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 build 26100.6584; NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 621.40, Windows 11 build 26100.6584
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (not a translator change)🤖 Generated with Claude Code
Read the whole diff and tested
8c73655a9merged on main6261ca916(clean): Windows 10 Pro 22H2 build 19045, VS 2022 RelWithDebInfo,LEONIDA_VK_VALIDATION=1.d3d12_vulkan_deviceexits 0 on main and with this PR, 0 VUID lines. Both 0x400 cases stay "not comparable on this host (ours 0x00000000, host 0x80070057)" and the recorded values hold. So a host without tight alignment behaves as your table says for 0x400.I did not run a mutated layer to see the recorded check go red.
AI-assisted (Claude Code, Claude Opus 5.5).
Tested
8c73655a9merged ontomain57ba40bd6(clean), native Windows 11 Pro 26H2 (build 26300,D3D12Core.dll10.0.26100.9818), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 RelWithDebInfo + Ninja.d3d12_vulkan_device: passes onmainand with this PR (exit 0). Noresource flag 0x200/0x400lines on either, so this runtime and driver agree with the layer on all three cases; the rest of the output is identical apart from pointer values.AI-assisted testing (non-developer tester).
Windows 11 + RTX 3090 Verification (
8c73655a93merged withmain791899f652) — PASS10.0.26200, in-boxD3D12Core.dll10.0.26100.9818), MSVC19.44.35207(/O2 /MD /EHsc /std:c++20 /W4 /permissive- /utf-8), NVIDIA GeForce RTX 3090 (610.88) + Microsoft WARP +VK_LAYER_KHRONOS_validation1.4.363.1(LEONIDA_VK_VALIDATION=1).git merge-treeontomain(791899f652) (0conflicts);python -I scripts/check_no_game_data.pyrc=0;0new/W4warnings.D3D12Core.dll10.0.26100.9818):10.0.26100.5074(whereD3D12_FEATURE(54)returnedE_INVALIDARGand0x200on a buffer succeeded), Windows 11's newer servicingD3D12Core.dll10.0.26100.9818returnsCheckFeatureSupport(D3D12_FEATURE(54)) = 0x00000000(S_OK,tier = 0NOT_SUPPORTED), refuses0x200(VIDEO_PROCESS_3DLUT_ONLY) on a buffer (0x80070057E_INVALIDARG), and accepts0x400(0x00000000S_OK) on both RTX 3090 (610.88) and WARP.#1222splitshost_knows_tight_alignment(0x200,trueon26100.9818) fromhost_tight_alignment(0x400,falsewhentier == 0, verified againstrecorded = S_OK), unmodifiedd3d12_vulkan_device_test.exepasses cleanly on26100.9818+ RTX 3090 (rc=0,0mismatches,0VUID-validation errors).26100.5074-style pre-tight-alignmentID3D12Device11host &recordedguard):mainagainst a26100.5074-style host wherefeat54 = E_INVALIDARG,0x200buffer= S_OK,0x400buffer/texture= E_INVALIDARG): fails withrc=1on all 3 cases (0x200 on a buffer,0x400 on a buffer,0x400 on a texture).8c73655a93against the same26100.5074-style host): passes withrc=0, loggingnot comparable on this hoston all 3 cases while verifyingours == *c.recorded; mutating0x200'srecordedexpectedHRESULTtoS_OKwhen!comparablefails as intended (rc=1,ours 0x80070057, recorded 0x00000000 (host 0x00000000, not comparable)).AI-assisted.
Validation run of this pull request.
git merge --no-edit --no-ff pr-1222, no conflicts); tested at the merge commit. The PR changes onlyruntime/test/d3d12_vulkan_device_test.cpp.cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ONcmake --build runtime/build --target gta6rt d3d12_vulkan_device_test -j 8ctest -R "^d3d12_vulkan_device$" --output-on-failure -j1(once on plain main, once on the merge)d3d12_vulkan_devicepassed. Run withctest -V, noresource flag 0x200or0x400mismatch lines are printed; the onlynot comparableline is the RAYTRACING_ACCELERATION_STRUCTURE one the PR leaves alone.Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.