Repository navigation
Conversation
0xKaji
left a comment
There was a problem hiding this comment.
Reviewed the diff: adds a CPU-only test target for vulkan_predicated_copy.h with proper CMake registration. Looks good.
|
Read the diff and traced the expected values against
AI-assisted (Claude); code read only, nothing run. |
|
Independent build + test: PASS (two coverage gaps found by mutation) AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo. CPU-only test; machine GPU NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124 (not used). Head
To see what the test actually pins down, I made three single-line local edits to
So the test doesn't cover two of the guards it says it covers ("Split at the smaller remaining descriptor range or dispatch limit"):
Two small cases with mocked |
… vulkan_predicated_copy_test
Claimed in the coordination issue as: #7804 (comment)
What and why
Adds CPU-only unit tests for
runtime/src/vulkan_predicated_copy.h(PredicatedBufferCopier,PredicatedBufferCopier::Batch, andPredicatedCopyDispatch) inruntime/test/vulkan_predicated_copy_test.cppand registersvulkan_predicated_copy_test/ CTestvulkan_predicated_copyinruntime/CMakeLists.txt.Using a mock
PFN_vkGetDeviceProcAddrdispatch table, the tests cover:Batch::preparezero-byte no-op, null-buffer / integer-overflow / overlapping same-buffer guards, and missing device entry-point checksvkCreateDescriptorSetLayout,vkCreatePipelineLayout,vkCreateShaderModule,vkCreateComputePipelines)vkCreateDescriptorPool/vkAllocateDescriptorSetsfailure cleanup, alignment-padded multi-window splitting, and descriptor offset/range writesemit()barrier/bind/push-constant/dispatch sequence, cached pipeline reuse, and destructor teardownTested
g++ 16.2.1,cmake+ninja(RelWithDebInfo)nvidia-open615.71.09(CPU-only test; no GPU or game files used)g++ -std=c++20 -Wall -Wextra -Wno-missing-field-initializers -Werror -Iruntime/src runtime/test/vulkan_predicated_copy_test.cpp -o /tmp/vulkan_predicated_copy_test && /tmp/vulkan_predicated_copy_test:vulkan_predicated_copy_test: okcmake -S runtime -B runtime/build/linux -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo && cmake --build runtime/build/linux --target vulkan_predicated_copy_test && ctest --test-dir runtime/build/linux --output-on-failure -R "^vulkan_predicated_copy$":1/1 passed (0.00 sec)python3 -I scripts/check_no_game_data.py runtime/test/vulkan_predicated_copy_test.cpp runtime/CMakeLists.txt: exit 0AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed.