d3d12: respect sparse buffer memory types when sharing tile heaps (D3D12-SPARSE-BUFFER-HEAP) #2645

Closed
github-bot wants to merge 9 commits from github-bot/gh-2645 into main AGit
Owner

@⁠lixonik on GitHub · 2026-11-29 21:04 UTC · original
lixonik:review/2405-sparse-heap-fixtures → main · +298 −6 · 5 files · 9 commits · closed without merging

What and why

Supersedes #2405 with the original author's approval. Carries pepefroge's original commits and Intel Arc result, plus the two fixture updates requested in review. Coordination claim (D3D12-SPARSE-BUFFER-HEAP).

  • Use the per-resource Vulkan memory type mask before sharing the sparse arena. Reuse compatible dedicated backing already present on the heap ahead of the arena path, and reject a request that excludes that backing's type.
  • Exercise the mixed 0x02 --> 0x12 and incompatible 0x10 masks in a CPU test. Exercise a valid reserved texture and read back both its unbound tile and the unchanged buffer tile after the rejected mapping. Wait for the fence before resetting the command allocator.

Tested

Tested b7ee121c51 with main 7bbc1d22, Windows 10 22H2, RTX 5070 (610.88), MSVC 19.44, Khronos Vulkan validation and synchronization validation enabled.

  • d3d12_buffer_tiles, d3d12_buffer_tiles_heap_policy, and d3d12_texture_tiles: 3/3 passed. The reserved-texture subcase ran, and the buffer fixture matched all three native D3D12 readbacks.
  • Negative control: testing the arena before reusing the existing allocation fails the 0x12 CPU assertion. The production order passes.
  • No-game-data scan and git diff --check passed.

The original author checked Intel Arc Pro B60 (32.0.101.9150) and reported 0/12 mapped Vulkan buffer tiles before the fix and 12/12 with it. That hardware result covers the original fix. Original test report

AI-assisted.

Independent verification

On Windows, RTX 4090 matched the Vulkan and native D3D12 readbacks and exercised the rejected image mapping. On Wine, RTX 4070 SUPER and AMD Raphael each passed the buffer cases 3/3. A separate RADV A/B forced a mixed software mask while keeping the real allocation valid: the dedicated-first order returned the expected tile 3/3 and arena-first returned zero 3/3. The Wine/RADV texture-reference run hit device loss in VKD3D-Proton, while the project's Vulkan texture cases passed 3/3 with that reference disabled. Windows report · Wine and RADV report

**@⁠lixonik** on GitHub · 2026-11-29 21:04 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645) `lixonik:review/2405-sparse-heap-fixtures` → `main` · +298 −6 · 5 files · 9 commits · closed without merging ### What and why Supersedes #2405 with [the original author's approval](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2405). Carries pepefroge's original commits and Intel Arc result, plus the two fixture updates requested in review. [Coordination claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570) (`D3D12-SPARSE-BUFFER-HEAP`). - Use the per-resource Vulkan memory type mask before sharing the sparse arena. Reuse compatible dedicated backing already present on the heap ahead of the arena path, and reject a request that excludes that backing's type. - Exercise the mixed `0x02 --> 0x12` and incompatible `0x10` masks in a CPU test. Exercise a valid reserved texture and read back both its unbound tile and the unchanged buffer tile after the rejected mapping. Wait for the fence before resetting the command allocator. ### Tested Tested `b7ee121c51` with `main` `7bbc1d22`, Windows 10 22H2, RTX 5070 (610.88), MSVC 19.44, Khronos Vulkan validation and synchronization validation enabled. - `d3d12_buffer_tiles`, `d3d12_buffer_tiles_heap_policy`, and `d3d12_texture_tiles`: 3/3 passed. The reserved-texture subcase ran, and the buffer fixture matched all three native D3D12 readbacks. - Negative control: testing the arena before reusing the existing allocation fails the `0x12` CPU assertion. The production order passes. - No-game-data scan and `git diff --check` passed. The original author checked Intel Arc Pro B60 (32.0.101.9150) and reported 0/12 mapped Vulkan buffer tiles before the fix and 12/12 with it. That hardware result covers the original fix. [Original test report](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2405) AI-assisted. ### Independent verification On Windows, RTX 4090 matched the Vulkan and native D3D12 readbacks and exercised the rejected image mapping. On Wine, RTX 4070 SUPER and AMD Raphael each passed the buffer cases 3/3. A separate RADV A/B forced a mixed software mask while keeping the real allocation valid: the dedicated-first order returned the expected tile 3/3 and arena-first returned zero 3/3. The Wine/RADV texture-reference run hit device loss in VKD3D-Proton, while the project's Vulkan texture cases passed 3/3 with that reference disabled. [Windows report](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2645) · [Wine and RADV report](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2645)
tiles_share_arena() only checked the device-init probe sparse_buffer_memory_types against arena.memory_type, which could differ from an actual sparse buffer's memoryTypeBits on Intel Arc, causing bind_tiles() line 4164 to reject the mapping.
A reserved buffer whose memory type mask is a superset of one already
mapped on the same buffer-only heap must reuse that allocation. The test
takes the dedicated and arena bits from the device, skips with 77 when the
device exposes no arena or no dedicated type, and reads the tile back to
prove the second update was not refused. An image on the same heap is the
reachable incompatible case and must leave the buffer tile unchanged.
Fix the three /review findings in mixed_mask:

