GPU: reuse scratch storage for pipeline input descriptions #3690

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3690 into main
andrewpozdnakov7-jpg commented 2026-11-28 07:15:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T07:15:38Z.


Graphics pipeline descriptions now reuse a scratch string for the input elements and write each entry directly to the existing debug list. This preserves the order and escaping in the text that feeds the pipeline library key.

I compared the exact old and new description routines and the resulting hashes over 1,024 generated layouts, including control characters and non-ASCII semantic names. The descriptions and hashes matched. With 16 elements the fixture counted 61 to 14 allocations or reallocations per description, and with 32 it counted 112 to 14. In 11 alternating CPU measurements, the medians were 35.3 to 28.2 µs at 16 elements and 53.3 to 40.7 µs at 32. This measures description formatting outside pipeline creation.

The committed test checks order and escaping. All five pipeline-host tests, strict GPU Clippy and the asset policy passed. The optional prebuild marker includes the host pipeline source in its fingerprint and is refreshed on the next prebuild.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5537781696 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3690). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T07:15:38Z. --- Graphics pipeline descriptions now reuse a scratch string for the input elements and write each entry directly to the existing debug list. This preserves the order and escaping in the text that feeds the pipeline library key. I compared the exact old and new description routines and the resulting hashes over 1,024 generated layouts, including control characters and non-ASCII semantic names. The descriptions and hashes matched. With 16 elements the fixture counted 61 to 14 allocations or reallocations per description, and with 32 it counted 112 to 14. In 11 alternating CPU measurements, the medians were 35.3 to 28.2 µs at 16 elements and 53.3 to 40.7 µs at 32. This measures description formatting outside pipeline creation. The committed test checks order and escaping. All five pipeline-host tests, strict GPU Clippy and the asset policy passed. The optional prebuild marker includes the host pipeline source in its fingerprint and is refreshed on the next prebuild. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 07:18:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T07:18:48Z.


Windows CI passed at f7e419b, including Clippy on both build configurations and the repository test job. The 1,024 generated description and key comparisons in the description apply to this head. Four sample masks still produced distinct cache keys in the combined test with #1866.

The next step is maintainer review.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding this change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7235853473 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3690#issuecomment-7235853473). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T07:18:48Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46120378748/job/140903355391) passed at `f7e419b`, including Clippy on both build configurations and the repository test job. The 1,024 generated description and key comparisons in the description apply to this head. Four sample masks still produced distinct cache keys in the [combined test with #1866](https://github.com/Marvisak/VIctory/pull/1866#issuecomment-7235849389). The next step is maintainer review. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding this change into another commit. AI-assisted with OpenAI Codex.
cloph-dsp commented 2026-11-28 11:15:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T11:15:05Z.


Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #3690 at head f7e419b19b3e2f9308351043123c18aeb7e42034, base/parent 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • cargo test --locked -p victory-gpu --lib -- pipeline::host::tests::pipeline_description_keeps_input_order_and_escaping --exact --test-threads=1 --quiet → 1 passed, 0 failed, 232 filtered, exit 0 (2 pre-existing warnings in the lib test build).
  • git grep -F for the test name on the base returned no match (test is new on this PR); git diff --check 63bcca4 HEAD clean (1 file, +47/-11).
  • Used a per-worktree CARGO_TARGET_DIR (never shared) with CARGO_BUILD_JOBS=2.
  • Only the named synthetic test was replayed; full workspace suite and clippy were not run locally.
  • GPU/driver: N/A (CPU-only pipeline-description test). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7238426714 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3690#issuecomment-7238426714). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T11:15:05Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #3690 at head `f7e419b19b3e2f9308351043123c18aeb7e42034`, base/parent `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - `cargo test --locked -p victory-gpu --lib -- pipeline::host::tests::pipeline_description_keeps_input_order_and_escaping --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 232 filtered, exit 0 (2 pre-existing warnings in the lib test build). - `git grep -F` for the test name on the base returned no match (test is new on this PR); `git diff --check 63bcca4 HEAD` clean (1 file, +47/-11). - Used a per-worktree `CARGO_TARGET_DIR` (never shared) with `CARGO_BUILD_JOBS=2`. - Only the named synthetic test was replayed; full workspace suite and clippy were not run locally. - GPU/driver: N/A (CPU-only pipeline-description test). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
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/3690:upstream-pr/3690'
git switch 'upstream-pr/3690'

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/3690'
git switch 'upstream-pr/3690'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3690'
git switch 'upstream-pr/3690'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3690'
git switch 'main'
git merge --squash 'upstream-pr/3690'
git switch 'main'
git merge --ff-only 'upstream-pr/3690'
git switch 'main'
git merge 'upstream-pr/3690'
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!3690
No description provided.