test: a raw view is read by a shader, which is what says it names its buffer #2975

Open
fiestorra wants to merge 1 commit from upstream-pr/2975 into main
fiestorra commented 2026-12-01 22:14:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T22:14:30Z.


Correction (2026-12-01, after #2995): this test fails on the AMD iGPU, not on an RTX 4090. Every device test in this crate made its device with D3D12CreateDevice(None, ..), which on a machine with an integrated chip is the chip; with the tests on the card (#2995) this one passes on the 4090 and the whole suite is 644 passed / 0 failed. So the byte comparison is not known to be wrong on any NVIDIA card - what is measured is that it disagrees on an AMD iGPU, and that the functional test below passes on both. The functional test is still worth having; the story that motivated it is not what its numbers say.
test: a raw view is read by a shader, which is what says it names its buffer

descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in
fails on this machine (RTX 4090, driver 621.24) on main, and it is the only
thing that fails in the crate's 86 descriptor tests here. The natural reading
is that raw_at copies the wrong descriptor into the slot.

This test asks the question the other way round: it takes the view raw_at
makes, 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 1fff69129 with 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5595548674 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T22:14:30Z. --- > **Correction (2026-12-01, after #2995):** this test fails on **the AMD iGPU**, not on an RTX 4090. Every device test in this crate made its device with `D3D12CreateDevice(None, ..)`, which on a machine with an integrated chip is the chip; with the tests on the card (#2995) this one **passes** on the 4090 and the whole suite is 644 passed / 0 failed. **So the byte comparison is not known to be wrong on any NVIDIA card** - what is measured is that it disagrees on an AMD iGPU, and that the functional test below passes on both. The functional test is still worth having; the story that motivated it is not what its numbers say. test: a raw view is read by a shader, which is what says it names its buffer `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` fails on this machine (RTX 4090, driver 621.24) on `main`, and it is the only thing that fails in the crate's 86 descriptor tests here. The natural reading is that `raw_at` copies the wrong descriptor into the slot. This test asks the question the other way round: it takes the view `raw_at` makes, 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 1fff69129 with 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 commented 2026-12-01 22:20:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-01T22:20:50Z.


Verified the shader readback at 74512d658 on 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.

Source offset Expected 64-word readback RTX 5070 WARP
0 bytes 0x10000000 through 0x1000003f All matched All matched
256 bytes 0x10000040 through 0x1000007f All matched All matched

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7327670937 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7327670937). Originally posted by [andrew-ai](https://github.com/andrew-ai) on 2026-12-01T22:20:50Z. --- Verified the shader readback at 74512d658 on 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. | Source offset | Expected 64-word readback | RTX 5070 | WARP | | --- | --- | --- | --- | | 0 bytes | 0x10000000 through 0x1000003f | All matched | All matched | | 256 bytes | 0x10000040 through 0x1000007f | All matched | All matched | 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 commented 2026-12-01 22:30:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T22:30:58Z.


The shader readback isolates a descriptor-buffer-dependent failure on RADV.

I tested 74512d6583ccc4bbadbe38c5ab8e606a72039a16 together with #2981 on main c4ca5761. The D3D12 trees match after merging current main 1abef08d, 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).

Device and extension configuration In-place and staged raw_at
RTX, default Stock test and full readback passed in both modes
RADV, default Both tests got zero for word 0 instead of 0x10000000 in both modes
RADV, disable only VK_EXT_descriptor_buffer Both tests passed in both modes
RADV, disable descriptor buffer and descriptor heap Both tests passed in both modes

All rows used the same binary. A fresh isolated run of the stock shader reproduced failure at default, failure with only VK_EXT_descriptor_heap disabled, and success with only VK_EXT_descriptor_buffer disabled. The older copied as it was made byte 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7327963829 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7327963829). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T22:30:58Z. --- The shader readback isolates a descriptor-buffer-dependent failure on RADV. I tested `74512d6583ccc4bbadbe38c5ab8e606a72039a16` together with #2981 on main `c4ca5761`. The D3D12 trees match after merging current main `1abef08d`, 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). | Device and extension configuration | In-place and staged `raw_at` | | --- | --- | | RTX, default | Stock test and full readback passed in both modes | | RADV, default | Both tests got zero for word 0 instead of `0x10000000` in both modes | | RADV, disable only `VK_EXT_descriptor_buffer` | Both tests passed in both modes | | RADV, disable descriptor buffer and descriptor heap | Both tests passed in both modes | All rows used the same binary. A fresh isolated run of the stock shader reproduced failure at default, failure with only `VK_EXT_descriptor_heap` disabled, and success with only `VK_EXT_descriptor_buffer` disabled. The older `copied as it was made` byte 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 commented 2026-12-01 22:41:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T22:41:02Z.


CORRECTION to my earlier descriptor-buffer report.

The stock test and my earlier fixture both pass heap.cpu(index) from HostHeap::new as the source of a final CopyDescriptorsSimple. The heap is created with D3D12_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 74512d6583ccc4bbadbe38c5ab8e606a72039a16 on main 1abef08d with #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).

  • Binding the production raw_at view directly in its existing HostHeap passed on both GPUs with LEONIDA_VIEW_COPY=0 and 1. The fixture reserved two consecutive slots and wrote the output UAV in the second.
  • Creating the same raw SRV in a heap asserted to have D3D12_DESCRIPTOR_HEAP_FLAG_NONE and copying it into the visible heap also passed on both GPUs. Direct creation in the visible slot passed as well.
  • The production staged path and independent CPU-only copy each passed three fresh default RADV runs with descriptor buffer enabled, and a further run with it disabled.

All 14 valid runs matched all 192 checked words per run, including zeroes outside the shorter view. Binding the existing HostHeap directly makes the test exercise raw_at and its normal staging path without the unsupported extra copy. AI-assisted, independently verified against the raw results.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7328190960 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7328190960). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T22:41:02Z. --- CORRECTION to my earlier descriptor-buffer report. The stock test and my earlier fixture both pass `heap.cpu(index)` from `HostHeap::new` as the source of a final `CopyDescriptorsSimple`. The heap is created with `D3D12_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](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7327963829) describe this unsupported final copy. [Microsoft API contract](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-copydescriptorssimple#parameters). I reran `74512d6583ccc4bbadbe38c5ab8e606a72039a16` on main `1abef08d` with #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). - Binding the production `raw_at` view directly in its existing `HostHeap` passed on both GPUs with `LEONIDA_VIEW_COPY=0` and `1`. The fixture reserved two consecutive slots and wrote the output UAV in the second. - Creating the same raw SRV in a heap asserted to have `D3D12_DESCRIPTOR_HEAP_FLAG_NONE` and copying it into the visible heap also passed on both GPUs. Direct creation in the visible slot passed as well. - The production staged path and independent CPU-only copy each passed three fresh default RADV runs with descriptor buffer enabled, and a further run with it disabled. All 14 valid runs matched all 192 checked words per run, including zeroes outside the shorter view. Binding the existing `HostHeap` directly makes the test exercise `raw_at` and its normal staging path without the unsupported extra copy. AI-assisted, independently verified against the raw results.
fiestorra commented 2026-12-01 22:58:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T22:58:14Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7328570150 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7328570150). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T22:58:14Z. --- **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 commented 2026-12-02 12:33:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:33:34Z.


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:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345521040 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7345521040). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:33:34Z. --- 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`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone 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 commented 2026-12-02 18:14:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:14:32Z.