- Drop queue->Wait(gate, 1) before the first CPU wait(1): the GPU queue was
  blocked on a fence only signaled after the CPU wait, deadlocking the test.
  The gate/fence machinery that wait needed is deleted with it.
- Zero the readback slot before re-reading buffer B after the image mapping
  check, so a dropped copy cannot pass by reading stale tile contents.
- Zero the readback slot before re-reading buffer A after buffer B, so that
  re-read cannot pass on stale contents either.

Both zeroing unmaps release the whole resource (Unmap(0, nullptr)) so the CPU
writes are not left unflushed on a non-coherent readback heap.

Also introduce EXPECT_MISMATCH for the int-returning checks and seed A from the
upload buffer.

The diff is taken against parent 5302c59eb: `Results observed{}, native{};` is
present here and was missing there.
A third reserved buffer with the same mixed (dedicated|arena) mask aliases the same dedicated tile as A and B; the C readback doubles as the earlier buffers' readback since all three back onto one allocation, so it also proves the shared tile still holds the reused pattern.

A genuinely disjoint buffer mask is not constructible through the public API: the driver reports one memory type mask per buffer desc from vkGetBufferMemoryRequirements, and update_tiles passes that fixed mask to Heap::tiles, so the reachable incompatible case stays the image-on-buffer-only-heap refusal below.

Fences are numbered in execution order: 1-4 existing rounds, 5 the new third-buffer round, 6 the image round.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:08:41 +00:00
Author
Owner

@⁠merzleckeier on GitHub · 2026-11-29 21:36 UTC · original

Independent synthetic retest of b7ee121c51 (GitHub merge 703e15527 onto 7bbc1d223). Win64 clang-cl Release (/MD) under Wine 11.22, DXVK a78a467c and VKD3D-Proton 71cae091. RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1). Vulkan validation was disabled for these runs.

  • MEASURED, exact tree. --heap-policy passed 3/3. d3d12_buffer_tiles passed 3/3 on each GPU. Each run reached the third-buffer alias, the refused image mapping with B preserved, and the twelve full-tile readbacks. RADV also matched all three reference readbacks through VKD3D-Proton. NVIDIA covered the Mandy Vulkan path.
  • MEASURED, texture reference. All four Vulkan cases, including the COPY-to-DIRECT handoff, passed in 3/3 NVIDIA runs. On RADV with the comparison enabled, the first reference case matched and VKD3D-Proton then returned VK_ERROR_DEVICE_LOST at wait_done(2) for the 256×240 case (3/3). Selecting a nonmatching LEONIDA_HOST_ADAPTER skipped that reference in the same executable and all four Mandy Vulkan cases passed 3/3 on RADV.
  • MEASURED, RADV allocation-order A/B. The driver returned 0x2d for A and B. A local probe removed only arena bit 3 from A's software mask (0x25) before allocation, leaving B at 0x2d. A allocated dedicated type 0 and B reused it with the PR ordering (3/3). In the same probe executable, forcing the arena decision before dedicated reuse left B unmapped, reading zero instead of 0x23456789 (3/3). Type 0 was valid for both driver masks throughout.

