GPU: find the position input once per CPU rectangle batch #3705

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

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


The CPU rectangle fallback uses the first in-stride float input with two or more components to identify the right-angle corner. Find that input once for the batch. Each rectangle still reads its own coordinates and reconstructs the same fourth vertex.

An optimized Windows x64 test compared the exact old and new expansion functions with the same right-angle routine. All bytes matched for 4,096 generated rectangles in each of five layouts, including F32, F16 and the fallback without a position input. The test also checked incomplete buffer tails.

Across nine alternating pairs, the five layouts took 1.6–5.5% less time per rectangle at batch size 1,024 and 2.8–6.2% less time at batch size 4,096. Single-rectangle results ranged from 3.8% faster to 4.7% slower. These timings cover the CPU expansion step. All nine primitive tests, both GPU Clippy configurations 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:5538809761 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3705). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T09:38:27Z. --- The CPU rectangle fallback uses the first in-stride float input with two or more components to identify the right-angle corner. Find that input once for the batch. Each rectangle still reads its own coordinates and reconstructs the same fourth vertex. An optimized Windows x64 test compared the exact old and new expansion functions with the same right-angle routine. All bytes matched for 4,096 generated rectangles in each of five layouts, including F32, F16 and the fallback without a position input. The test also checked incomplete buffer tails. Across nine alternating pairs, the five layouts took 1.6–5.5% less time per rectangle at batch size 1,024 and 2.8–6.2% less time at batch size 4,096. Single-rectangle results ranged from 3.8% faster to 4.7% slower. These timings cover the CPU expansion step. All nine primitive tests, both GPU Clippy configurations 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 09:41:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T09:41:53Z.


Both Clippy steps and all nine primitive tests passed in Windows CI on c0f8f5d. The workspace test step failed in frame::tests::waits_end_on_ticks_and_count_frames at frame.rs:231, where the zero-timeout poll returned S_OK instead of S_FALSE. The comparison in #2877 recorded the same failure on main. Could a maintainer rerun the failed check?

The local exact-source comparison and both Clippy configurations also passed.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7237406965 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3705#issuecomment-7237406965). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T09:41:53Z. --- Both Clippy steps and all nine primitive tests passed in [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46131418745/job/140937184922) on `c0f8f5d`. The workspace test step failed in `frame::tests::waits_end_on_ticks_and_count_frames` at `frame.rs:231`, where the zero-timeout poll returned `S_OK` instead of `S_FALSE`. [The comparison in #2877](https://github.com/Marvisak/VIctory/pull/2877#issuecomment-7223291370) recorded the same failure on main. Could a maintainer rerun the failed check? The local exact-source comparison and both Clippy configurations also passed. 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/3705:upstream-pr/3705'
git switch 'upstream-pr/3705'

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