Game: inline fixed-size pipeline state hashing #3732

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3732 into main
andrewpozdnakov7-jpg commented 2026-11-28 12:51:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T12:51:14Z.


Let city64 inline at pipeline-state call sites that already know the description's length. The compiler can specialize the length dispatch for those callers. The hash arithmetic and candidate sequence are unchanged.

An optimized Windows fixture ran the full Named::find on a generated pack with one known depth state, one known rasterizer state, and an unresolved blend hash. The recovered bytes and source labels matched on every run. Across eight alternating pairs of fresh processes, the median for ten searches fell from 1,259.79 ms to 1,016.99 ms. Every pair was faster, by 12.8%–23.9%.

Separate batches of 655,360 hashes for each compact size (16, 24 and 68 bytes) produced the same checksums. Isolated timings overlapped between builds. The measured change is for this pipeline-state search fixture. No end-to-end warm-up or launch timing was measured.

All 15 optimized game-crate tests, including the CityHash64 reference vectors, passed. Strict all-feature Clippy, the file formatting check, and the asset policy passed. #2658 adds reference coverage for the same hash.

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:5540297396 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3732). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T12:51:14Z. --- Let `city64` inline at pipeline-state call sites that already know the description's length. The compiler can specialize the length dispatch for those callers. The hash arithmetic and candidate sequence are unchanged. An optimized Windows fixture ran the full `Named::find` on a generated pack with one known depth state, one known rasterizer state, and an unresolved blend hash. The recovered bytes and source labels matched on every run. Across eight alternating pairs of fresh processes, the median for ten searches fell from 1,259.79 ms to 1,016.99 ms. Every pair was faster, by 12.8%–23.9%. Separate batches of 655,360 hashes for each compact size (16, 24 and 68 bytes) produced the same checksums. Isolated timings overlapped between builds. The measured change is for this pipeline-state search fixture. No end-to-end warm-up or launch timing was measured. All 15 optimized game-crate tests, including the CityHash64 reference vectors, passed. Strict all-feature Clippy, the file formatting check, and the asset policy passed. #2658 adds reference coverage for the same hash. 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 12:55:01 +00:00 (Migrated from github.com)

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


Windows CI passed on 94b4e7d, including the workspace tests and both Clippy configurations. The combined build with #2658 also passed all 336 reference comparisons and all 17 game-crate tests in both profiles. Combined result.

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:7239557748 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3732#issuecomment-7239557748). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T12:55:01Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46146706867/job/140984236029) passed on `94b4e7d`, including the workspace tests and both Clippy configurations. The combined build with #2658 also passed all 336 reference comparisons and all 17 game-crate tests in both profiles. [Combined result](https://github.com/Marvisak/VIctory/pull/2658#issuecomment-7239538514). 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/3732:upstream-pr/3732'
git switch 'upstream-pr/3732'

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