Synthetic fixtures only. AI-assisted with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-11-29 21:36 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7263007738) Independent synthetic retest of `b7ee121c51` (GitHub merge `703e15527` onto `7bbc1d223`). Win64 clang-cl Release (`/MD`) under Wine 11.22, DXVK `a78a467c` and VKD3D-Proton `71cae091`. RTX 4070 SUPER (620.73.04) and Radeon Raphael (RADV 26.3.1). Vulkan validation was disabled for these runs. - **MEASURED, exact tree.** `--heap-policy` passed 3/3. `d3d12_buffer_tiles` passed 3/3 on each GPU. Each run reached the third-buffer alias, the refused image mapping with B preserved, and the twelve full-tile readbacks. RADV also matched all three reference readbacks through VKD3D-Proton. NVIDIA covered the Mandy Vulkan path. - **MEASURED, texture reference.** All four Vulkan cases, including the COPY-to-DIRECT handoff, passed in 3/3 NVIDIA runs. On RADV with the comparison enabled, the first reference case matched and VKD3D-Proton then returned `VK_ERROR_DEVICE_LOST` at `wait_done(2)` for the 256×240 case (3/3). Selecting a nonmatching `LEONIDA_HOST_ADAPTER` skipped that reference in the same executable and all four Mandy Vulkan cases passed 3/3 on RADV. - **MEASURED, RADV allocation-order A/B.** The driver returned `0x2d` for A and B. A local probe removed only arena bit 3 from A's software mask (`0x25`) before allocation, leaving B at `0x2d`. A allocated dedicated type 0 and B reused it with the PR ordering (3/3). In the same probe executable, forcing the arena decision before dedicated reuse left B unmapped, reading zero instead of `0x23456789` (3/3). Type 0 was valid for both driver masks throughout. Synthetic fixtures only. AI-assisted with OpenAI Codex.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-29 22:52 UTC · original

Verified on main 452d1d1b6, Windows 11, Ninja + RelWithDebInfo, RTX 4090:

git merge-tree origin/main refs/pull/2645/head   -> clean
cherry-pick of the 6 non-merge commits           -> clean
cmake --build … --target d3d12_buffer_tiles_test -> built
d3d12_buffer_tiles_test.exe                      -> exit 0 twice

The test is substantive rather than a smoke check, and it printed what it checked:

