Policy: the file-size limit is 1 MiB, over the translator's 688 KiB lower.rs (fixes #1429) #1493

Manually merged
github merged 1 commit from github-bot/gh-1493 into main 2026-11-29 08:20:40 +00:00 AGit
Owner

@⁠kibagami-nc on GitHub · 2026-11-28 20:46 UTC · original
kibagami-nc:fix/policy-size-limit → main · +5 −3 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC

Fixes #1429 (found by Jesper-Andersson).

Updated on main (f9dfb76f): the limit is now 1 MiB. lower.rs has kept growing since this PR was opened:

lower.rs
1028eef2 (limit raised to 640 KiB) 570 KiB
923e38c (2026-11-28 evening) 652 KiB
f9dfb76f (now) 688 KiB (704,996 bytes)

At that pace, 768 KiB would have been passed again within days. #1460 (moving lower.rs's tests to their own file) saved 28 KiB, which no longer brings the file under 640 KiB, and it now conflicts with main.

What happens

xtask/src/policy.rs allows 640 KiB (655,360 bytes). So on main:

  • CI: cargo test --workspace --locked fails in repository_passes_policy:
    POLICY: crates/victory-shader/src/emit/lower.rs: 704996 bytes exceeds the 655360-byte limit
    
  • Commits: the pre-commit hook (cargo xtask policy --staged) refuses any commit that touches lower.rs.

The change

  • MAX_FILE_SIZE is 1 MiB. This is what 1028eef2 did when the file passed 570 KiB, but with room for the pace it now grows at.
  • The comment above it names the two largest files and their sizes: lower.rs at 688 KiB and crates/victory-gpu/src/host.rs at 593 KiB.
  • docs/asset-policy.md says 1 MiB.

The policy's other checks are unchanged: the allowlist, no binary data, no known binary signatures, no long hex or base64 runs. The limit still lets through only a text file of source.

Why not split lower.rs? Turning it into a lower/ module folder would be the lasting fix. But it moves close to 700 KiB of code that most open translator PRs touch, and each of them would then conflict.

Tests

  • cargo test -p xtask --locked: 7 passed, repository_passes_policy included. On main it fails as above.
  • cargo xtask policy: asset policy: 321 files ok.
  • cargo clippy -p xtask --all-targets --locked -- -D warnings: clean.
**@⁠kibagami-nc** on GitHub · 2026-11-28 20:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1493) `kibagami-nc:fix/policy-size-limit` → `main` · +5 −3 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC Fixes #1429 (found by Jesper-Andersson). **Updated on main (f9dfb76f): the limit is now 1 MiB.** `lower.rs` has kept growing since this PR was opened: | | `lower.rs` | |---|---| | 1028eef2 (limit raised to 640 KiB) | 570 KiB | | 923e38c (2026-11-28 evening) | 652 KiB | | f9dfb76f (now) | 688 KiB (704,996 bytes) | At that pace, 768 KiB would have been passed again within days. #1460 (moving `lower.rs`'s tests to their own file) saved 28 KiB, which no longer brings the file under 640 KiB, and it now conflicts with main. ## What happens `xtask/src/policy.rs` allows 640 KiB (655,360 bytes). So on main: - **CI:** `cargo test --workspace --locked` fails in `repository_passes_policy`: ``` POLICY: crates/victory-shader/src/emit/lower.rs: 704996 bytes exceeds the 655360-byte limit ``` - **Commits:** the pre-commit hook (`cargo xtask policy --staged`) refuses any commit that touches `lower.rs`. ## The change - `MAX_FILE_SIZE` is 1 MiB. This is what 1028eef2 did when the file passed 570 KiB, but with room for the pace it now grows at. - The comment above it names the two largest files and their sizes: `lower.rs` at 688 KiB and `crates/victory-gpu/src/host.rs` at 593 KiB. - `docs/asset-policy.md` says 1 MiB. The policy's other checks are unchanged: the allowlist, no binary data, no known binary signatures, no long hex or base64 runs. The limit still lets through only a text file of source. **Why not split `lower.rs`?** Turning it into a `lower/` module folder would be the lasting fix. But it moves close to 700 KiB of code that most open translator PRs touch, and each of them would then conflict. ## Tests - **`cargo test -p xtask --locked`**: 7 passed, `repository_passes_policy` included. On main it fails as above. - **`cargo xtask policy`**: `asset policy: 321 files ok`. - **`cargo clippy -p xtask --all-targets --locked -- -D warnings`**: clean.
crates/victory-shader/src/emit/lower.rs has grown to 667,523 bytes, past the
640 KiB limit, so repository_passes_policy fails in cargo test --workspace on
main, and the pre-commit hook refuses any commit that touches the file. The
limit goes to 768 KiB, as 1028eef2 raised it to 640 KiB when the file passed
570 KiB. The comment names the two largest files (host.rs is 584 KiB), and
docs/asset-policy.md the new limit.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 20:51:37 +00:00
github-bot changed title from Policy: the file-size limit is 768 KiB, over the translator's 652 KiB lower.rs (fixes #1429) to Policy: the file-size limit is 1 MiB, over the translator's 688 KiB lower.rs (fixes #1429) 2026-11-29 00:45:09 +00:00
github-bot force-pushed github-bot/gh-1493 from 30a387b59b to a28c59757b 2026-11-29 00:45:11 +00:00 Compare
github manually merged commit 83e1b3b0eb into main 2026-11-29 08:20:40 +00:00
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!1493
No description provided.