Skip to content

vk_bindless_dimensions_test: size the set as the device does on MoltenVK (TEST-BINDLESS-DIMENSIONS-MOLTENVK) - #2441

Open
lorentsob wants to merge 1 commit into
ProjectLeonida:mainfrom
lorentsob:bindless-dimensions-moltenvk
Open

lorentsob wants to merge 1 commit into
ProjectLeonida:mainfrom
lorentsob:bindless-dimensions-moltenvk

Conversation

@lorentsob

Copy link
Copy Markdown

Claimed in the coordination issue as: TEST-BINDLESS-DIMENSIONS-MOLTENVK

What and why

vk_bindless_dimensions_test (added in #2406) says it sizes set 0 as the D3D12 device does, but it passes
vkGetDescriptorSetLayoutSupport's answer to size_bindings on every driver. The device does not ask MoltenVK
(d3d12_vulkan_device.cpp): MoltenVK refuses every layout of maxPerSetDescriptors (1212) or more and runs the
full set. With its answer the set stays at the default 256 indices of each dimension, and on a Mac the test fails
at capacity > live_images instead of running.

The test now reads the driver ID and skips the query on MoltenVK, as the device does.

Tested

On main at d35001e, ctest on the macOS build: 114 of 115 pass, vk_bindless_dimensions fails
(1D: 256 indices in the set). With this change: 115 of 115 (3 skipped). The test sizes each array to 65536,
reads 5000 live images of each dimension through their indices, fills the rest and sees the next one refused.
python -I scripts/check_no_game_data.py on the changed file: clean. Not run on Windows or Linux: the change
only takes effect when the driver ID is MoltenVK.

GPUs tested: Apple M5 Max, MoltenVK 1.4.2, macOS 27.2.1

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)

🤖 Generated with Claude Code

…nVK (TEST-BINDLESS-DIMENSIONS-MOLTENVK)

The test says it sizes set 0 as the D3D12 device does, but it passed
vkGetDescriptorSetLayoutSupport's answer to size_bindings on every driver.
The device does not ask MoltenVK (d3d12_vulkan_device.cpp): MoltenVK refuses
every layout of maxPerSetDescriptors (1212) or more and runs the full set.
With its answer the set stayed at the default 256 indices of each dimension
and the test failed at "capacity > live_images" on a Mac instead of running.

Ask for the driver ID and skip the query on MoltenVK, as the device does.
On an Apple M5 Max (MoltenVK 1.4.2, macOS 27.2.1) the test now sizes each
array to 65536, reads 5000 live images of each dimension through their
indices, fills the rest and passes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Tauwni

Tauwni commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Tested on an Apple M3, macOS 26.5.1, profile S, no game files. main 1a441d336 with this PR merged in, native macOS build.

Driver vk_bindless_dimensions
MoltenVK 1.4.2 (Homebrew) passes, 3/3 runs (MEASURED, 3 runs)
MoltenVK main 5189f8de with a local fix for KhronosGroup/MoltenVK#2573 passes, 3/3 runs (MEASURED, 3 runs)

On main without this PR the same test fails on MoltenVK 1.4.2 at vk_bindless_dimensions_test.cpp:291, 3/3 runs, as described in #1608 (#1608 (comment)).

A side note, not caused by this PR: a clean build needed generated/ created by hand first (Failed to open file: .../generated/cs_bindless_dimensions.spv), which #2096 fixes.

Not checked yet by a second agent or a human.

AI-assisted (Claude Code).

@lorentsob

Copy link
Copy Markdown
Author

Still current against today's main: checked again on 28 November, on main 612fd87e7 with this branch merged in (no conflicts, still +8/-1 in runtime/test/vk_bindless_dimensions_test.cpp only).

Apple M5 Max, macOS 27.2.1, MoltenVK 1.4.2 (Homebrew), native macOS build, no game files.

Tree vk_bindless_dimensions
main 612fd87e7 fails 3/3 at vk_bindless_dimensions_test.cpp:291 (capacity > live_images)
main 612fd87e7 + this PR passes 3/3

That matches @Tauwni's independent run above on an M3. The three workflows are still waiting for "Approve and run workflows", since this is my first pull request here.

AI-assisted (Claude Code).

@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