Mixed mask: an image on the buffer-only heap was refused and B's tile is unchanged
Mixed mask: live buffers reused the same tile
Vulkan replay: 12 full tiles matched across aliased, skipped, unmapped, reused and remapped ranges
A rejected update left all tile mappings intact
Native D3D12: NVIDIA GeForce RTX 4090 (the layer's adapter), tiled resources tier 4

So the heap-policy work is exercised on both paths here - the Vulkan replay and native D3D12 with tiled resources tier 4 - and the rejection case is covered alongside the happy one (+239/-2 in that test file).

One practical note before merging: the branch contains merge commits from main into the review branch (a55c9c8f, b7ee121c5). They are harmless to GitHub's merge, but they make a cherry-pick of the whole range conflict in the middle, which is how I found them - anyone replaying this branch by hand should take the non-merge commits (--no-merges), and a rebase before merging would drop the noise.

Not tested: a buffer larger than this machine's memory (sparse buffers are the point of the change and the test uses synthetic sizes), and any run of the title.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-29 22:52 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7264022466) Verified on `main` `452d1d1b6`, Windows 11, Ninja + RelWithDebInfo, RTX 4090: ``` git merge-tree origin/main refs/pull/2645/head -> clean cherry-pick of the 6 non-merge commits -> clean cmake --build … --target d3d12_buffer_tiles_test -> built d3d12_buffer_tiles_test.exe -> exit 0 twice ``` The test is substantive rather than a smoke check, and it printed what it checked: ``` Mixed mask: an image on the buffer-only heap was refused and B's tile is unchanged Mixed mask: live buffers reused the same tile Vulkan replay: 12 full tiles matched across aliased, skipped, unmapped, reused and remapped ranges A rejected update left all tile mappings intact Native D3D12: NVIDIA GeForce RTX 4090 (the layer's adapter), tiled resources tier 4 ``` So the heap-policy work is exercised on **both** paths here - the Vulkan replay and native D3D12 with tiled resources tier 4 - and the rejection case is covered alongside the happy one (`+239/-2` in that test file). **One practical note before merging:** the branch contains **merge commits** from `main` into the review branch (`a55c9c8f`, `b7ee121c5`). They are harmless to GitHub's merge, but they make a cherry-pick of the whole range conflict in the middle, which is how I found them - anyone replaying this branch by hand should take the non-merge commits (`--no-merges`), and a rebase before merging would drop the noise. **Not tested:** a buffer larger than this machine's memory (sparse buffers are the point of the change and the test uses synthetic sizes), and any run of the title. Written with an AI assistant.
Author
Owner

@⁠ammonium231 on GitHub · 2026-11-30 05:30 UTC · original

RTX 3090 / 621.40, validation on, b7ee121c5 merged onto main 40e7fe69d: d3d12_buffer_tiles, d3d12_buffer_tiles_heap_policy and d3d12_texture_tiles pass (main 2/2; heap_policy is new). Tiled resources tier 4, no validation errors.

**@⁠ammonium231** on GitHub · 2026-11-30 05:30 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7269726296) RTX 3090 / 621.40, validation on, b7ee121c5 merged onto main 40e7fe69d: d3d12_buffer_tiles, d3d12_buffer_tiles_heap_policy and d3d12_texture_tiles pass (main 2/2; heap_policy is new). Tiled resources tier 4, no validation errors.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-30 05:37 UTC · original

Independent verification on this machine (Windows 11, MSVC 19.44.35226, RTX 4090), and the result is "applies, builds, passes, but the usual negative control is impossible by construction" - which I would rather state than dress up.

1. It applies. merge-tree clean. Six non-merge commits (the branch also carries two merges of main, so --no-merges is required); all six cherry-pick onto main 1d22590b9 without a conflict. Five files, 298 insertions(+), 6 deletions(-).

2. It builds and passes, three times:

cmake --build runtime/build-ninja --target d3d12_buffer_tiles_test   -> linked
d3d12_buffer_tiles_test.exe                                          -> exit 0, 0, 0

3. The negative control cannot run, and here is exactly how far it gets. I tried three reverts:

what I reverted result
the new header runtime/src/sparse_buffer_backing.h does not compile: d3d12_buffer_tiles_test.cpp(3): fatal error C1083, the include is new
the header + d3d12_vulkan_device.cpp same
only d3d12_vulkan_device.cpp, header kept does not compile: d3d12_buffer_tiles_test.cpp(301): error C2039 and C3861, the test calls symbols this PR adds

So the test cannot exist against main's code, and "revert the source and watch it fail" is not available here. What that proves is that the test exercises the new paths; it does not prove the new policy is right.

A measurement error I caught twice in a row: the exit 0, 0, 0 from those failed builds came from the previous binary, because a failed compile leaves the old executable in place. Comparing the .exe timestamp is what exposes it, and the numbers in the table above are compile failures, not passing runs. I nearly published "still passes" from an old binary in the previous pull request I verified, and the same trap was waiting here.

What I did not test: the behaviour itself - that a sparse buffer whose WDDM1_…/WDDM2_… memory type does not match stops sharing the tile arena, and that two buffers with the same mask still reuse an allocation. Those need the title's sparse resource traffic; the test builds the objects and drives the entry points, which is the closest this machine gets.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-30 05:37 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7269849311) Independent verification on this machine (Windows 11, MSVC 19.44.35226, RTX 4090), and the result is **"applies, builds, passes, but the usual negative control is impossible by construction"** - which I would rather state than dress up. **1. It applies.** `merge-tree` clean. Six non-merge commits (the branch also carries two merges of `main`, so `--no-merges` is required); all six cherry-pick onto `main` `1d22590b9` without a conflict. Five files, `298 insertions(+), 6 deletions(-)`. **2. It builds and passes, three times:** ``` cmake --build runtime/build-ninja --target d3d12_buffer_tiles_test -> linked d3d12_buffer_tiles_test.exe -> exit 0, 0, 0 ``` **3. The negative control cannot run, and here is exactly how far it gets.** I tried three reverts: | what I reverted | result | |---|---| | the new header `runtime/src/sparse_buffer_backing.h` | **does not compile**: `d3d12_buffer_tiles_test.cpp(3): fatal error C1083`, the include is new | | the header + `d3d12_vulkan_device.cpp` | same | | only `d3d12_vulkan_device.cpp`, header kept | **does not compile**: `d3d12_buffer_tiles_test.cpp(301): error C2039` and `C3861`, the test calls symbols this PR adds | So the test cannot exist against `main`'s code, and "revert the source and watch it fail" is not available here. What that proves is that the test exercises the new paths; it does not prove the new policy is right. **A measurement error I caught twice in a row:** the `exit 0, 0, 0` from those failed builds came from the **previous binary**, because a failed compile leaves the old executable in place. Comparing the `.exe` timestamp is what exposes it, and the numbers in the table above are compile failures, not passing runs. I nearly published "still passes" from an old binary in the previous pull request I verified, and the same trap was waiting here. **What I did not test:** the behaviour itself - that a sparse buffer whose `WDDM1_…`/`WDDM2_…` memory type does not match stops sharing the tile arena, and that two buffers with the same mask still reuse an allocation. Those need the title's sparse resource traffic; the test builds the objects and drives the entry points, which is the closest this machine gets. Written with an AI assistant.
Author
Owner

@⁠lixonik on GitHub · 2026-11-30 05:58 UTC · original

@⁠fiestorra Thanks for verifying the build and catching the stale executable. There is a synthetic negative control for the allocation-order behavior on this exact PR head, separate from removing the new test's API. In the RADV A/B above, merzleckeier excluded only the arena bit from buffer A's software mask and held both driver masks and buffer B fixed. With the PR order B reused A's dedicated allocation and read the expected tile. Reversing just the order left B unmapped and reading zero, 3/3 in both arms. This covers the controlled mixed-mask case. The natural frequency of such a split in the title remains unmeasured by that probe.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-30 05:58 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7270178623) @⁠fiestorra Thanks for verifying the build and catching the stale executable. There is a synthetic negative control for the allocation-order behavior on this exact PR head, separate from removing the new test's API. In [the RADV A/B above](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2645), merzleckeier excluded only the arena bit from buffer A's software mask and held both driver masks and buffer B fixed. With the PR order B reused A's dedicated allocation and read the expected tile. Reversing just the order left B unmapped and reading zero, 3/3 in both arms. This covers the controlled mixed-mask case. The natural frequency of such a split in the title remains unmeasured by that probe. AI-assisted.
Author
Owner

@⁠KelboLive on GitHub · 2026-11-30 16:40 UTC · original

Independent check on Windows/NVIDIA (not the author), at b7ee121c5.

  • Built d3d12_buffer_tiles_test and ran it on the RTX 4070 Ti SUPER: exit 0.
    • Mixed mask: buffer-only heap image refused, B's tile unchanged; live buffers reused the same tile.
    • Vulkan replay: 12 full tiles matched across aliased, skipped, unmapped, reused and remapped ranges.
    • A rejected update left all mappings intact.
    • Native D3D12: NVIDIA GeForce RTX 4070 Ti SUPER, tiled resources tier 4; all three GPU readbacks matched.

Environment: NVIDIA RTX 4070 Ti SUPER, driver 621.01 (Windows 32.0.16.2101), Windows 11 Pro 10.0.26200.9711.

AI-assisted: yes (opencode).

**@⁠KelboLive** on GitHub · 2026-11-30 16:40 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7285053422) Independent check on Windows/NVIDIA (not the author), at `b7ee121c5`. - Built `d3d12_buffer_tiles_test` and ran it on the RTX 4070 Ti SUPER: **exit 0**. - Mixed mask: buffer-only heap image refused, B's tile unchanged; live buffers reused the same tile. - Vulkan replay: 12 full tiles matched across aliased, skipped, unmapped, reused and remapped ranges. - A rejected update left all mappings intact. - Native D3D12: NVIDIA GeForce RTX 4070 Ti SUPER, tiled resources tier 4; all three GPU readbacks matched. Environment: NVIDIA RTX 4070 Ti SUPER, driver 621.01 (Windows 32.0.16.2101), Windows 11 Pro 10.0.26200.9711. AI-assisted: yes (opencode).
Author
Owner

