HLE: validate XPackage chunk selectors #412
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/412"
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 Marvisak/VIctory. Originally posted by enzoduarte1 on 2026-11-24T03:01:38Z.
What
IXPackageImplaccepted any selector array and returned success for nonsense the console rejects. This adds the publicXPackageChunkSelectorABI (u32type tag plus the language/tag/chunk-id/feature union) and onevalidate_selectorshelper used by all six selector-taking methods:XPackageCreateInstallationMonitorXPackageFindChunkAvailabilityXPackageChangeChunkInstallOrderXPackageInstallChunksAsyncXPackageEstimateDownloadSizeXPackageUninstallChunksZero selectors still mean the whole installation. A nonzero count with a null array, an unknown selector type, or a null/empty string attribute now returns
E_INVALIDARG. A foreign package id still returnsNO_PACKAGEbefore selector validation. The “own package is completely installed” model is unchanged for well-formed selectors.The layout and enum values come from the public GDK
XPackage.h/XPackageChunkSelectordocumentation; no title data is involved.Tested
x86_64-pc-windows-gnu(this machine has no MSVC linker).cargo test -p victory-hle --lib xpackage::tests: 3 passed, including new direct validation and vtable-level tests for every changed method.cargo test -p victory-hle: 88 unit tests + 1 integration test passed.cargo test --workspace --exclude victory-loader -- --test-threads=1: all suites passed.cargo clippy -p victory-hle --all-targets -- -A clippy::field_reassign_with_default -D warnings: clean. The allowed lint is the pre-existing warning fixed in PR #355.rustfmt --edition 2024 --check crates/victory-hle/src/modules/xpackage.rsandgit diff --check: clean.cargo xtask policy: 151 files ok. No game files or data taken from them were added.cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's/DELAYLOADflag, which MinGW rejects here; the same failure occurs on unmodifiedmain. A parallel run of the whole suite hit the known WARP flake from #181; rerunning serially and rerunningvictory-shaderalone both passed.Checklist
cargo fmt,cargo clippy --workspace --all-targetsandcargo test --workspacepass — see the toolchain limitations above; the changed crate is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:19:05Z.
Review: APPROVED
Tested
d2c7d4aon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (266 passed, 0 failed).ChunkSelectormatches the public layout: au32tag, padded to 8, then an 8-byte union. Reading the tag asu32instead of a Rust enum is the right way to reject unknown values safely. Thecountoverflow guard beforefrom_raw_partsis good.XPackageInstallChunksAsyncwith a foreign id used to complete the async block withNO_PACKAGE(finished_with(.., Err(NO_PACKAGE))). It now returnsNO_PACKAGEfrom the call without completing the block. That matches the XAsync rule that a failed begin call does not complete, so I think it is correct. Still, a title that waits on the block after ignoring the begin HRESULT would now wait forever. Worth a line in the description.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:36:05Z.
Thanks @enzoduarte1 for validating chunk selectors across the XPackage API. I tested head
d2c7d4a329abb59d669867c5b5020776eb7963a9with:Result: 3 passed, 0 failed (85 filtered out). The tests cover selector validation, malformed selectors being refused through the API, and the unchanged complete-installation behavior for valid requests. This validates the synthetic HLE object cases, not a title package installation.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:32:03Z.
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(4118f33b). Conflicting files:crates/victory-hle/src/modules/xpackage.rs.The content will be reviewed once the branch is rebased onto
main.Generated by Claude Code
upstream-sync referenced this pull request2026-11-25 02:06:05 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.