Skip to content

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 into
mainfrom
claude/project-thread-4946gf
Open

fxceless wants to merge 1 commit into
mainfrom
claude/project-thread-4946gf

Conversation

@fxceless

Copy link
Copy Markdown
Owner

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.

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

…the asset policy's 512 KiB limit

The check job fails on main: crates/victory-gpu/src/host.rs (528,954 bytes)
and crates/victory-shader/src/emit/lower.rs (535,588 bytes) are over the
asset policy's 512 KiB limit (#1342).

Only #[cfg(test)] modules move, verbatim apart from losing one level of
indentation; module names and paths 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 host/<name>.rs,
  the layout profile.rs and profile/tests.rs already use. 492,495 bytes.
- lower.rs: mod tests moves to emit/lower_tests.rs, declared with
  #[path = "lower_tests.rs"] as in #1322. 512,559 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kFDn6faAxnJwPKPwiCnj1
@fxceless fxceless self-assigned this Nov 26, 2026
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check, strict Clippy and focused tests passed. Upstream asset-policy baseline remains open (fxceless#1357).
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check, strict Clippy and focused tests passed. Upstream asset-policy baseline remains open (fxceless#1357).
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check and strict Clippy passed. Upstream asset-policy baseline remains open (fxceless#1357).
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check and strict Clippy passed. Upstream asset-policy baseline remains open (fxceless#1357).
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check, strict Clippy and focused synthetic tests passed. Upstream asset-policy baseline remains open (fxceless#1357).
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check, strict Clippy and focused synthetic tests passed. Upstream asset-policy baseline remains open (fxceless#1357).
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check, strict Clippy and focused synthetic tests passed. Upstream asset-policy baseline remains open (fxceless#1357).
spk-c pushed a commit to spk-c/victory-fork that referenced this pull request Nov 26, 2026
AI-assisted: keep original tested commit in history; local all-feature check, strict Clippy and focused synthetic tests passed. Upstream asset-policy baseline remains open (fxceless#1357).
@Filip722

Filip722 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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).

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.

The asset policy's 512 KiB limit is exceeded by host.rs and lower.rs on main: CI is red and the hook refuses commits to them

3 participants