Game: collect wanted pipeline state hashes in one pass #3700

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3700 into main
andrewpozdnakov7-jpg commented 2026-11-28 08:55:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:55:17Z.


Named::find currently traverses the graphics records once for each of the depth/stencil, rasterizer and blend hash sets. Collect all three in one pass and reserve the sets from the record count. The rest of state naming uses the same hashes and ordering.

In optimized Windows tests with 25,003 generated records, the three sets matched exactly. Across 31 alternating pairs, collection took 3.85 ms on main and 2.53 ms with this change when most records reused hashes, and 5.07 ms and 3.79 ms when every record used distinct hashes. The mixed fixture's full Named::find took 151.19 ms and 149.46 ms over nine alternating pairs, with identical state bytes and source labels. These are prebuild timings from generated inputs.

All 15 victory-game tests, strict Clippy and asset policy passed.

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:5538497045 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3700). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T08:55:17Z. --- `Named::find` currently traverses the graphics records once for each of the depth/stencil, rasterizer and blend hash sets. Collect all three in one pass and reserve the sets from the record count. The rest of state naming uses the same hashes and ordering. In optimized Windows tests with 25,003 generated records, the three sets matched exactly. Across 31 alternating pairs, collection took 3.85 ms on main and 2.53 ms with this change when most records reused hashes, and 5.07 ms and 3.79 ms when every record used distinct hashes. The mixed fixture's full `Named::find` took 151.19 ms and 149.46 ms over nine alternating pairs, with identical state bytes and source labels. These are prebuild timings from generated inputs. All 15 `victory-game` tests, strict Clippy and asset policy passed. 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 08:58:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T08:58:26Z.


Windows CI passed on 9780f06, including both Clippy configurations and the workspace tests. The three wanted sets matched exactly on 25,003 generated records. The collection step took 3.85 to 2.53 ms with repeated hashes and 5.07 to 3.79 ms with distinct hashes. The full mixed Named::find fixture returned the same state bytes and source labels.

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 the change into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7236929716 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3700#issuecomment-7236929716). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T08:58:26Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46128039441/job/140926892037) passed on `9780f06`, including both Clippy configurations and the workspace tests. The three wanted sets matched exactly on 25,003 generated records. The collection step took 3.85 to 2.53 ms with repeated hashes and 5.07 to 3.79 ms with distinct hashes. The full mixed `Named::find` fixture returned the same state bytes and source labels. 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 the change into another commit. AI-assisted with OpenAI Codex.
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/3700:upstream-pr/3700'
git switch 'upstream-pr/3700'

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