Skip to content

tests: accept a host that wraps GetResourceAllocationInfo totals past 2^64; ours stays saturated - #1432

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
EmreO33:alloc-total-overflow-hosts
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
EmreO33:alloc-total-overflow-hosts

Conversation

@EmreO33

@EmreO33 EmreO33 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Claimed in #1380 (comment). It follows up my finding in #1218, which this also corrects: only the two overflow totals below were real failures.

d3d12_vulkan_device_test failed at EXPECT(allocation_mismatches <= 0) on both GPUs of one laptop. compare_allocation_info required the host's exact answer for two GetResourceAllocationInfo totals that overflow 2^64. The hosts don't agree on those:

Host two 2^63 buffers largest buffer + buffer
WARP, and the RTX 5070 (621.24) host of #1204 0xFFFFFFFFFFFF0000 0xFFFFFFFFFFFF0000
Intel Raptor Lake-S (101.7092), Windows 26300.9974, D3D12Core 10.0.26100.9818 0 65536
RTX 5060 Laptop (621.24), same PC 0 65536
WARP, same PC 0xFFFFFFFFFFFF0000 0xFFFFFFFFFFFF0000

The same NVIDIA driver saturates elsewhere, and WARP on this PC saturates too. So the answer depends on the Windows build together with the hardware driver, not on the layer.

Change

  • The layer is unchanged and keeps saturating. A wrapped total can make a caller allocate less than one of its resources.
  • The test pins ours to the saturated answer (UINT64_MAX / 64 KiB * 64 KiB, alignment 64 KiB) for those two cases. A host total below its largest resource has wrapped, and the test prints host wraps to N, ours saturates instead of failing. Any other host answer is still compared exactly.
  • docs/d3d12_vulkan.md records which hosts wrap and which saturate.

Tested

d3d12_vulkan_device_test, RelWithDebInfo, MSVC 19.44, Windows 11 26300.9974:

Vulkan device / host before after
Intel Raptor Lake-S (101.7092) / same GPU exit 1 (2 mismatches) exit 0, prints both wraps
RTX 5060 Laptop (621.24) / same GPU exit 1 (2 mismatches) exit 0, prints both wraps
RTX 5060 Laptop / LEONIDA_HOST_ADAPTER=warp exit 0 exit 0

AI-assisted (Claude Code).

… 2^64; ours stays saturated

compare_allocation_info required the host's answer for two totals that
overflow 2^64 (two 2^63 buffers; the largest buffer plus one). WARP and
the hosts of ItsNotRexed#1204 saturate at 0xFFFFFFFFFFFF0000, but the Intel Raptor
Lake-S (101.7092) and RTX 5060 Laptop (621.24) hosts on Windows
26300.9974 (D3D12Core 10.0.26100.9818) wrap, to 0 and 65536, while WARP
on the same PC saturates. d3d12_vulkan_device_test failed there on both
GPUs.

Ours is now pinned to the saturated answer, which can't make a caller
allocate less than one of its resources. A host whose total is below its
largest resource has wrapped and is reported, not compared. Any other
host answer is still a mismatch.
@Rainmaker33

Copy link
Copy Markdown

Tested cee1ba5 on NVIDIA GeForce RTX 3090 (Ampere), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass.

The PR's diff applied cleanly to main bb2e184. Runtime built with scripts\build_runtime.ps1 (VS 2022, CMake, RelWithDebInfo), Vulkan SDK 1.4.363.0.

  • d3d12_vulkan_device with LEONIDA_VK_VALIDATION=1: passed, no VUIDs.
  • ctest: 82/82.

@ICUMADETHIS

Copy link
Copy Markdown
Contributor

Tested cee1ba5 merged into main bb2e184 on Windows 11 26300.9974 (D3D12Core 10.0.26100.9818), RTX 2080 Ti (NVIDIA 621.14), MSVC 14.44: pass, with no host wraps line, so this host saturates both overflow totals like the layer (main's exact comparison passes here too).

That's the same Windows build and D3D12Core as the two wrapping hosts in the table, so on 26300.9974 it isn't the Windows build alone: the RTX 2080 Ti (Turing) on 621.14 saturates, while the Raptor Lake-S and the RTX 5060 Laptop on 621.24 wrap. It might be worth a row in the docs/d3d12_vulkan.md table.

The red Windows CI job is d3d12_present at line 139 (d.create(true)) on the GPU-less runner, the same failure as main c2967a5. de47dbd, on main since bb2e184, makes that test skip without a Vulkan device, so a re-run on current main should clear it.

AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (MSVC 14.51, Windows SDK 10.0.26100): pass. ctest: 79/79 on the RTX 4080 SUPER, including d3d12_vulkan_device. The Intel UHD 770 failures are known and unrelated: d3d12_descriptor (min-LOD), d3d12_copy_xfmt, and d3d12_present (reported in #1380).

@kacper-serewis

Copy link
Copy Markdown
Contributor

Tested cee1ba5 merged onto current main (bb2e184, clean merge) on RTX 5070 (Blackwell, subgroup 32..32), NVIDIA 616.56, Windows 11 Pro 26200, MSVC 19.50, Vulkan SDK 1.4.363.0: pass.

  • ctest 82/82, including d3d12_present (the test that failed in this PR's Windows CI run; it passes here)
  • d3d12_vulkan_device_test exit 0: "... reserved resources, queries, and GetCopyableFootprints and GetResourceTiling all matched"

@ItsNotRexed
ItsNotRexed merged commit 0b6e995 into ItsNotRexed:main Nov 22, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants