Repository navigation
Conversation
al3xar
left a comment
There was a problem hiding this comment.
Tested f2b6ca347 on NVIDIA GeForce RTX 3060, driver 621.24 (Vulkan 1.4.357), Windows 11 x64, MSVC 19.44.35230.0, CMake + Ninja RelWithDebInfo (no game files): pass.
- Merges cleanly onto
upstream/main(dde82f27e). - Built
bindless_sizing_testandd3d12_bindless_churn_testwith zero new warnings inruntime/src/vulkan_bindless.handruntime/test/bindless_sizing_test.cpp. bindless_sizing_test.exeandctest -R "^bindless_sizing$": Passed (bindless sizing: synthetic limits gave the expected counts, exit 0).d3d12_bindless_churn_test.exeon RTX 3060: Passed (exit 0; 96 frames direct & async compute, 98,304 texels compared, 0 wrong).- Negative control (
runtime/src/vulkan_bindless.hreverted toupstream/main, PR test kept): fails as expected (line 157: count(f, D::dim_2d) == 169 && storage(f, D::dim_2d) == 169, exit 1). python -I scripts/check_no_game_data.py runtime/src/vulkan_bindless.h runtime/test/bindless_sizing_test.cpp: clean (exit 0).- Diff review: parameterizing
apply/fits/growwithbool cap_2d = true(leaving only the initial Step 1grow(storage)uncapped and adding a capped follow-upgrow(storage)to reclaim unused 2D storage slots) cleanly avoids starving 2D images under tight limits while keepinglayout_supportedcandidates consistent.
AI-assisted.
|
Independent Windows 11 MSVC + dual-GPU review of Environment
Build & Code Audit
Test Results
|
|
Tested Built No game files. AI-assisted (Claude Code). |
Claim: unlisted D3D/runtime bug claimed at #7913 (comment) (active coordination board is now #8047).
Depends on: none (built on
upstream/maindde82f27e994337094afc476ded0b1426f6e87e2; compatible with open PR #4811 becausefits(headroom, set_limit)preserves its 2-argument call form via a defaultbool cap_2d = trueparameter).Problem
In
leonida::bindless::size_bindings()(runtime/src/vulkan_bindless.h),apply(bool)only capped the four 2D storage bindings (counts[4]andcounts[8..10]) tostd::min(storage, counts[0])at the very end (apply(true)). Everywhere else—insidefits()and beforelimit_ms_bindings()/ Step 3set_limitsummation—it calledapply(false), keeping 2D storage uncapped atstorageeven whenimages < storage:grow(images),fits()charged4 * storagephantom 2D storage descriptors while trying to growimages, starvingimagesdown to1(zero usable 2D textures) under tightmaxPerStageResourcesormaxUpdateAfterBindDescriptorsInAllPoolslimits, only for the finalapply(true)to discard4 * (storage - images)descriptors.sampled_limitclampedimages < 256, descriptors freed by capping 2D storage fromstoragedown toimageswere never reclaimed for 2D-array, 3D, and 1D storage arrays.apply(false)leftcounts[4, 8..10]uncapped whenlimit_ms_bindings()and the Step 3set_limittotal summedcounts, and Step 3'sfits()passed uncapped candidates (storage(2D) > count(2D)) tolayout_supported.Per
docs/d3d12_vulkan.md§5, each storage array holds at most as many images as its dimension, and the 2Dr32uiarray matches the other 2D storage arrays.Fix
runtime/src/vulkan_bindless.h:apply(bool cap_2d),fits(..., bool cap_2d = true), andgrow(..., bool cap_2d = true)so 2D storage is uncapped only during Step 1's initialgrow(storage)pass (whenimagesis still1).imagesduring Step 1'sgrow(images), follow with a second Step 1grow(storage)(capped) to reclaim freed descriptors for non-2D storage up to the 256 default whenimages < 256, callapply(true)beforelimit_ms_bindings()andset_limit, and keep capping enabled throughout Step 3 (includinglayout_supportedqueries).runtime/test/bindless_sizing_test.cpp:maxPerStageResources, tight sampled-image limits alongside tight per-stage resource or storage limits, tightmaxUpdateAfterBindDescriptorsInAllPools, andlayout_supportedcandidate consistency.Synthetic before/after reproduction (
upstream/maindde82f27vsf2b6ca34)upstream/main(dde82f27)f2b6ca34)sampled=4000,storage=3584,resources=45002D=1,st2D=1,stArr/3D/1D=211(0 usable 2D slots)2D=169,st2D=169,stArr/3D/1D=211(4500/4500resources)sampled=1600,storage=3584,resources=45002D=1,st2D=1,stArr/3D/1D=2112D=64,st2D=64,stArr/3D/1D=256sampled=1600,storage=28162D=64,st2D=64,stArr/3D/1D=2012D=64,st2D=64,stArr/3D/1D=256(2816/2816storage)pool_limit=60002D=9,st2D=9,stArr/3D/1D=245,sam=1024(5056/6000)2D=197,st2D=197,stArr/3D/1D=245,sam=1028(6000/6000)pool_limit=5900,maxPerSetDescriptors=1024,layout_supported2D=7,st2D=7,sam=1024,asked=0(4976/5900)2D=191,st2D=191,sam=1028,asked=3(allstorage_consistent,5900/5900)A 20,000-profile randomized synthetic comparison between
upstream/mainandf2b6ca34produced 12,164 identical profiles, 7,836 strictly improved profiles, 0 regressions in any binding count or MS class, 0 changes in thefullreturn value, and 0 limit orstorage_consistentviolations.Testing
f2b6ca347dbecb5d9a32bf8c25091570ca099d14(based onupstream/maindde82f27e994337094afc476ded0b1426f6e87e2).runtime/test/bindless_sizing_test.cppagainst unmodifiedupstream/main:runtime/src/vulkan_bindless.hfailed as expected atline 157: count(f, D::dim_2d) == 169 && storage(f, D::dim_2d) == 169(exit code 1).cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfocmake --build runtime/build --target bindless_sizing_test descriptor_table_test vk_bindless_test d3d12_bindless_churn_test d3d12_descriptor_test vk_ps_sweep-> succeeded with 0 warnings in changed files.ctest --test-dir runtime/build -R "^(bindless_sizing|descriptor_table)$" --output-on-failure -V-> 2/2 passed (descriptor_table,bindless_sizing).LEONIDA_VK_VALIDATION=1):ctest --test-dir runtime/build -R "^(vk_bindless_ps_tex|vk_bindless_ps_imgatomic|d3d12_descriptor|d3d12_bindless_churn|d3d12_bindless_churn_validated)$" --output-on-failure -V-> 5/5 passed (d3d12_descriptor,vk_bindless_ps_tex,vk_bindless_ps_imgatomic,d3d12_bindless_churn,d3d12_bindless_churn_validated).git diff --check-> clean.python -I scripts/check_no_game_data.py runtime/src/vulkan_bindless.h runtime/test/bindless_sizing_test.cpp(plus PR body) -> clean.python -m compileall -q make_game.py tools testsandpython -I make_game.py --help-> passed.