Repository navigation
Vulkan: profiler follow-up: a draw's phases sampled together, slow paths exact - #989
Merged
hckrman101 merged 1 commit intoNov 9, 2026
Merged
Conversation
Contributor
Author
|
Thanks, all addressed in 90ec861 (rebased on current main):
Three deliberately broken variants (independent nested picks, exact part not subtracted, nested exact scopes counted twice) each fail it. The fps figure in the description was measured before this rework. The extra bookkeeping is only on the slow paths, but I haven't re-measured it. |
klimovich008
force-pushed
the
perf-prof-sampled-draw-scopes
branch
from
November 9, 2026 10:20
26e4596 to
90ec861
Compare
NotRexed
added a commit
that referenced
this pull request
Nov 9, 2026
klimovich008
force-pushed
the
perf-prof-sampled-draw-scopes
branch
from
November 9, 2026 15:30
90ec861 to
f226108
Compare
The outermost PROF_HOT on a thread picks one draw in eight and the phases nested in it follow its pick, so a phase never reads more than the one around it (one PRNG step per draw). What is slow and rare inside them (program_pick, a program read from disk, a pipeline new to the thread, a layout made, a ready wait, mesh_indirect_convert, a texture created, PROF_UPLOAD) is timed exactly by PROF / PROF_EXACT and counted once as it is: the PROF_HOT scopes around it weigh only the rest. Every scope is timed with RX_VK_PROF_ALL=1 or RX_VK_SLOW_LOG (read once, prof_full) and while RX_VK_BENCH replays its frame. PROF_DISPATCH is exact again. The seed is splitmix64 of a per-thread counter, the pick the generator's top bits. tests/test_prof_sampling.py runs the real scopes on a fake clock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NotRexed
added a commit
that referenced
this pull request
Nov 9, 2026
…s from-disk path times itself since #989) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is now
The first commit of this PR (b70cff4, per-draw phase timers sampled one in eight) was merged into main in 66a0f28. This branch is now rebased on current main and holds only the follow-up commit that answered the review, which the merge did not include.
Change
PROF_HOTon a thread decides once per draw, and nested hot scopes follow that decision, so a draw's phases are sampled together and their sum stays consistent.RX_VK_PROF_ALL=1still times every scope.Tested
tests/test_prof_sampling.py(new, inrun_all.py): 400,000 synthetic draws. Nested phases bounded, slow paths counted exactly once, phase totals within 0.6% of the true totals,RX_VK_PROF_ALL=1exact. It reads the sampling code this change adds, so on main it stops at a missing scope rather than showing a wrong total; it passes with the change.tests/test_parallel_rb_refresh.pystill passes after the rebase.Not covered
Not re-run in game after the rebase. Profiling builds only: release timings are unchanged.
🤖 Generated with Claude Code