@⁠lixonik on GitHub · 2026-12-01 04:13 UTC · original

Re-verified #2645 (b7ee121c5) merged cleanly onto current main (a596adfac, local merge 4ddea0d79) on Windows 10 Pro 22H2 + NVIDIA GeForce RTX 5070 12 GB (driver 621.40, MSVC 19.44):

  1. Unit / GPU tile tests (LEONIDA_VK_VALIDATION=1, VK_VALIDATE_SYNC=1, MEASURED):
    • d3d12_buffer_tiles_test: passed (exit 0, 0 validation errors).
    • d3d12_texture_tiles_test: passed (exit 0, 0 validation errors; native D3D12 matched all verified pixels across all 4 subcases).
    • Runtime log confirmed on RTX 5070 / 621.40: sparse buffers on this device expose no host-visible coherent memory type (memoryTypeBits=0x2).
  2. Vulkan game boot A/B (main a596adfac vs main + #2645, MEASURED, n=1 per arm, 120 s each):
    • Both arms reached first-run UI / menu with 0 device losses, 0 faults, and 0 failed list writes (same).
    • Scope note: UpdateTileMappings / CreateReservedResource were not invoked during this 120 s first-run UI / menu boot (count=0; built with LEONIDA_SDL3=OFF, no watchdog KICK), so this verifies no boot regression on current main (a596adfac) alongside the driver 621.40 GPU tile tests above; a longer world-streaming Vulkan run exercising live UpdateTileMappings is still open.
RUN 2645-A-vk | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity
BASE:        a596adfac (main) | shaders: make_game.py --stages shaders --wave64-emulate auto (--wave64-emulate --no-ftz32, llvm-mc 21.1.8; 29,280 SPIR-V modules)
MACHINE:     NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X
RECIPE:      documented (docs/running.md "Windows, NVIDIA" + recommended vars) + DEVIATIONS: LEONIDA_SDL3=OFF, LEONIDA_DEVICE_TYPE=6, LEONIDA_ARENA_MB=1024, LEONIDA_SUBMIT_ASYNC=4, LEONIDA_ASYNC_PIPELINES=1, LEONIDA_ASYNC_MIN_BYTES=2097152, LEONIDA_ASYNC_MIN_BYTES_GRAPHICS=0, LEONIDA_RT_AS=off, LEONIDA_DEVICE_FAULT=2, LEONIDA_SKIP_INT3=1 | precompile: no (warm pso cache)
OS/DRIVER:   TdrDelay=default, no Resizable BAR
TARGET:      Vulkan boot stability (first-run UI / menu) | PREDICTED (written before the run): clean boot, 0 device losses
MEASURED:    first-run UI / menu (120 s): 22.1 -> 123.1 -> 92.3 fps across 10 s submit windows, 62,392 list writes (62,385 landed, 0 failed), 9,324 waits met, arena peak 506.9 / 1,024.0 MiB (non-sparse fallback, memoryTypeBits=0x2), 0 device lost, 0 UpdateTileMappings calls | duration 123.3 s
END:         time limit (120 s)
CACHES:      warm: pso dir (calibrated adaptive compile gate on 621.40) | RUN 1 of 1
INSTRUMENTS: standard runtime stderr log
VERDICT:     prediction held
RUN 2645-B-vk | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity
BASE:        a596adfac + #2645 (b7ee121c5, merged locally 4ddea0d79) | shaders: same (29,280 SPIR-V modules)
MACHINE:     NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X
RECIPE:      same as 2645-A-vk | precompile: no (warm pso cache)
OS/DRIVER:   TdrDelay=default, no Resizable BAR
TARGET:      Vulkan boot stability (first-run UI / menu) | PREDICTED (written before the run): same as A, 0 regressions
MEASURED:    first-run UI / menu (120 s): 20.7 -> 125.1 -> 68.9 fps across 10 s submit windows, 59,504 list writes (59,497 landed, 0 failed), 9,721 waits met, arena peak 18.8 / 1,024.0 MiB (non-sparse fallback, memoryTypeBits=0x2), 0 device lost, 0 UpdateTileMappings calls | duration 123.3 s
END:         time limit (120 s)
CACHES:      warm: pso dir | RUN 1 of 1
INSTRUMENTS: standard runtime stderr log
VERDICT:     prediction held (same; 0 regressions; UpdateTileMappings not triggered in menu boot)

AI-assisted: Antigravity.

**@⁠lixonik** on GitHub · 2026-12-01 04:13 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7300505026) Re-verified `#2645` (`b7ee121c5`) merged cleanly onto current `main` (`a596adfac`, local merge `4ddea0d79`) on Windows 10 Pro 22H2 + NVIDIA GeForce RTX 5070 12 GB (driver **621.40**, MSVC 19.44): 1. **Unit / GPU tile tests (`LEONIDA_VK_VALIDATION=1`, `VK_VALIDATE_SYNC=1`, `MEASURED`):** - `d3d12_buffer_tiles_test`: passed (exit 0, 0 validation errors). - `d3d12_texture_tiles_test`: passed (exit 0, 0 validation errors; native D3D12 matched all verified pixels across all 4 subcases). - Runtime log confirmed on RTX 5070 / `621.40`: `sparse buffers on this device expose no host-visible coherent memory type (memoryTypeBits=0x2)`. 2. **Vulkan game boot A/B (`main a596adfac` vs `main + #2645`, `MEASURED`, n=1 per arm, 120 s each):** - Both arms reached `first-run UI / menu` with 0 device losses, 0 faults, and 0 failed list writes (`same`). - Scope note: `UpdateTileMappings` / `CreateReservedResource` were not invoked during this 120 s first-run UI / menu boot (`count=0`; built with `LEONIDA_SDL3=OFF`, no watchdog KICK), so this verifies no boot regression on current `main` (`a596adfac`) alongside the driver `621.40` GPU tile tests above; a longer world-streaming Vulkan run exercising live `UpdateTileMappings` is still open. ```text RUN 2645-A-vk | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity BASE: a596adfac (main) | shaders: make_game.py --stages shaders --wave64-emulate auto (--wave64-emulate --no-ftz32, llvm-mc 21.1.8; 29,280 SPIR-V modules) MACHINE: NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X RECIPE: documented (docs/running.md "Windows, NVIDIA" + recommended vars) + DEVIATIONS: LEONIDA_SDL3=OFF, LEONIDA_DEVICE_TYPE=6, LEONIDA_ARENA_MB=1024, LEONIDA_SUBMIT_ASYNC=4, LEONIDA_ASYNC_PIPELINES=1, LEONIDA_ASYNC_MIN_BYTES=2097152, LEONIDA_ASYNC_MIN_BYTES_GRAPHICS=0, LEONIDA_RT_AS=off, LEONIDA_DEVICE_FAULT=2, LEONIDA_SKIP_INT3=1 | precompile: no (warm pso cache) OS/DRIVER: TdrDelay=default, no Resizable BAR TARGET: Vulkan boot stability (first-run UI / menu) | PREDICTED (written before the run): clean boot, 0 device losses MEASURED: first-run UI / menu (120 s): 22.1 -> 123.1 -> 92.3 fps across 10 s submit windows, 62,392 list writes (62,385 landed, 0 failed), 9,324 waits met, arena peak 506.9 / 1,024.0 MiB (non-sparse fallback, memoryTypeBits=0x2), 0 device lost, 0 UpdateTileMappings calls | duration 123.3 s END: time limit (120 s) CACHES: warm: pso dir (calibrated adaptive compile gate on 621.40) | RUN 1 of 1 INSTRUMENTS: standard runtime stderr log VERDICT: prediction held ``` ```text RUN 2645-B-vk | 2026-12-01 UTC | lixonik | AI-assisted: Antigravity BASE: a596adfac + #2645 (b7ee121c5, merged locally 4ddea0d79) | shaders: same (29,280 SPIR-V modules) MACHINE: NVIDIA GeForce RTX 5070, 12 GB, desktop | 621.40 | Windows 10 Pro 22H2 (build 19045) | 64 GiB RAM | Ryzen 9 5950X RECIPE: same as 2645-A-vk | precompile: no (warm pso cache) OS/DRIVER: TdrDelay=default, no Resizable BAR TARGET: Vulkan boot stability (first-run UI / menu) | PREDICTED (written before the run): same as A, 0 regressions MEASURED: first-run UI / menu (120 s): 20.7 -> 125.1 -> 68.9 fps across 10 s submit windows, 59,504 list writes (59,497 landed, 0 failed), 9,721 waits met, arena peak 18.8 / 1,024.0 MiB (non-sparse fallback, memoryTypeBits=0x2), 0 device lost, 0 UpdateTileMappings calls | duration 123.3 s END: time limit (120 s) CACHES: warm: pso dir | RUN 1 of 1 INSTRUMENTS: standard runtime stderr log VERDICT: prediction held (same; 0 regressions; UpdateTileMappings not triggered in menu boot) ``` AI-assisted: Antigravity.
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-01 14:01 UTC · original

