Collect completed GPU timestamps at the meter boundary #27

Open
github-bot wants to merge 1 commit from github-bot/gh-27 into main AGit
Owner

@⁠avt0m4t48 on GitHub · 2026-12-03 03:37 UTC · original
avt0m4t48:diagnostics-collect-completed-gpu-brackets → main · +167 −96 · 2 files · 1 commits · draft

Problem

The optional GPU timestamp meter waits for a slot to wrap before it reports the result. That can leave a short run with zero reported brackets even after the drawing queue has finished them. Dividing those delayed samples by the current frame count also attributes them to the wrong window.

Change

Collect completed timestamp pairs in order at each meter boundary and before reuse when the ring is full. Reading a slot requires a successful queue signal and an observed completion on that fence. The meter polls once when results are pending and adds no GPU wait. It reports collected milliseconds, valid sample count, skips and results still pending. Fences and both timestamp commands stay tied to the drawing queue. D3D12 fence semantics

A selected send publishes its successful signal with one atomic store. The optional sampler can collect up to 512 pairs at a boundary and releases the ring lock before logging.

Verification

In the 512-submission fixture, the earlier meter reports zero completed samples at the first boundary and reports the first 80 ms bracket at the next boundary. The new meter reports all 512 at the first boundary and the next submission's 1 ms bracket at the next boundary.

A separate queue and interval ledger checked 20,000 synthetic events, slot order, skips, overlapping brackets and the emitted totals. Two serialized senders and a concurrent meter collected every one of 2,048 pairs once and in order. Additional checks covered invalid targets, wraparound, failed or unconfirmed signals, device removal, and the disabled sampler. The sender-slice replay checked command grouping and signal confirmation with and without diagnostics.

These replays use a CPU-backed timestamp mapping and simulated fences. Native Windows driver behavior, enabled-sampler overhead and gameplay frame times remain unmeasured.

Both the inline late path and the separate published sender publish their confirmed signals. The existing sender FIFO and inline gate order work on the same fence timeline.

The standalone GPU and combined workspace test targets type-checked for Windows x64 MSVC with diagnostics and pure-Rust BLAKE3. The Linux host used a metadata-only mimalloc declaration. Both staged source files passed asset policy.

**@⁠avt0m4t48** on GitHub · 2026-12-03 03:37 UTC · [original](https://github.com/linkoovosh/LinkoArts-build/pull/27) `avt0m4t48:diagnostics-collect-completed-gpu-brackets` → `main` · +167 −96 · 2 files · 1 commits · draft ### Problem The optional GPU timestamp meter waits for a slot to wrap before it reports the result. That can leave a short run with zero reported brackets even after the drawing queue has finished them. Dividing those delayed samples by the current frame count also attributes them to the wrong window. ### Change Collect completed timestamp pairs in order at each meter boundary and before reuse when the ring is full. Reading a slot requires a successful queue signal and an observed completion on that fence. The meter polls once when results are pending and adds no GPU wait. It reports collected milliseconds, valid sample count, skips and results still pending. Fences and both timestamp commands stay tied to the drawing queue. [D3D12 fence semantics](https://learn.microsoft.com/en-us/windows/win32/direct3d12/user-mode-heap-synchronization) A selected send publishes its successful signal with one atomic store. The optional sampler can collect up to 512 pairs at a boundary and releases the ring lock before logging. ### Verification In the 512-submission fixture, the earlier meter reports zero completed samples at the first boundary and reports the first 80 ms bracket at the next boundary. The new meter reports all 512 at the first boundary and the next submission's 1 ms bracket at the next boundary. A separate queue and interval ledger checked 20,000 synthetic events, slot order, skips, overlapping brackets and the emitted totals. Two serialized senders and a concurrent meter collected every one of 2,048 pairs once and in order. Additional checks covered invalid targets, wraparound, failed or unconfirmed signals, device removal, and the disabled sampler. The sender-slice replay checked command grouping and signal confirmation with and without diagnostics. These replays use a CPU-backed timestamp mapping and simulated fences. Native Windows driver behavior, enabled-sampler overhead and gameplay frame times remain unmeasured. Both the inline late path and the separate published sender publish their confirmed signals. The existing sender FIFO and inline gate order work on the same fence timeline. The standalone GPU and combined workspace test targets type-checked for Windows x64 MSVC with diagnostics and pure-Rust BLAKE3. The Linux host used a metadata-only mimalloc declaration. Both staged source files passed asset policy.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 05:21:56 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/27/head:github-bot/gh-27'
git switch 'github-bot/gh-27'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-27'
git switch 'github-bot/gh-27'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-27'
git switch 'github-bot/gh-27'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-27'
git switch 'main'
git merge --squash 'github-bot/gh-27'
git switch 'main'
git merge --ff-only 'github-bot/gh-27'
git switch 'main'
git merge 'github-bot/gh-27'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.