test: a raw view is read by a shader, which is what says it names its buffer #2975
Open
github-bot
wants to merge 1 commit from
github-bot/gh-2975 into main
AGit
pull from: github-bot/gh-2975
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
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.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2975
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2975"
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?
@fiestorra on GitHub · 2026-12-01 22:14 UTC · original
fiestorra:descriptor-view-test→main· +126 −0 · 1 files · 1 commits · opendescriptor::host::tests::views_are_made_beside_the_heap_and_copied_infails on this machine (RTX 4090, driver 621.24) on
main, and it is the onlything that fails in the crate's 86 descriptor tests here. The natural reading
is that
raw_atcopies the wrong descriptor into the slot.This test asks the question the other way round: it takes the view
raw_atmakes, moves it into a shader-visible heap as it is, binds it, and has a
compute shader read the buffer through it. If the view did not name its
buffer, the shader would read something else.
It passes here. So the view is right and the bytes of a descriptor slot are
not the thing to compare: the driver does not put D3D12's documented layout
there - the first two dwords are not the resource's address, in either the
mode where a view is made in the slot or the one where it is made beside and
copied in - and two slots for the same view need not hold the same bytes.
What that means for the test above is left alone here, on purpose: it is
someone's invariant on other drivers and turning it off is a decision with
evidence from more than one card. This adds the check that can be trusted in
its place.
Measured on main
1fff69129with this change:cargo test -p leonida-gpu --lib -- --test-threads=1 descriptor::
86 passed, 1 failed (that one), 5 ignored
cargo clippy -p leonida-gpu --all-targets 0 warnings
Not checked: a card that is not this one, and WARP - the test returns early
where there is no host GPU.
Written with an AI assistant.
@andrew-ai on GitHub · 2026-12-01 22:20 UTC · original
Verified the shader readback at
74512d658on native Windows with both an RTX 5070 (616.92) and Microsoft WARP. I extended the synthetic source buffer to two consecutive 256-byte ranges. The shader, dispatch, destination and descriptor-copy path stayed the same; only the source view's byte offset changed between runs.Each run identified the selected adapter by device LUID and checked every word after dispatch. This confirms the new test observes the buffer range selected by raw_at on both adapters. On this 5070 the previous descriptor-byte comparison also passed, as reported in #2570. Codex-assisted.
@merzleckeier on GitHub · 2026-12-01 22:30 UTC · original
The shader readback isolates a descriptor-buffer-dependent failure on RADV.
I tested
74512d6583ccc4bbadbe38c5ab8e606a72039a16together with #2981 on mainc4ca5761. The D3D12 trees match after merging current main1abef08d, and the tested descriptor module is identical with #2975 alone. Wine 11.22 / VKD3D-Proton 3.1.0, RTX 4070 SUPER (620.73.4) and AMD Raphael (RADV 26.3.1).raw_at0x10000000in both modesVK_EXT_descriptor_bufferAll rows used the same binary. A fresh isolated run of the stock shader reproduced failure at default, failure with only
VK_EXT_descriptor_heapdisabled, and success with onlyVK_EXT_descriptor_bufferdisabled. The oldercopied as it was madebyte comparison still failed on RADV with descriptor buffer disabled and the shader readback working. It also failed on NVIDIA despite working readback.The full readback compares all 64 words at offsets 0 and 256, plus a 128-byte view at offset 256 whose last 32 reads must be zero. The test still includes the copy to the shader-visible heap, so the extension result locates a configuration dependency without distinguishing every step in the descriptor path. AI-assisted, independently checked against the raw results.
@merzleckeier on GitHub · 2026-12-01 22:41 UTC · original
CORRECTION to my earlier descriptor-buffer report.
The stock test and my earlier fixture both pass
heap.cpu(index)fromHostHeap::newas the source of a finalCopyDescriptorsSimple. The heap is created withD3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE. A CPU handle still belongs to that heap. D3D12 requires the source to be in a non-shader-visible heap. The zero reads in my earlier report describe this unsupported final copy. Microsoft API contract.I reran
74512d6583ccc4bbadbe38c5ab8e606a72039a16on main1abef08dwith #2962, using the same descriptor module as #2975 alone. Wine 11.22 / VKD3D-Proton 3.1.0, RTX 4070 SUPER (620.73.4) and AMD Raphael (RADV 26.3.1).raw_atview directly in its existingHostHeappassed on both GPUs withLEONIDA_VIEW_COPY=0and1. The fixture reserved two consecutive slots and wrote the output UAV in the second.D3D12_DESCRIPTOR_HEAP_FLAG_NONEand copying it into the visible heap also passed on both GPUs. Direct creation in the visible slot passed as well.All 14 valid runs matched all 192 checked words per run, including zeroes outside the shorter view. Binding the existing
HostHeapdirectly makes the test exerciseraw_atand its normal staging path without the unsupported extra copy. AI-assisted, independently verified against the raw results.@fiestorra on GitHub · 2026-12-01 22:58 UTC · original
Thanks - RTX 5070 and WARP both reading all 64 words at both offsets is more than I could run here, and it is the negative control the test needed: a view that names its buffer reads it, on hardware and on the software adapter.
AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
@MoonEyes on GitHub · 2026-12-02 12:33 UTC · original
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).
@MoonEyes on GitHub · 2026-12-02 18:14 UTC · original
Test-only (one
#[test]ind3d12/crates/leonida-gpu/src/descriptor/host.rs). Not built here (Windows-only). It merges cleanly with currentmain, and the GPU evidence on this head is already in the thread.python -I tests/test_d3d12_switches.pypython -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/descriptor/host.rsRead in the diff:
a_raw_view_bound_to_a_shader_reads_its_bufferfills 64 words, makes the raw view withHostHeap::raw_at, copies it into a shader-visible heap, dispatches aByteAddressBuffertoRWBuffercopy and compares all 64 words. That checks the behaviour instead of descriptor bytes, which (as its comment says) the 621.24 driver no longer lays out as documented. andrew-ai ran it on an RTX 5070 (616.92) and WARP, reading all 64 words at both offsets. merzleckeier's RADV failure was withdrawn in their own correction.Note: it
returns silently whenhost()orHostHeap::newgivesNone, so on a machine without a D3D12 adapter it passes without testing anything. That is the existing pattern in this file, but aneprintln!("SKIP ...")would make a no-GPU pass visible in the logs.The render-path gate asked for on this PR does not apply to a diff that is entirely
#[cfg(test)], as far as I can see.Verdict: ready.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
@MoonEyes on GitHub · 2026-12-02 18:21 UTC · original
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).
@merzleckeier on GitHub · 2026-12-03 06:42 UTC · original · requested changes
[P2] Bind the raw view from its existing heap. At
74512d65,CopyDescriptorsSimpletakesheap.cpu(index)as its source atdescriptor/host.rs:7681.HostHeap::newcreates that heap withD3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE. A CPU handle still belongs to the shader-visible heap, and the API requires the copy source to be in a non-shader-visible heap.I reran the comparison on
d9b618f1plus74512d65, with Wine 11.22 / VKD3D-Proton 3.1. Both variants used the same compute shader and an explicitly serialized equivalent root signature because Wine's shader compiler did not supply the embedded signature. I checked the device by LUID and required heap creation to succeed.heap.cpu(index)HostHeap0x10000000in both modesBoth modes means separate runs with
LEONIDA_VIEW_COPY=0and1. Reserving two consecutive slots in the original heap, populating the output UAV in the second, and binding the table starting at the first retains coverage of both productionraw_atpaths. See also the earlier isolation of the invalid source.AI-assisted review with Codex.
@fiestorra on GitHub · 2026-12-03 08:21 UTC · original
Sobre el informe de ejecución que pides: queda pendiente y depende de una máquina con el título, que ahora mismo no es esta (aquí no hay ejecución del juego).
Lo que sí está hecho y medido:
Head: 74512d6583ccc4bbadbe38c5ab8e606a72039a16 Main: d9b618f10 git merge-tree --write-tree origin/main <head> → limpio, sin conflictoO sea que se puede probar tal cual, sin rebasar nada.
Y lo que hay que mirar en esta, para que el informe sea útil y corto: que una textura con vista raw no se vea negra ni con basura, y que ningún otro recurso empeore respecto a
main. No hace falta medir fps: el cambio es de corrección, no de rendimiento.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.