Policy: the site tables name offsets and tags, not the title's bytes #2968

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

@⁠P1ayer-1 on GitHub · 2026-11-29 19:06 UTC · original
P1ayer-1:fix/asset-policy-site-tables → main · +50 −3 · 1 files · 1 commits · open

#2420, item 1 of three. It does not close the issue: items 2 (the parallel-run flakes) and 3 (the diagnostics-only test) are untouched.

What it changes

cargo test --workspace cannot pass on main because of one deterministic policy violation, so CI has not reached its test step since the clippy errors landed:

POLICY: crates/victory-loader/src/heap_sites/frame_users.rs: 2022 hex digits in one run of \x/0x literals (embedded data?)

That file is the frame allocator's site table, and its rows are what its module docs say: an image offset, a window length and a BLAKE3-64 tag per site, with none of the title's bytes in it. It exceeds MAX_ENCODED_RUN (512) because ROWS is a long array of 0x literals.

  • LITERAL_RUN_EXCEPTIONS: path → reason. Only longest_hex_literal_run is skipped for a listed path. The file type, size, text, magic and hex/base64-run checks all still apply to it.
  • heap_sites/frame_users.rs is listed, with its reason, next to the constant.

Two things I deliberately did not do:

  • Not EXCEPTIONS. That list skips every check for a path — size, text, forbidden magic — which is right for bcpack-tables.bin (a binary nothing decodes without) and more than a .rs table needs.
  • Not a regeneration. The table is written by the heap-hooks site generator from the title's image, and the offsets are needed in exactly this form (ROWS: &[(u32, u16, u64, u16, u16, bool, u16)]), so re-encoding it would mean changing the generator and regenerating, which I cannot do here.

How it was tested

No GPU, nothing runs the title. Windows 11 build 26300, rustc 1.98.1, MSVC 14.44, --locked.

Before (this change stashed):

$ cargo test -p xtask repository_passes_policy
test policy::tests::repository_passes_policy ... FAILED
POLICY: crates/victory-loader/src/heap_sites/frame_users.rs: 2022 hex digits in one run of \x/0x literals (embedded data?)

After:

$ cargo test -p xtask
running 8 tests
test policy::tests::the_site_tables_literal_run_is_allowed_and_nothing_else_is ... ok
test policy::tests::repository_passes_policy ... ok
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

rustfmt --check xtask/src/policy.rs reports nothing in the added lines (it does flag ALLOWED_EXTENSIONS at line 17, which is there on main already and is not touched here).

Checked for overlap

  • Searched the open pull requests for the same issue and for the files this touches.
  • #2615 also touches xtask/src/policy.rs, but it rewrites the size-limit test in rejects_game_like_files. The changes are disjoint, and the new test here sits above that function, outside #2615's hunk, so the two should not conflict. I have not touched the size test.
**@⁠P1ayer-1** on GitHub · 2026-11-29 19:06 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2968) `P1ayer-1:fix/asset-policy-site-tables` → `main` · +50 −3 · 1 files · 1 commits · open ## Related #2420, **item 1 of three**. It does not close the issue: items 2 (the parallel-run flakes) and 3 (the `diagnostics`-only test) are untouched. ## What it changes `cargo test --workspace` cannot pass on main because of one deterministic policy violation, so CI has not reached its test step since the clippy errors landed: ``` POLICY: crates/victory-loader/src/heap_sites/frame_users.rs: 2022 hex digits in one run of \x/0x literals (embedded data?) ``` That file is the frame allocator's site table, and its rows are what its module docs say: an image offset, a window length and a BLAKE3-64 tag per site, with none of the title's bytes in it. It exceeds `MAX_ENCODED_RUN` (512) because `ROWS` is a long array of `0x` literals. - `LITERAL_RUN_EXCEPTIONS`: path → reason. Only `longest_hex_literal_run` is skipped for a listed path. The file type, size, text, magic and hex/base64-run checks all still apply to it. - `heap_sites/frame_users.rs` is listed, with its reason, next to the constant. Two things I deliberately did not do: - **Not `EXCEPTIONS`.** That list skips every check for a path — size, text, forbidden magic — which is right for `bcpack-tables.bin` (a binary nothing decodes without) and more than a `.rs` table needs. - **Not a regeneration.** The table is written by the heap-hooks site generator from the title's image, and the offsets are needed in exactly this form (`ROWS: &[(u32, u16, u64, u16, u16, bool, u16)]`), so re-encoding it would mean changing the generator and regenerating, which I cannot do here. ## How it was tested No GPU, nothing runs the title. Windows 11 build 26300, rustc 1.98.1, MSVC 14.44, `--locked`. Before (this change stashed): ``` $ cargo test -p xtask repository_passes_policy test policy::tests::repository_passes_policy ... FAILED POLICY: crates/victory-loader/src/heap_sites/frame_users.rs: 2022 hex digits in one run of \x/0x literals (embedded data?) ``` After: ``` $ cargo test -p xtask running 8 tests test policy::tests::the_site_tables_literal_run_is_allowed_and_nothing_else_is ... ok test policy::tests::repository_passes_policy ... ok test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ``` `rustfmt --check xtask/src/policy.rs` reports nothing in the added lines (it does flag `ALLOWED_EXTENSIONS` at line 17, which is there on main already and is not touched here). ## Checked for overlap - [x] Searched the open pull requests for the same issue and for the files this touches. - #2615 also touches `xtask/src/policy.rs`, but it rewrites the size-limit test in `rejects_game_like_files`. The changes are disjoint, and the new test here sits above that function, outside #2615's hunk, so the two should not conflict. I have not touched the size test.
`repository_passes_policy` fails on main: `heap_sites/frame_users.rs` holds a
2022-digit run of `0x` literals, past `MAX_ENCODED_RUN` (512), so
`cargo test --workspace` never passes and CI has not reached its test step
since the clippy errors landed (#2420).

The rows are what the module docs say they are: one image offset, one window
length and one BLAKE3-64 tag per site, and none of the title's bytes. So the
literal-run rule alone is lifted for that path, with its reason beside it,
rather than exempting the path from the whole allowlist as `EXCEPTIONS` does:
that would also lift the file type, size, text and magic checks.

Test: `the_site_tables_literal_run_is_allowed_and_nothing_else_is` (the same
run under any other name is still refused, and the magic and size checks still
apply to this path).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 19:08:12 +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/2968/head:github-bot/gh-2968'
git switch 'github-bot/gh-2968'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2968'
git switch 'github-bot/gh-2968'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2968'
git switch 'github-bot/gh-2968'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2968'
git switch 'main'
git merge --squash 'github-bot/gh-2968'
git switch 'main'
git merge --ff-only 'github-bot/gh-2968'
git switch 'main'
git merge 'github-bot/gh-2968'
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!2968
No description provided.