Shaders: guard wave64 graphics direct DXIL #1913
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!1913
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1913"
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?
@mokkamokacaffe on GitHub · 2026-11-24 23:00 UTC · original
mokkamokacaffe:dxil/guard-wave64-graphics-cache→main· +105 −11 · 4 files · 2 commits · openFixes #1895.
Wave64 vertex and pixel shaders can read lanes 32–63 while the selected adapter requires two 32-lane waves. Direct graphics DXIL has no split-wave64 form, so these programs must use the HLSL
upper_lanespath instead of producing incorrect direct DXIL.What is in it
crates/xcl/src/gpu/recomp/pso.rs: pass the adapter's wave32/split requirement into the live Direct DXIL VS/PS route and refuse programs that need upper-lane emulation, allowing the existing HLSL fallback to take them. The route uses the FSSM-header-aware wave-size decision from currentmain.crates/xcl/src/gpu/recomp/mod.rs: conservatively classify written/read upper lanes; incomplete or unknown instruction streams require fallback.crates/xcl/src/gpu/dxil/coverage.rs: apply the same refusal toxcl shaders --directinside its panic boundary, keeping offline coverage consistent with runtime routing.Tested
7134a641f03f66e72199f6c9a90b7323b43d4e0f:cargo check -p xcl --tests --target x86_64-pc-windows-msvcpassed after merging currentmain.cf70b66810cbc16ec312a63389ac6d510970e25d, Windows 11 build 26200.9974, Rust 1.100.0 MSVC, CPU fixture with an Intel Arc A770 driver installed:cargo test --locked -p xcl --lib gpu::dxil::coverage::tests::split_wave64_graphics_refuses_upper_lane_read -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 0 skipped.Regression run
The following paired run passed on the previous head. It is retained as historical evidence and must be replaced by a fresh pair from
scripts/smoke.ps1after testing current head7134a641f03f66e72199f6c9a90b7323b43d4e0f.main (historical):
this PR (historical head):
That historical PR run produced 100% of main's frames and 102% of its peak commit, with no crash or device removal. It does not satisfy the exact-head merge gate after the conflict-resolution commit and does not establish that the title reached the changed routing path.
Not tested
7134a641f03f66e72199f6c9a90b7323b43d4e0f.XCL_SHADER_BACKEND=dxilgameplay past the menus on the current head.AI use
main, verified the Windows MSVC-target test build, reviewed the external test reports, and drafted this description. External test reports disclose their own tools and models in the linked comments.@WebIdentity1 on GitHub · 2026-11-24 23:15 UTC · original
I tested commit
e9d23bed39c766d071325f9c63dff8e5d5ff6115on native Windows 10 19045, RTX 3090 (driver 591.74), Rust 1.98.1 MSVC, DXC 1.8.2502.11. The current head5e89ca2bf2bb25758d5c2e7eb9cafd2e43f1433chas the identical tree (3a69a738801756a4b5b1908eb8a3513cfd32c2a1) and parent; only the commit object changed. OpenAI Codex (GPT-6) prepared the synthetic test and ran the checks over SSH. Source-only archives were SHA-256 checked before and after each run; no game files were used.The existing
a_whole_wave_reduction_reads_its_identity,shader_cache_bypasses_debug_overrides,gpu_wave64_ps_whole_wave_reductions,gpu_wave64_vs_spill_slots_and_identity, anddirect_and_hlsl_graphics_stages_linktests each passed 1/0/0, with no GPU skips. I also added a local test-only overlay to exercisecoverage::translate_modefor both VS and PS with a written lane 32. It passed 1/0/0 on this PR; on parent689f2db477c3c062cf162649781640ef8a977c18, the same test (minus the newneeds_upper_lanesassertion, which the parent does not define) failed because direct translation returnedOk. Here is the head-side test to add if useful:I ran
cargo test --locked --workspace -- --test-threads=4on the clean PR head. The xcl library test binary stopped the workspace run: 922 passed, 4 failed, 25 ignored, 0 SKIPPED. The same four failures and 922/4/25 count occurred on the parent with only the regression test overlaid and excluded (--skip split_wave64_graphics_refuses_upper_lane_read):gpu_clamp_and_omod_per_instruction,placed_title_textures_share_vram_and_preserve_pixels, and two lock-poisoned texture/VRAM tests. These failures predate this PR on this machine; the remaining workspace packages did not run after the library failure.This validates the split-wave refusal at the offline translator and adjacent GPU graphics output. It does not exercise a retail shader container through the live PSO route or satisfy the required paired retail
smoke.ps1gate. I did not run a proprietary title.@eizispark on GitHub · 2026-11-24 23:19 UTC · original
Hardware test report — commit
5e89ca2Verified
5e89ca2bf2bb25758d5c2e7eb9cafd2e43f1433c(based on689f2db477c3c062cf162649781640ef8a977c18; clean merge with currentmain20cf130): pass (0new failures vs689f2db).Tested
32.0.32015.16001), 32 GB RAM,rustc 1.100.0 (0ef1bc386 2026-11-09)(stable-x86_64-pc-windows-msvc), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads:972 passed, 2 failed, 45 ignored(8 skipped), matching689f2db(972 passed, 2 failed, 45 ignored,8 skipped) on this adapter:--skip gpu::dxil::msaa_tests::gpu_direct_msaa_image_loadsavoids the pre-#1900RDNA4amdxc64crash on base689f2db, and the 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3) are the pre-existing689f2dbAMD fuzz seeds;0new failures8 skipped: 6gpu::recomp::lower_dxil::testsf16/f32 direct-DXIL per-lane cases refused where#1426semantics differ from the console's;shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required,0x887A002D);heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsgpu::recomp::upper_lanes::tests::a_whole_wave_reduction_reads_its_identity(9/9upper_lanes::tests),gpu::recomp::pso::shader_cache_tests::shader_cache_bypasses_debug_overrides, and native RDNA4 wave64 GPU tests (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,console_wave64_compute_through_the_pso_hook_dispatch_and_read_back) all passedRegression run
main(689f2db477c3c062cf162649781640ef8a977c18):PR (
5e89ca2bf2bb25758d5c2e7eb9cafd2e43f1433c):Not tested
needs_upper_lanesdirect-DXIL fallback,XCL_SHADER_BACKEND=dxilretail run, gameplay past the menusAI use
@WebIdentity1 on GitHub · 2026-11-24 23:25 UTC · original
I tested a local patch for @ruipedro-pinheiro's three review points on the source tree of
5e89ca2(identical to testede9d23be). OpenAI Codex (GPT-6) prepared it and ran the native Windows checks; no code was pushed. The patch below applies to the clean PR tree (git apply --checkpassed).The guard now returns
truefor an unknown instruction, a decoded instruction extending beyond the byte slice, or trailing incomplete bytes. This is conservative even afterS_ENDPGM; the direct CFG decoder also rejects unknown instructions, and the extra fallback avoids acting on a partial lane analysis. The offline guard is insidecatch_unwind, and thesplit: falsechoice is documented at the live graphics call site.I also added this focused test alongside the written-lane-32 test from my previous comment; it failed on the original PR code and passed with the patch:
Tested: Native Windows 10 19045, RTX 3090 driver 591.74, Rust 1.98.1 MSVC, DXC 1.8.2502.11; 310 source files per snapshot matched SHA-256 manifests before/after.
cargo test --locked -p xcl --lib split_wave64_graphics_refuses_incomplete_decode -- --test-threads=1 --show-output: original PR plus test 0/1/0 (expected negative); patched PR 1/0/0. The written-lane-32 guard, classifier, cache, and two wave64 graphics output tests each passed 1/0/0 on the patched PR, no focused GPU skips.Paired
cargo test --locked --workspace --no-fail-fast -- --test-threads=4: clean PR tree 970 passed / 5 failed / 45 ignored, patch plus two tests 972 / 5 / 45 across 20 targets. Both runs had the same five failures (gpu_clamp_and_omod_per_instruction,placed_title_textures_share_vram_and_preserve_pixels, two poisoned texture/VRAM tests,test_title_runs_and_game_folder_is_untouched) and the same 23 explicit GPU skip notices. Cargo recompiled XCL in both runs. This is a same-tree comparison, not a claim that the pre-existing failures are fixed.Not tested: Paired retail
smoke.ps1with this local patch, AMD, or a retail wave64 VS/PS through the live direct-DXIL PSO route. The other tester's retail smoke covered the unpatched PR head.@WebIdentity1 on GitHub · 2026-11-24 23:30 UTC · original
One additional test closes part of the live graphics container coverage gap. It uses the repository's existing synthetic
xbox::tests::{fssm, sample}helpers, callspso::direct_graphicswithsplit_wave64=truefor both VS and PS, checks the upper-lane refusal, then checks thatconsole_translationproduces complete HLSL and DXC compiles it. It does not set global environment variables or need game data. This test-only patch applies to the clean current PR tree:Tested: OpenAI Codex (GPT-6) ran
cargo test --locked -p xcl --lib direct_graphics_routes_written_upper_lane_to_hlsl -- --test-threads=1 --show-outputon native Windows 10 19045 with RTX 3090 driver 591.74, Rust 1.98.1 MSVC and DXC 1.8.2502.11. 1 passed / 0 failed / 0 ignored. The test uses DXC but does not execute the GPU. The 310-file source archive was the unchanged PR tree plus this test only and matched its SHA-256 manifest before/after; Cargo recompiled XCL. I also ran it successfully on the candidate with my earlier review fixes, but the unchanged-tree result is the one relevant to adoption.This checks container parsing, the direct graphics guard and DXC compilation of the fallback. It does not execute a draw, prove final GPU pixels, exercise
XCL_DIRECT_DXIL=alldispatch throughcompile_console_shader, or replace the paired retail smoke gate. No code was pushed.@Melow-code on GitHub · 2026-11-25 01:03 UTC · original
The three points look addressed: the alias-key behaviour is now pinned by the live-graphics-container test (a direct graphics PSO with split_wave64 for VS and PS exercises the CSE path my first point asked a core test for), and the other two were notes, not blockers. Nothing else from my side. Thanks for the clean follow-up. (Reply written with DeepSeek V4 Pro, OpenCode.)
@DavidM1911 on GitHub · 2026-11-25 02:24 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!
@JJAutoCompare on GitHub · 2026-11-25 03:00 UTC · original
PR #1913 — split-wave64 graphics compatibility
#1913
Tested
cf70b66810cbc16ec312a63389ac6d510970e25d. GitHub showed the PR open at that SHA before and after testing. The final discussion had six comments and one review, with no equivalent exact-head report.1.100.0 (0ef1bc386 2026-11-09), hostx86_64-pc-windows-msvc, Cargo1.100.0 (3acc79c0c 2026-11-05), unoptimized test profile. DXC and DXIL file versions1.9.2609.5.XCL_ADAPTER=A770andXCL_DXC_DIR=C:\Users\ljensen\AppData\Local\XclTooling\dxc-1.9.2609\bin\x64were set for the process. The fixture did not use the adapter or DXC.CARGO_BUILD_JOBS=2,CARGO_INCREMENTAL=0,CARGO_PROFILE_DEV_DEBUG=0,CARGO_PROFILE_TEST_DEBUG=0,CARGO_TARGET_DIR=L:/XclTooling/pr2014-1c971de6/target. TEMP and TMP pointed to the run's temp directory.Result — 1 passed, 0 failed, 0 ignored, 0 skipped, 1,066 filtered out. Cargo exited 0.
The checked-in fixture writes and reads lane 32 of a valid synthetic wave64 program. It confirms that the classifier requires upper-lane emulation and that split-wave64 offline direct DXIL translation returns the expected upper-lane emulation error for both VS and PS. With direct graphics DXIL enabled and wave64 splitting required, the expected live route is to refuse direct DXIL and continue through HLSL upper-lane emulation. The fixture stops at the offline guard with
validate=false, before generating or compiling shader code or running the DXIL validator. It has no built-in direct DXIL positive control.Not tested
Live PSO routing, HLSL fallback compilation, successful direct DXIL emission, DXIL validation, GPU execution or pixel output, malformed inputs, cache behavior, the workspace suite, and retail-title smoke.
AI use
T3 Code / Codex (
gpt-6.2-sol) verified the exact head and discussion, ran the checked-in fixture, and wrote this report.@Toons29 on GitHub · 2026-11-25 13:08 UTC · original
Regression run of
cf70b668on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 102 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.@throny on GitHub · 2026-11-25 14:54 UTC · original
Two contributors checked independently and found that #2252 solves the same problem (for #1895) in a different way: #1607, group D74. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@mokkamokacaffe on GitHub · 2026-11-25 23:21 UTC · original
The PR-description check now fails only because the previous AMD smoke run targeted old head
cf70b668. Someone with the hardware must rerunscripts/smoke.ps1on7134a641f03f; we should not relabel the old result as current-head validation.@thehollowedone on GitHub · 2026-11-25 23:58 UTC · original
Independent Windows/NVIDIA check of the current clean head
7134a64. Hardware: RTX 3080 Ti / driver 621.35, Windows 11 build 26300, rustc 1.99.1, DXC 1.8.2502.11; debug build.Tested
cargo test -p xcl --lib direct_graphics_routes_written_upper_lane_to_hlsl -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored. The synthetic VS/PS container was refused by direct graphics, routed to HLSL, and compiled by DXC. This fixture does not draw pixels.cargo build --workspace: passed.cargo test --workspace --no-fail-fast -- --test-threads=4: 1,432 passed, 0 failed, 47 ignored; 25 explicitSKIPPEDGPU notices.Not tested: a current-head paired title smoke, final pixels from an upper-lane VS/PS, AMD/native wave64, or gameplay through this route. The historical smoke blocks in the PR description remain historical; this test report does not replace the current-head regression run.
AI use: Codex (GPT-6.2 Sol) reviewed the fixture, ran the tests, and drafted this report.
github-bot referenced this pull request2026-11-26 06:18:30 +00:00
@DavidM1911 on GitHub · 2026-11-26 06:41 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@Melow-code on GitHub · 2026-11-24 23:13 UTC · original · reviewed
Routing is correct — wave64 VS/PS reading lanes 32-63 goes to HLSL upper_lanes. Three points:
needs_upper_lanesstops at the first decode error and returns the partial result. For a guard, the safe answer istruewhen decode fails before S_ENDPGM.catch_unwind. A panic inupper_lanes::analyzestops the whole coverage run. Put it inside the closure.splitstays false — if direct graphics has no split form, a one-line comment would clarify this.Please run the Rust tests on Windows before merge.
@Melow-code on GitHub · 2026-11-25 11:54 UTC · original · reviewed
The routing change is correct. A wave64 VS or PS in 32-lane waves can read lanes 32 to 63 in a way that is not native. Such a shader now goes to the HLSL
upper_lanesform. TheXCL_DXIL_NO_OPTcache bypass is also correct. Three points:needs_upper_lanesstops at the first decode error and returns the result for the part before it. For a guard, the safe answer istruewhen the decode fails beforeS_ENDPGM.translate_modeincoverage.rs. The new check runs beforecatch_unwind. A panic inupper_lanes::analyzethen stops the whole coverage run, where other panics come back as"panic: ...". Put the check inside the closure.splitstays false.direct_graphicsnow takessplit_wave64, but it still passessplit: falsetoKernelOptions. If the direct translator has no split form for graphics, add a short comment that says so.The PR says that nobody ran the Rust tests, the DXIL validation or a GPU run yet. Please run the tests on Windows once before merge, with the new
needs_upper_lanestest.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.