GPU: keep first-used pipelines in the early-start list #3565

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 17:58 UTC · original
andrewpozdnakov7-jpg:codex2/early-pipeline-order → main · +79 −16 · 1 files · 1 commits · open

early-pipelines.txt tells VIctory which pipelines to start compiling during the next load. When one run uses more than 8,192 distinct pipelines, the current save selects an arbitrary 8,192 from a hash set. A pipeline used in the first frame can fall off the list during a long session.

Keep the first 8,192 distinct keys in the order they were recorded. Repeated keys keep their original positions. When the current run uses fewer keys, the remaining slots still go to keys from previous runs in saved order. The early-list file format stays compatible. The existing prebuilt index tag includes this source file, so the next warm-up will recheck its entries.

The synthetic regression records 8,320 distinct keys with duplicates, saves the list and reads it back. In five control runs on main 63bcca4, 125–127 of the first 8,192 keys were absent. With the patch, all 8,192 survive in order. This checks cache selection. I did not time a game launch.

All 12 focused library tests passed. With app-local Agility and WARP, 247 repository GPU tests plus the temporary SDK module check passed, with 1 ignored. Both strict GPU Clippy configurations and the asset policy passed.

Coordination claim

AI-assisted with Codex. Please retain the Git author on cherry-pick or rebase. If you fold this into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 17:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/3565) `andrewpozdnakov7-jpg:codex2/early-pipeline-order` → `main` · +79 −16 · 1 files · 1 commits · open `early-pipelines.txt` tells VIctory which pipelines to start compiling during the next load. When one run uses more than 8,192 distinct pipelines, the current save selects an arbitrary 8,192 from a hash set. A pipeline used in the first frame can fall off the list during a long session. Keep the first 8,192 distinct keys in the order they were recorded. Repeated keys keep their original positions. When the current run uses fewer keys, the remaining slots still go to keys from previous runs in saved order. The early-list file format stays compatible. The existing prebuilt index tag includes this source file, so the next warm-up will recheck its entries. The synthetic regression records 8,320 distinct keys with duplicates, saves the list and reads it back. In five control runs on `main` `63bcca4`, 125–127 of the first 8,192 keys were absent. With the patch, all 8,192 survive in order. This checks cache selection. I did not time a game launch. All 12 focused library tests passed. With app-local Agility and WARP, 247 repository GPU tests plus the temporary SDK module check passed, with 1 ignored. Both strict GPU Clippy configurations and the asset policy passed. [Coordination claim](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633) AI-assisted with Codex. Please retain the Git author on cherry-pick or rebase. If you fold this into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 18:03:50 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 18:02 UTC · original

Windows CI passed on f3a0522.

The regression used 8,320 synthetic pipeline keys, recorded each twice, and checked the list after reading it back. Five control runs on 63bcca4 lost 125–127 of the first 8,192 keys. The patch kept all 8,192 in first-use order. The existing tests also confirmed that keys from earlier runs still fill spare slots in their saved order.

The next step is maintainer review. A game-startup timing comparison would be separate evidence for the effect on load time. If reusing the change, please retain the Git author, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding it into another commit.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 18:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/3565#issuecomment-7225047795) [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46045900327/job/140664981041) passed on `f3a0522`. The regression used 8,320 synthetic pipeline keys, recorded each twice, and checked the list after reading it back. Five control runs on `63bcca4` lost 125–127 of the first 8,192 keys. The patch kept all 8,192 in first-use order. The existing tests also confirmed that keys from earlier runs still fill spare slots in their saved order. The next step is maintainer review. A game-startup timing comparison would be separate evidence for the effect on load time. If reusing the change, please retain the Git author, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding it into another commit.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 18:27 UTC · original

Independent verification of #3565 at head f3a05225a93345d024890175669fb068618f5805, base 63bcca43c6a00a758510398fa43096ce7e4f7df0. AI-assisted: verification by Claude Code (Claude Sonnet 5.5).

Environment: Windows 11 build 26200, WARP d3d10warp.dll 10.0.26100.9818 (no physical GPU), VICTORY_WARP=1 and VICTORY_D3D12_WARP=1, Windows SDK 10.0.26100 dxil.dll.

Ran cargo test -p victory-gpu --lib --features diagnostics --locked -- --test-threads=1:

  • base: 246 passed, 0 failed, 1 ignored
  • head: 247 passed, 0 failed, 1 ignored (the one new test is a_full_current_run_keeps_pipelines_used_at_startup; the two reworked tests also pass)
  • cargo clippy -p victory-gpu --all-targets --features diagnostics --locked -- -D warnings: clean on base and on head

Control: I ported the new test's scenario to the base API (8,320 keys inserted into now, list(), read back, count the first 8,192 keys missing). It fails on base ("startup keys lost") and the real test passes on head.

