fix(d3d12): Isolate AMD buffer size query handles #2698
Open
Geovannisz wants to merge 3 commits from
upstream-pr/2698 into main
pull from: upstream-pr/2698
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!2698
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2698"
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 Geovannisz on 2026-11-30T05:15:50Z.
Claimed in the coordination issue as D3D12-RDNA4-BUFFER-SIZE-HANDLE.
What and why
On my RX 9070 XT, AMD's DXIL compiler faults during compute pipeline creation. LEONIDA_SEPARATE_SIZE_HANDLES=1 makes the native translator emit a dedicated heap handle for buffer-size queries. The reuse pass keeps it separate from memory-access handles. Dead-code removal can still discard unused queries. Both handles address the same view.
The setting is opt-in and participates in the translation-cache fingerprint. The README explains activation and retrying keys recorded as bad by an earlier warm run. The native translator contract is documented in docs/design.md.
This adapts imjustprism's approach in Marvisak/VIctory#2122 to Mandy's lowering and optimiser. It is independent of #2694, which serializes concurrent driver calls. My reproducer uses one pipeline per fresh process.
Compatibility with #2687's handle hoisting was checked in the current main source. The hoist_handles eligibility check accepts only uniform createHandleFromHeap calls. This workaround emits dedicated size-query handles with the non-uniform flag set, so they are excluded from that pass. KelboLive independently tested the merged tree and reported passing regression and waterfall/descriptor subsets.
Tested
MEASURED locally. Profile M, Radeon RX 9070 XT 16 GB desktop, driver 32.0.32029.2010, Windows 11 build 26300, Rust 1.98.1, MSVC x64.
1d22590reproduced the access violation on two previously failing compute pipelines, individually in fresh processes.950fea2, same binary and settings for both arms. With LEONIDA_SEPARATE_SIZE_HANDLES=0, both selected pipelines faulted. With the setting at 1, all 22 previously failing pipelines compiled, with zero refusals and zero worker crashes.1f188c4builds with cargo build --locked --profile diag -p leonida --features diagnostics,mimalloc. Changed-file game-data check and git diff --check pass.GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.32029.2010, Windows 11 build 26300. WARP used for synthetic readback tests.
AI-assisted: OpenAI Codex. The hardware and crash report are mine. The commit author is Geovanni (@Geovannisz), with Codex assistance recorded and prior VIctory work credited.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-30T05:41:55Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T13:17:38Z.
Cross-vendor check on Windows of
1f188c4f7on currentmainf9f3ec4c6(merges without conflict,82867d471). Native Windows 11, MSVC x64, Rust 1.98.1, fullcargo test -p leonida-shader --libon a hardware GPU that isn't AMD (not WARP), so the DXIL is validated and the dispatches/readbacks run on a second vendor's driver.LEONIDA_SEPARATE_SIZE_HANDLESunset: 386 passed, 0 failed, 4 ignored.LEONIDA_SEPARATE_SIZE_HANDLES=1: 386 passed, 0 failed, 4 ignored, including the waterfall tests with their separate size-query handles and the 10 descriptor-size tests.mainlists 389 tests (385 run + 4 ignored); the merge lists 390, so the only addition isbuffer_size_handles_are_kept_separate_when_reusing_values.So on this driver the opt-in changes no result, and leaving it off changes nothing either. That fits it being a workaround for the AMD compiler only. The 8 WARP-only failures in the description don't appear on hardware here in either mode. I can't reproduce the AMD fault itself, nor the standalone structured-buffer readback case.
AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T13:38:25Z.
Independent size-handle and cache-key check under Wine.
1f188c4fmerged ontof9f3ec4c6(tree3a86abcd). Windows x64 MSVC-target Rust 1.98.1, Wine 11.22, and VKD3D-Proton 3.1.0 (0bb64c56c8f0dcc). Radeon 610M (RADV 26.3.1) and RTX 4070 SUPER (620.73.04), using the DXIL validator from DXC v1.8.2505.1.MEASURED. One fresh process per mode per GPU compiled the synthetic structured-buffer count plus indexed-load fixture. DXC disassembly shows that unset and
=0emit byte-identical DXIL and share one SRV handle betweengetDimensionsandrawBufferLoad. With=1,getDimensionsuses a dedicated non-uniform handle andrawBufferLoaduses its separate handle. Both use the same descriptor index and resource properties. The emitted census was 3/3/4 total handles with 1 size query, 1 load, and 2 stores in every mode.All six hardware runs returned
[3, 77]and[5, 0x1234abcd]for the two input buffers. The production translation fingerprint returned distinct bytes for unset,0, and1. The only difference was the switch value in its environment record. The initial artifact reused a stale Cargo build-script output from a prior checkout. These results use a regenerated switch list.The focused size, waterfall, and optimizer selection on each GPU was 15 passed / 1 failed on
mainand 16 passed / 1 failed with the PR in both settings. The added optimizer regression passed. The existing NaN-scrubR32_UINTfailure showed the same result on main and PR within each GPU. All six full-suite runs exited with status 3 whilefirst_half_values_render_on_hardware_and_warpwas active.Synthetic translation and Wine readback coverage. A second agent checked the raw results. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T15:32:05Z.
Review: COMMENTED
Verified
1f188c4fwith an own target dir:cargo test -p leonida-shaderwithLEONIDA_SEPARATE_SIZE_HANDLES=1gives 371 passed / 0 failed / 4 ignored, and the waterfall (22) and descriptor (21) subsets pass with the switch both on and unset. The separation is genuinely tested: deleting theTag::SizeHandleguard inopt.rs:919makes the new regression fail with the size query merged into the memory-access handle ([[Inst(0), Inst(0)]]vs[[Inst(0), Inst(1)]]), and the dead-query case still drops (body == 3afterREUSE | DEAD).The mechanism is right: the buffer
getDimensionspath takes a fresh handle only for buffers withseparate_size_handles()(lower.rs:8296-8306,:1662-1667), built from the same index and props as the access handle, and the tag is attached tocreateHandleFromHeap(shader.rs:682-684) and preserved inbitcode.rs:397-402even with the census off, so it can neither be reused nor absorb a later access. The fingerprint claim checks out too: the build script's switch list contains the name andtranslation_fingerprint()hashes its value.git merge-treeagainst current main is clean, and on the merged tree the regression plus the waterfall/descriptor subsets pass. The branch is now 1027 commits behind and main has gained #2687'shoist_handles; that pass only hoists uniformcreateHandleFromHeapcalls, and these handles are emitted non-uniform, so the contract still holds — worth a sentence in the body so the interaction is on record.One nit:
tag == Tag::SizeHandle || census::enabled()inbitcode.rs:399would read better as aTag::needed_without_census()predicate, so the next optimisation tag does not have to edit that condition. The AMDamdxc64.dllfault and the 22-pipeline result cannot be reproduced here (no RX 9070 XT, no game data); the DXIL-level evidence above is what this machine can check.Imported from ubiquitarianism/leonida. Originally posted by Geovannisz on 2026-12-01T17:01:20Z.
Thanks @KelboLive for the independent verification and for checking the regression by removing its guard. I added the interaction with #2687's hoist_handles pass to the PR description after checking the current main source. The dedicated handles carry the non-uniform flag, which excludes them from its uniform-handle eligibility check.
Your Tag::needed_without_census() suggestion is noted as a readability improvement. The RX 9070 XT measurements remain scoped to the pinned offline A/B and the earlier warm run described in the PR.
AI-assisted: OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:24:47Z.
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 MoonEyes on 2026-12-02T18:01:24Z.
Verified on Linux: head
1f188c4f7merged into currentmain45dc41f95(clean merge of 7 auto-merged files; throwaway tree). The shader crate's portable tests pass on the merge, and the new test fails without the fix.On Linux the crate runs 254 of its tests; the DXIL-validator and device tests are
#[cfg(windows)]and did not run here. The Windows runs in this thread (@Kal0s-design, @merzleckeier) were onf9f3ec4c6(mainof 2026-11-30); this is the first run I know of on a merge with currentmain, so it shows the old branch still composes with today's optimiser (FxHash maps,hoist_handles) at least on the portable tests.Red/green (source reverted on the same merge): deleting only the new guard in
emit/bitcode/opt.rs(&& self.tags.get(&i) != Some(&super::Tag::SizeHandle), line 1146 on the merge):So the test pins exactly the reuse it is meant to prevent.
Review notes
LEONIDA_SEPARATE_SIZE_HANDLES=1), so default translations are unchanged. The switch is a quoted"LEONIDA_*"literal inleonida-shader, sobuild.rsputs it inLEONIDA_SHADER_SWITCHESand the shader cache key (translation_fingerprint) changes with it; a cached translation made without it is not served with it on.Module::tagnow recordsTag::SizeHandleeven when the census is off (the optimiser reads it). Only that tag escapes the census gate, so the census-off cost is one map insert per buffer size query with the switch on.heap_handle_at's(index, bounded)tuple plus a new trailingseparate: boolmakes three adjacentboolparameters (sampler,nonuniform,separate); easy to transpose at a call site. A small struct or enum would be safer, but it is not a defect today: all call sites were updated and the tests pass.docs/design.mdgets a new "Native D3D12 translator contract" table with this rule and how it was confirmed (synthetic test plus RX 9070 XT pipeline creation), as AGENTS.md asks.The in-game gate @MoonEyes asked for (render path, current head merged on current
main) is still open, and only an RDNA 4 machine can confirm the switch prevents the reported compiler fault. CI on the head is ataction_required.Verdict: ready for the code (opt-in, red/green shown on a current merge); blocked on the requested in-game run and CI approval before merge.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:21:16Z.
RUN (in game, batch of seventeen render-path pull requests), each head merged with
git merge --no-ffonto main3c106eb2f, in one build: #311115b579756, #29485284c6eae, #26981f188c4f7, #294644bf554fe, #3001d924cbb65, #28320c861595a, #291558e8535cf, #2822d359a2f85, #2896c9c6b103d, #29838278ef1b9, #3115ba5121192, #2945d2c08c14f, #297574512d658, #295126da88e8e, #2800b6ebcedd4, #28937c7e99b48, #3113fa1460b6b(and #30970d7a451ab, merged since). RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.The drops under 5 fps line up with shaders being translated while walking (about 500 translations in the last 330 s): this batch changes the shader translation, so the shader cache built by earlier runs did not apply and the pipeline precompile alone took about 45 minutes. The batch-5 run on the same machine and route had no sample under 5 fps (median 16.4). I read this as cold-cache stutter, not as a regression of a single pull request, but this run cannot tell them apart.
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. A first attempt of this batch is not counted: the run script gave up waiting for the game window after 40 minutes of precompile.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by Cody-Lincoln on 2026-12-03T03:21:00Z.
Game-run test, second RX 9070 XT (driver 32.0.32029.2010, Windows 11 26200),
diagprofile:mainat9b4d71899baseline vs this branch at1f188c4f7, default launcher settings plus-More @{LEONIDA_SEPARATE_SIZE_HANDLES='1'}(new translation fingerprint, as the README notes).Game Init) inamdxc64.dll+0x861b9f(read 0x8);leonida warmhad ended 19-27 worker processes with the same exception (pipelines/warm-bad.txt, 27 keys). The one start made with an empty book reached the world and died at frame 9025, same instruction.0 ended their process, warm-bad empty; the title got past its frame-0 fault and into the intro cutscene.host GPU failure … E_OUTOFMEMORY (0x8007000E)closing a command list — a ~30 GB resident local-LLM process on the same 64 GB PC; a clean run with it closed follows. Not attributable to this change.One observation for scope: on this card the frame-0 fault followed a
host pipeline shaders=[vertex, pixel]log line (the create that faulted was not compute), yet with the switch warm compiled all drawn pipelines with zero faults — so the size-handle shape appears to reach the graphics path here too, not only compute.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:56:09Z.
VERIFY-2698 — y aquí hay un test que falla en el head, no una falla de esta máquina
Ocho ficheros, +90/−16, ocho días abierto. La suite del crate que toca:
Y esta no es la de la iGPU:
leonida-shaderenmainestá en 429 pasados y 0 fallados (lo medí en la línea base de esta noche), y este crate no hace nada con adaptadores. Es un test de valores: una forma RDNA y su forma escrita a mano deberían dar diferencias distintas de cero y dan lo mismo —mad_legacy: written alikees el mensaje que el propio test escribe cuando las dos representaciones coinciden.Lo que eso significa, sin adornos: con este cambio, la forma
mad_legacyse compila igual que la escrita a mano, que es exactamente lo que el test está ahí para impedir — y el PR tocabitcode.rs,opt.rs,lower.rsyshader.rs, que es donde se decide cómo se emite una instrucción.Lo que no puedo decir: si el fallo lo introduce este PR o si ya estaba en su base. Su base es de hace ocho días y
mainha recibido cambios enemit/desde entonces (#3197está abierto tocandobitcode.rsylower.rs), así que la comparación honesta es la que hice: enmainhoy el test pasa; en su head, falla.Y lo que no voy a hacer: decidir cuál de los dos está bien.
mad_legacyes una instrucción de AMD con multiplicación y suma fundidas; si el emisor la está plegando a la forma canónica, el test puede estar pidiendo lo imposible, o el emisor puede estar perdiendo la forma quemad_legacynecesita. Eso es del autor, y con el mensaje del test delante lo puede ver en un minuto.Lo que sí verifiqué:
cargo test -p leonida-shader --liben su head, que es un comando y un número, y el nombre del test que falla. Todo lo demás de este comentario es lectura del mensaje.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:56:27Z.
Confirmado con el mismo comando en los dos árboles: en
mainpasa, en su head fallaAñadí esto porque mi comentario anterior comparaba contra una medición de la línea base, no contra el test suelto:
Y una cosa que conviene decir sobre la diferencia de conteos:
mainfiltra 434 y su head 370, porque su base es de hace ocho días y el crate tiene hoy más tests. Así que el fallo no es "un test que no existe enmain" — es el mismo test, que allí pasa.Lo que sigue sin decidir, y es del autor: si
mad_legacydebe emitirse con su forma o plegarse a la canónica. El test dice «deberían diferir»; el cambio hace que coincidan. Una de las dos cosas es la que cambia.Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T04:02:24Z.
I isolated the
mad_legacy: written alikeassertion from the Windows test using the same synthetic shader builder and RDNA masks on Linux. Each revision was built separately with Rust 1.98.1.mad_legacyDXIL with RDNA off/on1d22590b91f188c4f7main516c9eaabmainThe old base already has the reported failure. Current
maincontains the separatelegacy_madfix in3c2bfd429, and merging #2698 preserves it. Themul_legacycontrol produced different DXIL at both masks on all four trees. On the combined tree, the portable shader library suite had 256 passes (including the extracted assertion and the PR’s size-handle test), two ignored, and zero failures.This isolates the compiler-side assertion. The Windows GPU execution portion was outside this run. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T04:05:19Z.
Correction, and it is the good kind:
main+ this pull request is 430 passed, 0 failed — the red was its base, not the changeMy last two comments said the head has a failing test and left the question open. I answered it the way this repository says to: cherry-pick the commit onto
mainand run:So the failure I reported is not caused by this pull request at all. Its branch is eight days old, and something in
emit/landed onmainin between that fixedrdna_forms_give_what_the_spelled_out_ones_give— on the current base, with this change applied, it passes.Which makes this pull request: clean to merge, and blocked only by being old.
And what it costs to say so: the previous comments were technically true — the head does fail, 370/1, and the test is real — but a reader takes «the head fails» as «the change fails», and it does not. The difference is a rebase, and I should have run the cherry-pick before writing the first sentence about it rather than after. The method is in this repository's own notes; I used it for
#3209an hour ago and did not use it here.For whoever is merging: rebase it, and the 430 will be the number.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T04:14:08Z.
And the rebase is done and pushed, so nobody has to redo it:
pr-2698-rebased,2acb803ff, 430/0Since the cherry-pick applied cleanly, I did the whole thing:
The rebase had no conflicts, and the 446 seconds are real — this is the crate with the big bitcode tests, and it is the reason I ran the suite twice rather than once.
What the change is, now that its base is current: it isolates the handle of AMD's buffer size query — eight files in
emit/, plus a README anddocs/design.md— and the test that was red in its own base (rdna_forms_give_what_the_spelled_out_ones_give) is green onmain.So the state of
#2698is: clean, rebased, 430/0, and the only thing between it and a merge is somebody pressing the button. The branch is on my fork because my account cannot open the pull request, and the link above opens it with the same title and the evidence in this thread.One honest line about why it took three comments to get here: the first should have been the cherry-pick. I wrote «the head fails» because the head does fail, and a reader takes that as «the change fails». The difference was one command.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T04:19:09Z.
VERIFY-2698 (Verified by OreoFR) on current main
516c9eaab, head1f188c4f7.git merge --no-ffis clean (8 files, +90/−16). Main's separatelegacy_madfix (3c2bfd429) is kept.cargo test -q -p leonida-shadergives 430 passed, 0 failed, 6 ignored, on an RTX 4070 Laptop with driver 621.40. That includes the host-GPU and WARPsize_tests(DXIL validated),rdna_forms_give_what_the_spelled_out_ones_give(it passes merged into main, as @merzleckeier found), andbuffer_size_handles_are_kept_separate_when_reusing_values.LEONIDA_SEPARATE_SIZE_HANDLES=1: the size, waterfall, size-handle andrdna_formstests pass (34).-D warnings: only main's 6 known errors invalu_tests.rs, none in the touched files.emit/lower/amd.rs, after DexNom/VIctory PR 62, GPL-3.0): same approach. It also uses its own handle and is off by default. Ours additionally leaves a waterfall loop's size query on its per-lane handle, but no failure was shown on that path here, so we drop our prototype in favour of this PR.Verdict: compiler side OK merged into main; needs an RDNA4 in-game run before merge.
The author has been inactive since 11-30, so a carry follows at OreoFR's request: #3293.
(oreofr-agent, AI-assisted)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T04:19:11Z.
Carried into #3293 at OreoFR's request (author inactive since 11-30): commits cherry-picked with -x, authorship kept. (oreofr-agent, AI-assisted)
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.