queue_families: select earliest slot in pick_queue_slot when all slots are UINT32_MAX #2310
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2310
Loading…
Reference in a new issue
No description provided.
Delete branch "ubiq-queue-families-slot-max"
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 successfully merged and closed
Fixes an edge case in
leonida::pick_queue_slot()(runtime/src/queue_families.h):fewestwas initialized toUINT32_MAXand updated only whenusers[i] < fewest. If every slot in non-empty pools hadUINT32_MAXusers,pick_queue_slot()returned{SIZE_MAX, 0}(the sentinel meaning every pool is empty).chosen.pool == SIZE_MAX || users[i] < fewestso the earliest available slot is always selected when at least one pool is non-empty.runtime/test/queue_families_test.cpp.Verification
g++ -std=c++20 -D_GLIBCXX_DEBUG -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/queue_families_test.cpppassedg++ -std=c++20 -fsanitize=address,undefined -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/queue_families_test.cpppassedsat.pool == 1 && sat.index == 0, exit 1) against unmodifiedubiq/mainpython3 -I scripts/check_no_game_data.py runtime/src/queue_families.h runtime/test/queue_families_test.cppcleanClaimed in the coordination issue as: RT-QUEUE-FAMILIES-SLOT-MAX (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193699762)
AI-assisted: yes (Gemini)
VERIFY-2310— verified headbddeb09264merged cleanly withmaind48a957bbon Windows 11 Pro (build 26200), MSVC19.44(x64,/std:c++20 /W4 /WX /permissive- /utf-8 /EHsc), synthetic queue-family slot arrays only.Red (
maind48a957bb) -> Green (d48a957bb+bddeb09264)main:runtime/test/queue_families_test.cppagainstmain'sruntime/src/queue_families.h-> FAILED (exit 1atline 28: sat.pool == 1 && sat.index == 0, becauseusers[i] < fewestnever matched whenfeweststarted atUINT32_MAXand every non-empty pool slot hadUINT32_MAXusers).cl.exe /nologo /std:c++20 /W4 /WX /permissive- /utf-8 /EHsc /I"runtime/src" runtime/test/queue_families_test.cpp(with Vulkan headers) -> 0 warnings, exit0(queue_families_test: ok).AI-assisted.
Verified by OreoFR
c1ecf04ed+ PR headbddeb0926; green run in a merge package of 16 PRs, no new ctest failure vs mainstandalone build of queue_families_test.exe (the test is not registered in CMake)sat.pool == 1 && sat.index == 0AI-assisted (Claude Code, Claude Opus 5.5).
Tested
bddeb0926merged (no commit) withmainaa918e5d9, MSVC 19.52 (Visual Studio 18), Windows 11 10.0.26300.Blocker:
runtime/test/queue_families_test.cppis new but is not registered inruntime/CMakeLists.txt, so neither CI norctestever builds or runs it.ctest -Non the merge lists no such test, andtests/test_ctest_registration.pystill passes, so nothing catches this. Registering it the way the other header-only tests are would fix that:Also,
queue_families.hincludesvulkan/vulkan.h, so this test needstarget_link_libraries(queue_families_test PRIVATE Vulkan::Headers)inside theif(TARGET Vulkan::Headers)block.Hand-compiled (
cl /std:c++20 /EHsc /O2):queue_families_test: ok, exit 0.runtime/src/queue_families.hback tomain:line 28: sat.pool == 1 && sat.index == 0, exit 1.I did not run the ctest tests relinked by the header change: test runs on this machine are paused for memory.
AI-assisted (Claude Code).
Merged. Tested by OreoFR (RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11) on this head: queue_families_test red on main (line 28), green with the PR. Note: the test is not registered in CMake. AI-assisted: yes.