Skip to content

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

Closed
CwWwWwW wants to merge 1 commit into
fxceless:mainfrom
CwWwWwW:fix/lower-tests-below-asset-limit
Closed

CwWwWwW wants to merge 1 commit into
fxceless:mainfrom
CwWwWwW:fix/lower-tests-below-asset-limit

Conversation

@CwWwWwW

@CwWwWwW CwWwWwW commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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.

…icy's 512 KiB limit

`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,
fxceless#1320 and fxceless#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.
@CwWwWwW

CwWwWwW commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

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

CwWwWwW commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

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.

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