Move host.rs's and lower.rs's test modules to their own files, under the asset policy's 512 KiB limit #1357

Open
fxceless wants to merge 1 commit from upstream-pr/1357 into main
fxceless commented 2026-11-26 18:08:13 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by fxceless on 2026-11-26T18:08:13Z.


Requested by ELEVEN · project thread

Problem

The check job fails on main (#1342): cargo xtask policy reports

POLICY: crates/victory-gpu/src/host.rs: 528954 bytes exceeds the 524288-byte limit
POLICY: crates/victory-shader/src/emit/lower.rs: 535588 bytes exceeds the 524288-byte limit

Change

Only #[cfg(test)] modules move. Each one moves verbatim apart from losing one level of indentation, and the lines inside multi-line raw strings are left untouched. Module names and paths (host::tests, emit::lower::tests, ...) stay the same, so use super::... and every test name are unchanged. No non-test code changes.

  • host.rs: its eight test modules (tests, relay_tests, grouped_tests, late_tests, trail, spare, batch, queue2_tests) move to crates/victory-gpu/src/host/<name>.rs, the same layout profile.rs / profile/tests.rs already use. The size goes from 528,954 to 492,495 bytes.
  • lower.rs: mod tests moves to emit/lower_tests.rs, declared with #[path = "lower_tests.rs"] the way #1322 does it. The size goes from 535,588 to 512,559 bytes. #1322 has conflicts with main now, so this redoes its move on current main and would replace it.

Tests

  • I put each file back together from the new pieces and compared it with HEAD: the code is identical apart from whitespace, and all 1,958 string literals are byte-for-byte the same.
  • cargo xtask policy: 232 files ok.
  • cargo test -p xtask --locked: 5 passed, including repository_passes_policy.
  • cargo test -p victory-shader --lib --locked lower::tests: 14 passed, 1 ignored. That test was ignored before the move too.
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings was clean, both with and without --all-features. I ran it from Linux with CARGO_FEATURE_PURE=1 so blake3 builds without MSVC.
  • I could not run the victory-gpu tests here because they need Windows. This PR's CI is their first run.

Note: lower.rs is about 11 KiB under the limit and grows quickly, so #1342's idea of a separate limit for .rs files is still worth deciding.

Fixes #1342.


Generated by Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:5515027784 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1357). Originally posted by [fxceless](https://github.com/fxceless) on 2026-11-26T18:08:13Z. --- <!-- claude-projects-attribution: {"github_login":"fxceless"} --> _Requested by **ELEVEN** · [project thread](https://claude.ai/code/project/chan_01X5mdrDBPSw6f8UR5PM4z8d?thread=cmsg_01X5mdrDBPSw6f8UR5PM4z8d9EGSEwCezh69gY9yymtEQm)_ ## Problem The `check` job fails on `main` (#1342): `cargo xtask policy` reports ``` POLICY: crates/victory-gpu/src/host.rs: 528954 bytes exceeds the 524288-byte limit POLICY: crates/victory-shader/src/emit/lower.rs: 535588 bytes exceeds the 524288-byte limit ``` ## Change Only `#[cfg(test)]` modules move. Each one moves verbatim apart from losing one level of indentation, and the lines inside multi-line raw strings are left untouched. Module names and paths (`host::tests`, `emit::lower::tests`, ...) stay the same, so `use super::...` and every test name are unchanged. No non-test code changes. - `host.rs`: its eight test modules (`tests`, `relay_tests`, `grouped_tests`, `late_tests`, `trail`, `spare`, `batch`, `queue2_tests`) move to `crates/victory-gpu/src/host/<name>.rs`, the same layout `profile.rs` / `profile/tests.rs` already use. The size goes from 528,954 to **492,495** bytes. - `lower.rs`: `mod tests` moves to `emit/lower_tests.rs`, declared with `#[path = "lower_tests.rs"]` the way #1322 does it. The size goes from 535,588 to **512,559** bytes. #1322 has conflicts with `main` now, so this redoes its move on current `main` and would replace it. ## Tests - I put each file back together from the new pieces and compared it with `HEAD`: the code is identical apart from whitespace, and all 1,958 string literals are byte-for-byte the same. - `cargo xtask policy`: **232 files ok**. - `cargo test -p xtask --locked`: 5 passed, including `repository_passes_policy`. - `cargo test -p victory-shader --lib --locked lower::tests`: 14 passed, 1 ignored. That test was ignored before the move too. - `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings` was clean, both with and without `--all-features`. I ran it from Linux with `CARGO_FEATURE_PURE=1` so blake3 builds without MSVC. - I could not run the victory-gpu tests here because they need Windows. This PR's CI is their first run. Note: `lower.rs` is about 11 KiB under the limit and grows quickly, so #1342's idea of a separate limit for `.rs` files is still worth deciding. Fixes #1342. --- _Generated by [Claude Code](https://claude.ai/code)_
Filip722 commented 2026-11-27 00:44:56 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T00:44:56Z.


I carried the existing host test split onto the current d154dcb1 base and preserved its authorship. The extracted bodies and the new deferred test were verified byte-for-byte. For the shader file, current main already moves out the lower tests, so the branch moves the intact buffer-lowering method to its own module. A separate test commit expresses the inherited IEEE comparison expectations through partial_cmp.

The full local asset policy passes for 240 files on 6a0bce34. The host and shader source files are 514,318 and 521,436 bytes. On the immediately preceding b1d777a integration, Windows-target GPU and shader Clippy passed with warnings denied, the focused suites passed, and the NaN shader test ran on the RTX 5060 Laptop under GE-Proton11-14. The old and new NaN reference functions also agreed in 1,498,176 comparisons. The two contributor PRs using this shared dependency passed full Windows CI on the latest base. Render-scale CI · Wine-fixture CI

Source for the rebase is available in my fork. Review branch

Assisted by Codex (GPT-6.2-Sol High).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7206719683 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1357#issuecomment-7206719683). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-27T00:44:56Z. --- I carried the existing host test split onto the current `d154dcb1` base and preserved its authorship. The extracted bodies and the new deferred test were verified byte-for-byte. For the shader file, current main already moves out the lower tests, so the branch moves the intact buffer-lowering method to its own module. A separate test commit expresses the inherited IEEE comparison expectations through `partial_cmp`. The full local asset policy passes for 240 files on `6a0bce34`. The host and shader source files are 514,318 and 521,436 bytes. On the immediately preceding `b1d777a` integration, Windows-target GPU and shader Clippy passed with warnings denied, the focused suites passed, and the NaN shader test ran on the RTX 5060 Laptop under GE-Proton11-14. The old and new NaN reference functions also agreed in 1,498,176 comparisons. The two contributor PRs using this shared dependency passed full Windows CI on the latest base. [Render-scale CI](https://github.com/fxceless/victory-fork/actions/runs/45918429413) · [Wine-fixture CI](https://github.com/fxceless/victory-fork/actions/runs/45918432798) Source for the rebase is available in my fork. [Review branch](https://github.com/Filip722/victory-fork/tree/review/ci-source-split-d154) Assisted by Codex (GPT-6.2-Sol High).
Filip722 commented 2026-11-27 07:38:19 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T07:38:19Z.


I updated the source-split review branch to main 9a9091d at 47d0ba29f6c06aee7f6c057b4c94c406daec9d40. It retains this proposal's source moves and places two additional GPU helpers in modules because the current host.rs exceeded the policy limit. It includes #1440's precedence fix and the warning-free NaN comparison oracle already in the review stack.

I tested the combination with #1442 on Windows MSVC. Both workspace Clippy modes passed with warnings denied, and the full asset scan passed all 246 files. Five pipeline-library tests, five scheduler tests, and the IEEE comparison fixture on the RTX 5060 under GE-Proton passed.

Assisted by Codex (GPT-6.2-Sol High).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7212669172 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1357#issuecomment-7212669172). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-27T07:38:19Z. --- I updated the [source-split review branch](https://github.com/Filip722/victory-fork/tree/review/ci-source-split-d154) to main `9a9091d` at `47d0ba29f6c06aee7f6c057b4c94c406daec9d40`. It retains this proposal's source moves and places two additional GPU helpers in modules because the current `host.rs` exceeded the policy limit. It includes #1440's precedence fix and the warning-free NaN comparison oracle already in the review stack. I tested the [combination with #1442](https://github.com/Filip722/victory-fork/tree/review/ci-name-lock-9a) on Windows MSVC. Both workspace Clippy modes passed with warnings denied, and the full asset scan passed all 246 files. Five pipeline-library tests, five scheduler tests, and the IEEE comparison fixture on the RTX 5060 under GE-Proton passed. Assisted by Codex (GPT-6.2-Sol High).
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/1357:upstream-pr/1357'
git switch 'upstream-pr/1357'

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