Repository navigation
Conversation
039a363 to
2304774
Compare
|
Tested Independent debug verification on clean
Both logged 20 native-wave64 skips, three per-lane f16/f32 refusals, and one skip each for unavailable driver-cache control and heap windows. The RTX 2080 SUPER also logged two missing-D3D12-debug-layer skips.
The two workspace failures had identical assertions on both PCs: Not tested Retail smoke, title shader samples, full AMD workspace, Intel, release mode, and performance. The parent checks were targeted, not full-workspace runs. AI use Ran via Samaritan:
|
|
In-title test on an RTX 3090 (32-lane waves), on a different local stack: with this change ported, the presented world frame is no longer flat grey, and the output LUT matches your numbers. One run, with two deviations from the PR that are listed below, so read it as a second data point, not as a test of this head. Setup
Measured
Not tested / not established
AI use: Claude Code (Claude Fable 5.2 coordinating; a Claude Fable 5.2 agent did the port, the runs and the dumps). I looked at the last dumped frame and checked its log line; the other numbers are from the agent's notes. |
2304774 to
46b0298
Compare
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
The new test's own assertion fails — UAV stripping keeps the wrong format. Needs a fix before merge. — Devin |
46b0298 to
980eb78
Compare
… constant tables after the program; PR xcl-dev#1428: dispatches past 65 535 groups folded) The direct translator's TRANSLATOR_VERSION is 11 here (the fork was at 10 already, upstream's commit moves 9 to 10). The group limit of a folded dispatch takes io slot 114; 113 is the fork's loop budget. The ExecuteIndirect clamp runs on direct and compute lists only (a bundle cannot hold its barriers). Software adapter, whole library suite on the branch: 1393 passed, 0 failed, 24 ignored; 56 tests that open the hardware GPU not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
980eb78 to
b7209c2
Compare
|
@DavidM1911 |
bmjask
left a comment
There was a problem hiding this comment.
No concrete source-level defect found. Post-program rodata recognition and CODE_ADDRESS_HI layout gating are correct across HLSL/Direct-DXIL; current CI/smoke and direct GPU coverage are strong. Residual gaps: direct geometry/legacy GS/per-lane intentionally remain unsupported, no byte/short/MUBUF coverage, and add a multi-program FSSM case to ensure one program cannot alias later program rodata. AMD/Intel validation would help. I found no blocker.
|
Tested
Not tested
AI use
|
|
On Linux + NVIDIA (vkd3d-proton), the driver crashes in Setup: RTX 3070 8 GB, NVIDIA 595.91.07, Linux 6.17, Wine 11.22, vkd3d-proton master What happens:
Edit, later the same evening: the trigger is the code-address window logic. With
With tables for the 10 ACES bakes on that variant, the presented frame stops being flat grey here as well: the world scene now comes through the composite. I have not checked why the driver chokes on the window test, and this variant is only a diagnosis build: a table read can then be confused with a load of the title's memory at the same low dword. So it is not a fix in itself, but it points at the part of the read path that needs another form on NVIDIA Linux. Trap for others testing this: after one such crash, the translated-shader cache keeps the translations with their tables. Later runs then crash even with tables switched off, until that cache folder ( I can try variants of the read path here if you have one in mind (each test is a short build + a ~1-minute run). AI use: investigated and written with Claude Code (Claude Opus 5.5); all results are from real runs on the machine above. |
|
@pr1sm-dev thanks for the careful bisect, the window test was the right lead. Here is a variant that keeps code addresses apart from title memory without that test on the loads that do not need it: branch https://github.com/MacieGx/xcl/tree/recomp/getpc-constant-data-v2, one commit (
The direct DXIL path does the same. On Windows / RTX 5080 the two GPU tests (now also with a load that reads the table on one path and memory on the other) pass, plus AI use: Claude Code (Claude Opus 5.5 coordinating; a Claude Opus 5.5 subagent wrote the change and ran the tests). |
…e program Console programs keep constant tables after s_endpgm and read them PC-relative (s_getpc_b64 + s_load_dword* / global_load_dword*). The translation gave s_getpc_b64 the program offset with high dword 0, so in a title these loads read memory window 0 at a low offset: zeros. 676 of the 26503 shader records of a retail title use this, among them all postfx_aces LUT bakes, whose 64-cube output LUT came out as one constant texel, so the presented image was flat. The data blocks after the program (xbox::Fssm::rodata, the new Options::rodata) now go with the translation: - HLSL: emit.rs embeds them as `static const uint xcl_rodata[]`, and s_load and FLAT / GLOBAL dword loads whose address may be a code address take the dwords at that address inside a block from the table (xcl_cload* / xcl_gload*). - Direct DXIL: the same, as an internal constant array of the module (Lw::rodata_loads in lower_window.rs); s_buffer_load through a V# built from s_getpc_b64 reads it too. kernel::translate_entry_rodata carries the data. The per-lane form (XCL_PER_LANE) has no table and leaves such programs to the per-instruction form. TRANSLATOR_VERSION 9 -> 10. - pso.rs passes the data on the compute, VS / PS and mesh paths (HLSL and direct), and `xcl shaders` (precompile, direct sweep) does too. Loads are sorted at translation by whether their address comes from s_getpc_b64, by a forward dataflow over the CFG (gpu/recomp/code_loads.rs: s_getpc_b64 and offsets added to it give a code address, merges join, loads give data). A load whose address never comes from it stays a plain memory load with no table test; one whose address comes from it on every path reads only the table (xcl_cload*, 0 outside the blocks, no memory access); a mixed one reads the memory and selects the table's dwords, with no branch, when the raw high dword is CODE_ADDRESS_HI (0xC0DE, above any user-space address). s_getpc_b64 gives that high dword only in a program with a mixed load and several memory windows, and 0 otherwise. Why: the first form tested the window index in a branch around every such load, and the NVIDIA Linux driver (vkd3d-proton) crashed compiling it (pr1sm-dev on xcl-dev#2229). Not covered: byte / short global loads, MUBUF buffer_load, the legacy GS path and the per-lane form still read memory at such addresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b7209c2 to
d2dee32
Compare
|
@pr1sm-dev thank you, that settles it. v2 is now folded into this PR: one commit, |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
Independent RTX 3080 Ti check of head In each existing one-window fixture, set The one-window mixed-load selection currently checks the low offset without a code-address tag in HLSL and direct DXIL. It appears mixed code/memory loads need a distinguishable code pointer in one-window mode too, with both fixture variants kept as regressions. Command for each run: |
|
A separate classifier regression on #2229 head The select classification joins register uses only; the inline-zero operand is omitted by Commands: |
…e program Console programs keep constant tables after s_endpgm and read them PC-relative (s_getpc_b64 + s_load_dword* / global_load_dword*). The translation gave s_getpc_b64 the program offset with high dword 0, so in a title these loads read memory window 0 at a low offset: zeros. 676 of the 26503 shader records of a retail title use this, among them all postfx_aces LUT bakes, whose 64-cube output LUT came out as one constant texel, so the presented image was flat. The data blocks after the program (xbox::Fssm::rodata, the new Options::rodata) now go with the translation: - HLSL: emit.rs embeds them as `static const uint xcl_rodata[]`, and s_load and FLAT / GLOBAL dword loads whose address may be a code address take the dwords at that address inside a block from the table (xcl_cload* / xcl_gload*). - Direct DXIL: the same, as an internal constant array of the module (Lw::rodata_loads in lower_window.rs); s_buffer_load through a V# built from s_getpc_b64 reads it too. kernel::translate_entry_rodata carries the data. The per-lane form (XCL_PER_LANE) has no table and leaves such programs to the per-instruction form. TRANSLATOR_VERSION 9 -> 10. - pso.rs passes the data on the compute, VS / PS and mesh paths (HLSL and direct), and `xcl shaders` (precompile, direct sweep) does too. Loads are sorted at translation by whether their address comes from s_getpc_b64, by a forward dataflow over the CFG (gpu/recomp/code_loads.rs: s_getpc_b64 and offsets added to it give a code address, merges join, loads give data). A load whose address never comes from it stays a plain memory load with no table test; one whose address comes from it on every path reads only the table (xcl_cload*, 0 outside the blocks, no memory access); a mixed one reads the memory and selects the table's dwords, with no branch, when the raw high dword is CODE_ADDRESS_HI (0xC0DE, above any user-space address). s_getpc_b64 gives that high dword in a program with a mixed load, and 0 otherwise. Why: the first form tested the window index in a branch around every such load, and the NVIDIA Linux driver (vkd3d-proton) crashed compiling it (pr1sm-dev on xcl-dev#2229). The tag is given with one memory window too: memory loads there take the low dword only, and without it the title's memory at the table's low offset was read as the table (thehollowedone on xcl-dev#2229). Not covered: byte / short global loads, MUBUF buffer_load, the legacy GS path and the per-lane form still read memory at such addresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d2dee32 to
3ce7f30
Compare
|
@thehollowedone thanks, a real hole: with one window a mixed load could take ordinary memory at the table's low offset for the table. Fixed in |
|
NVIDIA test report for
Lib tests only; no title run. AI-assisted (Claude Code, Claude Opus 5.5). |
|
Independent NVIDIA test report on exact head Tested
Regression run main: PR: Not tested
AI use
|
|
NVIDIA and AMD full-suite run, to go with the reports above by LocranKing, upipibi, since none of them covers AMD. Tested exact head Tested
Not tested
AI use
|
…m (port upstream xcl-dev#2229) LATER shared analysis: new backend-independent recomp/code_loads.rs dataflow (Code/Maybe load classification over Decoded) lands whole with its unit test; recomp::CODE_ADDRESS_HI, Options::rodata and Fssm::rodata (the code-region data blocks) land as the shared plumbing the future SPIR-V path needs. HLSL/DXIL emit + host plumbing stay out.
Prime1997
left a comment
There was a problem hiding this comment.
Needs changes — keep the useful work. Checked head 3ce7f30fa5ea60dab1a1c99ae35c31c810c9415c.
The conditional-source classification still loses the non-register alternative when a program-data pointer is selected against an inline constant such as zero. SDWA also needs the actual scalar/vector selected source, including scalar constants and NULL. The local repair preserves those alternatives and includes code_loads.rs in the translator cache identity, so an older misclassification is not retained through cached output.
Local validation: head plus an uncommitted repair and regression fixtures: 7 passed, 0 failed, 0 ignored, 0 skipped. These are CPU checks of the local repair, not a claim that the unmodified PR passed them. Separate negative-control checks produced 3 passes and 4 expected failures.
Build command: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated target> (only the private absolute target path is replaced here). Each selected test executable was then run separately as <test-exe> <exact-name> --exact --test-threads=1 --nocapture.
Selected exact tests
gpu::recomp::code_loads::tests::scalar_selects_include_constant_addressesgpu::recomp::code_loads::tests::vector_select_includes_inline_zero_addressgpu::recomp::code_loads::tests::selects_keep_definite_code_and_data_loadsgpu::recomp::code_loads::tests::loads_from_s_getpc_read_the_code_and_the_others_memorygpu::recomp::code_loads::tests::sdwa_selects_include_scalar_constant_addressesgpu::recomp::code_loads::tests::sdwa_vector_register_numbers_are_not_constantsgpu::recomp::code_loads::tests::sdwa_selects_track_scalar_register_addresses
Latest-main source comparison: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7; full-head merge-tree result: clean. This is a source compatibility check, not a tested integration build. Local repair patch SHA-256: a6df4718f105df9db45a3cd904fc9211c022511c81189554e9a39ccd49b5b839.
Windows 11 Pro build 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug tests. RTX 3060 Ti / driver 32.0.16.1714 is present but was not exercised. No full-suite, GPU or title result is claimed; installed builds and game data were untouched.
AI use: Codex (GPT-6) reviewed the source, prepared the local repair/fixtures, ran the checks and drafted this report.
Optional temporary Discord for coordinating this contributor work, helping test and comparing results.
|
AMD RX 9070 (RDNA4, RADV / Linux) test report on Setup
Tested
Not tested
AI use
|
…e program Console programs keep constant tables after s_endpgm and read them PC-relative (s_getpc_b64 + s_load_dword* / global_load_dword*). The translation gave s_getpc_b64 the program offset with high dword 0, so in a title these loads read memory window 0 at a low offset: zeros. 676 of the 26503 shader records of a retail title use this, among them all postfx_aces LUT bakes, whose 64-cube output LUT came out as one constant texel, so the presented image was flat. The data blocks after the program (xbox::Fssm::rodata, the new Options::rodata) now go with the translation: - HLSL: emit.rs embeds them as `static const uint xcl_rodata[]`, and s_load and FLAT / GLOBAL dword loads whose address may be a code address take the dwords at that address inside a block from the table (xcl_cload* / xcl_gload*). - Direct DXIL: the same, as an internal constant array of the module (Lw::rodata_loads in lower_window.rs); s_buffer_load through a V# built from s_getpc_b64 reads it too. kernel::translate_entry_rodata carries the data. The per-lane form (XCL_PER_LANE) has no table and leaves such programs to the per-instruction form. TRANSLATOR_VERSION 9 -> 10. - pso.rs passes the data on the compute, VS / PS and mesh paths (HLSL and direct), and `xcl shaders` (precompile, direct sweep) does too. Loads are sorted at translation by whether their address comes from s_getpc_b64, by a forward dataflow over the CFG (gpu/recomp/code_loads.rs: s_getpc_b64 and offsets added to it give a code address, merges join, loads give data). A load whose address never comes from it stays a plain memory load with no table test; one whose address comes from it on every path reads only the table (xcl_cload*, 0 outside the blocks, no memory access); a mixed one reads the memory and selects the table's dwords, with no branch, when the raw high dword is CODE_ADDRESS_HI (0xC0DE, above any user-space address). s_getpc_b64 gives that high dword in a program with a mixed load, and 0 otherwise. Why: the first form tested the window index in a branch around every such load, and the NVIDIA Linux driver (vkd3d-proton) crashed compiling it (pr1sm-dev on xcl-dev#2229). The tag is given with one memory window too: memory loads there take the low dword only, and without it the title's memory at the table's low offset was read as the table (thehollowedone on xcl-dev#2229). The dataflow follows every source of an instruction: a constant source of a select (inline or literal) is data, so a select between a code address and a constant is decided at run time, not read from the table only; an SDWA source with S0 / S1 set is the SGPR it names, which rdna2::sgpr_uses leaves out and rdna2::vgpr_uses takes for a VGPR. code_loads.rs and the recompiler's cfg.rs it runs on are in build.rs's TRANSLATOR_SOURCES, so a change to them gives the translated cache another identity for both paths. Not covered: byte / short global loads, MUBUF buffer_load, the legacy GS path and the per-lane form still read memory at such addresses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
AMD Windows, translation size and driver time for #2229 on an RX 9070 XT: the current head Setup: RX 9070 XT (driver 32.0.32029.2010), Ryzen 7 7700, 32 GB RAM, Windows 11, release. This head and its base
The 284-byte program's driver times overlap between the two builds, within this machine's noise. AI use: Claude Code (Claude Opus 5.5) built the binaries, ran the measurements and wrote this; I posted it. |
3ce7f30 to
98a629a
Compare
Console programs keep constant tables after
s_endpgmand read them PC-relative (s_getpc_b64+s_load_dword*/global_load_dword*). The translation gaves_getpc_b64the program's offset with high dword 0, so in a title those loads read memory window 0 at a low offset and got zeros. This makes both translators (HLSL and direct DXIL) read the program's own constant data there. Part of #505.676 of the 26503 shader records of the newer retail title (#505) take such an address. Among them are all
postfx_acesLUT bakes (CS_Bake*LUT*): the ACES tone-scale spline coefficients sit after the program, so with zeros every channel came out 1.0 and the 64-cube output LUT the composite pass reads was one constant texel (0.162, 0.162, 0.162, 1). The presented picture was then one flat grey whatever the scene. Others in the list:scattering_transmittance_system,prefilter_env_map,MS_VS_CascadeShadows*,MS_VS_Transform*,rtdirectionalshadows,indirect_diffuse_lighting:CS_ScreenProbes_ActivateProbes,water_*.What is in it
crates/xcl/src/gpu/xbox.rs:Fssm::rodata(program), the data blocks after a program.crates/xcl/src/gpu/recomp/code_loads.rs(new): sorts thes_load*/s_buffer_load*and FLAT / GLOBAL loads of a program with constant data by whether their address comes froms_getpc_b64, by a forward dataflow over the CFG (s_getpc_b64and offsets added to it give a code address, merges join, loads give data; an indirect jump makes every load "maybe"). Three forms follow:s_getpc_b64: a plain memory load, no table test (as before this PR);xcl_cload*, the table's dwords (0 outside the blocks), no memory access and no window index;xcl_gload*(hi, a)reads the memory and selects the table's dwords, with no branch, when the raw high dword isCODE_ADDRESS_HI(0xC0DE, above any user-space address).s_getpc_b64's high dword isCODE_ADDRESS_HIin a program with such a mixed load, with one memory window as with several, and 0 in a program with only table loads or only memory loads. With one window the memory loads take the low dword only, so a tagged pointer used for a memory load still reads the memory; without the tag there, a mixed load took the title's memory at the table's low offset for the table (thehollowedone, below). A first form tested the window index in a branch around every load of such a program; the NVIDIA Linux driver crashed compiling it (pr1sm-dev, below).crates/xcl/src/gpu/recomp/mod.rs,emit.rs: newOptions::rodata. The HLSL embeds the blocks asstatic const uint xcl_rodata[]and emits the three forms above.crates/xcl/src/gpu/dxil/(kernel.rs,lower.rs,lower_mem.rs,lower_window.rs,coverage.rs): the same for the direct translator, as an internal constant array of the module (Lw::rodata_loads), with the same three forms;s_buffer_loadthrough a V# built froms_getpc_b64reads it too.kernel::translate_entry_rodatacarries the data (and, for compute, the compact table sizetranslate_compute_onpicks for wave32-only GPUs); the per-lane form has no table and leaves such programs to the per-instruction form. ItsTRANSLATOR_VERSIONgoes from 9 to 10.crates/xcl/src/gpu/recomp/pso.rs,crates/xcl/src/shaders.rs: the data is passed on the compute, VS / PS and mesh paths (HLSL and direct), and byxcl shaders(--precompile, the direct sweep).gpu::recomp::tests::gpu_loads_read_the_constant_data_after_the_programandgpu::dxil::core_tests::gpu_direct_loads_read_the_constant_data_after_the_program: a program reads its table throughs_getpc_b64+s_load_dword*/global_load_dword*(direct: alsos_buffer_loadthrough a V# on it), with one window, two windows in the switch form and with heap windows; the values must equal the table...._not_the_memory_at_its_offset(both translators): the same with one window, the memory a load through the same register pair reads at the table's low offset.gpu::recomp::code_loads::tests::loads_from_s_getpc_read_the_code_and_the_others_memory: the pattern of a retail LUT bake gives the table loads "code", a descriptor table load nothing and a load whose pointer is a code address on one path only "maybe".Tested
main8b957bec(now98a629a, no change to the code besides the rebase).cargo build --release --workspace && cargo test --release --workspace --no-fail-fast -- --test-threads=4on98a629a: 1449 passed, 4 failed (the samefuzz_validate_and_gpu_0..3), 47 ignored. The counts below are from3ce7f30, before the rebase.stable-x86_64-pc-windows-msvc, release. On3ce7f30(this PR, rebased ontomain08db802; the GPU tests sit in the middle ofrecomp/tests.rsanddxil/core_tests.rs, so tests other PRs append at the end do not conflict with them).d2dee32; their fixture variant is now the two..._not_the_memory_at_its_offsettests, ands_getpc_b64tags the code pointer with one window too.cargo test --release -p xcl --lib -- constant_data_after_the_program code_loadson3ce7f30: 5 passed, 0 failed, 0 ignored (all four GPU tests ran on the GPU, no SKIPPED).cargo build --release --workspace && cargo test --release --workspace --no-fail-fast -- --test-threads=4on3ce7f30: 1430 passed, 4 failed, 47 ignored.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3(CreateComputePipelineState: out of memory (0x8007000E)), which fail the same way onmain(last checked on568e7db: 1150 passed, the same 4 failed, 46 ignored).rerouted_disk_entries_follow_the_direct_translatorandpc_resource_desc_strips_uav_on_unsupported_formats_and_msaa, reported in the comments, are not in this diff; they failed on the oldermain5478c4awithout this change and pass in the runs above.--no-fail-fastcargo stops after thexcllib binary.main): 21 "no wave64" (recomp::lower::tests×4,recomp::lower_dxil::tests×14,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,dxil::kernel::dispatch_chain_native_wave64_builds_whole), 3 "refused by the per-lane form" (lower_dxil::tests),heap_window_out_of_memory_falls_back_to_the_switch_form("no heap windows"),pso_measurement_compiles_an_exact_synthetic_record(driver cache cannot be disabled without Developer Mode).mainalone it does not reach its world, so the effect was measured on a local branch that adds other open PRs and local work tomain(XCL_HEAP_WINDOWS=1,XCL_UMA_SHADOW=1, pipelines precompiled), with the first form of this change applied (before the port tomainand before the three load forms):postfx_aces:CS_BakeACESWithGamutCompressLUT_QuasiLogShaper(64-cube RGBA16F, slice 0 read back): 1 distinct texel of 4096 before, about 3300 after, in two runs;xcl shaders <pack> --export-hlsl <dir> --record-hash 14f33bcccd1ec01d --split 0withXCL_HEAP_WINDOWS=1on3ce7f30(postfx_aces:CS_BakeACESWithGamutCompressLUT_QuasiLogShaper, 4 windows): its 6 table loads (global_load_dwordx3afters_getpc_b64) arexcl_cload, its 3 descriptor table loads (s_load_dwordx4/x8) plain memory loads, noxcl_gload, ands_getpc_b64gives high dword 0.30b0eb9b, releasex86_64-pc-windows-gnu, the retail title on the HLSL path withXCL_HEAP_WINDOWS=1, 120 s): the previous headb7209c2ended in the driver at 9.4 s compiling a program with the table (status0x3inwinevulkan), no frames; with1bfa10d(the change to the three load forms, now squashed into this commit) the run reached 120 s, that program compiled in 288 ms and 2785 frames were shown. One run each.xcl shaders <pack> --direct --hash 56c0cd3b82a00c6e --validate(indirect_diffuse_lighting:CS_ScreenProbes_ActivateProbes): translates in about 1 s and validates, 3.4 MB DXIL with heap windows. On the HLSL path that program is 28 MB of DXIL, so keeping it on the direct translator matters for compile time.Regression run
main:
this PR: pending for the rebased head. Since #2624 a PR that changes the translator first prepares all ~26,500 shaders with a cold cache, about 70 min on this machine before
smoke.ps1sees the title start; I'll add the block after that run. Anyone with the title is welcome to runscripts/smoke.ps1on this head and post the block.Not tested
main.buffer_load, the legacy GS path and the per-lane form (XCL_PER_LANE) still read memory at such addresses.AI use
code_loads.rs) and their test, ported the change tomain, added the one-window tag and its tests after thehollowedone's finding, squashed it and ran the whole suite on this commit and onmain. The Linux / NVIDIA run is pr1sm-dev's (their comment names their tool and model).🤖 Generated with Claude Code