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

Open
amazedturnip wants to merge 1 commit from upstream-pr/1731 into main
amazedturnip commented 2026-11-24 20:00:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-24T20:00:47Z.


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).
<!-- greyfinch-sync:ivall/xcl:issue:5479382281 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1731). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-24T20:00:47Z. --- 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).
DavidM1911 commented 2026-11-24 23:08:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:37:47Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7146458351 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1731#issuecomment-7146458351). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T22:37:47Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
JJAutoCompare commented 2026-11-25 04:10:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:04:14Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7152500716 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1731#issuecomment-7152500716). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:04:14Z. --- # 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.
github-actions[bot] commented 2026-11-28 20:17:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T20:17:40Z.


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:7245180152 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1731#issuecomment-7245180152). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T20:17:40Z. --- 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.
amazedturnip commented 2026-11-28 20:36:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-28T20:36:44Z.


Still merges cleanly onto main (765b2c5b) with passing checks; pins gpu::adapter::name() UTF-16 DXGI_ADAPTER_DESC1 extraction and NUL truncation contracts — waiting on maintainer / post-goal review.

<!-- greyfinch-sync:ivall/xcl:comment:7245412961 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1731#issuecomment-7245412961). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-28T20:36:44Z. --- Still merges cleanly onto main (765b2c5b) with passing checks; pins gpu::adapter::name() UTF-16 DXGI_ADAPTER_DESC1 extraction and NUL truncation contracts — waiting on maintainer / post-goal review.
Foniass commented 2026-12-01 06:36:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:36:52Z.


Triage (#1607) – head 86c3eb9

No open or merged PR tests gpu::adapter::name; main has no test of it (adapter_tests.rs does not cover it).
Nits: CONTRIBUTING puts unit tests of a function in the file's test module (crates/xcl/src/gpu/adapter_tests.rs) rather than a new integration test binary; name_with_non_bmp_code_units_round_trips only uses BMP characters (®, ™), so it does not test surrogate pairs as its name says.
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:7303073210 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1731#issuecomment-7303073210). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:36:52Z. --- **Triage (#1607)** – head 86c3eb9 No open or merged PR tests `gpu::adapter::name`; main has no test of it (`adapter_tests.rs` does not cover it). Nits: CONTRIBUTING puts unit tests of a function in the file's test module (`crates/xcl/src/gpu/adapter_tests.rs`) rather than a new integration test binary; `name_with_non_bmp_code_units_round_trips` only uses BMP characters (®, ™), so it does not test surrogate pairs as its name says. 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/1731:upstream-pr/1731'
git switch 'upstream-pr/1731'

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/1731'
git switch 'upstream-pr/1731'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1731'
git switch 'upstream-pr/1731'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1731'
git switch 'main'
git merge --squash 'upstream-pr/1731'
git switch 'main'
git merge --ff-only 'upstream-pr/1731'
git switch 'main'
git merge 'upstream-pr/1731'
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!1721
No description provided.