Review: I found no correctness problem. note stops at EARLY_MAX first-use keys and ignores repeats. list() returns them in first-use order, then fills from earlier runs only up to the cap. I checked the full-cap early return, the duplicate key path and the empty-before path. The reworked tests still cover the earlier-run fill and the ordering across saves. This was a code and unit-test check only. I did not measure startup behaviour.

**@⁠oni-swr** on GitHub · 2026-11-27 18:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3565#issuecomment-7225507222) Independent verification of #3565 at head `f3a05225a93345d024890175669fb068618f5805`, base `63bcca43c6a00a758510398fa43096ce7e4f7df0`. AI-assisted: verification by Claude Code (Claude Sonnet 5.5). Environment: Windows 11 build 26200, WARP d3d10warp.dll 10.0.26100.9818 (no physical GPU), `VICTORY_WARP=1` and `VICTORY_D3D12_WARP=1`, Windows SDK 10.0.26100 dxil.dll. Ran `cargo test -p victory-gpu --lib --features diagnostics --locked -- --test-threads=1`: - base: 246 passed, 0 failed, 1 ignored - head: 247 passed, 0 failed, 1 ignored (the one new test is `a_full_current_run_keeps_pipelines_used_at_startup`; the two reworked tests also pass) - `cargo clippy -p victory-gpu --all-targets --features diagnostics --locked -- -D warnings`: clean on base and on head Control: I ported the new test's scenario to the base API (8,320 keys inserted into `now`, `list()`, read back, count the first 8,192 keys missing). It fails on base ("startup keys lost") and the real test passes on head. Review: I found no correctness problem. `note` stops at `EARLY_MAX` first-use keys and ignores repeats. `list()` returns them in first-use order, then fills from earlier runs only up to the cap. I checked the full-cap early return, the duplicate key path and the empty-`before` path. The reworked tests still cover the earlier-run fill and the ordering across saves. This was a code and unit-test check only. I did not measure startup behaviour.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-27 18:32 UTC · original

Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC.

  • PR head: f3a05225a93345d024890175669fb068618f5805, merge base 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • Command: cargo test --locked -p victory-gpu --lib -- pipeline::library::tests::a_full_current_run_keeps_pipelines_used_at_startup --exact --test-threads=1 --quiet
  • Result: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 232 filtered out, exit 0.
  • Negative control: git grep -F -c a_full_current_run_keeps_pipelines_used_at_startup 63bcca43 -- . → exit 1 / 0 hits (test genuinely new); present on PR head.
  • git diff --check 63bcca43 HEAD → exit 0.
  • Caveat: only the named in-memory pipeline-library test was replayed; no D3D12 device or full crate suite.
  • GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved.
  • AI-assisted: Hy4 flash.
**@⁠cloph-dsp** on GitHub · 2026-11-27 18:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/3565#issuecomment-7225597680) Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC. - PR head: `f3a05225a93345d024890175669fb068618f5805`, merge base `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - Command: `cargo test --locked -p victory-gpu --lib -- pipeline::library::tests::a_full_current_run_keeps_pipelines_used_at_startup --exact --test-threads=1 --quiet` - Result: `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 232 filtered out`, exit 0. - Negative control: `git grep -F -c a_full_current_run_keeps_pipelines_used_at_startup 63bcca43 -- .` → exit 1 / 0 hits (test genuinely new); present on PR head. - `git diff --check 63bcca43 HEAD` → exit 0. - Caveat: only the named in-memory pipeline-library test was replayed; no D3D12 device or full crate suite. - GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved. - AI-assisted: Hy4 flash.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-27 21:54 UTC · original

NVIDIA full-suite run, to go with the reports above by cloph-dsp, oni-swr, since none of them names a GPU run. Tested exact head f3a0522 (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: 867 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: a_full_current_run_keeps_pipelines_used_at_startup.
  • --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.
**@⁠futurepro62** on GitHub · 2026-11-27 21:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/3565#issuecomment-7228862681) NVIDIA full-suite run, to go with the reports above by cloph-dsp, oni-swr, since none of them names a GPU run. Tested exact head `f3a0522` (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`: **867 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `a_full_current_run_keeps_pipelines_used_at_startup`. - `--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 can be merged automatically.
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/3565/head:github-bot/gh-3565'
git switch 'github-bot/gh-3565'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3565'
git switch 'github-bot/gh-3565'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3565'
git switch 'github-bot/gh-3565'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3565'
git switch 'main'
git merge --squash 'github-bot/gh-3565'
git switch 'main'
git merge --ff-only 'github-bot/gh-3565'
git switch 'main'
git merge 'github-bot/gh-3565'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3565
No description provided.