Game: skip duplicate depth register candidates #3724

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

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


Skip two repeated depth/stencil candidates in the register search. A disabled stencil with stored FF/FF masks already emits those bytes, and the front-only candidate repeats the first one when the back face is already off. The same first occurrence remains in each case. The two possible face pairs fit in a fixed array.

In 3,840 generated register combinations, the original 126,720 outputs contained 120,252 distinct rows per record. The new output matched the first-occurrence sequence exactly. The pipeline naming consumer removes a hash when it finds a match, so skipping a repeated row preserves the selected bytes and ordering.

An optimized Windows fixture that hashes every emitted row used 16 balanced timing pairs. The two duplicate-heavy cases emitted 32 rows instead of 64. Disabled stencil with default masks took 1.23 → 0.65 µs, and enabled stencil with an already-off back face took 1.50 → 0.68 µs. The two controls with genuinely different masks or faces still emitted 64 rows.

All 15 game 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:5539861851 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3724). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T11:55:28Z. --- Skip two repeated depth/stencil candidates in the register search. A disabled stencil with stored `FF/FF` masks already emits those bytes, and the front-only candidate repeats the first one when the back face is already off. The same first occurrence remains in each case. The two possible face pairs fit in a fixed array. In 3,840 generated register combinations, the original 126,720 outputs contained 120,252 distinct rows per record. The new output matched the first-occurrence sequence exactly. The pipeline naming consumer removes a hash when it finds a match, so skipping a repeated row preserves the selected bytes and ordering. An optimized Windows fixture that hashes every emitted row used 16 balanced timing pairs. The two duplicate-heavy cases emitted 32 rows instead of 64. Disabled stencil with default masks took 1.23 → 0.65 µs, and enabled stencil with an already-off back face took 1.50 → 0.68 µs. The two controls with genuinely different masks or faces still emitted 64 rows. All 15 game 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 11:59:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T11:59:28Z.


The exact 97f1f0c head passed Windows CI, including the workspace tests and both Clippy configurations. Across 3,840 generated register states, it preserved the order of all first occurrences. The two measured duplicate-heavy cases emitted 32 rows instead of 64. The distinct-mask and distinct-face controls still emitted all 64 rows.

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:7238916460 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3724#issuecomment-7238916460). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T11:59:28Z. --- The exact `97f1f0c` head passed [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46142149095/job/140970221669), including the workspace tests and both Clippy configurations. Across 3,840 generated register states, it preserved the order of all first occurrences. The two measured duplicate-heavy cases emitted 32 rows instead of 64. The distinct-mask and distinct-face controls still emitted all 64 rows. 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/3724:upstream-pr/3724'
git switch 'upstream-pr/3724'

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