Game: skip register packets for already named pipeline states #3698

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

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


Before reading a record's register image, check whether its depth/stencil or blend state still needs a name. Records whose hashes are already resolved now skip the register and format reads and the deduplication table. The existing matching path still handles either kind independently.

In an optimized Windows fixture with 25,003 generated records, 25,000 referred only to states supplied by the database. The other records supplied one depth state and one blend state and left a third hash unresolved. The full Named::find returned the same state bytes and source labels. Its median across nine alternating pairs was 141.44 ms on main and 128.35 ms with this change.

For the register matching step alone, fifteen alternating pairs measured 12.55 ms to 2.78 ms in the mixed fixture. In the control where every record repeats one still-unresolved packet, the precheck adds a lookup on each record and the median was 5.63 ms to 6.16 ms. Both checks use generated inputs. #2575 stops whole searches after the wanted hashes have been found, while this handles already named records even with unresolved hashes elsewhere.

All 15 game crate tests, strict Clippy and the 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:5538422479 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3698). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T08:44:52Z. --- Before reading a record's register image, check whether its depth/stencil or blend state still needs a name. Records whose hashes are already resolved now skip the register and format reads and the deduplication table. The existing matching path still handles either kind independently. In an optimized Windows fixture with 25,003 generated records, 25,000 referred only to states supplied by the database. The other records supplied one depth state and one blend state and left a third hash unresolved. The full Named::find returned the same state bytes and source labels. Its median across nine alternating pairs was 141.44 ms on main and 128.35 ms with this change. For the register matching step alone, fifteen alternating pairs measured 12.55 ms to 2.78 ms in the mixed fixture. In the control where every record repeats one still-unresolved packet, the precheck adds a lookup on each record and the median was 5.63 ms to 6.16 ms. Both checks use generated inputs. #2575 stops whole searches after the wanted hashes have been found, while this handles already named records even with unresolved hashes elsewhere. All 15 game crate tests, strict Clippy and the 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:47:38 +00:00 (Migrated from github.com)

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


Windows CI passed on 9dfdf6d, including both Clippy configurations and the workspace tests. On the generated 25,003-record mixed pack, Named::find returned identical depth, blend and raster maps and source labels. Median time was 141.44 ms on base and 128.35 ms with this change. The all-unresolved repeated-packet control was about 0.53 ms slower at the register stage.

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:7236814998 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3698#issuecomment-7236814998). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T08:47:38Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46127243935/job/140924465835) passed on `9dfdf6d`, including both Clippy configurations and the workspace tests. On the generated 25,003-record mixed pack, `Named::find` returned identical depth, blend and raster maps and source labels. Median time was 141.44 ms on base and 128.35 ms with this change. The all-unresolved repeated-packet control was about 0.53 ms slower at the register stage. 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/3698:upstream-pr/3698'
git switch 'upstream-pr/3698'

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