D3D12.X: a console sampler keeps its filter and border colour #1885

Open
github-bot wants to merge 2 commits from github-bot/gh-1885 into main AGit
Owner

@⁠veyn-sudo on GitHub · 2026-11-24 22:34 UTC · original
veyn-sudo:pr/sampler-filter → main · +73 −13 · 1 files · 2 commits · open

CreateSamplerX (device #61) made every sampler anisotropic with a transparent black border, whatever the desc asked for: point samplers filtered linearly, and opaque black and white borders were lost. Both fields are in the console desc and are now taken from it.

What is in it (crates/xcl/src/hle/d3d12x/device_x.rs)

  • the filter: magnification / minification at +4 / +8, mip at +0x10, numbered as in an S# (the z filter at +0xC has no PC field). The desc is built in pc_sampler_desc, so that it can be tested
  • the border colour at +0x44

A maximum anisotropy of 1 gives no anisotropic filter. Anisotropic point (2) is point, as #1117 reads it in an S#.

Tested

  • RTX 2070 SUPER (driver 617.14), i7-9700K, Windows 11 (26300), Rust 1.99.0; tests in debug, title in release
  • cargo test --workspace -- --test-threads=4: 961 passed, 0 failed, 43 ignored. SKIPPED lines: 18 no wave64, 1 no heap windows, 3 per-lane f16 refusals
  • new tests console_samplers_keep_their_filter, console_samplers_keep_their_border_colour
  • the 30 different descs a retail title makes up to its first screen: 5 point (2 2 1 1), 17 bilinear (1 1 1 2, 1 1 2 2), 8 anisotropic (3 3 2 2, one with a maximum of 1). 9 use border addressing, one of them with opaque black and one with white. None has a comparison function

Regression run

main:

xcl-smoke v1
commit: c4d37bec1bb4286eb373aea963404a23f13401fa
gpu: NVIDIA GeForce RTX 2070 SUPER
title: 404998dc
seconds: 60
exit: 0x0
frames shown: 1540 (PresentX 1540)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17766 MB

PR:

xcl-smoke v1
commit: b76c075450a3bee4d4d27ad6e9de06d0e308f933
gpu: NVIDIA GeForce RTX 2070 SUPER
title: 404998dc
seconds: 60
exit: 0x0
frames shown: 1555 (PresentX 1555)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18724 MB

Not tested

  • a visible difference in the title: none was looked for
  • the field meanings are read from these descs and the S# numbering; +0xC as z and +0x10 as mip rests on the S# field order and the two descs where they differ
  • AMD, Intel and other NVIDIA GPUs; comparison samplers (none seen, not modelled, as before)

HANDOFF.md says "#61 CreateSamplerX (0x6C-byte desc → anisotropic PC sampler)": no longer true for every sampler.

AI use

  • Claude Code with Claude Opus 5.5 found the cause, wrote the code, the tests, the measurements and this description, and ran the tests

🤖 Generated with Claude Code

**@⁠veyn-sudo** on GitHub · 2026-11-24 22:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1885) `veyn-sudo:pr/sampler-filter` → `main` · +73 −13 · 1 files · 2 commits · open `CreateSamplerX` (device #61) made every sampler anisotropic with a transparent black border, whatever the desc asked for: point samplers filtered linearly, and opaque black and white borders were lost. Both fields are in the console desc and are now taken from it. **What is in it** (`crates/xcl/src/hle/d3d12x/device_x.rs`) - the filter: magnification / minification at +4 / +8, mip at +0x10, numbered as in an S# (the z filter at +0xC has no PC field). The desc is built in `pc_sampler_desc`, so that it can be tested - the border colour at +0x44 A maximum anisotropy of 1 gives no anisotropic filter. Anisotropic point (2) is point, as #1117 reads it in an S#. **Tested** - RTX 2070 SUPER (driver 617.14), i7-9700K, Windows 11 (26300), Rust 1.99.0; tests in debug, title in release - `cargo test --workspace -- --test-threads=4`: 961 passed, 0 failed, 43 ignored. SKIPPED lines: 18 no wave64, 1 no heap windows, 3 per-lane f16 refusals - new tests `console_samplers_keep_their_filter`, `console_samplers_keep_their_border_colour` - the 30 different descs a retail title makes up to its first screen: 5 point (2 2 1 1), 17 bilinear (1 1 1 2, 1 1 2 2), 8 anisotropic (3 3 2 2, one with a maximum of 1). 9 use border addressing, one of them with opaque black and one with white. None has a comparison function **Regression run** main: ``` xcl-smoke v1 commit: c4d37bec1bb4286eb373aea963404a23f13401fa gpu: NVIDIA GeForce RTX 2070 SUPER title: 404998dc seconds: 60 exit: 0x0 frames shown: 1540 (PresentX 1540) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17766 MB ``` PR: ``` xcl-smoke v1 commit: b76c075450a3bee4d4d27ad6e9de06d0e308f933 gpu: NVIDIA GeForce RTX 2070 SUPER title: 404998dc seconds: 60 exit: 0x0 frames shown: 1555 (PresentX 1555) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18724 MB ``` **Not tested** - a visible difference in the title: none was looked for - the field meanings are read from these descs and the S# numbering; +0xC as z and +0x10 as mip rests on the S# field order and the two descs where they differ - AMD, Intel and other NVIDIA GPUs; comparison samplers (none seen, not modelled, as before) `HANDOFF.md` says "#61 CreateSamplerX (0x6C-byte desc → anisotropic PC sampler)": no longer true for every sampler. **AI use** - Claude Code with Claude Opus 5.5 found the cause, wrote the code, the tests, the measurements and this description, and ran the tests 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CreateSamplerX made every sampler anisotropic, so point samplers filtered linearly. The desc has
the filters at +4 / +8 (magnification, minification), +0xC (z) and +0x10 (mip), numbered as in an
S#.

Of the 30 different descs a retail title makes up to its first screen, 5 are point (2 2 1 1), 17
bilinear (1 1 1 2, 1 1 2 2) and 8 anisotropic (3 3 2 2; one of them with a maximum of 1). None has
a comparison function.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CreateSamplerX gave every sampler a transparent black border. The desc has the colour at +0x44: of
a retail title's 9 descs with border addressing, one asks for opaque black and one for white.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:08:31 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 22:45 UTC · original · edited 2026-11-24 22:53 UTC

Full-suite run, since this PR has no test report yet. Tested exact head b76c075 (on its base c4d37be).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: 956 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: console_samplers_keep_their_filter, console_samplers_keep_their_border_colour.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 961 passed, 0 failed, 43 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • On NVIDIA, --skip leaves out five tests where this PR's base has them. They fail on main 689f2db too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. These are heap_window_out_of_memory_falls_back_to_the_switch_form (#1651) and the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests (follow-up on #1651). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 22:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1885#issuecomment-7146608328) · edited 2026-11-24 22:53 UTC Full-suite run, since this PR has no test report yet. Tested exact head `b76c075` (on its base `c4d37be`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu`: **956 passed, 0 failed, 43 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `console_samplers_keep_their_filter`, `console_samplers_keep_their_border_colour`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **961 passed, 0 failed, 43 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - On NVIDIA, `--skip` leaves out five tests where this PR's base has them. They fail on main `689f2db` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns their skips into failures. These are `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651) and the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 02:07 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!

**@⁠DavidM1911** on GitHub · 2026-11-25 02:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/1885#issuecomment-7150341179) 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!
Author
Owner

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

PR #1885 — Intel Arc A770 verification

Tested commit b76c075450a3bee4d4d27ad6e9de06d0e308f933, the fetched PR head.

Environment

STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0. DXC/DXIL 1.9.2609.5, rustc 1.100.0 (0ef1bc386 2026-11-09). Unoptimized builds with debug info disabled and XCL_ADAPTER=A770.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both succeeded outside the GPU lock.
  • cargo test -p xcl console_samplers_keep -- --nocapture reported 2 passed, 0 failed, 0 ignored. The two CPU tests verify point, linear, mixed and anisotropic filter encoding and preservation of all four border-colour components in the PC descriptor used by CreateSamplerX.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under the shared Arc lock. Cargo exited 101. pr1885-suite.log contains 20 result blocks totalling 942 passed, 19 failed, 43 ignored, with 22 SKIPPED lines counted separately. Both sampler tests passed in this run too.

Failures and skips

  • 18 library failures. 14 rejected compute PSO creation with 0x80070057, including FP64 cases. Four reported result mismatches in FMA overflow, FP16 high-half preservation, implicit-LOD offset sampling (25.609375 vs 26), and wave64 pixel reductions. The offset-sampling test supplies a sampler from an S# descriptor directly to the GPU runner.
  • One test-title e2e failure. The RSSetDepthBiasX check read blue at the top-right pixel where it expected green.
  • The 22 logged skips were 17 for unavailable wave64, three for refused wave32 per-lane DXIL forms, one for unavailable driver-cache control, and one for unavailable heap windows. They provide no coverage for the skipped paths.

Not tested

GPU rendering via CreateSamplerX, retail titles or a paired main/PR smoke run, other GPUs, and game-data checks gated by unset XCL_SAMPLE_* variables. The debug-layer title check returns early on this host because d3d12SDKLayers.dll is absent.

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 pr1885-suite.log and published this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1885#issuecomment-7151501361) # PR #1885 — Intel Arc A770 verification Tested commit `b76c075450a3bee4d4d27ad6e9de06d0e308f933`, the fetched PR head. **Environment** STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32, `DoublePrecisionFloatShaderOps=0`. DXC/DXIL 1.9.2609.5, `rustc 1.100.0 (0ef1bc386 2026-11-09)`. Unoptimized builds with debug info disabled and `XCL_ADAPTER=A770`. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both succeeded outside the GPU lock. - `cargo test -p xcl console_samplers_keep -- --nocapture` reported **2 passed, 0 failed, 0 ignored**. The two CPU tests verify point, linear, mixed and anisotropic filter encoding and preservation of all four border-colour components in the PC descriptor used by `CreateSamplerX`. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once under the shared Arc lock. Cargo exited 101. `pr1885-suite.log` contains 20 result blocks totalling **942 passed, 19 failed, 43 ignored**, with **22 `SKIPPED ` lines** counted separately. Both sampler tests passed in this run too. **Failures and skips** - 18 library failures. 14 rejected compute PSO creation with `0x80070057`, including FP64 cases. Four reported result mismatches in FMA overflow, FP16 high-half preservation, implicit-LOD offset sampling (25.609375 vs 26), and wave64 pixel reductions. The offset-sampling test supplies a sampler from an S# descriptor directly to the GPU runner. - One test-title e2e failure. The `RSSetDepthBiasX` check read blue at the top-right pixel where it expected green. - The 22 logged skips were 17 for unavailable wave64, three for refused wave32 per-lane DXIL forms, one for unavailable driver-cache control, and one for unavailable heap windows. They provide no coverage for the skipped paths. **Not tested** GPU rendering via `CreateSamplerX`, retail titles or a paired `main`/PR smoke run, other GPUs, and game-data checks gated by unset `XCL_SAMPLE_*` variables. The debug-layer title check returns early on this host because `d3d12SDKLayers.dll` is absent. **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 `pr1885-suite.log` and published this report.
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/1885/head:github-bot/gh-1885'
git switch 'github-bot/gh-1885'

Merge

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