Tests: align XMemVirtualQuery buffers and verify CPU flags #650
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!650
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-650"
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?
@yaandrei2000 on GitHub · 2026-11-24 02:53 UTC · original
yaandrei2000:fix/xmem-virtual-query-test-alignment→main· +27 −11 · 1 files · 1 commits · openFix intermittent failures in the XMemVirtualQuery tests. The old byte array could be misaligned for VirtualQueryEx on Windows x64. Zero-initialized flags could also mask a missing write for reserved or guarded pages. Related to #656.
What is in it
crates/xcl/src/hle/kernelx.rs, share a C-layoutQueryInfobetween the two tests. Check the buffer layout, start each query withcpu_flags = u32::MAX, and verifyMEM_RESERVEfor the reserved case andMEM_COMMITwithPAGE_READWRITE | PAGE_GUARDfor the guard case.Tested
Tested commit
7fdea657c96e45e9630b6db9016d7b5f8b7746cbin a clean worktree based onf4ce27ceb6d1b0576d0c659b713b674778bf1968. Windows 11 build 26300.9974, Ryzen 5 5500, GTX 1660 Ti (driver 617.42), Rust 1.88.0 (x86_64-pc-windows-msvc), debug, DXC 1.9.2609.5.cpu_flagsonly for readable pages. Both tests from53301d8still passed. Both updated tests failed on the reserved and guard-page cases withcpu_flags & 3 == 3(expected0).--no-fail-fastcommands on cleanf4ce27c. It reported 697 passed, 4 failed, and 41 ignored. Both trees failed the cubemap VRAM reuse assertion inplaced_title_textures_share_vram_and_preserve_pixels. The resulting poisoned locks also failedtransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory. Cleanmainalso failedxmem_virtual_query_marks_cpu_readable_memory(returned0, expected1). Cubemap check #447 and Poisoned test locks #673SKIPPEDresults as passes in each workspace run:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware.Earlier independent checks of
53301d8cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4on the exact commit reported 688 passed, 0 failed, 41 ignored, and two Wave64 skips included in the pass count. Both focused tests passed. NVIDIA report53301d8onto91f9a5ereported 692 passed, 0 failed, 41 ignored, and 0 skips. Both focused tests passed. The commands werecargo build --workspaceandcargo test --workspace -- --test-threads=4. AMD reportRegression run
Please apply the
test-onlylabel after reviewing this revision.Not tested
Retail titles, cases requiring external
XCL_SAMPLE_*data, release builds, and the updated tests on AMD GPUs.AI use
ChatGPT (GPT-6.2) helped diagnose and write the original fix. OpenAI Codex (GPT-6 family, exact variant unavailable) strengthened the tests, ran and checked the mutation and workspace tests, and drafted this description.
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@xelerb-debug on GitHub · 2026-11-24 03:13 UTC · original
Test report for 53301d8c86b0d799a1fa18792a2df87acecb6751 (this PR's head)
Tested
stable-x86_64-pc-windows-msvc), debugcargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4on the head: 688 passed, 0 failed, 41 ignored (lib: 648 passed, 0 failed, 21 ignored; integration tests and doc-tests: 40 passed, 0 failed, 20 ignored)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)cedf8ce),cargo test -p xcl --lib xmem_virtual_queryfailsxmem_virtual_query_marks_cpu_readable_memory3 times out of 3. It also failed on508a0c7. With this PR, bothxmem_virtual_querytests pass.VirtualQueryExreturns 0 withERROR_NOACCESS(998) when the output buffer sits at an offset of 1 or 4 from a 16-byte-aligned buffer, and succeeds at offsets 0 and 8. The old[u8; 64]buffer has 1-byte alignment, so whether the test passed depended on the stack layout. On Rust 1.90 it failed every run, and adding any local variable made it pass.QueryInfotakes the 8-byte alignment ofMEMORY_BASIC_INFORMATION, which fixes this.main(dd2ae9a) without conflicts (git merge-tree); the merged tree was not tested.Not tested
mainAI use
@MesshM on GitHub · 2026-11-24 03:33 UTC · original
Test run of
53301d8c86b0d799a1fa18792a2df87acecb6751on AMD RDNA4. I merged it onto currentmain91f9a5elocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 692 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 652 passed, 0 failed, 21 ignoredSKIPPED;xmem_virtual_query_marks_cpu_readable_memoryandxmem_virtual_query_excludes_guard_pagespass.Review: Duplicate of #656 (open), which fixes the same misaligned buffer with an
align(8)wrapper and also clears the buffer between the two queries; this one uses a#[repr(C)]struct withoffset_ofchecks (cpu_flagsat 48, size 64), which documents the layout. Only one should land. The fix itself is right:MEMORY_BASIC_INFORMATIONneeds 8-byte alignment.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@ItsMrDubey on GitHub · 2026-11-24 04:57 UTC · original
Test report for
7fdea657c96e45e9630b6db9016d7b5f8b7746cb(this PR's head)Tested
stable-x86_64-pc-windows-msvc), debug; DXC 1.9.2602.17 from Windows SDK 10.0.2610017 test binaries: 698 passed, 3 failed, 41 ignored. Same machine,
main64b3f3559: 700 passed, 1 failed, 41 ignored.This PR's tests:
hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory: okhle::kernelx::tests::xmem_virtual_query_excludes_guard_pages: okOn this machine the failure is not intermittent:
xmem_virtual_query_marks_cpu_readable_memoryfails onmain64b3f3559on every run (5 of 5 single-test reruns,XMemVirtualQueryreturns 0), and passes with this PR.Failures:
placed_title_textures_share_vram_and_preserve_pixelsfailed at its cubemap reuse check, and two tests failed on the lock it poisoned (transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memory). That is the known flake in #718 (fixed by #447), not this PR.SKIPPED (no wave64 on this GPU):
gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.
@madaraXor on GitHub · 2026-11-24 10:44 UTC · original
Tested on Windows 10 with Rust 1.90, where
mainfails this test every timemain6efdabc, then the same tree with this PR's diff applied (gh pr diff 650, head7fdea65). AMD Radeon RX 6700 XT, Ryzen 5 5600X, Windows 10 Pro 22H2 (19045.6466), Rust 1.90.0stable-x86_64-pc-windows-msvc, debug.xcl-<hash>.exe kernelx::tests::xmem_virtual_query --test-threads=1, 5 runs each:main:xmem_virtual_query_marks_cpu_readable_memoryfails 5 of 5 (panic atkernelx.rs:2070);xmem_virtual_query_excludes_guard_pagespasses.09940bb(reverted): the[0u8; 64]buffer sat at an address 4 mod 8 andVirtualQueryExfailed withERROR_NOACCESS(998), soXMemVirtualQueryreturned 0.Not tested: the whole suite with this PR applied; #656 (same failure, smaller change).
AI use: Claude Code, Claude Opus 5.5 ran the tests and wrote this comment.
@Toons29 on GitHub · 2026-11-25 02:58 UTC · original
Regression run of
7fdea657on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.@Anon64 on GitHub · 2026-11-25 08:09 UTC · original
On current
main568e7db, this test fails every time on my machine. It passes with this PR merged on top.Tested
cargo test --workspace -- --test-threads=4onmain568e7db: 1097 passed, 1 failed, 26 ignored. The failure ishle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory, atkernelx.rs:2285(CPU flagleft: 0, right: 1). SKIPPED tests: the wave64 ones (this adapter has no wave64) andir_text_assembles_signs_and_runs(no dxil.dll).cargo test -p xcl --lib xmem_virtual_query_marksonmain: failed 5 of 5 runs.7fdea65merged onto568e7db(clean merge),cargo test -p xcl --lib xmem_virtual_query: 2 passed, 0 failed in each of 5 runs.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 12:31 UTC · original
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!
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.