Skip to content

Tests: align the XMemVirtualQuery output buffer - #656

Closed
TurGangS wants to merge 1 commit into
xcl-dev:mainfrom
TurGangS:tests-align-xmem-query
Closed

TurGangS wants to merge 1 commit into
xcl-dev:mainfrom
TurGangS:tests-align-xmem-query

Conversation

@TurGangS

Copy link
Copy Markdown

The debug memory-query test failed on this PC at its first assertion. #454 and #465 also report that failure. Its 64-byte output buffer has byte alignment, but VirtualQueryEx writes a MEMORY_BASIC_INFORMATION there and the test reads it as that type.

What is in it

  • Align the buffer to 8 bytes in the kernelx test and clear it between the committed and reserved page cases. Both cases keep their original assertions.

Tested

  • Windows 11 build 26300.9974, i9-14900KF, RTX 4070 Ti (32.0.16.1088), Rust 1.88.0, DXC 1.9.2609.5, debug.
  • The focused test failed on 18c105a (returned 0, expected 1) and passed on d3e0b22.
  • cargo test --offline --workspace -- --test-threads=4: 689 passed, 0 failed, 41 ignored. Two passes reported SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware. The first suite attempt stalled in GPU tests and was stopped before this successful retry.

Regression run

  • Only the test changes. Please apply the test-only label after reviewing the diff.

Not tested

  • Retail titles, release mode on this revision, and other hardware.

AI use

  • OpenAI Codex (GPT-6) reproduced the failure, edited the test, ran the suite and drafted this description.

The test passes a byte array to VirtualQueryEx and reads it as MEMORY_BASIC_INFORMATION. Give the array the alignment of the x64 structure so the result no longer depends on the stack layout.
@MonkeyPython

Copy link
Copy Markdown

Third data point for the #650 / #656 choice: xmem_virtual_query_marks_cpu_readable_memory passes on this Windows host at this PR's head, on both adapters.

Setup: Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB; RTX 3080 Ti 12 GB (driver 621.01) and AMD Radeon(TM) Graphics (Raphael iGPU). PR head d3e0b22, release.

Runs (cargo test -p xcl --release --lib xmem_virtual_query_marks_cpu_readable_memory):

  • Default adapter (3080 Ti): 1 passed / 0 failed.
  • XCL_ADAPTER=Radeon (iGPU): 1 passed / 0 failed.

The test is CPU-side (kernelx working-set query), so it is adapter-independent here; the failures reported on 4070 Ti and Mac do not reproduce on this machine. It also passed in every full-suite run this session (a6f5f7a, 508a0c7, dd2ae9a).

Not tested: the 4070 Ti / Mac configurations themselves.

AI use: Gentle Shell (Pi coding agent), model qwen4-max: ran the tests and wrote this report from their logs; a human reviews it before posting. No code changes.

@ivall

ivall commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Closing this as a duplicate: #650 makes the same change and was opened first (the XMemVirtualQuery tests use an aligned buffer). It stays open and is the one that will be reviewed and merged.

This says nothing about the quality of the code here. I compared the two diffs; the pair was also found by independent checks in #1607. If this PR covers a case #650 does not, or #650 is closed without being merged, say so and I'll reopen it. A test that is only here is welcome on #650.

Thank you for the work.

AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this comment; the decision is the maintainer's.

@ivall ivall closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants