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 #1342

Open
opened 2026-11-26 17:21:31 +00:00 by github-bot · 0 comments
Owner

@⁠CarverXI on GitHub · 2026-11-26 17:15 UTC · original

Two source files on main are over the asset policy's 512 KiB limit, so the check job fails on main and the pre-commit hook refuses every commit that touches either file.

What fails

xtask/src/policy.rs has MAX_FILE_SIZE = 512 * 1024 for everything outside the run logs under diagnostics/ (which got rules of their own on 2026-11-26, the case of #1177). On main at e4245f3:

file bytes over the limit since
crates/victory-shader/src/emit/lower.rs 535,588 58de9bf (526,968; it was 521,771 at a20809d)
crates/victory-gpu/src/host.rs 528,954 e4245f3 (it was 513,413 at 58de9bf)

The latest CI run on main fails in Tests, at policy::tests::repository_passes_policy:

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

What it does to contributors

  • cargo xtask policy --staged (the pre-commit hook) checks the whole staged file, not the change, so any commit that touches host.rs or lower.rs is refused whatever it changes. #1341 is 240 bytes in host.rs and had to be committed with the hook skipped; #1320 notes the same failure.
  • check is red on every pull request for a reason that is not in it, so a real failure in a pull request no longer stands out.
  • Both files grow with nearly every commit to main (host.rs took 15 KiB in one), so this stays until something is decided.

Ways out, as far as I can see

  1. A higher limit for source files. The limit is there to keep game data out, and the other checks (the allowlist of extensions, the forbidden magics, NUL bytes, the longest encoded run) are what tell data from source; for .rs the size says little. For instance 2 MiB for .rs, 512 KiB for the rest, the way run logs have their own rule now.
  2. The two files on the exemption list (policy.rs has one, "keep this empty if at all possible"), each with its reason. The smallest change, and the next file to cross the line needs it again.
  3. Split the two files. host.rs has parts that stand alone (the fill_ahead module, the flights and the relay, the card copies, Batch); the cleanest and the most work, and it makes every open pull request against those files conflict.

Option 1 looks to me like the one that fits what the limit is for. I can send it as a pull request (the constant by extension, a test beside run_logs_have_their_own_rules) if you want it that way.

**@⁠CarverXI** on GitHub · 2026-11-26 17:15 UTC · [original](https://github.com/fxceless/victory-fork/issues/1342) Two source files on `main` are over the asset policy's 512 KiB limit, so the `check` job fails on `main` and the pre-commit hook refuses every commit that touches either file. ## What fails `xtask/src/policy.rs` has `MAX_FILE_SIZE = 512 * 1024` for everything outside the run logs under `diagnostics/` (which got rules of their own on 2026-11-26, the case of #1177). On `main` at `e4245f3`: | file | bytes | over the limit since | |---|---|---| | `crates/victory-shader/src/emit/lower.rs` | 535,588 | `58de9bf` (526,968; it was 521,771 at `a20809d`) | | `crates/victory-gpu/src/host.rs` | 528,954 | `e4245f3` (it was 513,413 at `58de9bf`) | The latest CI run on `main` fails in `Tests`, at `policy::tests::repository_passes_policy`: ``` 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 ``` ## What it does to contributors - `cargo xtask policy --staged` (the pre-commit hook) checks the whole staged file, not the change, so any commit that touches `host.rs` or `lower.rs` is refused whatever it changes. #1341 is 240 bytes in `host.rs` and had to be committed with the hook skipped; #1320 notes the same failure. - `check` is red on every pull request for a reason that is not in it, so a real failure in a pull request no longer stands out. - Both files grow with nearly every commit to `main` (`host.rs` took 15 KiB in one), so this stays until something is decided. ## Ways out, as far as I can see 1. **A higher limit for source files.** The limit is there to keep game data out, and the other checks (the allowlist of extensions, the forbidden magics, NUL bytes, the longest encoded run) are what tell data from source; for `.rs` the size says little. For instance 2 MiB for `.rs`, 512 KiB for the rest, the way run logs have their own rule now. 2. **The two files on the exemption list** (`policy.rs` has one, "keep this empty if at all possible"), each with its reason. The smallest change, and the next file to cross the line needs it again. 3. **Split the two files.** `host.rs` has parts that stand alone (the `fill_ahead` module, the flights and the relay, the card copies, `Batch`); the cleanest and the most work, and it makes every open pull request against those files conflict. Option 1 looks to me like the one that fits what the limit is for. I can send it as a pull request (the constant by extension, a test beside `run_logs_have_their_own_rules`) if you want it that way.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:21:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
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/fxceless--victory-fork#1342
No description provided.