Policy: the size-limit test checks the size limit itself #2615

Open
github-bot wants to merge 1 commit from github-bot/gh-2615 into main AGit
Owner

@⁠iBooM72 on GitHub · 2026-11-29 14:58 UTC · original
iBooM72:fix/policy-size-test → main · +12 −4 · 1 files · 1 commits · open

What it changes

The asset policy's "too big" test no longer checks the size limit. Its file is a 600 KiB run of one letter: over the original 512 KiB limit, but under the current 1 MiB. It was refused only by the hex/base64 run rule, so the test still passed with the size check turned off.

The new test, rejects_only_files_over_the_size_limit, uses short lines that no other rule refuses. A file of exactly MAX_FILE_SIZE must be accepted. One byte more must be refused for its size alone. It uses the constant, so it follows the limit if that changes.

Only test code changes. The policy rules stay the same.

How it was tested

  • GPU and profile: not applicable (xtask test only, no game run). Windows 11.
  • Before: with the size check turned off locally, the old test passed.
  • After: the new test passes. It fails with the size check turned off, and with > changed to >=.
  • For shader changes, the wave sizes tested: not a shader change.
  • cargo test passed for the crates it touches: no. cargo test -p xtask --locked: 7 passed, 1 failed. repository_passes_policy refuses heap_sites/frame_users.rs (#2420), and fails the same way on unmodified 829188e9.
  • cargo clippy -p xtask --all-targets --locked -- -D warnings and cargo xtask policy --staged passed.
  • Both workspace clippy commands from CI fail here and on 829188e9, with no errors reported in xtask (#2019 covers the unwind_copy one).
  • cargo test --workspace --locked --no-fail-fast: 8 tests failed. 5 also failed in the same run on 829188e9, and 2 in repeat runs there. The last, library_state_and_lock in victory-hle, is a timing test. It failed once here, then passed 12 of 12 repeats here and on 829188e9. No other crate depends on xtask.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none changes this size test. #1719, #1776, #1816, #1818, #1967 and #1993 change MAX_FILE_SIZE, and the new test would follow their value. #730, #1399 and #1739 change nearby tests, so they may need a small merge.

🤖 Generated with Claude Code

**@⁠iBooM72** on GitHub · 2026-11-29 14:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2615) `iBooM72:fix/policy-size-test` → `main` · +12 −4 · 1 files · 1 commits · open ## What it changes The asset policy's "too big" test no longer checks the size limit. Its file is a 600 KiB run of one letter: over the original 512 KiB limit, but under the current 1 MiB. It was refused only by the hex/base64 run rule, so the test still passed with the size check turned off. The new test, `rejects_only_files_over_the_size_limit`, uses short lines that no other rule refuses. A file of exactly `MAX_FILE_SIZE` must be accepted. One byte more must be refused for its size alone. It uses the constant, so it follows the limit if that changes. Only test code changes. The policy rules stay the same. ## How it was tested - GPU and profile: not applicable (xtask test only, no game run). Windows 11. - Before: with the size check turned off locally, the old test passed. - After: the new test passes. It fails with the size check turned off, and with `>` changed to `>=`. - For shader changes, the wave sizes tested: not a shader change. - `cargo test` passed for the crates it touches: **no**. `cargo test -p xtask --locked`: 7 passed, 1 failed. `repository_passes_policy` refuses `heap_sites/frame_users.rs` (#2420), and fails the same way on unmodified `829188e9`. - `cargo clippy -p xtask --all-targets --locked -- -D warnings` and `cargo xtask policy --staged` passed. - Both workspace clippy commands from CI fail here and on `829188e9`, with no errors reported in xtask (#2019 covers the `unwind_copy` one). - `cargo test --workspace --locked --no-fail-fast`: 8 tests failed. 5 also failed in the same run on `829188e9`, and 2 in repeat runs there. The last, `library_state_and_lock` in `victory-hle`, is a timing test. It failed once here, then passed 12 of 12 repeats here and on `829188e9`. No other crate depends on xtask. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none changes this size test. #1719, #1776, #1816, #1818, #1967 and #1993 change `MAX_FILE_SIZE`, and the new test would follow their value. #730, #1399 and #1739 change nearby tests, so they may need a small merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The old "too big" case was a 600 KiB run of one letter, under the 1 MiB
limit: it was refused only as a long hex/base64 run, and still passed
with the size check turned off. Use short lines, which no other rule
refuses, and check a file of exactly MAX_FILE_SIZE (accepted) and one
byte more (refused for its size alone).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 15:03:23 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2615/head:github-bot/gh-2615'
git switch 'github-bot/gh-2615'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2615'
git switch 'github-bot/gh-2615'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2615'
git switch 'github-bot/gh-2615'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2615'
git switch 'main'
git merge --squash 'github-bot/gh-2615'
git switch 'main'
git merge --ff-only 'github-bot/gh-2615'
git switch 'main'
git merge 'github-bot/gh-2615'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2615
No description provided.