GPU timing: stop the last sample at the untimed tail #3622

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3622 into main
andrewpozdnakov7-jpg commented 2026-11-27 23:01:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:01:30Z.


The timestamp heap has 4,096 slots for up to 4,095 command intervals. On longer lists, the last sampled interval used to end at list close. The report then put the work from the untimed tail under the last sampled command's name.

Take the terminal timestamp when the first untimed command is noted. When the whole list fits, take it at close as before.

I tested lists with 0, 1, 4,095, 4,096 and 4,098 notes on Windows with app-local WARP 1.0.22 and D3D12 Agility 1.620.2. Each list performed a 1 MiB synthetic copy bracketed by a separate query heap. On 63bcca4, the last sample included that copy for both oversize lists. With this change it ends before the copy, and the three controls still end after the copy. All copies returned the expected bytes.

Coordination claim

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5534197190 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3622). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T23:01:30Z. --- The timestamp heap has 4,096 slots for up to 4,095 command intervals. On longer lists, the last sampled interval used to end at list close. The report then put the work from the untimed tail under the last sampled command's name. Take the terminal timestamp when the first untimed command is noted. When the whole list fits, take it at close as before. I tested lists with 0, 1, 4,095, 4,096 and 4,098 notes on Windows with app-local WARP 1.0.22 and D3D12 Agility 1.620.2. Each list performed a 1 MiB synthetic copy bracketed by a separate query heap. On `63bcca4`, the last sample included that copy for both oversize lists. With this change it ends before the copy, and the three controls still end after the copy. All copies returned the expected bytes. [Coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7229688815) AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-27 23:02:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:02:22Z.


On app-local WARP 1.0.22 with D3D12 Agility 1.620.2, a separate query heap bracketed each 1 MiB copy. At 4,096 and 4,098 notes, the original terminal timestamp fell after the copy. On f6989c6 it falls before the copy, with 4,095 samples in both cases. At 0, 1 and 4,095 notes the endpoint still falls after the copy. Readback matched in all five cases.

The diagnostics GPU suite passed 246 repository tests and one SDK identity check, with one ignored test. Both strict Clippy configurations and the asset policy passed. Windows CI for this head

Please keep the Git author on a cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if this work is folded into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7229821220 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3622#issuecomment-7229821220). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T23:02:22Z. --- On app-local WARP 1.0.22 with D3D12 Agility 1.620.2, a separate query heap bracketed each 1 MiB copy. At 4,096 and 4,098 notes, the original terminal timestamp fell after the copy. On `f6989c6` it falls before the copy, with 4,095 samples in both cases. At 0, 1 and 4,095 notes the endpoint still falls after the copy. Readback matched in all five cases. The diagnostics GPU suite passed 246 repository tests and one SDK identity check, with one ignored test. Both strict Clippy configurations and the asset policy passed. [Windows CI for this head](https://github.com/Marvisak/VIctory/actions/runs/46080096415/job/140776825466) Please keep the Git author on a cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if this work is folded into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-27 23:17:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:17:10Z.


#3622 at f6989c6 and #3313 at 7592bb4 both touch the note-recording hunk. The resolved branch keeps #3313's timing-only note path and #3622's terminal timestamp at the first untimed note. The merge preserves both heads on 63bcca4. Integration branch bc29b83

I reused one command list across four submissions, resetting it between runs. A separate query heap bracketed a 1 MiB synthetic copy. On #3313 alone and on the combined branch, the GPU summary counted 4,095, 2, 4,095 and 4,095 commands for 4,096, 2, 4,098 and 4,095 notes. On #3313 alone all four endpoints fell after the copy. On the merge, the endpoints for both oversized lists fell before the copy. The two shorter lists still ended after it, including the short list immediately after a reset. Every readback byte matched.

