Recompiler: an S# word written with s_brev_b32 is a constant too #2290
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!2290
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2290/head"
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?
@Prime1997 on GitHub · 2026-11-25 12:29 UTC · original
Prime1997:contrib/static-sampler-brev→main· +62 −1 · 2 files · 1 commits · merged 2026-11-25 18:17 UTCRequested by Prime · project thread
constant_samplersturns an S# whose four words the code sets from constants into a static sampler, and it followeds_mov_b32,s_movk_i32ands_mov_b64only. The console compiler writes a word with only high bits set bit-reversed (s_brev_b32 s66, 40for 0x14000000), so such an S# was not recognised and its image instruction looked upSamplerDescriptorHeap[word 3 & 0x7FF]: entry 0 for a constant S#. This takess_brev_b32of a constant as the constant it is. Fixes #2284.What is in it
crates/xcl/src/gpu/recomp/mod.rs: one more arm inconstant_samplers(the direct translator calls the same function).crates/xcl/src/gpu/recomp/tests.rs:static_sampler_word_from_s_brev_is_a_constant(no GPU) andgpu_static_sampler_word_from_s_brev(samples through the sampler).Tested
cargo test -p xcl --lib -- static_sampler: 4 passed, 0 failed, no SKIPPED (the two new tests,gpu_static_samplers_from_constants_in_code,ps_get_lod_with_a_static_sampler). Without the change inmod.rsstatic_sampler_word_from_s_brev_is_a_constantfails (static_samplersis empty: left[], right[([146, 16773120, 335544320, 0], false)]).xcl shaders … --direct --sample 1500 --seed 7 --dump, counted withconstant_samplersover the decoded programs): 534 use a sampler in 4951 sample / gather instructions; 1253 of those are static onmain, 1735 with this change. The 482 new ones are in 203 programs.cargo test --workspace -- --test-threads=4: 1156 passed, 0 failed, 46 ignored (SKIPPED GPU tests: 25 – 20 need 64-lane waves, 3 are cases the direct per-lane form refuses,heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(needs Windows Developer Mode)).Regression run
Seeded 60 s runs without input (the same copied profile and shader cache for each, release builds from clean checkouts of the two commits,
XCL_HEAP_WINDOWS=1 XCL_LAZY_PSO=1 XCL_LAZY_COMPUTE=1 XCL_PSO_PRELOAD=0 XCL_DXC_THREADS=2). The main run is from earlier the same day, not back to back.main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
@Lum7nt on GitHub · 2026-11-25 12:59 UTC · original
AMD hardware test on clean head
253bc79d0b46f7a58945c9aa0b3e03cb132ba13b:Windows 11 build 26300, Radeon RX 9070 XT (driver
32.0.32029.2010), Rust 1.100.0 MSVC, DXC/DXIL 1.9.2609.5. SetXCL_ADAPTER=9070 XTandXCL_REQUIRE_GPU=1, then ran:cargo test --offline --locked --release -p xcl --lib static_sampler -- --nocapture --test-threads=1Result: 4 passed, 0 failed, 0 ignored; no SKIPPED messages. This includes
gpu_static_sampler_word_from_s_brevand the CPU constant-detection test.Not tested: whole workspace, retail title or main/PR smoke comparison; this result does not establish a title rendering or loading improvement.
AI use: OpenAI Codex (GPT-6; exact variant unavailable) configured the tools, ran the test, and drafted this report.
@luckyteagirl on GitHub · 2026-11-25 13:01 UTC · original
Independent AMD verification of exact PR head
253bc79d0b46f7a58945c9aa0b3e03cb132ba13bon a Radeon RX 6800M, including the news_brev_b32static-sampler GPU fixture through both translation paths.Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver
30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Debugcargo test --locked -p xcl --lib -j 2 static_sampler -- --test-threads=1 --show-output, withXCL_ADAPTER=6800MandXCL_REQUIRE_GPU=wave64. No runtime skips.XCL_DIRECT_DXIL=1: 4 passed, 0 failed, 0 ignored.gpu_static_sampler_word_from_s_brev, the existing static-sampler GPU fixture, the non-GPU regression, and the DXIL static-sampler test all passed.XCL_DIRECT_DXIL=0: 4 passed, 0 failed, 0 ignored on the same card. The new fixture samples the 4×4 texture through the static point sampler and checks the RGBA result in 64 lanes.This adds RX 6800M coverage to the PR's NVIDIA result. I did not run the full workspace suite, a paired retail-title smoke, or inspect a title image on this head. The PR's own 60-second smoke pair is on NVIDIA; this report only verifies the focused synthetic path on AMD.
AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows GPU filters, checked the logs and clean head, and drafted this report. No game data was used.
@Aniseto on GitHub · 2026-11-25 13:08 UTC · original
Ran the static-sampler tests at
253bc79(clean head, base1a0bbe3):Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
All four pass here, including the two new ones:
static_sampler_word_from_s_brev_is_a_constantgpu_static_sampler_word_from_s_brevtogether with
gpu_static_samplers_from_constants_in_codeandps_get_lod_with_a_static_sampler. The GPU tests run on the real adapter, sos_brev_b32of a constant is recognised on this part too.What this adds: the author's run was an Ampere RTX 3060 Ti (debug), and the AMD report in the thread is an RX 9070 XT (release); this is a Blackwell wave32 NVIDIA part on driver 32.0.16.2124, debug profile, single-threaded.
Not tested: native wave64, RDNA2/RDNA3 and Intel GPUs, Wine, release profile, retail titles.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@nnonno91 on GitHub · 2026-11-25 15:13 UTC · original
Independent Windows test of
253bc79d0b46f7a58945c9aa0b3e03cb132ba13b. The new bit-reversed static sampler fixture picked the expected texel across all 64 logical lanes through both shader translation paths on Radeon integrated graphics and RTX 5090.Tested
cargo test --locked -p xcl --lib static_sampler -- --nocapture --test-threads=1on each selected adapter. Each run reported 4 passed, 0 failed, 0 ignored, and no logged skips.XCL_DIRECT_DXIL=1, rancargo test --locked -p xcl --lib gpu_static_sampler_word_from_s_brev -- --nocapture --test-threads=1on each adapter. Each run reported 1 passed, 0 failed, 0 ignored, and no logged skips.Not tested
Parent revision, retail titles, or the full workspace suite.
AI use
OpenAI Codex (GPT-6.2 Sol) ran the tests, verified the results, and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 17:17 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!