metal: VICTORY_PASS_TIMING=draw — per-draw/per-dispatch GPU timing at draw/dispatch boundaries (#460 follow-up) #604
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS#604
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@AnastasisKon on GitHub · 2026-11-28 11:33 UTC · original
What happens
VICTORY_PASS_TIMING=1(#464, PR #598) samples each pass encoder's start and end, so a render pass of 500 draws is timed as one lump. Apple GPUs also support counter sampling at draw and dispatch boundaries (MTLCounterSamplingPointAtDrawBoundary/AtDispatchBoundary; an AGXG15X supports both, but not blit — see #598). Per-draw times would name the expensive draws inside a pass, not just the pass.Fix
A finer mode of the same switch, e.g.
VICTORY_PASS_TIMING=draw(or=2): sample at the pass encoder's start, at each draw/dispatch boundary inside the pass, and at its end; consecutive resolved timestamps then give per-draw and per-dispatch durations. Log per pass the N most expensive draws by pipeline hash and draw index (the pass's own lines today give the pass lump). Blit passes stay untimed where the device lacksAtBlitBoundary. Unit test: a synthetic two-draw render pass (zero-draw trick won't do — needs two draws, so a real pipeline from the test fixtures, or two dispatches of the affine compute) yields per-draw intervals that sum to about the pass interval.Off by default like the rest; documented in docs/native-host.md.
@AnastasisKon on GitHub · 2026-11-28 11:33 UTC · original
/claim
Taking this follow-up to #464 (PR #598): a
drawmode of VICTORY_PASS_TIMING that samples at each draw/dispatch boundary inside a pass (AtDrawBoundary/AtDispatchBoundary, which Apple GPUs support), so per-draw costs are named, not just the pass lump. Blit stays per-encoder (no AtBlitBoundary on G15X-class). Unit test with two dispatches of the test compute shader. Draft PR from my fork's vibe/ branch to follow.@github-actions[bot] on GitHub · 2026-11-28 11:33 UTC · original
Claimed by @AnastasisKon. Open a draft pull request with
Refs #600in its description within 24 hours, or the claim expires.@AnastasisKon on GitHub · 2026-11-28 12:37 UTC · original
/release - done: PR #606 adds
VICTORY_PASS_TIMING=drawfor per-draw/per-dispatch GPU timing. Carried in my fork'smain(69146296) on top of #598.@AnastasisKon on GitHub · 2026-11-28 12:42 UTC · original
/release - done: PR #606 adds
VICTORY_PASS_TIMING=drawfor per-draw/per-dispatch GPU timing. Carried in my fork'smain(69146296) on top of #598.@github-actions[bot] on GitHub · 2026-11-28 12:42 UTC · original
Released. This issue is free to claim.