The combined result passed with DRED off and on, using app-local WARP 1.0.22 and Agility 1.620.2. The existing #3313 timing fixture also passed (2 / 4 / 4 commands). The diagnostics GPU library suite passed 246 tests with three ignored. The reset probe stayed local. AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7230021911 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3622#issuecomment-7230021911). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T23:17:10Z. --- #3622 at `f6989c6` and #3313 at `7592bb4` both touch the note-recording hunk. The resolved branch keeps #3313's timing-only note path and #3622's terminal timestamp at the first untimed note. The merge preserves both heads on `63bcca4`. [Integration branch `bc29b83`](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/gpu-timing-tail-single-list) I reused one command list across four submissions, resetting it between runs. A separate query heap bracketed a 1 MiB synthetic copy. On #3313 alone and on the combined branch, the GPU summary counted 4,095, 2, 4,095 and 4,095 commands for 4,096, 2, 4,098 and 4,095 notes. On #3313 alone all four endpoints fell after the copy. On the merge, the endpoints for both oversized lists fell before the copy. The two shorter lists still ended after it, including the short list immediately after a reset. Every readback byte matched. The combined result passed with DRED off and on, using app-local WARP 1.0.22 and Agility 1.620.2. The existing #3313 timing fixture also passed (2 / 4 / 4 commands). The diagnostics GPU library suite passed 246 tests with three ignored. The reset probe stayed local. AI-assisted with Codex.
akimfomin commented 2026-11-28 02:00:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by akimfomin on 2026-11-28T02:00:20Z.


KLBF #14 keeps missing frame counts distinct from zero. A related test for the untimed tail would have two valid intervals, a missing observation, then a known timestamp with no completed sample. The tail must not turn into a zero interval or elongate the modeled sample. The CPU check I ran covers the count fields only, not GPU timing.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7232062629 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3622#issuecomment-7232062629). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-28T02:00:20Z. --- [KLBF #14](https://github.com/PastiiJay/klbf-lab/pull/14) keeps missing frame counts distinct from zero. A related test for the untimed tail would have two valid intervals, a missing observation, then a known timestamp with no completed sample. The tail must not turn into a zero interval or elongate the modeled sample. The CPU check I ran covers the count fields only, not GPU timing.
andrewpozdnakov7-jpg commented 2026-11-28 02:07:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T02:07:29Z.


I resolved the HostList::note overlap with #3313 in 75f42f9. It preserves both current heads. The integration records timing with DRED off and retains the timestamp at the start of the untimed tail.

I ran the exact note, close, slowest, and aggregation code against a CPU timestamp fixture with three query slots for two intervals. On 7592bb4, the second sample included the untimed tail and read 980 ms. On the merge it reads 15 ms. The first sample remains 10 ms. A failed readback and a known close timestamp with zero command intervals each produce an empty command list. With the failed readback, the single list still contributes its 20 ms of wall time and no command duration.

The old head passed three cases and failed the tail case. The integration passed all four. These are deterministic CPU checks with simulated query data. The original #3622 Windows WARP run covers the production 4,096-slot cap.

Please preserve the Git author if cherry-picking or rebasing, or include this trailer if folding the change into another commit.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>

<!-- greyfinch-sync:Marvisak/VIctory:comment:7232147172 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3622#issuecomment-7232147172). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T02:07:29Z. --- I resolved the `HostList::note` overlap with #3313 in [75f42f9](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/75f42f9fe3bd38b790610681037a3516721f54ff). It preserves both current heads. The integration records timing with DRED off and retains the timestamp at the start of the untimed tail. I ran the exact `note`, `close`, `slowest`, and aggregation code against a CPU timestamp fixture with three query slots for two intervals. On `7592bb4`, the second sample included the untimed tail and read 980 ms. On the merge it reads 15 ms. The first sample remains 10 ms. A failed readback and a known close timestamp with zero command intervals each produce an empty command list. With the failed readback, the single list still contributes its 20 ms of wall time and no command duration. The old head passed three cases and failed the tail case. The integration passed all four. These are deterministic CPU checks with simulated query data. The original #3622 Windows WARP run covers the production 4,096-slot cap. Please preserve the Git author if cherry-picking or rebasing, or include this trailer if folding the change into another commit. `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`
futurepro62 commented 2026-11-29 18:22:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-29T18:22:36Z.


Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head f6989c6 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 866 passed, 0 failed, 10 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7260432703 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3622#issuecomment-7260432703). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-29T18:22:36Z. --- Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `f6989c6` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **866 passed, 0 failed, 10 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3622:upstream-pr/3622'
git switch 'upstream-pr/3622'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3622'
git switch 'upstream-pr/3622'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3622'
git switch 'upstream-pr/3622'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3622'
git switch 'main'
git merge --squash 'upstream-pr/3622'
git switch 'main'
git merge --ff-only 'upstream-pr/3622'
git switch 'main'
git merge 'upstream-pr/3622'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!3622
No description provided.