Recompiler: clamp out-of-range format codes to INVALID instead of format 77 (#1488) #2336
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!2336
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2336/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?
@slopgobblercobbler on GitHub · 2026-11-25 15:23 UTC · original
slopgobblercobbler:fix/recomp-fmt-info-bounds→main· +32 −2 · 2 files · 1 commits · closed without mergingResolves XCL-BT-010 in #1488.
What is in it
crates/xcl/src/gpu/recomp/emit.rs(bothBufKind::FormatLoadandBufKind::FormatStore):FMT_INFO[min({fmt}, 77u)]with({fmt} <= 77u) ? FMT_INFO[{fmt}] : 0u;.78..127) now evaluate to0u(INVALID), turning out-of-range format loads into0and stores into no-ops instead of decoding as format77(32_32_32_32_FLOAT).crates/xcl/src/gpu/recomp/tests.rs:format_codes_above_77_evaluate_to_invalidtesting both HLSL emission and GPU execution with format code80in both V# descriptor and MTBUF format immediate.Tested
cargo test -p xcl -- recomp(195 passed, 0 failed, 18 ignored)git diff --check upstream/main..HEADclean with zero trailing whitespacepython -I scripts/check_no_game_data.py crates/xcl/src/gpu/recomp/emit.rs crates/xcl/src/gpu/recomp/tests.rsconfirmed cleanNot tested
AI use
@nnonno91 on GitHub · 2026-11-25 15:28 UTC · original
Independent Windows check of
21c8b82f58e38e633625ade4a6096e87e6e27aaa. Both buffer instruction forms loaded zeros and left destination memory untouched for invalid formats, on Radeon integrated graphics and RTX 5090.Tested
cargo test --locked -p xcl --lib format_codes_above_77_evaluate_to_invalid -- --nocapture --test-threads=1on Radeon: 1 passed, 0 failed, 0 ignored, no logged skips.cargo test --locked -p xcl --lib local_typed_buffer_format_boundaries -- --nocapture --test-threads=1with a temporary test-only fixture on each explicitly selected adapter. Each run reported 1 passed, 0 failed, 0 ignored, no logged skips. Checked all four load components and read back separate store destinations for the descriptor-based and immediate-format paths. Format 77 returned and stored the expected nonzero values. Formats 78, 80 and 127 returned four zeros and preserved all four destination words. Restored the clean worktree.Not tested
Direct DXIL translation, the parent revision, retail titles, or the full workspace suite. The added test exercised the HLSL translation path.
AI use
OpenAI Codex (GPT-6.2 Sol) prepared and ran the tests, verified the results, and wrote this report.
@SlopTart on GitHub · 2026-11-25 15:30 UTC · original
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite (--release --locked,--test-threads=2): 144 passed / 3 failed / 1 ignored, same three baseline failures as plainorigin/mainon this rig (rig's known baseline: fuzz seed 1003 of #2115,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed).gpu::recomp::tests::format_codes_above_77_evaluate_to_invalid: passes on this lane (targeted run,--exact).The clamped format-code lookup behaves identically on RDNA3 under Wine; no delta in the suite.
Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@frenziedcoder on GitHub · 2026-11-25 15:31 UTC · original
NVIDIA test report for
21c8b82: full suite green and a clean smoke pair (1640 vs 1673 frames), but the new test fails withXCL_DIRECT_DXIL=1: the direct-DXIL path has its own format table lookup, which still clamps to 77.Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head21c8b82f58e38e633625ade4a6096e87e6e27aaa, no local changes.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 859 passed, 0 failed, 42 ignored; the PR's own testformat_codes_above_77_evaluate_to_invalidpasses. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Direct-DXIL path
XCL_DIRECT_DXIL=1 cargo test -p xcl --lib format_codes_above_77 -- --test-threads=1on the same head: fails,out-of-range format 80 load must return 0,left: 287454020(0x11223344, the word in memory, i.e. read as format 77). Without the switch it passes.fmt_infoincrates/xcl/src/gpu/dxil/lower_mem.rs, which still doesumin(fmt, 77)onxcl_fmt_info(andk.min(77)for a constant format). The NVIDIA runs of #2057 useXCL_DIRECT_DXIL=1, so for them this PR doesn't change anything yet.?:evaluates both operands, so({fmt} <= 77u) ? FMT_INFO[{fmt}] : 0ustill indexes the 78-entrystatic consttable with 80.select({fmt} <= 77u, FMT_INFO[min({fmt}, 77u)], 0u), the formimg_clsin the same file uses, keeps the index in range.Regression run (
scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen;XCL_PSO_PRELOAD=0for both builds, because this machine's preload list holds the program of #1307)base (
c160d86, this PR's merge base withmain):this PR:
Not tested: the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD.
AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report.
@luckyteagirl on GitHub · 2026-11-25 15:59 UTC · original
Confirmed the direct-DXIL gap reported by @frenziedcoder on exact head
21c8b82f58e38e633625ade4a6096e87e6e27aaa, using Windows 11 build 26200, AMD Radeon RX 6800M (driver30.0.13002.13003), Rust 1.99 MSVC, and DXC/DXIL 1.9.2609.5.XCL_ADAPTER=6800M,XCL_DIRECT_DXIL=1:format_codes_above_77_evaluate_to_invalidfailed 0 passed / 1 failed. Format 80 returned287454020(0x11223344) instead of zero.XCL_DIRECT_DXIL=0: the same test passed 1/0/0.gpu/dxil/lower_mem.rs::fmt_info: keepumin(fmt, 77)for a safe table index, then select zero when the original format exceeds 77:With this local change, the direct-DXIL format-80 test passed 1/0/0, and the broader
formatfilter passed 16/0/0, with no explicit skips. I restored the local change; the checkout is clean at the exact PR head. This is a suggested fix for this PR, not a new submitted commit. I did not run a full workspace suite or title smoke pair.AI use: OpenAI Codex (GPT-6) reproduced the failure, tested the local fix, and prepared this report.
@throny on GitHub · 2026-11-25 17:12 UTC · original
Two contributors checked independently and found that this PR makes the same change as #1574 (for #1488): #1607, group D84. They suggest keeping #1574. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.
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.
@DavidM1911 on GitHub · 2026-11-25 18:10 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!
@CalvyPZ on GitHub · 2026-11-25 22:42 UTC · original
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
github-bot referenced this pull request2026-11-26 06:18:31 +00:00
Pull request closed