Tests: cover XG copy argument forms across pitched subresources #2473

Open
anes66 wants to merge 2 commits from upstream-pr/2483 into main
anes66 commented 2026-11-25 20:01:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by anes66 on 2026-11-25T20:01:04Z.


Stacked on #1435; only the top commit, 767f439, belongs to this PR. The dependency keeps its original author.

The existing ABI regression covers a single RGBA8 surface. These two CPU tests extend it to pitched mip levels, array slices, separate depth/stencil planes, BC1/BC3 blocks and 3D textures. They also cover a source whose address space is reserved but not committed, and stale upper stack-slot bits around the added 32-bit argument.

What is in it

  • crates/xcl/src/hle/xg.rs, tests only: 10 descriptors and 512 copy calls through the six- and seven-argument vtable forms. Expected bytes are placed per element; reads use that reference rather than the preceding copy's output. Whole-buffer comparisons check row/slice padding, other subresources and trailing sentinels too.
  • Argument decoding checks a reserved PAGE_NOACCESS source without reading it, three added-argument values, three stale upper halves, and unused trailing-slot values in the older form.

Tested

  • Windows 10 22H2 (19045), Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug; CPU only. An RTX 3060 12 GB is installed but no GPU was queried or used by these tests.
  • Unmodified #1435 head 14c8a2d: cargo test --locked -p xcl --lib hle::xg::tests -j2 -- --nocapture --test-threads=1: 4 passed, 0 failed, 0 ignored, 0 skipped.
  • With these tests on that head (8b4d42c): the same command: 6 passed, 0 failed, 0 ignored, 0 skipped.
  • With #1435 and these tests on main e0d93c8 (this branch, 767f439): the same command: 6 passed, 0 failed, 0 ignored, 0 skipped.
  • The same tests on the manual A/B tree (main 2898511 + #1435, head aec6fa1) also pass in release: 6 passed, 0 failed, 0 ignored, 0 skipped; 512 copy calls.
  • Negative controls, restored before the passing runs: adding one to the newer form's decoded row pitch fails the copy matrix; requiring committed memory when detecting the source fails the reserved-source test.
  • GitHub Windows CI on this head passes: build plus 1,425 reported passed, 0 failed, 46 ignored across 37 test binaries/doc-test groups. The script reports 346 GPU skips within those pass counts; they are not hardware coverage. Both added tests ran and passed. The runner has no hardware GPU or game sample data, and the workflow excludes the test-title launch.

Not tested

  • Local full workspace suite, hardware GPU execution, the console-library oracle or a retail-title run with this patch. No proprietary files are needed by the new tests.

Merge prerequisites

  • This is a draft dependency stack. Once #1435 lands, rebasing leaves only the test commit; until then the combined diff also contains its runtime change.
  • The description check currently requires the project's disclosure section and paired title smoke runs. Those runs have not been made on this head; no smoke blocks are supplied as passing results.
<!-- greyfinch-sync:ivall/xcl:issue:5498247896 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2483). Originally posted by [anes66](https://github.com/anes66) on 2026-11-25T20:01:04Z. --- Stacked on #1435; only the top commit, `767f439`, belongs to this PR. The dependency keeps its original author. The existing ABI regression covers a single RGBA8 surface. These two CPU tests extend it to pitched mip levels, array slices, separate depth/stencil planes, BC1/BC3 blocks and 3D textures. They also cover a source whose address space is reserved but not committed, and stale upper stack-slot bits around the added 32-bit argument. **What is in it** - `crates/xcl/src/hle/xg.rs`, tests only: 10 descriptors and 512 copy calls through the six- and seven-argument vtable forms. Expected bytes are placed per element; reads use that reference rather than the preceding copy's output. Whole-buffer comparisons check row/slice padding, other subresources and trailing sentinels too. - Argument decoding checks a reserved `PAGE_NOACCESS` source without reading it, three added-argument values, three stale upper halves, and unused trailing-slot values in the older form. **Tested** - Windows 10 22H2 (19045), Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug; CPU only. An RTX 3060 12 GB is installed but no GPU was queried or used by these tests. - Unmodified #1435 head `14c8a2d`: `cargo test --locked -p xcl --lib hle::xg::tests -j2 -- --nocapture --test-threads=1`: 4 passed, 0 failed, 0 ignored, 0 skipped. - With these tests on that head (`8b4d42c`): the same command: 6 passed, 0 failed, 0 ignored, 0 skipped. - With #1435 and these tests on `main` `e0d93c8` (this branch, `767f439`): the same command: 6 passed, 0 failed, 0 ignored, 0 skipped. - The same tests on the manual A/B tree (`main` `2898511` + #1435, head `aec6fa1`) also pass in release: 6 passed, 0 failed, 0 ignored, 0 skipped; 512 copy calls. - Negative controls, restored before the passing runs: adding one to the newer form's decoded row pitch fails the copy matrix; requiring committed memory when detecting the source fails the reserved-source test. - [GitHub Windows CI on this head](https://github.com/xcl-dev/xcl/actions/runs/45690846488) passes: build plus 1,425 reported passed, 0 failed, 46 ignored across 37 test binaries/doc-test groups. The script reports 346 GPU skips within those pass counts; they are not hardware coverage. Both added tests ran and passed. The runner has no hardware GPU or game sample data, and the workflow excludes the test-title launch. **Not tested** - Local full workspace suite, hardware GPU execution, the console-library oracle or a retail-title run with this patch. No proprietary files are needed by the new tests. **Merge prerequisites** - This is a draft dependency stack. Once #1435 lands, rebasing leaves only the test commit; until then the combined diff also contains its runtime change. - The description check currently requires the project's disclosure section and paired title smoke runs. Those runs have not been made on this head; no smoke blocks are supplied as passing results.
DavidM1911 commented 2026-11-25 21:05:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:34:27Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7173871668 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2483#issuecomment-7173871668). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T20:34:27Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
SlopTart commented 2026-11-25 21:05:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T20:52:02Z.


gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of the three new copy tests (copy_argument_forms_keep_reserved_sources_and_stack_dword_boundaries, copy_argument_forms_preserve_pitched_mips_planes_arrays_and_volumes, subresource_copies_take_both_argument_forms): 3 passed.

<!-- greyfinch-sync:ivall/xcl:comment:7174295345 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2483#issuecomment-7174295345). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T20:52:02Z. --- `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of the three new copy tests (`copy_argument_forms_keep_reserved_sources_and_stack_dword_boundaries`, `copy_argument_forms_preserve_pitched_mips_planes_arrays_and_volumes`, `subresource_copies_take_both_argument_forms`): 3 passed.
github-actions[bot] commented 2026-11-30 08:39:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:39:50Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273187372 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2483#issuecomment-7273187372). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:39:50Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 08:09:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:09:28Z.


Triage (#1607) – head 767f439

The first commit (copy_args in xg.rs, CopyInto/FromSubresource taking the newer library's added argument) is already on main as adccb7d8; #3099 carries the same commit inside its rebase. What this PR adds on top is the two tests copy_argument_forms_keep_reserved_sources_and_stack_dword_boundaries and copy_argument_forms_preserve_pitched_mips_planes_arrays_and_volumes, which main does not have. A rebase onto main should leave only the test commit and clear the conflict.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304948289 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2483#issuecomment-7304948289). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:09:28Z. --- **Triage (#1607)** – head 767f439 The first commit (`copy_args` in xg.rs, CopyInto/FromSubresource taking the newer library's added argument) is already on main as adccb7d8; #3099 carries the same commit inside its rebase. What this PR adds on top is the two tests `copy_argument_forms_keep_reserved_sources_and_stack_dword_boundaries` and `copy_argument_forms_preserve_pitched_mips_planes_arrays_and_volumes`, which main does not have. A rebase onto main should leave only the test commit and clear the conflict. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2483:upstream-pr/2483'
git switch 'upstream-pr/2483'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2483'
git switch 'upstream-pr/2483'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2483'
git switch 'upstream-pr/2483'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2483'
git switch 'main'
git merge --squash 'upstream-pr/2483'
git switch 'main'
git merge --ff-only 'upstream-pr/2483'
git switch 'main'
git merge 'upstream-pr/2483'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
xcl-dev/xcl!2473
No description provided.