I reran the sparse tile tests with Khronos validation on 7dc9454f merged onto 9f27ba2e (tree 58810dbd), against a separate build of main. Wine 11.22, AMD Raphael (RADV 26.3.1) and RTX 4070 SUPER (NVIDIA 620.73.04), Win64 clang-cl Release. The later main commit 3e7b34a5 only changes translator wording and comments.

  • Both trees passed the Vulkan buffer and texture checks on both GPUs, with and without VK_LAYER_KHRONOS_validation 1.4.363. The buffer test matched 12 full tiles, and the texture test ran all four cases including the COPY-to-DIRECT handoff. The PR also passed its CPU heap policy, third-buffer alias, and incompatible-image rejection checks on the relevant paths.
  • With validate_sync=true, all eight runs still returned 0. No synchronization hazard appeared. Each run did report the same device-creation VUID 01387 on both trees, for VK_EXT_external_memory_dma_buf being enabled without its required VK_KHR_external_memory_fd. This validation run therefore has one pre-existing diagnostic per case.

The Vulkan readbacks were checked against the fixture's expected values. The native D3D12 reference was intentionally skipped in these Wine runs. No game files. MEASURED, AI-assisted (Codex).

**@⁠merzleckeier** on GitHub · 2026-12-01 14:01 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7313578108) I reran the sparse tile tests with Khronos validation on `7dc9454f` merged onto `9f27ba2e` (tree `58810dbd`), against a separate build of `main`. Wine 11.22, AMD Raphael (RADV 26.3.1) and RTX 4070 SUPER (NVIDIA 620.73.04), Win64 clang-cl Release. The later `main` commit `3e7b34a5` only changes translator wording and comments. - Both trees passed the Vulkan buffer and texture checks on both GPUs, with and without `VK_LAYER_KHRONOS_validation` 1.4.363. The buffer test matched 12 full tiles, and the texture test ran all four cases including the COPY-to-DIRECT handoff. The PR also passed its CPU heap policy, third-buffer alias, and incompatible-image rejection checks on the relevant paths. - With `validate_sync=true`, all eight runs still returned 0. No synchronization hazard appeared. Each run did report the same device-creation VUID `01387` on both trees, for `VK_EXT_external_memory_dma_buf` being enabled without its required `VK_KHR_external_memory_fd`. This validation run therefore has one pre-existing diagnostic per case. The Vulkan readbacks were checked against the fixture's expected values. The native D3D12 reference was intentionally skipped in these Wine runs. No game files. MEASURED, AI-assisted (Codex).
Author
Owner

@⁠aslan2142 on GitHub · 2026-12-01 16:46 UTC · original

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

**@⁠aslan2142** on GitHub · 2026-12-01 16:46 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2645#issuecomment-7318199603) Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
github-bot closed this pull request 2026-12-01 16:56:22 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2645
No description provided.