[PR #1100] [CLOSED] tests: verify placed attachment backing at submission (RT-PLACED-IMAGE-DEFER) #1137

Closed
opened 2026-11-26 20:20:12 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1100
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: split/rt-placed-image-defer


📝 Commits (1)

  • c92dc97 tests: verify placed attachment backing at submission (RT-PLACED-IMAGE-DEFER)

📊 Changes

1 file changed (+16 additions, -4 deletions)

View changed files

📝 runtime/test/d3d12_existing_heap_test.cpp (+16 -4)

📄 Description

Rebased onto 5129be10. #984 brought deferred slot-133 backing and the first-use fixture into main. This PR now retains three assertions from the original split. All four retry callers must succeed, an equivalent committed image must already have backing, and closing the command list must leave allocation deferred until submission in the default mode. The original test report is below. On c92dc976, d3d12_existing_heap passed 1/1 with deferred backing and 1/1 with LEONIDA_PLACED_IMAGE_DEFER=0 under Wine 11.22 on an RTX 4070 (NVIDIA 620.73.04). Both runs cover the four retry callers, the committed control, the backing check after close, and the 128-pixel readback.

Claimed in the coordination issue as: RT-PLACED-IMAGE-DEFER (claim).

Part of the split of #984 into small pull requests.

Depends on: none

Overlaps: #1079 resolves shader views of live placements by address. This change uses the existing slot-133 placement path on main. Streamed sources and shared BC backing are tracked separately.

What and why

Slot 133 allocated private Vulkan memory for every placed render target, depth/stencil target and storage texture, including attachments that only received a logical descriptor. On a device with a limited memory budget, unused attachments compete with active ones.

The image and its format and layout metadata still exist at creation. The runtime binds memory on the first command replay, shader view or CPU subresource copy that needs the image. Concurrent callers share one successful bind. A failed allocation or bind can be retried, and a failed bind releases its unused allocation. Set LEONIDA_PLACED_IMAGE_DEFER=0 for eager allocation.

Tested

Release cross-build with clang-cl 23 and an xwin SDK. Commands use a configured build directory. PROTON_WINE names the Wine executable and WINEPREFIX selects the test prefix.

cmake --build runtime/build/boot --target gta6rt -j6
cmake --build runtime/build/boot --target d3d12_existing_heap_test -j6
cd runtime/build/boot
export WINEDEBUG=-all
unset LEONIDA_PLACED_IMAGE_DEFER
timeout 120 "$PROTON_WINE" d3d12_existing_heap_test.exe
LEONIDA_PLACED_IMAGE_DEFER=0 timeout 120 "$PROTON_WINE" d3d12_existing_heap_test.exe

Both targets built. The existing-heap test passed twice on the same binary. Each run used a 16 × 8 RGBA8 render target placed at a reserved, inaccessible address.

Check Default Eager rollback
Placed target has backing after RTV creation and command-list close No Yes
Equivalent committed target has backing at creation Yes Yes
Placed target has backing after clear and copy Yes Yes
Cleared pixels read back as magenta 128/128 128/128
Bind helper after one injected failure 4/4 callers succeeded, one successful bind 4/4 callers succeeded, one successful bind

GPUs tested: NVIDIA GeForce RTX 4070 12 GB, driver 620.73.04, CachyOS kernel 7.3.5, Proton Experimental (Wine 11). Native Windows, AMD, Intel and a game boot were not tested on this child. The optional XMA decoder was omitted from the cross-build because its Rust target was unavailable.

AI-assisted: yes.

Checklist

  • One commit directly on upstream main 3aa975421.
  • One runtime change with synthetic render-target readback and a rollback control.
  • All tracked files passed python3 -I scripts/check_no_game_data.py.
  • Runtime only. No translator contract changes.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1100 **Author:** [@Moriz82](https://github.com/Moriz82) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `split/rt-placed-image-defer` --- ### 📝 Commits (1) - [`c92dc97`](https://github.com/ubiquitarianism/leonida/commit/c92dc9762f30a24e86d85e34d38f6c0d3aec2275) tests: verify placed attachment backing at submission (RT-PLACED-IMAGE-DEFER) ### 📊 Changes **1 file changed** (+16 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/d3d12_existing_heap_test.cpp` (+16 -4) </details> ### 📄 Description **Rebased onto `5129be10`.** #984 brought deferred slot-133 backing and the first-use fixture into main. This PR now retains three assertions from the original split. All four retry callers must succeed, an equivalent committed image must already have backing, and closing the command list must leave allocation deferred until submission in the default mode. The original test report is below. On `c92dc976`, `d3d12_existing_heap` passed 1/1 with deferred backing and 1/1 with `LEONIDA_PLACED_IMAGE_DEFER=0` under Wine 11.22 on an RTX 4070 (NVIDIA 620.73.04). Both runs cover the four retry callers, the committed control, the backing check after close, and the 128-pixel readback. Claimed in the coordination issue as: RT-PLACED-IMAGE-DEFER ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140549546)). Part of the split of #984 into small pull requests. Depends on: none Overlaps: #1079 resolves shader views of live placements by address. This change uses the existing slot-133 placement path on main. Streamed sources and shared BC backing are tracked separately. ### What and why Slot 133 allocated private Vulkan memory for every placed render target, depth/stencil target and storage texture, including attachments that only received a logical descriptor. On a device with a limited memory budget, unused attachments compete with active ones. The image and its format and layout metadata still exist at creation. The runtime binds memory on the first command replay, shader view or CPU subresource copy that needs the image. Concurrent callers share one successful bind. A failed allocation or bind can be retried, and a failed bind releases its unused allocation. Set `LEONIDA_PLACED_IMAGE_DEFER=0` for eager allocation. ### Tested Release cross-build with clang-cl 23 and an xwin SDK. Commands use a configured build directory. `PROTON_WINE` names the Wine executable and `WINEPREFIX` selects the test prefix. ```sh cmake --build runtime/build/boot --target gta6rt -j6 cmake --build runtime/build/boot --target d3d12_existing_heap_test -j6 cd runtime/build/boot export WINEDEBUG=-all unset LEONIDA_PLACED_IMAGE_DEFER timeout 120 "$PROTON_WINE" d3d12_existing_heap_test.exe LEONIDA_PLACED_IMAGE_DEFER=0 timeout 120 "$PROTON_WINE" d3d12_existing_heap_test.exe ``` Both targets built. The existing-heap test passed twice on the same binary. Each run used a 16 × 8 RGBA8 render target placed at a reserved, inaccessible address. | Check | Default | Eager rollback | | --- | --- | --- | | Placed target has backing after RTV creation and command-list close | No | Yes | | Equivalent committed target has backing at creation | Yes | Yes | | Placed target has backing after clear and copy | Yes | Yes | | Cleared pixels read back as magenta | 128/128 | 128/128 | | Bind helper after one injected failure | 4/4 callers succeeded, one successful bind | 4/4 callers succeeded, one successful bind | GPUs tested: NVIDIA GeForce RTX 4070 12 GB, driver 620.73.04, CachyOS kernel 7.3.5, Proton Experimental (Wine 11). Native Windows, AMD, Intel and a game boot were not tested on this child. The optional XMA decoder was omitted from the cross-build because its Rust target was unavailable. AI-assisted: yes. ### Checklist - [x] One commit directly on upstream main `3aa975421`. - [x] One runtime change with synthetic render-target readback and a rollback control. - [x] All tracked files passed `python3 -I scripts/check_no_game_data.py`. - [x] Runtime only. No translator contract changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:12 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#1137
No description provided.