Policy: the file-size limit is 1 MiB, over the translator's 688 KiB lower.rs (fixes #1429) #1493
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1493"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T20:46:51Z.
Fixes #1429 (found by Jesper-Andersson).
Updated on main (
f9dfb76f): the limit is now 1 MiB.lower.rshas kept growing since this PR was opened:lower.rs1028eef2(limit raised to 640 KiB)923e38c(2026-11-28 evening)f9dfb76f(now)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.rsallows 640 KiB (655,360 bytes). So on main:cargo test --workspace --lockedfails inrepository_passes_policy:cargo xtask policy --staged) refuses any commit that toucheslower.rs.The change
MAX_FILE_SIZEis 1 MiB. This is what1028eef2did when the file passed 570 KiB, but with room for the pace it now grows at.lower.rsat 688 KiB andcrates/victory-gpu/src/host.rsat 593 KiB.docs/asset-policy.mdsays 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 alower/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_policyincluded. On main it fails as above.cargo xtask policy:asset policy: 321 files ok.cargo clippy -p xtask --all-targets --locked -- -D warnings: clean.