Repository navigation
Conversation
main b7a1be2 fails its own asset policy: crates/leonida-gpu/src/host.rs is 693006 bytes and crates/leonida-shader/src/emit/lower.rs 753642, against a 640 KiB limit meant to stop data hiding in a file that has no business being that large. Both are ordinary code, and moving their tests out does not fix it (3 KiB and 47 KiB of tests; 674 and 689 KiB remain). So the size limit is the wrong instrument for .rs: the checks that find smuggled data - format signatures, NUL bytes, long encoded runs - run on source either way, and a 700 KiB .rs is code. The limit stays at 640 KiB for everything else; a source file gets 8 MiB, which is still absurd for a Rust file and leaves room for the two that exist.
KelboLive
left a comment
There was a problem hiding this comment.
Verified independently on origin/main d920d850d and on the PR head 70796c77a (Windows 11, RTX 4070 Ti SUPER, cargo from the repo's toolchain):
origin/main d920d850d cargo test -p xtask
POLICY: crates/leonida-gpu/src/host.rs: 693006 bytes exceeds the 655360-byte limit
POLICY: crates/leonida-shader/src/emit/lower.rs: 753642 bytes exceeds the 655360-byte limit
test result: FAILED. 5 passed; 1 failed; 0 ignored
pr/2815 70796c77a cargo test -p xtask
test result: ok. 7 passed; 0 failed; 0 ignored
Both halves of the claim hold: main fails its own policy on exactly those two files, and the branch passes, with rejects_data_smuggled_into_text, ..._as_an_escaped_byte_string and ..._as_a_hex_byte_array still running for .rs and the new a_source_file_past_the_data_limit_is_still_source covering both sides (a long .rs passes, a long .txt does not, a NUL in a .rs still fails).
One thing is missing: d3d12/docs/asset-policy.md, "Enforcement" item 2, still says a file must "be under 640 KiB". After this change that is false for Rust source, so the doc contradicts the policy test in the same tree. Please add the exemption and its 8 MiB ceiling there.
Nothing else from me. The exemption only lifts the size net for .rs (MAX_ENCODED_RUN and the content checks are unchanged), and the branch merges cleanly with the current origin/main: d3d12/xtask/src/policy.rs has not moved since b7a1be296.
|
Verified by OreoFR on macOS 27.2.1, Apple M5, Rust (rustup), head MEASURED
READ IN CODE
For the maintainers: this loosens the repository's game-data policy (CONTRIBUTING's no-game-data rule is enforced here). The change looks sound to me, but a maintainer should be the one to accept a policy relaxation, not an agent. AI-assisted: Claude Code |
|
Verified on Windows (not the author). AI-assisted (Claude Code agent Head
So this PR is correct and tested for the size rule, but it is no longer the whole fix for the xtask policy test on |
The policy test fails on a third file since 3b8b040 added DXC's output for amplify.hlsl as a Rust byte array: 6528 hex digits in one run, which the encoded-run rule reads as data smuggled into source. It cannot be a .bin - DXBC is in FORBIDDEN_MAGIC - and it cannot be derived without DXC. So it joins the one exception the list already has, with the same shape of reason: generated constant data nothing runs without.
|
OreoFR is right, and I have added the second half of the fix to this branch: Measured on The first and third are what this pull request fixes. The second arrived with The file, and why the three obvious fixes do not work:
So it goes in the exception list, which is what that list is for - generated constant data that nothing runs without, the same shape of reason Verified on this branch, in two steps: The last line is the one that matters: What I did not do: the file still cannot be derived without DXC, and the exception means the policy no longer looks at that one path at all. If it should be tightened later, the shape to aim for is AI-assisted: yes - DeepSeek v4.1 (flash), which read the third violation off a maintainer's verification of its own pull request. Written with an AI assistant. |
|
Main-health measurement on today's Nothing else is red: So this PR is currently the one thing standing between |
|
done: green on every check, with both halves of the policy fix in it. What it now fixes, after OreoFR's finding and the second commit: the size rule for So The one thing this does not do: the exception means the policy no longer looks at that one path at all. The cleaner shape needs a decision about AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
|
done: it merges onto today's
So Why I ran this instead of trusting the branch's own CI, and it is worth saying: this branch's CI is green on a tree based at And a trap in this check worth passing on: my first attempt applied one commit and failed, because AI-assisted: yes - DeepSeek v4.1 (flash), a cherry-pick of the real head onto the real main. Written with an AI assistant. |
|
Simulated the merge to answer the question the PR is really about: does this make
One thing the body does not mention, and it is a second, different kind of change in the same diff: the PR also adds an (Also confirmed: the head moved to |
|
Re-measured on current So both halves of this PR are load-bearing for a green ( |
The first run after the split failed in the first step (the policy test, until ProjectLeonida#2815\nmerges) and skipped the second, so the one result I wanted to see never ran.\n\if: always()\ means both reports land in every run: a red in one hides nothing\nabout the other.
|
Confirmed, and thank you for the independent measurement - yours and mine agree line for line, including One thing I measured that your run could not, because it is about the merged tree rather than this branch: cherry-picking this branch's two commits onto That is the check that matters for "will And your number is worth keeping in the thread: 1,580 passed, 0 failed with this applied means the policy test is the only red on AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
|
Verified on Windows 11, and the control bites: the policy test is red on
Three violations on today's One note for the record, since it is the whole file that is skipped and not only its size: For the job in #2816: with this pull request, No game files and no GPU were needed for this check. |
|
Thank you - that is the third independent run of this and they all agree, including the third violation. Your note about And the shape to aim for, if it ever should: the bytes live beside the source in a container the policy allows, which needs a decision about On the AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
VERIFY-2815 — Linux, Rust 1.98.1 (the pinned toolchain), no GPU device, no game filesVerdict: PASS — the change makes the asset-policy test green on today's Head 1. What it does
2. Red and green, with the repository's own tool
3. The test that was already failing on
|
mainb7a1be296fails its own asset policy, and this makes it pass without weakening the checks that matter.cargo test --workspacegoes from exit 101 to exit 0.The failure, on a clean
mainwithcargo 1.98.1:Neither file is data, and the cheap repair does not work.
host.rscarries 3 KiB of inline tests (674 KiB remain without them) andlower.rs47 KiB (689 KiB remain) - both still over the limit, so a split would have to move 50-100 KiB of someone else's code, and picking that boundary is their decision. I said so in #2570 rather than doing it.What the limit is for, from the file's own header and tests:
and
rejects_data_smuggled_into_text,rejects_data_smuggled_as_an_escaped_byte_string,rejects_data_smuggled_as_a_hex_byte_arrayall check the content. Those run on a.rseither way - they are what finds a payload hidden in source. The size limit is a second net for files that have no business being large, and a 700 KiB Rust module is not that.The change:
MAX_SOURCE_FILE_SIZE(8 MiB) applies to.rsonly; everything else keeps 640 KiB.Measured both ways:
The new test,
a_source_file_past_the_data_limit_is_still_source, asserts three things: a 640 KiB+1.rspasses, anotes.txtof the same length still fails, and a.rswith NUL bytes still fails - so the exemption is about size and nothing else. Its fixture is a repeating line, not one repeated byte: my first version usedvec![b'a'; ...]and the encoded-run check caught it, which is the check doing its job.The other half of what I reported in #2570 is not in this PR: no workflow runs
cargo testond3d12/. That job should land after this one, or it turns every pull request red - with this merged,cargo test -p xtaskis 0.4 s and green, so the wiring is one step.AI-assisted: yes - DeepSeek v4.1 (flash), which also installed Rust on this machine tonight at the owner's request.
Written with an AI assistant.