Repository navigation
Conversation
8bca7cb to
328cf29
Compare
|
AMD run, as asked under "Not tested": RDNA3 Radeon RX 7800 XT (16 GB, native 64-lane waves,
|
|
Retail-pack measurement, as asked under "Not tested": about −15 % DXC time on a 1-in-100 sample, 0 errors. Machine: Ryzen 7 7800X3D (16 threads), 32 GB RAM, ~17 GB commit free, RTX 5070 Ti (driver 32.0.16.2114, 32-lane waves), Windows 11 26300, DXC 1.9.2602.17, release build. Measured at Method:
Not measured: the split wave64 form (the survey translates the native 64-lane form), the driver's pipeline time, DXC's peak memory, and the GPU tests on this card. No game material: timings and counts only. Measured with an AI assistant (Claude Code). |
|
Independent Windows + RTX 5080 GPU verification of Build & Tests
Code check
(AI-assisted) |
|
AI-assisted review (Claude Code). Windows 11 (10.0.26200), Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74, 32-lane waves), Rust 1.99.0 MSVC, debug build. Synthetic programs only, no game files. Tested With the Windows SDK's DXC, the linked path never works. The README names the Windows SDK as the DXC source. The newest SDK, 10.0.26100, ships
DXC 1.8.2505 and 1.9.2602 (GitHub releases) accept it. Everyone who measured above used 1.9.2602.17, so nobody has run the SDK case yet. Suggestions:
Measured with DXC 1.9.2602.17. I used xcl-pso's synthetic E/F bench from #156 (a copy in my tree; translated compute programs, one creator, fresh seeds so the driver hasn't seen them). DXC time is with 2 compiles at a time. The driver column is the first
The DXC columns are from a CPU-only run with 4 programs. The driver run's own DXC times agree (C 2.9–3.0 → 1.6 s, D 4.7–4.9 → 2.0–2.1 s).
Related, and bigger than this PR on NVIDIA. The same
DXC 1.9 emits DXIL half the size or less, and the 5070 Ti's driver then compiles it 1.4–2.2× faster. DXC's own time goes up for a whole compile. Linking (this PR) takes that back for windowed programs. The driver times in #156's synthetic table were taken with the SDK DXC. Not tested:
|
|
A data point for the SDK-DXC boundary, measured on this machine (Ryzen 7 9800X3D, RTX 3060 Ti, Windows 11):
Suggests the version check / README note would be more precise as "DXC >= 1.8" rather than "SDK DXC fails": a 26100 SDK with 1.8.2502 passes the attribute probe here. |
|
A follow-up to the review above, on how this fits with #187 and on the driver's part for access-dense programs. With #187. The two merge with one conflict, in Driver time when accesses are dense. The review's shapes had a memory access every 8 rounds. With a load and a store every round (split wave64, 1000 rounds, an exec-masked block every 4 rounds, 2 never-seen programs per row):
So the PR does what it says for DXC, and on such programs the driver's part, which it leaves as it is, is the larger one by far. In your own bench with a heap form added (1600 accesses, 2 rounds): DXC 1.0 s (1 window) / 11.0 s (whole) / 1.6 s (linked) / 1.2 s (heap), and GPU time for 2048 groups 0.237 / 0.273 / 0.271 / 0.243 ms. Tested
Not tested
AI use: Claude Code, Claude Fable 5.2. |
…ong SDKs first Nobody running XCL could tell which dxcompiler.dll it had loaded, and it matters: with DXC 1.7.2308 (what Windows SDK 10.0.26100.4654 installs; other revisions of that SDK have 1.8.2502) the DXIL of translated compute programs was 2-2.7 times the size of DXC 1.9.2602's and an NVIDIA driver took 1.4-2.2 times as long to build pipelines from it (xcl-dev#156); 1.7 also rejects [WaveSize] on library entries (xcl-dev#174). - dxc.rs: after loading, dxcompiler.dll and dxil.dll are asked for IDxcVersionInfo and IDxcVersionInfo2 (commit), and their version resources are read. One info line with versions and folder; below 1.8 one warning with the measured cost and XCL_DXC_DIR. The release number is taken from the file: IDxcVersionInfo gives the DXIL version the library knows, and release 1.8.2505 answers 1.9. - report.json: `dxc` (folder, both libraries). Filled by the game process when it compiled something, else by the launcher from its checks. - xcl run's checks print the version, and a note with the fix when it is below 1.8. - Windows SDK folders are tried in the order of their DXC's version, then of the SDK's, compared as numbers (old SDKs' compilers carry their Windows build number and go last). XCL_DXC_DIR and the folder of xcl.exe come first as before. - README: DXC 1.8 or newer is recommended, and where to get it. Co-Authored-By: Claude <noreply@anthropic.com>
shdann
left a comment
There was a problem hiding this comment.
In dxc.rs:249–254, two different compute shaders can request the same accessor library at startup. Each thread can see an empty cache before either stores its result. Both then compile the same library. The result is correct, but the extra DXC work happens during the cold start this change aims to shorten. Consider storing a per-key initialization cell under the map lock, then compiling outside the map lock. Preserve retry after a compile failure. A test with two distinct programs sharing one library can count library compilations and check that both programs link. Static review of 328cf29 with OpenAI Codex (GPT-6); I did not measure the timing impact.
|
Test report for #174 with a retail title, since Not tested says no title has been run with it: head Tested
Not tested
AI use
|
328cf29 to
ddb9350
Compare
|
@TheHoracio, @Foniass, @mastrr9 and @einfachama thank you for the reports on
Since #187 landed, this PR conflicted with AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
@Kalmarv and @ryosen0 thank you for the review and the measurements. On the DXC version: the finding is right. In On #187: the merge is done as @Kalmarv described it. On the dense-access table: agreed, the driver's part, which this PR does not touch, is the larger one there. AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
@shdann thank you, that is right. In AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
@shdann, @Kalmarv and @ryosen0 both points are now in the PR, as a second commit,
On this GTX 1650, AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
@einfachama and @Foniass you ran earlier heads of this PR with a title, so a request, only if you have a moment: a AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
2007e7d to
cd19625
Compare
|
@DavidM1911 thank you for the note: #174 conflicted with AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
cd19625 to
d466910
Compare
|
@einfachama @Foniass the head of this PR moved to AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
AMD run on Machine: AMD Radeon RX 7800 XT (RDNA3, native wave64), driver 32.0.31035.1003, Windows 11 Pro 10.0.26200, Rust 1.100.0 Tested
Not tested
AI use: Claude Code (Claude Sonnet 5.5) ran the commands and wrote this report for oni-swr. |
|
@oni-swr thank you for the AMD run of #174 at
Agreed that this is a test run and not the smoke pair: the pair, AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
Independent 60 s smoke pair (plus a second warm run for comparison) for head Tested
Comparison (
Regression run
PR PR Not tested: AI use: Antigravity (Gemini 4 Neon) ran the builds and smoke runs and drafted this report; the account owner reviewed and approved posting. |
|
@thiagocalile thank you for the smoke pair on
That last number is a real finding I did not have. On my GTX 1650 the pair of the first commit showed no such difference (913 frames and 11,707 MB against 904 and 11,655 MB), so it may depend on the card or on DXC 1.8 linking where DXC 1.7 would not. I have not found the cause yet. The branch also conflicts with AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
Test report for exact head Tested
main: PR: Not tested: AMD, the head merged onto current AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety before it was built. |
|
@throny thank you, that is the pair the check needed. I pasted your two blocks into the description exactly as printed, and The branch conflicts with AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
With several memory windows every access is a switch between them. DXC inlines the accessors before it optimises, so a program gets one switch per access and its time grows much faster than their number. Compute programs with 100 accesses or more are now compiled with the accessors only declared and linked with them afterwards (IDxcLinker inlines them): 1600 accesses 36 s -> 4.4 s, the same DXIL size and GPU time. The generated HLSL is unchanged. XCL_LINK_MEM=0 turns it off; a program that cannot be linked is compiled whole.
… stops the attempts Two points of the review of the linked form. The kept accessor library was looked up under the map's lock and inserted under it again after the compile, so two programs that asked for the same library together compiled it twice (shdann): each key now has its own cell, the first caller compiles outside the map's lock, the others of that key wait for it, and a failure is not kept. And only the warning was behind a Once, so with a DXC that cannot link (before 1.8 it refuses [WaveSize] on a library entry) every program with enough accesses paid a failed attempt before the whole compile (Kalmarv, ryosen0): the first failure now closes the gate for the rest of the process. The README says the linker needs DXC 1.8 or newer.
d466910 to
6ccfd1d
Compare
|
@throny thank you again for the pair on The head is What is needed, as before: I will not push anything more to the branch until your pair is in. AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
Test report for exact head Tested
main: PR: Not tested: AMD, the head merged onto current AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety before it was built. Note on the choice of |
bmjask
left a comment
There was a problem hiding this comment.
No source-level defect found, but this draft is not merge-ready. Current-head main/PR smoke pair is missing, and RX 6600 results show 133.5%/141.5% of main peak commit—above the project 125% threshold—without root cause. Resolve/gate that regression before merge. Also add title-output validation for linked programs and, if practical, end-to-end DXC 1.7 failed-link fallback coverage. Windows no-GPU build/test alone is insufficient.
|
@throny thank you, that is the pair for the exact head. I pasted your two blocks into the description as printed, and added your numbers: 1,647 against 1,625 frames (101 %) and a peak commit of 14,014 against 14,099 MB, no device removal and no crash on either; and the suite on Noted too that against a newer AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
@bmjask @gefydev Fresh AMD RX 6600 run on the rebased head 6ccfd1d (compared against its base main 2898511: peak commit is 13,687 MB vs 11,934 MB = 114.7%, within the 125% threshold). Independent test and smoke report for head Tested
Regression run (
PR Not tested: full workspace suite on this head (tested by @throny on RTX 4080), NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window. AI use: Antigravity (Gemini 4 Hydrogen) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting. |
|
@thiagocalile thank you, that is the run that was missing on AMD. For the exact head AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
Lane L6 of the compile-time handoff (DXC cost). Draft. About −14 % DXC time on retail compute programs (measured below); the tests pass on AMD (RX 7800 XT, comment below). #187 has landed and removes the window switch itself (windows from the descriptor heap, VS / PS too, and much faster on its own synthetic CS), but only with
XCL_HEAP_WINDOWS=1: that is opt-in, so the switch form is still the default and this PR serves it, and the programs #187 rebuilds in the switch form when the driver refuses the heap form. A program in the heap form has no switch accessors, andlinked_formleaves it alone.Rebased onto
main2898511(two commits). It conflicted withmainindxc.rsand at the end oftests.rs. Indxc.rs,mainadded a special case forE_OUTOFMEMORYinside the code that this PR moved intooutput(): it is kept there. Intests.rs, where this PR conflicted at every rebase because every merged change adds its tests at the end, the three tests of this PR now live in their own file,link_tests.rs, next toheap_window_tests.rs, with the two small helpers they need (gpu_ready,on_gpu). #2346 landed before that: the windows aregloballycoherentonly when the program needs it, solinked_programs_keep_their_declarationsnow runs a program with a GLC load and one without, in wave32 and wave64, and checks that linking keeps either. Inemit.rs,main'smem_accessors(windows, heap)and its out-of-rangedefault(reads 0, stores dropped) are kept:mem_methods()now also returns what each method does outside the windows,loadx4_switchandmethod_switchwrite the same switch textmainwrites, andlinked_formasks formem_accessors(w, None). The accessor text for the switch form is still byte-identical tomain's.What is slow
With several memory windows every
memaccess is a call to an accessor that switches between the windows. DXC inlines it when it compiles, before it optimises, so a program gets one switch per access, and DXC's time grows much faster than their number. HANDOFF (956a476) measured it at about double DXC + driver time on one large CS; #172 measured about 26 % of DXC time on its 1-in-100 pack sample. The first table below is the worst case, programs made of memory accesses only; the second is real ones.What is in it
emit::linked_formturns such a program into two DXIL libraries: the program, with its accessors only declared, and the accessors. DXC cannot inline a declaration.dxc::compile_linkedcompiles both and links them withIDxcLinker, which inlines the accessors after the program was optimised. The compiled accessor library is kept, and compiled once per key even when several programs ask for it together (kept_once, the second commit).cs_*(which is also what MS and GS programs run as), only with 2–4 windows, only from 100 places that use an accessor. VS and PS are unchanged.LinkGate, the second commit): a DXC before 1.8 refuses[WaveSize]on a library entry and would otherwise fail the same way for every program. The README says the linker needs DXC 1.8 or newer.XCL_LINK_MEM=0turns it off. It shares the DXIL cache, so compare with anotherXCL_DXIL_CACHE.The HLSL the translator emits is unchanged (the accessor text is byte-identical to
mainfor 2, 3 and 4 windows), so cache keys do not change: programs already in a DXIL cache stay as they were compiled.Measured, synthetic worst case
GTX 1650 (driver 32.0.16.2124, 32-lane waves), Ryzen 5 1600, 16 GB RAM, ~13.5 GB commit free, Windows 11 26300, DXC 1.9.2602.17, debug build.
bench_memory_window_accessors(ignored test, in this PR): synthetic split-wave64 CS, 3 rounds, the forms one after the other in every round, a different program each time so that the driver cannot answer from its cache. Medians:main)main)dispatch_timedgives).Measured on a retail pack
GTX 1650 machine above (16 GB RAM), release build, one binary,
XCL_LINK_MEM=0/1. Cold--precompile --only cs --limit 22300(143 compute programs, 4 windows, split wave64), 4 DXC threads, a new empty cache for every run, order off-on, on-off, off-on:XCL_LINK_MEM=0--pipelines, one at a time, in two runs). Driver time off / on was not compared.Tried and dropped
[noinline]accessors in the program itself: the same DXC gain and a smaller DXIL, but NVIDIA keeps them as calls and the dispatch is 4.5–6× slower. (DXC's validator also takes only scalars in such functions.)noinline.Tested
gpu_linked_memory_accessors: one program with 1–4 dword loads and stores, scalar loads, 32- and 64-bit atomics, in two windows, odd and even lanes in different ones. Registers and memory are the same whole and linked, and loads match what is in memory.linked_programs_keep_their_declarations: wave size (32 and 64), thread count, the windows' registers,globallycoherent(resource properties) and the number of functions are those of the whole program.956a476:cargo test --workspace: 538 lib tests pass, 0 fail, 2 SKIPPED (no wave64); other suites pass. The same with the threshold at 0, so that everycs_*program with windows is linked: 538 pass, 0 fail.6ccfd1d(GTX 1650,CARGO_BUILD_JOBS=2):cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 1366 passed, 3 failed, 47 ignored. 28 SKIPPED, none on a path this PR changes: 21 wave64 cases (no wave64 on this GPU), 3 per-lane f16 cases the per-lane form refuses, 1 "no heap windows", 3 for the D3D12 debug layer not being installed. The 3 failures aretitle_textures::tests::placed_title_textures_share_vram_and_preserve_pixels(Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) #718, which fails now and then) and the two tests its panic leaves on a poisoned lock (transitions_apply_when_their_list_is_submittedandvram::tests::d32s8_targets_take_their_own_size_of_video_memory). The same three fail with the same command on a clean checkout ofmain2898511, and all three pass alone on one thread: nothing to do with DXC or this PR. It includes the PR's two tests (gpu_linked_memory_accessors,linked_programs_keep_their_declarations) and the four tests of the second commit (accessor_library_tests).kept_once).Regression run
The pair below is for the current head,
6ccfd1d, and was made and reported by @throny (comment):scripts/smoke.ps1, 60 s, release builds, the same title for both,main2898511(the base of this head) first and then the head, on an NVIDIA GeForce RTX 4080 (driver 610.88, Intel i9-12900K, 64 GB, Windows 11 Pro 26300, DXC 1.9.2602.17). The blocks are exactly as the script printed them.main:
PR:
Other runs of this change, so that nothing is left out:
d466910(the same two commits on an oldermain),main22b6222against it: 1,527 against 1,567 frames, 14,073 against 14,048 MB.main(72b59b5), the same head6ccfd1d: 14,010 MB againstmain's 9,225 MB. He reports thatmainitself got lighter in between (the shared stand-ins,625a0f3and after), not this PR, and that a rebase onto currentmainshould bring the head down with it. I have not rebased again, so as not to change the head that has the pair; I will rebase if the maintainers ask for it.6ccfd1dagainst its basemain2898511(comment): 1,483 against 1,488 frames, no device removal, no crash, peak commit 13,687 against 11,934 MB (114.7 %), inside the 125 % of the check; and the 6 tests withlinkin their names pass (1 ignored, the bench). An earlier run of his on the previous headd466910against an oldermain(50a9fde) had shown a peak commit of 15,958 / 16,910 MB against 11,951 MB (133 % / 141 %); the run on the current head and its own base does not repeat it, and I do not know what made the difference.ddb9350, before several rebases) againstmainafc5ee8: 913 frames and 11,707 MB against 904 and 11,655 MB.6ccfd1d: @throny, RTX 4080: 1369 passed, 0 failed, 47 ignored (26 SKIPPED lines). Ond466910: @throny 1281 / 0 / 47; @oni-swr, RX 7800 XT: 1280 passed, 1 failed (fuzz_validate_and_gpu_1, which fails the same way onmain, DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115), 47 ignored.Not tested
main. @thiagocalile ran the smoke pair on an RX 6600 (see above). No AMD timings of the DXC change itself, and no world load on AMD.956a476); they were not repeated onb9fdc89or6ccfd1d.LinkGate), not through a failing link.Gate A passed at 2026-11-23 18:21 UTC on main 956a476; Gate B passed at 18:54 UTC on main 956a476. PRs read: #113, #123, #138, #139, #162, #166, #172: none changes how accessors are compiled. The tests use synthetic programs only; no game material is in this PR.
AI use
main2898511:b9fdc89and6ccfd1d), resolved the conflicts, wrote the second commit (the review fixes and their tests), moved the tests of this PR tolink_tests.rs, ran the suite, and updated this description.