Recompiler: handle packed ISG1 vertex inputs sharing a register (#105) #313
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!313
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-313"
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?
@Michael-Glaser on GitHub · 2026-11-23 23:07 UTC · original
Michael-Glaser:fix/recomp-vertex-packed-isg1→main· +59 −4 · 2 files · 1 commits · openPart of #105.
Mode::VertexnamedXclInfieldsa{e.register}and ignorede.mask, emitting duplicate field names and reading wrong channels when twoISG1inputs share a register. Overlaps #297 (same packed-ISG1 issue, different approach).What is in it
crates/xcl/src/gpu/recomp/emit.rs: nameXclInfieldsa{k}by index (matchingMode::Pixel) and map VGPR channels usinge.mask.crates/xcl/src/gpu/recomp/tests.rs: unit testvertex_packed_isg1_inputs_get_distinct_fields_and_components.Tested
aarch64-apple-darwin, Rust 1.100.0):cargo check --offline --target x86_64-pc-windows-msvc --workspace --tests(0 errors, 0 new warnings).Not tested
cargo test, GPU tests, andscripts/smoke.ps1not run yet.AI use
In Mode::Vertex, struct XclIn named fields a{e.register} and VGPR initialisation looked up the first element matching e.register while ignoring e.mask. When two ISG1 vertex inputs pack into one register (e.g. TEXCOORD0 .xy and TEXCOORD1 .zw in register 1), XclIn emitted duplicate field names (failing DXC compilation) and upper channels read from the first element instead of the packed element's components. Name XclIn fields by element index (a{k}, matching Mode::Pixel) and match each VGPR channel against e.mask, indexing the packed element starting from component 0 while keeping the unmasked fallback for single elements that rely on IA defaults. Assisted-by: Antigravity (Gemini 4 Neon)github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@regiumlepidi on GitHub · 2026-11-23 23:46 UTC · original
A Windows run for this draft, and a note that #297 (draft) fixes the same packed-ISG1 case in another way; the two conflict in
emit.rs.This PR:
18ca3b6merged onto currentmaindb1ddb2(clean merge) builds and passes on both adapters: 667 passed, 0 failed, 41 ignored on an RTX 5070 Ti (driver 617.42) and on the Ryzen 7 9800X3D's RDNA2 iGPU (driver 32.0.21030.2001,XCL_ADAPTER=radeon);mainalone is 666 / 0 / 41 on both.vertex_packed_isg1_inputs_get_distinct_fields_and_componentsfails withmain'semit.rsand passes with this PR's. Windows 11 Pro 25H2, Ryzen 7 9800X3D, rustc 1.100.0 MSVC, DXC from Windows SDK 10.0.26100, debug, noXCL_SAMPLE_*.Cross-check with #297 (
a5b7825; #297 does not merge withmaindb1ddb2any more, so each PR at its own head, on9ab7d76). Each PR's tests appended to the other'stests.rs, both adapters, same result on each:gpu_vs_packed_isg1_inputs(draws on the GPU)vs_packed_isg1_inputs_are_members_of_their_own(HLSL text)vertex_packed_isg1_inputs_get_distinct_fields_and_components(HLSL text)mainfloat2 a1_0/float2 a1_2, notfloat4 a1/a2a1_0memberSo on the one test that draws (packed TEXCOORD0 .xy / TEXCOORD1 .zw through an R32G32 input layout), both fixes give the expected pixels on NVIDIA and on RDNA2; the failing cross cases only assert the other PR's member names. Both read a component no element covers as
0u, and both keep an element alone in its register asfloat4 a…. The difference that is left: #313 declares every packed element as a 4-vector starting at component 0 and indexes by the bits of its mask, #297 declares each with its own width.Not tested:
scripts/smoke.ps1on a real title (I have none); RDNA3 / RDNA4, Intel.AI use: Claude Code with Claude Opus 5.5 ran the builds and the cross-check and wrote this comment; the numbers come from those runs.
@upipibi on GitHub · 2026-11-24 14:07 UTC · original
This and #297 (opened 28 minutes earlier) both fix the packed ISG1 vertex inputs of #105: two elements in one register become two
XclInmembers instead of two members with one name. They differ in how a fetch-shader VGPR finds its member:a{register}_{first}and declares only the components of its mask. It maps VGPRinput_vgpr + cto componentc - first. A component no element covers stays 0.a{k}, each a full4-vector. It maps by the popcount of the element's mask below the channel, and falls back to the first element whose register holds the VGPR.Both have tests. They edit the same lines of
emit.rs, so only one can land. Read from the diffs only; I have not run either.AI-assisted (Claude Code).
@throny on GitHub · 2026-11-24 19:38 UTC · original
Two contributors checked independently and found that #297 #1371 solves the same problem (for #105) in a different way: #1607, group D20. 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, not a request from the maintainers; nobody from the project has adopted #1607 so far.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@Toons29 on GitHub · 2026-11-25 02:54 UTC · original
Regression run of
40f90f7bon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % 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; I checked the blocks before posting.@JJAutoCompare on GitHub · 2026-11-25 04:13 UTC · original
Tested
Independent native Windows run for xcl-dev/xcl#313 at
40f90f7b09fcad72ebcc4822b77b8f521e3049a7, verified as the open PR head before the run. The assigned detached checkout was clean before and after testing. The PR discussion had a same-head AMD retail smoke run and an older-revision Windows suite run. It had no equivalent exact-head focused CPU result.STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 (build 26200.9974), AMD Ryzen 7 3800X, Rust and Cargo 1.100.0 (
stable-x86_64-pc-windows-msvc, rustc0ef1bc386). Cargo used the unoptimized test profile with debug info and incremental compilation disabled. XCL logged dxcompiler and dxil 1.9.2609.5.Exit 0. 1 passed, 0 failed, 0 ignored, 0 skipped, 719 filtered out. The synthetic fixture asserts complete HLSL translation, distinct
float4fieldsa0,a1, anda2forPOSITION0,TEXCOORD0, andTEXCOORD1, and VGPR readsv4/v7froma0[0/3],v8/v9froma1[0/1], andv10/v11froma2[0/1], including the remap from the shared register's.zw. The run loaded DXC and successfully compiledmainasvs_6_6to DXIL with DXC's default validation. The build emitted one deprecation warning forfetch_updateinxgameruntime.Not tested
Separate DXIL validation, D3D12 pipeline creation, GPU execution, retail titles, the workspace suite, and comparison with #1371.
AI use
T3 Code / Codex (gpt-6.2-sol) inspected the fixture, ran the existing test, and wrote this report.
Raw evidence:
L:/XclTooling/pr313/environment.log,L:/XclTooling/pr313/cargo-test.log,L:/XclTooling/pr313/pr-313.html.@DavidM1911 on GitHub · 2026-11-25 14:43 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!
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.