Shaders: move lowerer unit tests to their own file #3797

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

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


Move the existing emit::lower::tests module into emit/lower/tests.rs. The production lowerer retains its source outside the test declaration. The moved tests keep their module and test names.

lower.rs drops from 520,563 to 468,293 bytes, leaving 55,995 bytes under the 524,288-byte per-file asset limit. The limit already blocks the exact head of #1924. This frees room for shader compatibility patches without moving production lowering routines. Recorded asset-policy failure

The before and after test inventories matched exactly for all 33 lowerer tests. All 33 passed, along with both strict shader Clippy configurations and the asset policy.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the move into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5544988704 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3797). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T22:01:00Z. --- Move the existing `emit::lower::tests` module into `emit/lower/tests.rs`. The production lowerer retains its source outside the test declaration. The moved tests keep their module and test names. `lower.rs` drops from 520,563 to 468,293 bytes, leaving 55,995 bytes under the 524,288-byte per-file asset limit. The limit already blocks the exact head of #1924. This frees room for shader compatibility patches without moving production lowering routines. [Recorded asset-policy failure](https://github.com/Marvisak/VIctory/pull/1924#issuecomment-7246183444) The before and after test inventories matched exactly for all 33 lowerer tests. All 33 passed, along with both strict shader Clippy configurations and the asset policy. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the move into another commit. AI-assisted with OpenAI Codex.
andrewpozdnakov7-jpg commented 2026-11-28 22:04:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T22:04:20Z.


Windows CI passed on 3a6d4dd, including both Clippy configurations and the workspace tests. The 33 lowerer test names match main, and all 33 passed in the local check. The production prefix of lower.rs is byte-identical. Its file size is now 468,293 bytes with 55,995 bytes of room under the per-file asset limit.

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:7246475592 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3797#issuecomment-7246475592). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T22:04:20Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46194484720/job/141132481645) passed on 3a6d4dd, including both Clippy configurations and the workspace tests. The 33 lowerer test names match main, and all 33 passed in the local check. The production prefix of lower.rs is byte-identical. Its file size is now 468,293 bytes with 55,995 bytes of room under the per-file asset limit. 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.
andrewpozdnakov7-jpg commented 2026-11-28 22:56:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T22:56:02Z.


I repeated the file-limit check with the current heads of #3617 (8bfad4c), #3717 (32a02eb), and #3803 (fda9900). The merge keeps nearest-even rounding in the dedicated transcendental path from #3717 and directed rounding in v_cvt_f16_f32 from #3803. The combined lower.rs is 524,553 bytes. The asset policy rejects it because the per-file limit is 524,288 bytes. #3717 author update

With #3797 at 3a6d4dd, the file drops to 472,283 bytes, leaving 52,005 bytes of room. The production code matches byte for byte, the same 33 lowerer tests all pass, and the asset policy passes for 192 files. Strict shader Clippy passed with default and all features. WARP 1.0.22 passed the 200 conversion readbacks, the existing modes 0 and 3 control, and all three rounding and NaN regressions from #3617/#3717.

Taking #3797 first avoids the size failure. The comparison branch preserves the original Git commits and merge parents. Please retain the Git authors on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding my changes into another commit. Comparison branch

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7247082670 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3797#issuecomment-7247082670). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T22:56:02Z. --- I repeated the file-limit check with the current heads of #3617 (`8bfad4c`), #3717 (`32a02eb`), and #3803 (`fda9900`). The merge keeps nearest-even rounding in the dedicated transcendental path from #3717 and directed rounding in `v_cvt_f16_f32` from #3803. The combined `lower.rs` is 524,553 bytes. The asset policy rejects it because the per-file limit is 524,288 bytes. [#3717 author update](https://github.com/Marvisak/VIctory/pull/3717#issuecomment-7246934135) With #3797 at `3a6d4dd`, the file drops to 472,283 bytes, leaving 52,005 bytes of room. The production code matches byte for byte, the same 33 lowerer tests all pass, and the asset policy passes for 192 files. Strict shader Clippy passed with default and all features. WARP 1.0.22 passed the 200 conversion readbacks, the existing modes 0 and 3 control, and all three rounding and NaN regressions from #3617/#3717. Taking #3797 first avoids the size failure. The comparison branch preserves the original Git commits and merge parents. Please retain the Git authors on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding my changes into another commit. [Comparison branch](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/3797-fp16-asset-limit) 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/3797:upstream-pr/3797'
git switch 'upstream-pr/3797'

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