Skip to content

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

Open
andrewpozdnakov7-jpg wants to merge 1 commit into
Marvisak:mainfrom
andrewpozdnakov7-jpg:codex2/rectangle-position-layout
Open

andrewpozdnakov7-jpg wants to merge 1 commit into
Marvisak:mainfrom
andrewpozdnakov7-jpg:codex2/rectangle-position-layout

Conversation

@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor

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 <andrewpozdnakov7-jpg@users.noreply.github.com> if folding the change into another commit.

AI-assisted with OpenAI Codex.

@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant