[PR #1716] tests: slot 133 teardown leaves nothing at vkDestroyDevice (RT-SLOT133-STANDIN-LEAK) #1730

Open
opened 2026-11-26 21:18:45 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1716
Author: @Tyrannys
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: claude/slot133-standin-leak-adc6b3


📝 Commits (3)

  • 573c918 tests: d3d12test::Ref releases on = {}; slot 133 teardown test (RT-SLOT133-STANDIN-LEAK)
  • 63a96d1 Merge remote-tracking branch 'upstream/main' into claude/slot133-standin-leak-adc6b3
  • 3819f0a tests: leave the Ref change to #1758 (TEST-REF-MOVE-ONLY)

📊 Changes

2 files changed (+140 additions, -0 deletions)

View changed files

📝 runtime/CMakeLists.txt (+8 -0)
➕ runtime/test/xbox_slot133_teardown_test.cpp (+132 -0)

📄 Description

Claimed in the coordination issue as: RT-SLOT133-STANDIN-LEAK (ubiquitarianism/leonida#1608)

Depends on: #1758

What and why

The finding in #1608 (and adrianmjim's run on #1558): after a slot 133 placement, vkDestroyDevice reports 57-63 objects that were never destroyed (VUID-vkDestroyDevice-device-05137) under LEONIDA_VK_VALIDATION=1. The leak comes from the test helper, not the runtime.

d3d12test::Ref had no assignment operator of its own, so placed = {}; copied a null pointer over the reference and never called Release. The placed texture kept its reference to the device proxy, and the whole D3D12 device was still alive at vkDestroyDevice. I took the runtime's slot 133 paths one at a time (provider refusal → host-address texture → committed stand-in) and none holds a reference after release.

adrianmjim's #1758 (TEST-REF-MOVE-ONLY) makes the same Ref change: move-only, and ref = {} releases. It is equivalent to the change this pull request first carried, so that part has been reverted here (in a new commit; the history is unchanged), and the Ref fix is left to #1758. This pull request now only adds a regression test for slot 133 teardown.

The new xbox_slot133_teardown test needs no game files. Through slot 133 on the Vulkan device behind the proxy, it places:

  • a 1280×720 format-118 depth target without UAV
  • a 256×256 RGBA8 texture
  • an RGBA8 render target
  • a buffer

It drops each one with = {} and checks that the proxy's reference count is back where it was. Then it releases the device and reads the validation error count only after vkDestroyDevice.

Tested

NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11, MSVC, Ninja RelWithDebInfo. Branch with current main (a73a57e13) merged in.

  • With #1758's d3d12_test_shaders.h (head a8a56cb47; it differs from main only in Ref): xbox_slot133_teardown passes plain and with LEONIDA_VK_VALIDATION=1, with no VUID reported.
  • Without the Ref fix (this branch on its own): it fails, with VUID-vkDestroyDevice-device-05137 for the objects of the device that is still alive. So this pull request should merge after #1758.
  • Earlier, with the Ref change, the whole ctest passed (403/403) and #1558's test was clean under validation. check_no_game_data.py on the changed files is clean. The game was not run.

GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🤖 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/1716 **Author:** [@Tyrannys](https://github.com/Tyrannys) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `claude/slot133-standin-leak-adc6b3` --- ### 📝 Commits (3) - [`573c918`](https://github.com/ubiquitarianism/leonida/commit/573c9184ec1c0295a4985277d9919dc1c09b0f5f) tests: d3d12test::Ref releases on `= {}`; slot 133 teardown test (RT-SLOT133-STANDIN-LEAK) - [`63a96d1`](https://github.com/ubiquitarianism/leonida/commit/63a96d1174092e9e0e66f62d6bc5813b2eb5e518) Merge remote-tracking branch 'upstream/main' into claude/slot133-standin-leak-adc6b3 - [`3819f0a`](https://github.com/ubiquitarianism/leonida/commit/3819f0a0fcd280158bc8f34cd3965bb663e407f6) tests: leave the Ref change to #1758 (TEST-REF-MOVE-ONLY) ### 📊 Changes **2 files changed** (+140 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+8 -0) ➕ `runtime/test/xbox_slot133_teardown_test.cpp` (+132 -0) </details> ### 📄 Description Claimed in the coordination issue as: RT-SLOT133-STANDIN-LEAK (ubiquitarianism/leonida#1608) Depends on: #1758 ### What and why The finding in #1608 (and adrianmjim's run on #1558): after a slot 133 placement, `vkDestroyDevice` reports 57-63 objects that were never destroyed (VUID-vkDestroyDevice-device-05137) under `LEONIDA_VK_VALIDATION=1`. The leak comes from the test helper, not the runtime. `d3d12test::Ref` had no assignment operator of its own, so `placed = {};` copied a null pointer over the reference and never called `Release`. The placed texture kept its reference to the device proxy, and the whole D3D12 device was still alive at `vkDestroyDevice`. I took the runtime's slot 133 paths one at a time (provider refusal → host-address texture → committed stand-in) and none holds a reference after release. adrianmjim's #1758 (TEST-REF-MOVE-ONLY) makes the same `Ref` change: move-only, and `ref = {}` releases. It is equivalent to the change this pull request first carried, so that part has been reverted here (in a new commit; the history is unchanged), and the `Ref` fix is left to #1758. This pull request now only adds a regression test for slot 133 teardown. The new `xbox_slot133_teardown` test needs no game files. Through slot 133 on the Vulkan device behind the proxy, it places: - a 1280×720 format-118 depth target without UAV - a 256×256 RGBA8 texture - an RGBA8 render target - a buffer It drops each one with `= {}` and checks that the proxy's reference count is back where it was. Then it releases the device and reads the validation error count only **after** `vkDestroyDevice`. ### Tested NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11, MSVC, Ninja RelWithDebInfo. Branch with current `main` (a73a57e13) merged in. - With #1758's `d3d12_test_shaders.h` (head a8a56cb47; it differs from `main` only in `Ref`): `xbox_slot133_teardown` passes plain and with `LEONIDA_VK_VALIDATION=1`, with no VUID reported. - Without the `Ref` fix (this branch on its own): it fails, with VUID-vkDestroyDevice-device-05137 for the objects of the device that is still alive. So this pull request should merge after #1758. - Earlier, with the `Ref` change, the whole `ctest` passed (403/403) and #1558's test was clean under validation. `check_no_game_data.py` on the changed files is clean. The game was not run. GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a) 🤖 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>
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#1730
No description provided.