Tests: pin gpu::adapter name() DXGI DESC1 extraction contract #1731

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

@⁠amazedturnip on GitHub · 2026-11-24 20:00 UTC · original
amazedturnip:xcl/tests-gpu-adapter-desc-name-extraction-contract-194420 → main · +70 −0 · 1 files · 1 commits · open

Adds crates/xcl/tests/gpu_adapter_desc.rs: an integration test pinning adapter::name() to return exactly the UTF-16 prefix of DXGI_ADAPTER_DESC1::Description up to the first NUL, capped at the 128-code-unit array. Constructs only default/NUL-padded descriptions (no device, no GPU); verifies trailing-NUL padding, 127/128-unit boundary truncation, NUL-in-middle, all-NUL/empty, NUL-first, and non-ASCII code units. No production code changed.

What is in it

  • crates/xcl/tests/gpu_adapter_desc.rs: new integration test file pinning xcl::gpu::adapter::name() against DXGI_ADAPTER_DESC1 values built directly (no device/GPU): trailing NUL padding, truncation at the 128-code-unit array boundary without terminator (127 and 128 units), NUL in the middle, all-NUL/empty array, NUL-first array, non-BMP code units (e.g. AMD ™).

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=2 — 864 passed, 0 failed, 42 ignored (SKIPPED GPU tests: 1 (no heap windows))
  • Verification / negative control: Temporarily replaced the name() prefix computation with 'let n = desc.Description.len();' (and reverted with git checkout); the full new suite failed 6/6 (empty array, NUL-terminated empty, NUL-in-middle, non-BMP, trailing padding, truncated boundary); after revert, the suite passed 6/6 again.

Not tested

  • retail Xbox Series X|S title (not available on this host)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
**@⁠amazedturnip** on GitHub · 2026-11-24 20:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1731) `amazedturnip:xcl/tests-gpu-adapter-desc-name-extraction-contract-194420` → `main` · +70 −0 · 1 files · 1 commits · open Adds crates/xcl/tests/gpu_adapter_desc.rs: an integration test pinning adapter::name() to return exactly the UTF-16 prefix of DXGI_ADAPTER_DESC1::Description up to the first NUL, capped at the 128-code-unit array. Constructs only default/NUL-padded descriptions (no device, no GPU); verifies trailing-NUL padding, 127/128-unit boundary truncation, NUL-in-middle, all-NUL/empty, NUL-first, and non-ASCII code units. No production code changed. **What is in it** - crates/xcl/tests/gpu_adapter_desc.rs: new integration test file pinning xcl::gpu::adapter::name() against DXGI_ADAPTER_DESC1 values built directly (no device/GPU): trailing NUL padding, truncation at the 128-code-unit array boundary without terminator (127 and 128 units), NUL in the middle, all-NUL/empty array, NUL-first array, non-BMP code units (e.g. AMD ™). **Tested** - Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build - AMD (`AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)`, `XCL_ADAPTER=radeon`): `cargo test --workspace -- --test-threads=2` — 864 passed, 0 failed, 42 ignored (SKIPPED GPU tests: 1 (no heap windows)) - Verification / negative control: Temporarily replaced the name() prefix computation with 'let n = desc.Description.len();' (and reverted with git checkout); the full new suite failed 6/6 (empty array, NUL-terminated empty, NUL-in-middle, non-BMP, trailing padding, truncated boundary); after revert, the suite passed 6/6 again. **Not tested** - retail Xbox Series X|S title (not available on this host) - NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64) **AI use** - Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
Adds crates/xcl/tests/gpu_adapter_desc.rs, an integration test that constructs DXGI_ADAPTER_DESC1 values directly (no GPU/device) and asserts that adapter::name() returns exactly the UTF-16 prefix of Description up to the first NUL, capped at the 128-code-unit array: trailing NUL padding, truncated-at-boundary without terminator (127 and 128 units), NUL in the middle, all-NUL/empty, non-BMP code units (e.g. Radeon ™), and a NUL-first array. Uses Default::default() as the baseline instead of cloning a real adapter. No production code changed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:54 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:37 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 22:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1731#issuecomment-7146458351) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:04 UTC · original

XCL PR #1731 verification

