Asset policy: host test split, Rust-source ceiling, and v_cmp clippy fix (redo #1357/#1361) #1319

Closed
CwWwWwW wants to merge 3 commits from upstream-pr/1322 into main
CwWwWwW commented 2026-11-26 15:07:07 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-26T15:07:07Z.


Problem

main's check job is red before any PR code runs, so #1322 (and every other PR) cannot be green:

  • crates/victory-gpu/src/host.rs 559,917 B and crates/victory-shader/src/emit/lower.rs 544,888 B exceed the asset policy's 524,288-byte limit;
  • cargo clippy --workspace --all-targets -- -D warnings fails on crates/victory-shader/src/emit/valu_tests.rs for IEEE comparison expressions.

The original #1322 lower.rs test move is already in main (b1d777a), so rebasing the old branch is empty. This branch redoes the two abandoned policy PRs against current main and fixes the main clippy failure, as requested.

Change

  • host.rs tests: the ten #[cfg(test)] modules (38,156 B) move verbatim to crates/victory-gpu/src/host/*.rs, declared from host.rs with #[path]; no non-test code changes, same module paths/test names. host.rs is 522,365 B (under 512 KiB).
  • Rust-source ceiling: .rs files get a 2 MiB ceiling (MAX_SOURCE_FILE_SIZE) while other files keep MAX_FILE_SIZE = 512 KiB; magic-byte, NUL-byte and encoded-run guards are unchanged. Docs and policy tests updated. This redoes #1361.
  • Clippy: every_f32_comparison_answers_nans_as_ieee enumerates IEEE ordered/unordered answers including NaNs; clippy's double_comparisons/neg_cmp_op_on_partial_ord rewrites would change NaN answers, so the test allows those two lints with the reason. This clears main's current clippy failure.

Validation

  • cargo xtask policy: 241 files ok (was 2 violations).
  • cargo test -p xtask --locked: 6 passed, 0 failed (including policy::tests::repository_passes_policy and the new source-limit test).
  • cargo test -p victory-gpu --lib --locked: 238 passed, 0 failed, 6 ignored.
  • cargo test -p victory-shader --lib --locked: 243 passed, 0 failed, 16 ignored.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.
  • No game or GPU needed; only test-module moves and policy/lint changes.

Once this lands, #1333 (rebased onto it) can pass check without carrying unrelated policy changes.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5512469743 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-26T15:07:07Z. --- ## Problem `main`'s `check` job is red before any PR code runs, so #1322 (and every other PR) cannot be green: - `crates/victory-gpu/src/host.rs` 559,917 B and `crates/victory-shader/src/emit/lower.rs` 544,888 B exceed the asset policy's 524,288-byte limit; - `cargo clippy --workspace --all-targets -- -D warnings` fails on `crates/victory-shader/src/emit/valu_tests.rs` for IEEE comparison expressions. The original #1322 lower.rs test move is already in main (`b1d777a`), so rebasing the old branch is empty. This branch redoes the two abandoned policy PRs against current main and fixes the main clippy failure, as requested. ## Change - **host.rs tests:** the ten `#[cfg(test)]` modules (38,156 B) move verbatim to `crates/victory-gpu/src/host/*.rs`, declared from `host.rs` with `#[path]`; no non-test code changes, same module paths/test names. `host.rs` is 522,365 B (under 512 KiB). - **Rust-source ceiling:** `.rs` files get a 2 MiB ceiling (`MAX_SOURCE_FILE_SIZE`) while other files keep `MAX_FILE_SIZE = 512 KiB`; magic-byte, NUL-byte and encoded-run guards are unchanged. Docs and policy tests updated. This redoes #1361. - **Clippy:** `every_f32_comparison_answers_nans_as_ieee` enumerates IEEE ordered/unordered answers including NaNs; clippy's `double_comparisons`/`neg_cmp_op_on_partial_ord` rewrites would change NaN answers, so the test allows those two lints with the reason. This clears main's current clippy failure. ## Validation - `cargo xtask policy`: **241 files ok** (was 2 violations). - `cargo test -p xtask --locked`: **6 passed, 0 failed** (including `policy::tests::repository_passes_policy` and the new source-limit test). - `cargo test -p victory-gpu --lib --locked`: **238 passed, 0 failed, 6 ignored**. - `cargo test -p victory-shader --lib --locked`: **243 passed, 0 failed, 16 ignored**. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: clean. - No game or GPU needed; only test-module moves and policy/lint changes. Once this lands, #1333 (rebased onto it) can pass `check` without carrying unrelated policy changes.
CwWwWwW commented 2026-11-26 16:06:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-26T15:09:33Z.


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.
<!-- greyfinch-sync:fxceless/victory-fork:comment:7195866984 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7195866984). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-26T15:09:33Z. --- 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 commented 2026-11-26 16:06:38 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-26T15:23:33Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7196202185 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7196202185). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-26T15:23:33Z. --- 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 commented 2026-11-27 02:18:42 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T02:18:42Z.