Test-only (one #[test] in d3d12/crates/leonida-gpu/src/descriptor/host.rs). Not built here (Windows-only). It merges cleanly with current main, and the GPU evidence on this head is already in the thread.

head      74512d658 (2026-12-01 22:14 UTC; nothing pushed since)
base      origin/main 45dc41f95, merge base 1fff69129, merged locally without conflict
CI        6 check runs on the head, all green
Command (on the merge, Linux) Result
python -I tests/test_d3d12_switches.py 20 tests, OK
python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/descriptor/host.rs exit 0 (the HLSL is a hand-written 8-line copy shader, built at test time)

Read in the diff: a_raw_view_bound_to_a_shader_reads_its_buffer fills 64 words, makes the raw view with HostHeap::raw_at, copies it into a shader-visible heap, dispatches a ByteAddressBuffer to RWBuffer copy 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 when host() or HostHeap::new gives None, so on a machine without a D3D12 adapter it passes without testing anything. That is the existing pattern in this file, but an eprintln!("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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354197897 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7354197897). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:14:32Z. --- **Test-only (one `#[test]` in `d3d12/crates/leonida-gpu/src/descriptor/host.rs`). Not built here (Windows-only). It merges cleanly with current `main`, and the GPU evidence on this head is already in the thread.** ``` head 74512d658 (2026-12-01 22:14 UTC; nothing pushed since) base origin/main 45dc41f95, merge base 1fff69129, merged locally without conflict CI 6 check runs on the head, all green ``` | Command (on the merge, Linux) | Result | |---|---| | `python -I tests/test_d3d12_switches.py` | 20 tests, OK | | `python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/descriptor/host.rs` | exit 0 (the HLSL is a hand-written 8-line copy shader, built at test time) | **Read in the diff:** `a_raw_view_bound_to_a_shader_reads_its_buffer` fills 64 words, makes the raw view with `HostHeap::raw_at`, copies it into a shader-visible heap, dispatches a `ByteAddressBuffer` to `RWBuffer` copy 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 `return`s silently when `host()` or `HostHeap::new` gives `None`, so on a machine without a D3D12 adapter it passes without testing anything. That is the existing pattern in this file, but an `eprintln!("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](https://claude.ai/code)_
MoonEyes commented 2026-12-02 18:21:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:21:36Z.


RUN (in game, batch of seventeen render-path pull requests), each head merged with git merge --no-ff onto main 3c106eb2f, in one build: #3111 15b579756, #2948 5284c6eae, #2698 1f188c4f7, #2946 44bf554fe, #3001 d924cbb65, #2832 0c861595a, #2915 58e8535cf, #2822 d359a2f85, #2896 c9c6b103d, #2983 8278ef1b9, #3115 ba5121192, #2945 d2c08c14f, #2975 74512d658, #2951 26da88e8e, #2800 b6ebcedd4, #2893 7c7e99b48, #3113 fa1460b6b (and #3097 0d7a451ab, 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.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
Rendered fps, last 240 s (43 samples) median 14.6, mean 12.7
Rendered fps, last 120 s median 13.7
Time under 5 fps in the world 13 % (short drops, lowest sample 0.3 fps)

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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354441525 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7354441525). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:21:36Z. --- RUN (in game, batch of seventeen render-path pull requests), each head merged with `git merge --no-ff` onto main `3c106eb2f`, in one build: #3111 `15b579756`, #2948 `5284c6eae`, #2698 `1f188c4f7`, #2946 `44bf554fe`, #3001 `d924cbb65`, #2832 `0c861595a`, #2915 `58e8535cf`, #2822 `d359a2f85`, #2896 `c9c6b103d`, #2983 `8278ef1b9`, #3115 `ba5121192`, #2945 `d2c08c14f`, #2975 `74512d658`, #2951 `26da88e8e`, #2800 `b6ebcedd4`, #2893 `7c7e99b48`, #3113 `fa1460b6b` (and #3097 `0d7a451ab`, 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. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | Rendered fps, last 240 s (43 samples) | median 14.6, mean 12.7 | | Rendered fps, last 120 s | median 13.7 | | Time under 5 fps in the world | 13 % (short drops, lowest sample 0.3 fps) | 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 commented 2026-12-03 06:42:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T06:42:03Z.

Review: CHANGES_REQUESTED


[P2] Bind the raw view from its existing heap. At 74512d65, CopyDescriptorsSimple takes heap.cpu(index) as its source at descriptor/host.rs:7681. HostHeap::new creates that heap with D3D12_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 d9b618f1 plus 74512d65, 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.

Adapter Current test's extra copy from heap.cpu(index) Direct binding of the production HostHeap
RTX 4070 SUPER Expected first and last words in both modes All 64 words matched in both modes
AMD Raphael / RADV Word 0 was zero instead of 0x10000000 in both modes All 64 words matched in both modes

Both modes means separate runs with LEONIDA_VIEW_COPY=0 and 1. 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 production raw_at paths. See also the earlier isolation of the invalid source.

AI-assisted review with Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6164850980 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#pullrequestreview-6164850980). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T06:42:03Z. **Review:** CHANGES_REQUESTED --- **[P2] Bind the raw view from its existing heap.** At `74512d65`, `CopyDescriptorsSimple` takes `heap.cpu(index)` as its source at `descriptor/host.rs:7681`. `HostHeap::new` creates that heap with `D3D12_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](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-copydescriptorssimple#parameters). I reran the comparison on `d9b618f1` plus `74512d65`, 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. | Adapter | Current test's extra copy from `heap.cpu(index)` | Direct binding of the production `HostHeap` | | --- | --- | --- | | RTX 4070 SUPER | Expected first and last words in both modes | All 64 words matched in both modes | | AMD Raphael / RADV | Word 0 was zero instead of `0x10000000` in both modes | All 64 words matched in both modes | Both modes means separate runs with `LEONIDA_VIEW_COPY=0` and `1`. 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 production `raw_at` paths. See also the [earlier isolation of the invalid source](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7328190960). AI-assisted review with Codex.
fiestorra commented 2026-12-03 08:21:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T08:21:14Z.


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 conflicto

O 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7372154845 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2975#issuecomment-7372154845). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T08:21:14Z. --- **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 conflicto ` **O 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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2975:upstream-pr/2975'
git switch 'upstream-pr/2975'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2975'
git switch 'upstream-pr/2975'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2975'
git switch 'upstream-pr/2975'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2975'
git switch 'main'
git merge --squash 'upstream-pr/2975'
git switch 'main'
git merge --ff-only 'upstream-pr/2975'
git switch 'main'
git merge 'upstream-pr/2975'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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!2975
No description provided.