Head 86c3eb9fe59dad01fb76c5f09c8f9146bb72b69a. Clean detached worktree on STOR-WINLAB. The diff adds only crates/xcl/tests/gpu_adapter_desc.rs.

AMD Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175), Windows 11 Enterprise Evaluation x64 (build 26200), DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Cargo dev/test profiles had debug info and incremental compilation disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both succeeded outside the Arc mutex. The latter built 20 test binaries.
  • cargo test -p xcl --test gpu_adapter_desc with XCL_ADAPTER=NONE_CPU_ONLY outside the mutex reported 6 passed, 0 failed, 0 ignored, 0 skipped. The tests construct in-memory DXGI descriptors and verify trailing NUL padding, an interior or leading NUL, all-zero descriptions, the 127/128 UTF-16 code-unit boundary, and non-ASCII BMP characters (® and ™). They require no DXGI factory or GPU device.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. The log confirms the A770 backend. The 21 result summaries (20 test binaries and one doctest target) report 863 passed, 18 failed, 42 ignored. Cargo exited 101. The six PR tests passed again.

Workspace failures and skips

  • The library target had 17 GPU test failures. Thirteen reported CreateComputePipelineState error 0x80070057. Four reported mismatches in FMA overflow, implicit mip LOD sampling, f16 high-half preservation, or wave64 pixel reductions.
  • The test title failed dynamic depth bias check #94 in test_title_runs_and_game_folder_is_untouched. The top-right pixel was blue where green was expected.
  • pr1731-suite.log has 7 lines beginning with SKIPPED , already included in Cargo's pass count. Reasons were no wave64 (2), no D3D12 debug layer (2), tiled tier below 2, inability to disable the driver cache, and no heap windows. These skips provide no coverage.

Not tested

Matched main run, retail-title smoke, sample game data, or AMD/NVIDIA GPUs.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1731-suite.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1731#issuecomment-7152500716) # XCL PR #1731 verification Head `86c3eb9fe59dad01fb76c5f09c8f9146bb72b69a`. Clean detached worktree on STOR-WINLAB. The diff adds only `crates/xcl/tests/gpu_adapter_desc.rs`. AMD Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175), Windows 11 Enterprise Evaluation x64 (build 26200), DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Cargo dev/test profiles had debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both succeeded outside the Arc mutex. The latter built 20 test binaries. - `cargo test -p xcl --test gpu_adapter_desc` with `XCL_ADAPTER=NONE_CPU_ONLY` outside the mutex reported **6 passed, 0 failed, 0 ignored, 0 skipped**. The tests construct in-memory DXGI descriptors and verify trailing NUL padding, an interior or leading NUL, all-zero descriptions, the 127/128 UTF-16 code-unit boundary, and non-ASCII BMP characters (® and ™). They require no DXGI factory or GPU device. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. The log confirms the A770 backend. The 21 result summaries (20 test binaries and one doctest target) report **863 passed, 18 failed, 42 ignored**. Cargo exited 101. The six PR tests passed again. **Workspace failures and skips** - The library target had 17 GPU test failures. Thirteen reported `CreateComputePipelineState` error `0x80070057`. Four reported mismatches in FMA overflow, implicit mip LOD sampling, f16 high-half preservation, or wave64 pixel reductions. - The test title failed dynamic depth bias check #94 in `test_title_runs_and_game_folder_is_untouched`. The top-right pixel was blue where green was expected. - `pr1731-suite.log` has 7 lines beginning with `SKIPPED `, already included in Cargo's pass count. Reasons were no wave64 (2), no D3D12 debug layer (2), tiled tier below 2, inability to disable the driver cache, and no heap windows. These skips provide no coverage. **Not tested** Matched main run, retail-title smoke, sample game data, or AMD/NVIDIA GPUs. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1731-suite.log` and published.
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/1731/head:github-bot/gh-1731'
git switch 'github-bot/gh-1731'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1731'
git switch 'github-bot/gh-1731'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1731'
git switch 'github-bot/gh-1731'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1731'
git switch 'main'
git merge --squash 'github-bot/gh-1731'
git switch 'main'
git merge --ff-only 'github-bot/gh-1731'
git switch 'main'
git merge 'github-bot/gh-1731'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.