metal: VICTORY_PASS_TIMING=draw — per-draw/per-dispatch GPU timing at draw/dispatch boundaries (#460 follow-up) #600
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T11:33:16Z.
What happens
VICTORY_PASS_TIMING=1(#460, PR #594) 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 #594). 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.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T11:33:48Z.
/claim
Taking this follow-up to #460 (PR #594): 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.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T11:33:58Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #600in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:37:14Z.
/release - done: PR #602 adds
VICTORY_PASS_TIMING=drawfor per-draw/per-dispatch GPU timing. Carried in my fork'smain(69146296) on top of #594.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:42:14Z.
/release - done: PR #602 adds
VICTORY_PASS_TIMING=drawfor per-draw/per-dispatch GPU timing. Carried in my fork'smain(69146296) on top of #594.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T12:42:24Z.
Released. This issue is free to claim.