I tried rebasing this branch onto current main (81d54b0), but the rebase produces an empty diff: the lower.rs test move already landed on main in commit b1d777a (it adds lower_tests.rs and changes lower.rs's tail to #[path = "lower_tests.rs"] mod tests;). Resolving the add/add conflict in lower_tests.rs with main's version leaves no commit, so I did not push an empty branch.

The policy failure on current main is now a different one: host.rs 559,917 B and lower.rs 544,888 B exceed 524,288 B because of non-test code added since; that is tracked in #1342 and the open #1357/#1361. This PR is superseded and cannot make the check green on its own; I recommend closing it (or repurposing its file-split if you want a fresh policy fix, but that would be a different change).

No branch update was pushed; the PR head is still 2ee6853.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7208012582 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7208012582). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-27T02:18:42Z. --- I tried rebasing this branch onto current `main` (`81d54b0`), but the rebase produces an **empty diff**: the lower.rs test move already landed on main in commit `b1d777a` (it adds `lower_tests.rs` and changes lower.rs's tail to `#[path = "lower_tests.rs"] mod tests;`). Resolving the add/add conflict in `lower_tests.rs` with main's version leaves no commit, so I did not push an empty branch. The policy failure on current main is now a different one: `host.rs` 559,917 B and `lower.rs` 544,888 B exceed 524,288 B because of non-test code added since; that is tracked in #1342 and the open #1357/#1361. This PR is superseded and cannot make the check green on its own; I recommend closing it (or repurposing its file-split if you want a fresh policy fix, but that would be a different change). No branch update was pushed; the PR head is still `2ee6853`.
CwWwWwW commented 2026-11-27 02:41:12 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T02:41:12Z.


Ready for review. This branch now redoes the abandoned #1357 and #1361 work against current main and also fixes main's current clippy failure, so the check has a chance to be green:

  • 02c62c9 GPU: host.rs's ten test modules move to crates/victory-gpu/src/host/*.rs via #[path] (no non-test changes; host.rs 522,365 B).
  • 73e19bb Policy: .rs source files get a 2 MiB ceiling (other files stay 512 KiB; magic/NUL/encoded-run guards unchanged) + docs/policy tests.
  • 374cb35 Shaders: allow the two clippy comparison lints on the IEEE v_cmp NaN test (clippy's rewrites would change NaN answers).

Local validation: cargo xtask policy 241 files ok; cargo test -p xtask 6 passed; cargo test -p victory-gpu --lib 238 passed; cargo test -p victory-shader --lib 243 passed; workspace clippy default and --all-features clean. CI run 45929521337 is in progress.

I could not add fxceless as a formal reviewer through the API (404 from the review-request endpoint for this fork PR), so this comment is the review request. Once this merges, #1333 can be rebased on top and should be green without unrelated policy commits.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7208343877 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7208343877). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-27T02:41:12Z. --- Ready for review. This branch now redoes the abandoned #1357 and #1361 work against current `main` and also fixes main's current clippy failure, so the check has a chance to be green: - `02c62c9` GPU: host.rs's ten test modules move to `crates/victory-gpu/src/host/*.rs` via `#[path]` (no non-test changes; host.rs 522,365 B). - `73e19bb` Policy: `.rs` source files get a 2 MiB ceiling (other files stay 512 KiB; magic/NUL/encoded-run guards unchanged) + docs/policy tests. - `374cb35` Shaders: allow the two clippy comparison lints on the IEEE `v_cmp` NaN test (clippy's rewrites would change NaN answers). Local validation: `cargo xtask policy` 241 files ok; `cargo test -p xtask` 6 passed; `cargo test -p victory-gpu --lib` 238 passed; `cargo test -p victory-shader --lib` 243 passed; workspace clippy default and --all-features clean. CI run 45929521337 is in progress. I could not add `fxceless` as a formal reviewer through the API (404 from the review-request endpoint for this fork PR), so this comment is the review request. Once this merges, #1333 can be rebased on top and should be green without unrelated policy commits.
CwWwWwW commented 2026-11-27 09:01:18 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T09:01:18Z.


Verification on current main (9a9091d, 2026-11-27), from this mission's independent audit:

main still fails the asset policy:

crates/victory-gpu/src/host.rs            571758 bytes over the 524288-byte limit
crates/victory-shader/src/emit/lower.rs   527045 bytes over the 524288-byte limit

This matters beyond clippy: CI's Tests step (cargo test --workspace --exclude victory-gpu) includes xtask's repository_passes_policy, so even after #1440 fixes the Clippy step, the Tests step still fails on the policy.

The Rust-source ceiling commit in this PR (73e19bb) was cherry-picked onto 9a9091d in a scratch worktree: it applies cleanly (+34/-5 in docs/asset-policy.md, xtask/src/policy.rs), and with it:

  • cargo run -p xtask -- policy -> asset policy: 235 files ok (exit 0)
  • cargo test -p xtask -> 6 passed, 0 failed (repository_passes_policy included)

So the policy half of this PR still resolves the current CI Tests blocker on today's main. The clippy part is now partly superseded: open PR #1440 also fixes wave64_after_loop.rs (a file added after this branch's base), so that commit here can be dropped or kept as preferred. (Independent verification; no external code used.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7214187675 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7214187675). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-27T09:01:18Z. --- Verification on current `main` (`9a9091d`, 2026-11-27), from this mission's independent audit: main still fails the asset policy: ``` crates/victory-gpu/src/host.rs 571758 bytes over the 524288-byte limit crates/victory-shader/src/emit/lower.rs 527045 bytes over the 524288-byte limit ``` This matters beyond clippy: CI's Tests step (`cargo test --workspace --exclude victory-gpu`) includes xtask's `repository_passes_policy`, so even after #1440 fixes the Clippy step, the Tests step still fails on the policy. The Rust-source ceiling commit in this PR (`73e19bb`) was cherry-picked onto `9a9091d` in a scratch worktree: it applies cleanly (+34/-5 in `docs/asset-policy.md`, `xtask/src/policy.rs`), and with it: - `cargo run -p xtask -- policy` -> `asset policy: 235 files ok` (exit 0) - `cargo test -p xtask` -> 6 passed, 0 failed (`repository_passes_policy` included) So the policy half of this PR still resolves the current CI Tests blocker on today's main. The clippy part is now partly superseded: open PR #1440 also fixes `wave64_after_loop.rs` (a file added after this branch's base), so that commit here can be dropped or kept as preferred. (Independent verification; no external code used.)
CwWwWwW commented 2026-11-27 09:10:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T09:10:01Z.


Merge simulation onto current main (9a9091d, 2026-11-27), in a scratch worktree: git merge --no-ff fix/asset-policy-redo merges cleanly (no conflicts; host.rs auto-merges with the newer code, and the test modules land in host/*.rs). On the merged tree:

  • cargo run -p xtask -- policy -> asset policy: 245 files ok (exit 0)
  • cargo test -p xtask -> 6 passed, 0 failed (repository_passes_policy included)
  • cargo check --workspace --all-targets -> clean
  • cargo test -p victory-gpu --lib -- --test-threads=1 -> 242 passed, 0 failed, 7 ignored
  • cargo test -p victory-shader --lib -> 252 passed, 0 failed, 19 ignored

So this PR already applies cleanly to today's main and is verified there. With #1440 (which fixes the wave64_after_loop.rs clippy lint added after this branch's base) the two independent CI blockers - clippy and the asset policy - would both be covered.

(Independent verification in a scratch worktree of this repository; no external code used.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7214357383 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7214357383). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-27T09:10:01Z. --- Merge simulation onto current `main` (`9a9091d`, 2026-11-27), in a scratch worktree: `git merge --no-ff fix/asset-policy-redo` merges **cleanly** (no conflicts; `host.rs` auto-merges with the newer code, and the test modules land in `host/*.rs`). On the merged tree: - `cargo run -p xtask -- policy` -> `asset policy: 245 files ok` (exit 0) - `cargo test -p xtask` -> 6 passed, 0 failed (`repository_passes_policy` included) - `cargo check --workspace --all-targets` -> clean - `cargo test -p victory-gpu --lib -- --test-threads=1` -> 242 passed, 0 failed, 7 ignored - `cargo test -p victory-shader --lib` -> 252 passed, 0 failed, 19 ignored So this PR already applies cleanly to today's main and is verified there. With #1440 (which fixes the `wave64_after_loop.rs` clippy lint added after this branch's base) the two independent CI blockers - clippy and the asset policy - would both be covered. (Independent verification in a scratch worktree of this repository; no external code used.)
CwWwWwW commented 2026-11-27 16:21:56 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-27T16:21:56Z.


Not applicable on the VIctory-NVIDIA tree that replaced main: the asset policy is now a uniform 640 KiB limit (xtask/src/policy.rs) and both large files fit under it; the 512 KiB split problem no longer exists, and the shader clippy target is absent. Closing.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7223172901 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1322#issuecomment-7223172901). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-27T16:21:56Z. --- Not applicable on the VIctory-NVIDIA tree that replaced main: the asset policy is now a uniform 640 KiB limit (xtask/src/policy.rs) and both large files fit under it; the 512 KiB split problem no longer exists, and the shader clippy target is absent. Closing.

Pull request closed

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!1319
No description provided.