Shaders: lower.rs's tests move to their own file, under the asset policy's 512 KiB limit #1322

Closed
github-bot wants to merge 1 commit from github-bot/gh-1322 into main AGit
Owner

@⁠CwWwWwW on GitHub · 2026-11-26 15:07 UTC · original
CwWwWwW:fix/lower-tests-below-asset-limit → main · +604 −604 · 2 files · 1 commits · closed without merging

Problem

The check job fails on main, so every PR (including #1320 and #1321) inherits a red check: cargo xtask policy reports

POLICY: crates/victory-shader/src/emit/lower.rs: 526968 bytes exceeds the 524288-byte limit

The file crossed the repository's 512 KiB asset-policy limit in the last translator change (58de9bf). The policy is an allowlist for text files, so the fix is to keep the file under the limit rather than to add an exception.

Change

Move the inline #[cfg(test)] mod tests of lower.rs (602 lines, 14 tests) verbatim to crates/victory-shader/src/emit/lower_tests.rs, declared from lower.rs as:

#[cfg(test)]
#[path = "lower_tests.rs"]
mod tests;

lower.rs already uses #[path] for intersect.rs and halves.rs; emit/ keeps its other tests in their own files (diff_tests.rs, valu_tests.rs, ...). The module path (emit::lower::tests), the use super::... imports and every test name are unchanged; no non-test code moves or changes.

Sizes: lower.rs 526,968 -> 505,165 bytes; lower_tests.rs is new at 19,555 bytes.

Tests

  • cargo xtask policy: 222 files ok (was 1 violation) - this is the check that was failing.
  • cargo test -p xtask --locked: 5 passed, policy::tests::repository_passes_policy included.
  • cargo test -p victory-shader --lib --locked lower::tests: 13 passed, 1 ignored (the module's 14 tests; one was ignored before the move too).
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.
  • cargo clippy --workspace --all-targets --locked and cargo test --workspace --locked --exclude victory-gpu: running at the time of writing; I will report/update here if anything fails.
  • No game or GPU needed: this is a file move; the tests themselves are unchanged.

Once this lands, #1320 and #1321 can be rebased and their check job is expected to go green.

**@⁠CwWwWwW** on GitHub · 2026-11-26 15:07 UTC · [original](https://github.com/fxceless/victory-fork/pull/1322) `CwWwWwW:fix/lower-tests-below-asset-limit` → `main` · +604 −604 · 2 files · 1 commits · closed without merging ## Problem The `check` job fails on main, so every PR (including #1320 and #1321) inherits a red check: `cargo xtask policy` reports ``` POLICY: crates/victory-shader/src/emit/lower.rs: 526968 bytes exceeds the 524288-byte limit ``` The file crossed the repository's 512 KiB asset-policy limit in the last translator change (58de9bf). The policy is an allowlist for text files, so the fix is to keep the file under the limit rather than to add an exception. ## Change Move the inline `#[cfg(test)] mod tests` of `lower.rs` (602 lines, 14 tests) verbatim to `crates/victory-shader/src/emit/lower_tests.rs`, declared from `lower.rs` as: ```rust #[cfg(test)] #[path = "lower_tests.rs"] mod tests; ``` `lower.rs` already uses `#[path]` for `intersect.rs` and `halves.rs`; `emit/` keeps its other tests in their own files (`diff_tests.rs`, `valu_tests.rs`, ...). The module path (`emit::lower::tests`), the `use super::...` imports and every test name are unchanged; no non-test code moves or changes. Sizes: `lower.rs` 526,968 -> 505,165 bytes; `lower_tests.rs` is new at 19,555 bytes. ## Tests - `cargo xtask policy`: **222 files ok** (was 1 violation) - this is the check that was failing. - `cargo test -p xtask --locked`: **5 passed**, `policy::tests::repository_passes_policy` included. - `cargo test -p victory-shader --lib --locked lower::tests`: **13 passed, 1 ignored** (the module's 14 tests; one was ignored before the move too). - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: clean. - `cargo clippy --workspace --all-targets --locked` and `cargo test --workspace --locked --exclude victory-gpu`: running at the time of writing; I will report/update here if anything fails. - No game or GPU needed: this is a file move; the tests themselves are unchanged. Once this lands, #1320 and #1321 can be rebased and their `check` job is expected to go green.
`cargo xtask policy` rejects `crates/victory-shader/src/emit/lower.rs`:
the file grew past the 512 KiB limit (526,968 bytes) in the last
translator change, so the `check` job fails on main - and on every PR,
#1320 and #1321 included.

Move the inline `#[cfg(test)] mod tests` (602 lines, 14 tests) to
`crates/victory-shader/src/emit/lower_tests.rs` and declare it with
`#[cfg(test)] #[path = "lower_tests.rs"] mod tests;`. `lower.rs` already
uses `#[path]` for `intersect.rs` and `halves.rs`, and `emit/` keeps its
other test modules in their own files. The module path
(`emit::lower::tests`), the imports and the test names are unchanged; the
code moves as it is.

`lower.rs` is 505,165 bytes after the move; the new file is 19,555.
`cargo xtask policy`: 222 files ok; `cargo test -p xtask`: 5 passed,
`repository_passes_policy` among them; `cargo test -p victory-shader --lib
lower::tests`: 13 passed, 1 ignored; `cargo clippy -p victory-shader
--all-targets -- -D warnings`: clean.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:07:39 +00:00
Author
Owner

@⁠CwWwWwW on GitHub · 2026-11-26 15:09 UTC · original

Local CI-like validation on this branch:

  • cargo xtask policy: 222 files ok (the failing check).
  • cargo test -p xtask --locked: 5 passed, repository_passes_policy included.
  • cargo test -p victory-shader --lib --locked: 222 passed, 0 failed, 4 ignored (whole crate; lower::tests alone: 13 passed, 1 ignored, as before the move).
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean (39 s).
  • cargo test --workspace --locked --exclude victory-gpu cannot complete on this machine: victory-loader's loads_binds_and_calls_probe builds tests/fixtures/hle-probe with a nested cargo, and this machine has no MSVC toolchain (the repo pins x86_64-pc-windows-msvc; I use a GNU host as a fallback), so that nested fixture link fails. Environmental and unrelated to this move; the CI windows-latest job with MSVC is the authority.
**@⁠CwWwWwW** on GitHub · 2026-11-26 15:09 UTC · [original](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7195866984) Local CI-like validation on this branch: - `cargo xtask policy`: **222 files ok** (the failing check). - `cargo test -p xtask --locked`: **5 passed**, `repository_passes_policy` included. - `cargo test -p victory-shader --lib --locked`: **222 passed, 0 failed, 4 ignored** (whole crate; `lower::tests` alone: 13 passed, 1 ignored, as before the move). - `cargo clippy --workspace --all-targets --locked -- -D warnings`: **clean** (39 s). - `cargo test --workspace --locked --exclude victory-gpu` cannot complete on this machine: `victory-loader`'s `loads_binds_and_calls_probe` builds `tests/fixtures/hle-probe` with a nested cargo, and this machine has no MSVC toolchain (the repo pins `x86_64-pc-windows-msvc`; I use a GNU host as a fallback), so that nested fixture link fails. Environmental and unrelated to this move; the CI `windows-latest` job with MSVC is the authority.
Author
Owner

@⁠CwWwWwW on GitHub · 2026-11-26 15:23 UTC · original

CI-main-log evidence for this PR (run 45836860665, commit 58de9bf, job check): the Tests step is the only failing one and fails on exactly this: POLICY: crates/victory-shader/src/emit/lower.rs: 526968 bytes exceeds the 524288-byte limit -> policy::tests::repository_passes_policy ... FAILED. All other crates' tests listed in the log passed. So this branch removes the only failure that was keeping check red on main; once it lands, #1320/#1321/#1323 can be rebased and their checks are expected to go green.

**@⁠CwWwWwW** on GitHub · 2026-11-26 15:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7196202185) CI-main-log evidence for this PR (run 45836860665, commit 58de9bf, job `check`): the `Tests` step is the only failing one and fails on exactly this: `POLICY: crates/victory-shader/src/emit/lower.rs: 526968 bytes exceeds the 524288-byte limit` -> `policy::tests::repository_passes_policy ... FAILED`. All other crates' tests listed in the log passed. So this branch removes the only failure that was keeping `check` red on main; once it lands, #1320/#1321/#1323 can be rebased and their checks are expected to go green.
github-bot closed this pull request 2026-11-27 01:03:58 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.