Skip to content

d3d12_vulkan_device_test: an allocation-info mismatch says MISMATCH, and the comparison ends with a count (TEST-VK-ALLOC-INFO-OUTPUT) - #1369

Open
Diegobecker07 wants to merge 1 commit into
ProjectLeonida:mainfrom
Diegobecker07:test-vk-alloc-info-output
Open

Diegobecker07 wants to merge 1 commit into
ProjectLeonida:mainfrom
Diegobecker07:test-vk-alloc-info-output

Conversation

@Diegobecker07

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-VK-ALLOC-INFO-OUTPUT (#14 (comment))

What and why

compare_allocation_info in runtime/test/d3d12_vulkan_device_test.cpp printed two kinds of line with the same allocation info <case>: prefix:

  • a mismatch, on stderr: allocation info <case>: ours size … alignment …, host size … alignment …;
  • the informational line for every compared texture, matching or not, on stdout: allocation info <case>: alignment …, size ours … host ….

So "no allocation info lines" reads like a pass criterion (it was given as one in the #375 merge note), although a run with a host device always prints dozens of the second kind: 46 on an RTX 5070 Ti, with 0 mismatches.

This PR changes the test output only:

  • A mismatch line now starts with allocation info MISMATCH, and so does the Device4/Device8 per-resource layout one.
  • The comparison ends like the other host comparisons in this test (FORMAT_INFO on …: … mismatches): GetResourceAllocationInfo against the host on <adapter>: N compared, M mismatches.
  • The function's comment says which line is which.

What is compared and what counts as a mismatch are unchanged. Without a host device the function still returns -1 before printing anything.

Tested

  • scripts\build_runtime.ps1 (MSVC 19.44, VS 2022 Build Tools, CMake 3.31.6 + Ninja, Vulkan SDK 1.4.363.0): builds; no new warning in the changed lines.
  • ctest -R "^d3d12_vulkan_device$" -V: passed (17.6 s). It prints GetResourceAllocationInfo against the host on NVIDIA GeForce RTX 5070 Ti: 153 compared, 0 mismatches, 46 informational lines and no allocation info MISMATCH line. Before this change, on main 51a6074d2, the same machine printed the same 46 informational lines and no mismatch.

GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 621.24, Vulkan 1.4.357, Windows 11 Pro 26300

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

…and the comparison ends with a count (TEST-VK-ALLOC-INFO-OUTPUT)

compare_allocation_info printed its mismatch line (stderr) and the line it prints for every compared texture
(stdout) with the same "allocation info <case>:" prefix, so "no allocation info lines" read like a pass criterion
although a run with a host device always prints dozens of the second kind. A mismatch now starts with
"allocation info MISMATCH", as does the Device4/Device8 layout one, and the comparison ends like the other host
comparisons: "GetResourceAllocationInfo against the host on <adapter>: N compared, M mismatches". Test output
only; what is compared and what counts as a mismatch are unchanged.
@Diegobecker07

Copy link
Copy Markdown
Contributor Author

Re-checked against current main (0d80bc5), which also changed runtime/test/d3d12_vulkan_device_test.cpp. The PR merges cleanly, so I did not rebase it. On the merged tree (full runtime build, Windows 11 Pro 26300, NVIDIA RTX 5070 Ti, driver 621.24), d3d12_vulkan_device passes and prints GetResourceAllocationInfo against the host on NVIDIA GeForce RTX 5070 Ti: 153 compared, 0 mismatches.

The rest of ctest also passed except d3d12_shader_cache. It failed once because two other ctest runs on the same machine used its fixed %TEMP%\leonida_shader_cache_disk_test directory at the same time, and it passes 3/3 alone. This PR does not touch that test.

CI is waiting for workflow approval (first-time contributor).

AI-assisted.

@PierreEbele

Copy link
Copy Markdown
Contributor

Reviewed 8d14c29: test-output-only change; the test builds only under Windows/MSVC and needs a host D3D12
device, so nothing was executed here. Checked the diff hunk by hunk: create_host_device's adapter-name out-param
already exists on main, every ++compared follows the comparison it counts, the skipped branch is unchanged, the
MISMATCH wording matches the other device tests, nothing greps the old lines, and it merges cleanly into current
main. Nit, no action: a mismatch in the skipped branch counts in the final total but not "compared". No finding.
AI-assisted review.

Recommendation: Merge

@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Windows 11 + RTX 3090 Verification Report (8d14c29c54 merged onto origin/main a9e247cd69)

  • Merge Status: Clean merge onto origin/main (a9e247cd69) and clean combined merge alongside #732, #1223, #1449, and #2414.
  • Environment: Windows 11 (10.0.26200, x64), MSVC 19.44.35228, NVIDIA GeForce RTX 3090, VK_LAYER_KHRONOS_validation 1.4.363.1 (LEONIDA_VK_VALIDATION=1, VK_VALIDATE_SYNC=1).

Diff Audit (1 file, +20/-3)

  • runtime/test/d3d12_vulkan_device_test.cpp:
    • Prefixes stderr failure lines in compare_allocation_info with allocation info MISMATCH ... so failure lines are unambiguous next to normal stdout allocation info <case>: ... lines.
    • Tracks unsigned compared across every host-compared allocation-info, visible-mask (GetResourceAllocationInfo / Info1 / Info2), multisample quality-level, and Device4/Device8 layout case, and prints a final GetResourceAllocationInfo against the host on <adapter>: <compared> compared, <mismatches> mismatches summary line.

Red -> Green Verification on RTX 3090

  1. Red (origin/main a9e247cd69):
    • d3d12_vulkan_device_test.exe on RTX 3090 (17.02 s, rc=0) printed per-texture allocation info ... lines with 0 summary lines on stdout and lacked MISMATCH in compare_allocation_info's stderr format strings.
  2. Green (#1369 + origin/main):
    • d3d12_vulkan_device_test.exe (/O2 /MD /EHsc /W4 /permissive- /utf-8, 0 new warnings) passed on RTX 3090 (14.96 s, rc=0, 0 VUID- / validation errors) and printed:
      GetResourceAllocationInfo against the host on NVIDIA GeForce RTX 3090: 153 compared, 0 mismatches
    • Combined merge with #732 (d3d12_vulkan_device_test.exe): rc=0 (15.06 s, 153 compared, 0 mismatches, 0 VUID- errors).

Verdict: PASS — ready to merge.

AI-assisted.

@enlight3d

Copy link
Copy Markdown
Contributor

RUN of #1369 (before/after output check, GPU box, merged build)

Heads: PR head 8d14c29c54b9, main 54b2a81e95c4. Tested as main + PR head (git merge --no-ff, local only): merged cleanly, no conflicts.

This PR changes only what d3d12_vulkan_device_test prints, not what it checks, so there is no test that can go red for a bug. What I compared is the test's output with the PR's test file and with main's, in the same merged tree.

Commands (VS 2022 x64 environment, from the worktree root):
cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON
cmake --build runtime/build -j 8 --target d3d12_vulkan_device_test gta6rt
ctest -R "^d3d12_vulkan_device$" -V -j1

  • "Red" (the PR's test file reverted to main's, same build): ctest Passed, 45 allocation info <case>: informational lines, no allocation info MISMATCH line, and no final count line.
  • Green (merged): ctest Passed, the same 45 informational lines, 0 allocation info MISMATCH lines, and the new last line GetResourceAllocationInfo against the host on NVIDIA GeForce RTX 3090: 153 compared, 0 mismatches.
  • So the new output is there and nothing changes in pass/fail; I could not check the MISMATCH wording itself because this GPU has no mismatch to trigger it (that line is only read, not exercised).
  • Link: no new imports vs main (dumpbin /imports of gta6rt.exe, DLL!symbol, sorted: 700 entries on main and on main + PR, identical; the PR only touches a test file).

Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44 (VS 2022 Build Tools), CMake + Ninja, RelWithDebInfo, -DLEONIDA_REQUIRE_VULKAN=ON, Vulkan SDK 1.4.363.1.

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.

4 participants