Guidance for coding agents working in this repository.
- Project:
vk-benchVulkan micro-benchmark. - Language: C++ (single primary source file:
src/main.cpp). - Build: CMake.
- Runtime: Linux Docker workflow with NVIDIA GPU (
--gpus all) is the default path.
- Keep benchmark behavior deterministic and easy to compare run-to-run.
- Prefer small, reviewable changes over broad refactors.
- Preserve JSON output compatibility unless a change is explicitly requested.
- Avoid changing benchmark semantics (scene workloads, frame loops, timing region boundaries) unless requested.
- Add comments only where logic is non-obvious (timing, synchronization, resource lifetime).
- Keep code style consistent with existing file formatting and naming.
- Do not add dependencies unless they are necessary and justified.
When changing code, run what is feasible in the environment:
- Configure/build with CMake.
- Run a short headless benchmark (
--framessmall) and verify JSON output is written. - Confirm no obvious regressions in CLI arguments or scene dispatch.
If GPU execution is not available, state what could not be validated.
src/main.cpp: Vulkan setup, scene execution, timing collection, JSON output.CMakeLists.txt: targets, shader compilation/install, window mode options.scripts/run_bench.sh: scripted benchmark runs in Docker.scripts/nsight_capture.sh: Nsight Systems capture helper.scripts/collect_system_info.sh: host/container environment capture.README.md: user-facing usage and run instructions.
- Do not assume window mode is available; respect
VK_BENCH_HAS_WINDOW. - Keep shader lookup behavior intact (
VK_BENCH_SHADER_DIR, executable-local shaders, fallback paths). - Ensure Vulkan objects are destroyed in reverse-lifetime order on every exit path.