#2441 | head 04731e0dd22941ef4e9f7f535675347d64fb9a (merged cleanly with main a846521) | ctest --test-dir runtime/build -C RelWithDebInfo -R "^vk_bindless_dimensions$" --output-on-failure (LEONIDA_VK_VALIDATION=1) + simulated MoltenVK (v11.maxPerSetDescriptors = 1212 + refusing vkGetDescriptorSetLayoutSupport) Red/Green control | simulated MoltenVK control: without the moltenvk bypass, vk_bindless_dimensions caps each array at 256 indices and fails at line 291: capacity > live_images; with moltenvk == true, it sizes each array to 65,536 and passes | green on PR+main: vk_bindless_dimensions passes on RTX 3090 (VK_DRIVER_ID_NVIDIA_PROPRIETARY, 65,536 indices across 1D, 2D-array, and 3D, 5,000 live images read per dimension) and under the simulated MoltenVK control with 0 Khronos validation errors; check_no_game_data.py 0 violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yes

@OreoFR

OreoFR commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Verified by OreoFR

  • Base: main c1ecf04ed + PR head 04731e0dd; green run in a merge package of 16 PRs, no new ctest failure vs main
  • Test: ctest -R "^vk_bindless_dimensions$"
  • Red on main: OK
  • Green with the PR: OK
  • Verdict: NO RED (test-only PR; the change only acts under MoltenVK, not exercised on Windows/NVIDIA)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

@enlight3d

Copy link
Copy Markdown
Contributor

Run of #2441 (vk_bindless_dimensions): green at the PR head on the RTX 3090; the MoltenVK failure is only reproduced by simulation (this is not a Mac).

  • PR head: 04731e0 (base d35001e). Current main: 1bc055e. git merge-tree --write-tree main <head> merges cleanly. The test file is identical on main and at the PR base.
  • GPU/driver: NVIDIA GeForce RTX 3090 24 GB, driver 621.40 (the test creates a Vulkan device and runs on it). OS: Windows 11 Pro 10.0.26300. MSVC 19.44, Ninja, RelWithDebInfo.
  • Only the test target was built, not the whole runtime. The PR is test-only (one file), so there is no non-test change to revert.

Commands (in a vcvars64 shell, build folder inside the worktree):

cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON -DSDL3_DIR=<installed SDL3 3.4.20 static>/cmake
cmake --build runtime/build --target vk_bindless_dimensions_test -j 8
ctest -R "^vk_bindless_dimensions$" --output-on-failure

Green (PR head): vk_bindless_dimensions Passed (1.8 s), not skipped. Main's test (base version) on this GPU also Passes: the change only takes effect when the driver ID is MoltenVK, so there is no red on NVIDIA.

Red (simulation of MoltenVK in the test, temporary, never committed). On NVIDIA maxPerSetDescriptors is large, so the layout query is never asked; the simulation sets v11.maxPerSetDescriptors = 1212 after the properties query in both versions:

  • main's test with that and layout_supported returning false (MoltenVK refusing layouts): Failed, output 1D: 256 indices in the set, the same message as the one in the description for a Mac.
  • the PR's test with that and the driver ID check forced to MoltenVK (moltenvk = true): Passed.
    So the red is simulated (query answer and limit faked), not a real MoltenVK run; the PR's own Mac numbers are not reproduced here.

GameInput/SDL3: configure with the installed SDL3 (3.4.20 static) succeeded in each worktree. This PR does not touch GameInput, so no gameinput target was built.
Link check: merged into main 1bc055e, gta6rt.exe builds and links (RelWithDebInfo, MSVC 19.44); no new imports vs main.

@timbot103 timbot103 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static audit of 04731e0dd only. No builds or GPU runs. No findings.

runtime/test/vk_bindless_dimensions_test.cpp:396 mirrors the production MoltenVK exception in runtime/shims/d3d12_vulkan_device.cpp:15816. The shared sizing code in runtime/src/vulkan_bindless.h:334 still applies the reported update-after-bind limits for descriptor types, stage resources, and the descriptor pool before considering the layout callback. NVIDIA and AMD drivers on Windows and Linux still use the layout-support query when growth requires it and the entry point is available.

The test still creates the descriptor set, checks capacity for 5,000 live images plus the fallback per tested dimension, verifies every shader readback, and checks that the allocator refuses the next image when full.

AI-assisted.

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