d3d12 translator: a buffer's size through its own handle on AMD (carry of #2698, D3D12-AMD-SIZE-HANDLE-CARRY) #3293
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
2 participants
Due date
No due date set.
Reference
leonida/mandy!3293
Loading…
Reference in a new issue
No description provided.
Delete branch "carry/amd-size-handle"
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?
Pull request successfully merged and closed
Carry of #2698 by @Geovannisz. Item: D3D12-AMD-SIZE-HANDLE-CARRY, claimed in #2570. The author has been inactive since 2026-11-30, and this is carried at OreoFR's request. All three commits are cherry-picked with
-x, authorship kept.Why
On RDNA4 (Radeon RX 9070 / 9070 XT), AMD's DXIL compiler can crash inside
amdxc64.dll+0x861b9f(read at 0x8) while building a pipeline, before the first frame:#3222 guards the crash after it happens. This change aims at its cause: a buffer's
getDimensionssharing a heap handle with that buffer's loads.What it does (unchanged from #2698)
With
LEONIDA_SEPARATE_SIZE_HANDLES=1, a buffer's size query inLower::descriptor_datagets its own heap handle to the same view, at the same index and raw twin.Tag::SizeHandle), and dead queries are still removed.LEONIDA_SHADER_SWITCHES).What changed vs #2698
516c9eaab, with no conflicts. Main's separatelegacy_madfix (3c2bfd429) is kept. The failingrdna_forms_give_what_the_spelled_out_ones_giveon #2698's old base comes from that base, and it passes here.emit/lower/amd.rs, after DexNom/VIctory PR 62, GPL-3.0-or-later) does the same thing behind its own switch. It also leaves the size query of a waterfall loop on its per-lane handle; #2698 does not exempt that case. With the switch on, the waterfall and size tests pass here, so no gap was shown and nothing was added. A reviewer with an RDNA4 card may want to look at that path.Tested
RTX 4070 Laptop 8 GB, driver 621.40, Windows 11; the tree is identical to #2698 merged into main
516c9eaab.cargo test -q -p leonida-shader: 430 passed, 0 failed, 6 ignored. That includes the host-GPU and WARPsize_tests(DXIL validated),rdna_forms_give_what_the_spelled_out_ones_give, andbuffer_size_handles_are_kept_separate_when_reusing_values.LEONIDA_SEPARATE_SIZE_HANDLES=1: thesize_tests, waterfall, size-handle andrdna_formstests pass, 34 of them.cargo clippy -p leonida-shader --all-targets -- -D warnings: only the 6 errors main already has invalu_tests.rs, none in the touched files.scripts/check_no_game_data.pyon the changed files: OK.Needs: an in-game run on an RDNA4 card before merge. We have none here; the RX 9070 player could run a build with
LEONIDA_SEPARATE_SIZE_HANDLES=1. According to #2698'sdocs/design.mdentry, it was also confirmed by offline native pipeline compilation on an RX 9070 XT (driver 32.0.32029.2010).AI-assisted (oreofr-agent, Claude Code).
🤖 Generated with Claude Code
VERIFY-3293 — el carry de
#2698, verificado otra vez sobre la base actual: 430/0/6Es el mismo cambio, reabierto por OreoFR para que no dependa de una rama de ocho días:
Los mismos números que medí en
#2698con el cherry-pick (430/0/6) y en la rama que rebasé (2acb803ff, 430/0/6). Tres caminos, un resultado — y eso es lo que hace que valga la pena decirlo: la corrección de mi comentario anterior no era un artefacto de cómo rebasé yo.Lo que este carry resuelve de verdad:
#2698estaba abierto contra una base de hace ocho días, y el rojo de su propia rama (rdna_forms_give_what_the_spelled_out_ones_give) hacía que pareciera roto. Reabrir sobremainelimina la pregunta entera — el rojo no aparece, y nadie tiene que leer tres comentarios míos para descubrir que era la rama.Y una cosa que ahora se puede decir con el carry delante:
#3294— "Test RDNA legacy MAD lowering without a GPU" — aparece a la vez, y su test nuevo se llamardna_legacy_mad_uses_distinct_dxil. Es exactamente la pregunta que dejé abierta en#2698(«¿debemad_legacyemitirse con su forma o plegarse a la canónica?»): la respuesta es un test que compara el DXIL de las dos formas y exige que difieran. Así que los dos PRs son el mismo trabajo, uno con el cambio y otro con la prueba.Si los dos entran juntos,
#2698puede cerrarse el mismo día — y lo digo porque su contenido está aquí, no porque lo haya decidido yo.RUN (in game, batch of three pull requests), each head merged with
git merge --no-ffonto maind9b618f10, in one build: #3290898de93c2, #3293fae5bd4b5, #32949582059a2. 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. Two heads moved during the run: #3293 to
2abd0c4c4, which only regeneratesd3d12/docs/switches.md(git diff fae5bd4b5 2abd0c4c4outside*.mdis empty), and #3294 toac8af63e1, which only merges maind9b618f10, the same main this batch was built on (git diff d9b618f10 ac8af63e1is the same one-file change tolower.rsthat was tested). This run therefore also stands for those two new heads.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. #3290's switch is opt-in and was left off. #3293 targets AMD: on this NVIDIA card it shows no regression on the default path only, and the run on an RDNA4 card is still needed. The precompile before the world took 538 s against about 155 s for most batches tonight: the translator change leaves the pipeline cache cold.AI-assisted (Claude Code).
tested, for the record, even though the pull request is closed without a merge. Machine: Windows 11, NVIDIA GeForce RTX 5080 16 GB, driver 621.47, hardware-accelerated GPU scheduling on, page file 49,152 MB.
node --test tests/test_*.cjs-> 113 tests, 113 pass, 0 fail.cargo test --workspace --exclude xtask --lockedind3d12/atd540d3a06e->leonida-gpu715 passed / 1 failed / 59 ignored, identical to main, the one failure the knowndescriptor::host::tests::views_are_made_beside_the_heap_and_copied_inthat passes withLEONIDA_VIEW_COPY=0. Headd540d3a06eon base99e0bc1ce6.As noted before, on this NVIDIA card only the not-refused half of the handle carry is observable: the size comes back through the same handle and nothing is refused.
#3286is the head that clears the last failure, so if this one is re-opened it will read clean on top of it.