d3d12: compile runtime SM 5.1 shaders via app-local DXC on Wine (D3D12-LINUX-DXC-RUNTIME-SHADERS) #2642
Open
zmasi wants to merge 13 commits from
upstream-pr/2642 into main
pull from: upstream-pr/2642
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
ProjectLeonida/mandy!2642
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2642"
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?
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T20:42:31Z.
Claimed in #2570:
D3D12-LINUX-DXC-RUNTIME-SHADERS(https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7250675174)Summary
Implements
D3D12-LINUX-DXC-RUNTIME-SHADERSacrossd3d12/crates/leonida-gpu,d3d12/README.md, andd3d12/docs/switches.md:compiler.rs,lib.rs,d3d12/README.md):compiler::compile_named. On native Windows (wine_get_versionabsent onntdll.dll), every shader continues to compile via systemD3DCompilewith its original profile and flags untouched.dxc_profile_for), whenflags & !D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES == 0and the target iscs_5_1,ps_5_1, orvs_5_1,compile_namedloadsdxcompiler.dll, preloadsdxil.dllfrom the executable's own directory usingLOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32, creates and cachesIDxcCompiler3once behind aMutex, and compiles ascs_6_0/ps_6_0/vs_6_0(-HV 2016 -flegacy-macro-expansion -O1), preserving[RootSignature(...)]blobs, atomics, and unbounded descriptor arrays that Wine's built-in FXC strips or rejects.compiler.rswarns once and falls back to FXC; once DXC is loaded, compile errors extract UTF-8 diagnostics viaIDxcResult::GetOutput::<IDxcBlobUtf8>(DXC_OUT_ERRORS, ...)(withGetErrorBufferfallback, or an explicit{hr:#010x}status message when diagnostic blobs are empty), logtracing::warn!("DXC: ..."), and returnErrdirectly without retrying Wine's FXC.[RootSignature]shaders throughcompiler::compile_named(host.rs,compose.rs,host/trainer.rs,indirect.rs,indirect/bench.rs,inplace.rs,replay/play/merge.rs):host::compile(coveringambient.rs,descriptor/host.rs,host.rsdepth planes,host/awake.rs,host/card_steps.rs,host/send.rs,host/upcheck.rs,resource.rs, andtiles.rs),Host::make_card_work(CARD_COMPARE),compose::compile_source(Composer::new),host::trainer::compile(F4 trainer overlay),indirect(WIDE_PROBE, argument clamp, andindirect::bench),inplace::Rig::shade(LEONIDA_INPLACE_PROBE), andreplay::play::merge(Player::set_merging) throughcompiler::compile_named, leavingcompiler.rsas the sole non-testD3DCompilecaller ind3d12/(texture.rsalias_cast_testsandtests/replay.rsare test-only).compiler/tests.rs,d3d12/docs/switches.md):LEONIDA_TEST_DXC_DIRand compiler tests ind3d12/crates/leonida-gpu/src/compiler/tests.rs(classified under## Only in testsind3d12/docs/switches.md), covering the Wine/native routing table (dxc_profile_for), empty-error-blobHRESULTlogging (dxc_status_error),CARD_COMPAREFXC/DXC PSO + UTF-8 error diagnostics, and hardware D3D12 compute dispatch + readback (compiled_compute_shader_dispatches_and_reads_back_on_fxc_and_dxc) across both FXCcs_5_1and signed DXCcs_6_0with macro-concatenated[RootSignature], root constants, root UAV, and an unboundedByteAddressBuffer[]descriptor table.ambient_readback.rsandtests/replay.rschanges removed for a separate follow-up PR per review).Verification
164506d01) merged withorigin/main(b41763227) on Windows 11 Pro10.0.26200+ NVIDIA GeForce RTX 3090 (driver610.88) + Windows SDK DXC (dxcompiler.dll+dxil.dll):cargo test --locked --target x86_64-pc-windows-msvc -p leonida-gpu --lib compiler::and--features diagnostics --lib compiler::->5/5passed on both (including hardware D3D12 compute dispatch + readback on both FXCcs_5_1and DXCcs_6_0).cargo test --locked --target x86_64-pc-windows-msvc -p leonida-gpu --features diagnostics --libonthe_composer_compiles_with_and_without_the_nan_clamp,trainer_menu_shaders_compile_with_embedded_root_signature,inplace_probe_shader_compiles_with_embedded_root_signature, andmerge_shader_compiles_with_embedded_root_signature->4/4passed.cargo test --locked --target x86_64-pc-windows-msvc -p leonida-gpu --features diagnostics --test replay->1/1passed (a_frame_is_recorded_and_replayedon stockmaintests/replay.rs).cargo clippy --locked --target x86_64-pc-windows-msvc -p leonida-gpu [--features diagnostics] --all-targets --no-deps->0warnings in all new/modified hunks (0warnings crate-wide in default build).python -I tools/d3d12_switches.py --check d3d12/docs/switches.md,python -I tests/test_d3d12_switches.py(20/20),python -I tests/test_text_write_line_endings.py(3/3), andpython -I scripts/check_no_game_data.py-> all exit0.1.9.2609.5,WINEDLLOVERRIDES=d3dcompiler_47=b->0device-lost/crashes,0two-plane composer not madeerrors (vs1,334and black picture onmain),0DXC:warnings.1.9.2609->20/20runtime helpers compiled,DROPPED indirect2,400–3,700/frame -> 0.1.9.2609-> routing matrix and DXC root-signature/diagnostic checks passed across both adapters.GPUs tested: NVIDIA GeForce RTX 3090 24 GB (Windows 11 Pro
10.0.26200, driver 610.88, Windows SDK DXC); prior Linux Wine / VKD3D-Proton verification on AMD Radeon Pro Vega II (RADV 26.0.8), NVIDIA GeForce RTX 4050 Laptop (580.196.07), NVIDIA GeForce RTX 4070 SUPER & AMD Radeon Raphael (620.73.04 / RADV 26.3.1), and NVIDIA GeForce RTX 4090 (620.73.04).AI-assisted: yes — authored with OpenAI Codex / Claude Opus on initial branch commits, updated on this head with Gemini 4 Carbon (High), and independently reviewed in read-only mode on this head by Gemini 4 Neon (XHigh) (
opus-systems-critic).Checklist
mainand merges cleanly.CONTRIBUTING.md), including in logs or reports quoted here.docs/design.md, with how it was confirmed. (n/a: runtime HLSL compilation only)Imported from ubiquitarianism/leonida. Originally posted by z3r0rc on 2026-11-29T20:57:10Z.
AI-assisted: yes (AI agent of a human operator, on an independent RTX 4090 Wine fork).
A +1 from an independent reproduction that landed on the same remedy the same week, with measured counts for the record. No stake beyond the symptom: our own branch is retired in favour of yours.
Offline (Wine 11.23 in a container, no GPU, no game files), over the 20 HLSL variants the runtime compiles for itself at run time (argument clamp, batched clamp, wide probe, card compare/gather/scatter, awake check, upload check, plane corners/floats/steps, inplace read, trainer vs/ps, six ambient passes): 15 of 20 fail under Wine's builtin
d3dcompiler_47— exactly the ones with raw-buffer member methods (E5005: Method 'InterlockedOr' is not defined on type 'RWByteAddressBuffer'., same forLoad4, andE5005: Function "isnan" is not defined.) — and the builtin also accepts[RootSignature(...)]while leavingRTS0out of the container, soCreateRootSignaturefails on code that compiled. The 5 that pass have neither a raw-buffer member nor a declared root signature — a split that lines up exactly with the sources yourwine_get_version+*_5_1+ flags-mask gate routes to DXC.Live (RTX 4090, driver 620.73.04, Wine 11.23, app-local
dxcompiler.dll+dxil.dll): with the fallback in, the five compile-failure WARN families disappear, the argument clamp comes alive andDROPPED indirectgoes from 2,400–3,700 per frame to 0, and the world renders lit where every earlier window showed a black world with perfect menus — menus and cinematics are drawn direct, which is why they looked fine all along. In one normal play window the fallback fires 12 times: 8 × compiled code holding no root signature the source declares, 2 ×isnan, 1 ×Load4, 1 ×InterlockedOr.One small design note from our tree: report "no app-local DXC found" apart from "DXC refused this source" — one combined message that always blamed the file sent us hunting for a DLL that was already loaded.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T20:58:22Z.
Thank you @z3r0rc for the independent Wine 11.23 + RTX 4090 reproduction (
15/20runtime HLSL variants,2,400–3,700 -> 0dropped indirects per frame) and for retiring the duplicate branch in favour of this PR!Confirmed on your diagnostic note as well:
compiler.rs(9075a5e419, lines 66–77 andcompile_dxc) separates those two failure modes — missing/unloadabledxcompiler.dll+dxil.dlllogs"app-local DXC unavailable; using FXC on Wine (embedded root signatures may be missing)"once in theLazyLockinitializer and falls back toD3DCompile, whereas a loaded DXC rejecting HLSL extractsIDxcBlobUtf8(DXC_OUT_ERRORS) and logs"DXC: ..."directly without falling back or blaming DLL discovery.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T21:04:57Z.
Follow-up covering the graphics and diagnostic paths of
9075a5e41merged onto7bbc1d22(34fc022c). CachyOS, Wine 11.22, VKD3D-Proton71cae091, RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1). Microsoft DXC 1.9.2609MEASURED. With the matching pair beside the unchanged test executable, five cases per GPU switched from failing to passing. They cover
CARD_COMPAREand the unbounded root signature, display-plane composition, the trainer overlay, fog readback, and the offscreen unbounded texture table. The table test readfixed=1024 other=1765on both GPUs. On RADV, a compiler-only directory and a pair in the working directory alone both reproduced the representative FXC fallback failure. The full recorder/replay test stopped at the native command-list identity check in both arms.MEASURED, diagnostic unit test. The existing test that checks
Error::message()failed 3/3 per GPU even with the pair loaded. A local probe printedleonida.hlsl:1:12: error: expected parameter declaratorfromdxc_errorsbeforeError::new, followed by the genericCall failed.fromError::message().I put a small follow-up on my fork. The test checks the failed DXC status and the diagnostic text directly from
IDxcResult. The runtime still logs the detailed text and returns the same Windows result as before. This passed 3/3 per GPU, and the five working cases above stayed green on both GPUs. Test fixe32fa8b49Synthetic fixtures only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T21:11:15Z.
Thank you @merzleckeier for testing the graphics, trainer, composition, fog readback, and unbounded-table paths across RTX 4070 SUPER and Radeon Raphael under Wine 11.22, and for isolating the Wine
Error::message()behavior indxc_compiles_card_compare_with_embedded_root_signature_and_utf8_errors!Folded in your
invoke_dxc/test_dxc_factorycheck (also probingload_dxc()beside the test executable before Windows Kits, and keeping anis_err()check oncompile_dxc) and verifiedcompiler::tests(2/2) on Windows 11 + RTX 3090 + Windows SDK DXC.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T21:18:13Z.
Thanks for folding in the diagnostic check. I retested
603845afabfand9075a5e419on the same base (a84c41909b) with Wine 11.22 and VKD3D-Proton 3.2 (71cae091). I used the x64 DXC1.9.2609pair and selected one Vulkan ICD per process. The adapters were RTX 4070 SUPER (NVIDIA 620.73.04) and Radeon Raphael (RADV 26.3.1).LEONIDA_TEST_DXC_DIRunset,9075a5e419printed the DXC skip marker on both adapters (1 run each).603845afabfexecuted and passed the DXC root-signature/invalid-HLSL diagnostic test 3/3 times per adapter, with no skip marker.603845afabf. Both readbacks ran on the selected device.LEONIDA_TEST_DXC_DIRran the diagnostic test successfully. In a separate process with the same placement, the runtime-facing compiler test still hit the existing Wine FXC fallback error (0x80004005), consistent with the override's test-only scope.Offline, synthetic fixtures only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T21:54:22Z.
Tested
603845afamerged (no commit) withmain060c47160: Windows 11, Rust toolchain fromd3d12/rust-toolchain.toml, CPU only, no game run.cargo test -p leonida-gpu --locked:main549 passed, 47 ignored; with this PR 553 passed, 48 ignored, 0 failed.cargo clippy -p leonida-gpu --locked -- -D warnings: 10 findings onmainand the same 10 with the PR (all inleonida-luaandleonida-shader); this PR adds none.mainand does not force a rebase of #2566.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by z3r0rc on 2026-12-01T10:33:01Z.
A Linux/NVIDIA data point from a machine that went through this exact wall: on Wine the builtin d3dcompiler_47 (vendored vkd3d-shader 2.1) refuses every runtime HLSL helper this tree compiles — no RWByteAddressBuffer member methods (E5005),
[RootSignature]/RTS0 dropped. Five WARN families sit in every log, and the consequence is a black world with fine menus: 2,400-3,700 indirect draws dropped per frame means the world-fill passes never run. Our interim fallback (system D3DCompile*_5_1first, app-local DXC*_6_0on refusal or missing RTS0, sources byte-identical) turns it into a lit, drivable world: 20/20 runtime helpers compile with an app-local dxcompiler.dll (DXC 1.9.2609),DROPPED indirectgoes to zero, and the same exe and env swing between the black world and 28-30 fps. Your app-local DXC shape is right — please land it; we will delete our local fallback the day it does.The full measured env baseline for Linux play is posted on #2577. AI-assisted comment; measured logs (RTX 4090, NVIDIA 620.73.04, Wine 11.23, VKD3D-Proton master).
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T18:00:44Z.
Review: COMMENTED
Not superseded:
git grepon current main finds nocompile_named/compile_runtime_hlsl, and the SM 5.1 call sites still useD3DCompile. Merged into today's main it applies cleanly, builds, and the affected suites pass (compiler::tests2/2 with the DXC test genuinely executing on the Windows SDK pair,compose1,trainer5,inplace_probe1,merge::tests1). The native-Windows gate is right (on_wine()viawine_get_version,compiler.rs:98, with the FXC call keeping name/entry/target/flags), and the DXC diagnostic path is mutation-covered (forcingdxc_errorstoNonefailscompiler.rs:339).Two things before merge:
compiler.rscallsD3DCompile" invariant no longer holds after merge. Main gainedtexture.rs:4301(test-onlyalias_cast_tests) since your base. Please rebase and either route it through the new helper or restate the invariant as "runtime, non-test".[RootSignature]failure differently — it ships natived3dcompiler_47.dlland serialises root signatures incompose.rs/trainer.rs. The two approaches overlap on these exact files, so one should land first, or the DXC path should be documented as the replacement. This is worth settling before either merges, since both claim the same symptom.Also: mutating the gate at
compiler.rs:56toif trueleaves every test green — the Wine-vs-native routing is covered only by manual runs (hereon_wine()is false,load_dxc()looks beside the test exe, and the tests callcompile_dxcdirectly). A sentence saying that is intentional would save the next bisector.The branch is 1,463 commits behind but the merged tree is green; a rebase is for the invariant and CI, not for correctness.
Imported from ubiquitarianism/leonida. Originally posted by deynesdev on 2026-12-02T07:10:51Z.
Tested on Linux/NVIDIA without Microsoft's
d3dcompiler_47.dll:8db6aca2amerged (locally, nothing pushed) intomainf37c4a87d, against plainf37c4a87d. Both runs forced Wine's built-in compiler (WINEDLLOVERRIDES=d3dcompiler_47=b), same save and settings (scripts/play-linux.shdefaults,LEONIDA_SKIP_BINK=1), 180 s each.Setup: RTX 4050 Laptop 6 GB, NVIDIA 580.196.07, Fedora 44, Wine 11.21 Staging, VKD3D-Proton 3.2.0 (
71cae091b06571e+). Built with--target x86_64-pc-windows-gnullvm. DXC: the x64dxcompiler.dll+dxil.dllpair 1.9.2609.5 from a Microsoft DirectXShaderCompiler release, copied next toleonida.exe.maintwo-plane composer not made; showing base plane only error=Call failed. (0x80004005)With the PR the intro and the first scene look as they do with the native
d3dcompiler_47(which is what Linux users have needed until now to get any picture). One run each.AI-assisted: yes (Claude Code, Claude Opus 5.5): the runs, logs and this comment.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:23:33Z.
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by deynesdev on 2026-12-02T13:58:08Z.
In-game run on the current head for the render-path gate:
30b1e2984merged (locally, nothing pushed) ontomain21843cef0(merge commite8c818908). One run, 420 s.71cae091b06571e+), built with--target x86_64-pc-windows-gnullvm. DXC: the x64dxcompiler.dll+dxil.dllpair 1.9.2609.5 from a Microsoft release, next toleonida.exe. Wine's built-in compiler forced (WINEDLLOVERRIDES=d3dcompiler_47=b),LEONIDA_SKIP_BINK=1, otherwisescripts/play-linux.shdefaults, same save copy.two-plane composer not madelines and 0DXC unavailable/DXC:warnings. The other WARN families in the log (descriptor-view records, pipeline methods not implemented, texture re-upload checks) are not from the compiler and are not new to this PR.mainalone: not repeated on this SHA, so no new comparison. My earlier 180 s run of this PR againstmainf37c4a87d(the comment above) had 1,334 composer failures and a black picture onmain, and 0 failures and a normal picture with the PR.AI-assisted: yes (Claude Code, Claude Sonnet 5.5): the build, the run, the log reading and this comment.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T14:17:12Z.
Review: COMMENTED
Independent retest of current head
30b1e2984merged cleanly onto69cd4106c. MSVC target on CachyOS, Wine 11.22 / VKD3D-Proton 3.1.0, RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1). I forced Wine's builtind3dcompiler_47and used the same compiler test executable with and without the matching app-local DXC pair.cs_5_1,vs_5_1,ps_5_1, andcs_5_1with unbounded tables.cs_5_0andcs_5_1with the untranslated skip-optimization flag stayed on FXC and produced code.fixed=1024 other=1765and matched all 1,024 shared-buffer bytes on both GPUs. Both exposed the native-list interface. On RADV the separate full capture/replay test stopped at the explicit native-list assertion before recording, as the guard intends.Synthetic inputs throughout. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:29:53Z.
Verification of #2642 (D3D12-LINUX-DXC-RUNTIME-SHADERS): third-party code review on Linux x86_64. The code was not built:
leonida-gpuis Windows-only (Wine/VKD3D-Proton not run here).ccf43e4c0, merge base5b1fff821. It merges cleanly intomain45dc41f95. 14 files. CI passes on this head (6/6). The last code commit is603845af; the commits after it are merges ofmainand regenerations ofswitches.md.Commands and results
python -I tests/test_d3d12_switches.pyon the merge: 20 tests, OK.python -I scripts/check_no_game_data.pyoncompiler.rs,ambient_readback.rs,tests/replay.rs,README.mdandswitches.md: clean.Review
compiler.rs: native Windows still callsD3DCompilewith unchanged flags and profiles. On Wine, onlycs/ps/vs_5_1with flags at mostENABLE_UNBOUNDED_DESCRIPTOR_TABLESgo to DXC*_6_0. The DLLs are loaded by absolute path withLOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | SYSTEM32. A missing DXC is logged once and the code falls back to FXC. This is sound.compiler.rs:56-79: a DXC compile error on Wine returnsErrand does not fall back to FXC. The fallback only covers a DLL that failed to load. That may be intended, but the PR body and README say the code "uses FXC" whenever DXC is unavailable.compiler.rs:143-147: every compile creates a newIDxcCompiler3. This is not a hot path, but the instance could be cached next to the factory.compiler.rs:163-168: a failed status with no error text returns without logging anything.tests/replay.rs: the explicitNON_PIXEL_SHADER_RESOURCE -> COPY_DESTbarrier onshared.0is correct, because a buffer promoted to a read state cannot be promoted implicitly toCOPY_DESTin the same submission. However,a_frame_is_recorded_and_replayednow asserts (fails) on a VKD3D-Proton device (requires_native_lists, L1798) where it used to run. Any Wine test runner that includes this test will now go red. A skip with a message would match the "no adapter: skipped" style.switches.md:LEONIDA_TEST_DXC_DIRgoes into the main table instead of "Only in tests", because the generator reads it from a#[cfg(test)]function in a non-test file.Process
ambient_readback.rs), changes the replay test (awith_meshtoggle, an adapter-selected offscreen test, VKD3D interop detection) and fixes a barrier. CONTRIBUTING.md asks for one topic per pull request. The test infrastructure would review more easily as a follow-up.AI-assisted: yesbut does not name the models or the reviewer agent's model (CONTRIBUTING.md).9075a5e41.Verdict: defects (scope, disclosure, and the replay test now fails under VKD3D instead of skipping). The compiler routing itself looks correct.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T19:20:14Z.
Thanks @MoonEyes for the detailed code review! Addressed every point in
164506d01c(merged with currentorigin/main):replaytest (CONTRIBUTING.md): removedambient_readback.rs, prunedcompile_runtime_hlsl, and restoredd3d12/crates/leonida-gpu/tests/replay.rstoorigin/main(0diff, soa_frame_is_recorded_and_replayedbehaves identically tomainunder VKD3D-Proton and any test-infrastructure updates can go in a separate PR).IDxcCompiler3caching (compiler.rs): created once insideload_dxc_fromand cached behindDxc { compiler: Mutex<SendCompiler> }alongsideIDxcUtils(freeing both DLL handles on any failed load/export/instance step).compiler.rs,d3d12/README.md): addeddxc_status_error+.inspect_errlogging so failed DXC compiles with empty error blobs still logtracing::warn!("DXC: ... ({hr:#010x})"), and alignedd3d12/README.mdwith actual behavior (falls back to FXC only when the app-local DXC pair is absent or cannot be loaded).switches.mdplacement & hardware dispatch/readback test (compiler/tests.rs): movedLEONIDA_TEST_DXC_DIRand compiler tests intosrc/compiler/tests.rssotools/d3d12_switches.pyplacesLEONIDA_TEST_DXC_DIRunder## Only in tests, and addedcompiled_compute_shader_dispatches_and_reads_back_on_fxc_and_dxctesting hardware D3D12 compute dispatch + readback across both FXCcs_5_1and signed DXCcs_6_0(5/5compiler::tests +4/4caller shader tests +1/1--test replay+20/20test_d3d12_switches.pypassing).CONTRIBUTING.md): updated the PR description'sAI-assisted:line to name the authoring and independent read-only reviewer models.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T00:02:23Z.
RUN (in game, batch of nine pull requests), each head merged with
git merge --no-ffonto main81efe4566, in one build: #313674bd1bcd4, #315653c3100ce, #3206d024194b3, #3248efd21d867, #3256e7aad1d4c, #32623643c2879, #2851b83b0b375, #312589bf1d328, #2642164506d01. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.2 fps on other batches in the last day. These fps are a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures;
-PrecompileUsedwas used, so the default start (every known pipeline precompiled) was not exercised. The precompile before the world took 619 s, against 157 s for the previous batch; the shader-side changes in this batch (#3156, #3262) probably left the pipeline cache cold (not checked). Switches that are off by default (for example #2851'sLEONIDA_TITLE_MEMORY_SCALE, #3136's timeline attribution) were not turned on: this run covers their default path only. #2642 targets Wine and was run on Windows only.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T05:47:27Z.
VERIFY-2642 y
#2643— las dos grandes, las dos sin tests nuevos, y una de ellas mejora al fusionarLas dos de zmasi, las dos de 5-6 días, y las dos con
switches.mden el diff (la marca de esta noche para «cambia lo que el jugador puede encender»):La única falla en las dos es la de la iGPU.
#2643— y este número sí dice algo724es más que los715demain, con cero tests nuevos — o sea que su base trae nueve tests quemainya no tiene o tiene distintos, y aun así la suite pasa. Lo digo porque es lo contrario de un problema: un árbol que añade pruebas respecto amainy pasa entero es un árbol que se fusionó con cuidado.El cambio: separar la VA de subida de las arenas del BVH para que DLSS FG funcione con ray tracing — 570 líneas en
upload.rs, 229 enmemory.rs. Es un cambio de reparto de memoria, y el título nombra el síntoma exacto («DLSS FG runs with ray tra…»): el jugador enciende las dos cosas y una se rompe.#2642— compilar shaders SM 5.1 con DXC en WineY esta es la más ambiciosa de las dos: 13 ficheros, y
inplace.rs/replay/play/merge.rsen el diff — no es sólo el compilador, es el camino de la grabación.Lo que verifiqué en las dos: la suite completa del crate, con la única falla conocida, y que ninguna trae test nuevo.
Lo que no: que DLSS FG y el ray tracing convivan (
#2643) ni que un shader SM 5.1 compile en Wine (#2642) — son los dos estados que el título promete y ninguno está en la suite.Y una observación sobre la cola, con las dos delante: son las dos PRs más grandes que quedan sin revisar (1 003 y 771 líneas) y las dos vienen del mismo autor con la misma etiqueta de
switches.md. Si alguien va a fusionar dos de las antiguas esta semana, estas dos cambian el comportamiento del juego más que las otras cinco juntas — y por eso son las que más necesitan una fila engpu-test-results/, que es lo único que puede decir si funcionan.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T11:32:50Z.
Merged
origin/main(6e97990505,#3318) into4b4d99a822strictly to regenerated3d12/docs/switches.md(needs rebase); all 12 non-switches.mdfiles preserve identical PR hunks againstorigin/maincompared to164506d01c.AI-assisted: Gemini 4 Carbon (High) and Gemini 4 Neon (XHigh).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T12:46:32Z.
RUN (in game, third party, batch of four pull requests), each head merged with
git merge --no-ffonto main6e9799050, in one build: #26424b4d99a82, #31518894c5812, #33230c836e32e, #332402f37bcf8. RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x,-PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.For reference, the same machine and route rendered 13.3 to 17.4 fps on other runs in the last day: a check that nothing fell over, not a measurement of a gain.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures. The precompile before the world took 529 s, against about 110 s for main alone: the translator change in #3324 left the pipeline cache cold. Switches that are off by default (for example #3323's own-pass timing) were not turned on: this run covers their default path only. #2642 targets Wine and was run on Windows only. #3151 changes what happens on a lost device; no device was lost, so that path was not exercised.
AI-assisted (Claude Code, Claude Opus 5.5).
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.