[PR #1298] tests: cover retire-ticket device loss #1328

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1298
Author: @Okachamie
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: test-retire-ticket-device-loss


📝 Commits (1)

  • f1ff7d0 tests: cover retire-ticket device loss

📊 Changes

1 file changed (+27 additions, -3 deletions)

View changed files

📝 runtime/test/vk_queue_query_sync_test.cpp (+27 -3)

📄 Description

Claimed in the coordination issue as: TEST-RETIRE-TICKET-DEVICE-LOSS

What and why

VulkanContext::completed_retire_ticket() can be the first Vulkan operation to discover VK_ERROR_DEVICE_LOST. The merged #408 fix marks the context lost and retires nothing in that case, but the existing regression injects the error into the queue's own progress-semaphore query instead. Which query observes the loss first depends on the driver, so the current test can pass on NVIDIA while failing on AMD.

Add a deterministic case with a fresh context and one pending submission. Inject VK_ERROR_DEVICE_LOST into the retire-ticket counter query, then require a zero completed ticket, a lost context, and exactly one intercepted error. The existing progress-query case now compares interception-count deltas so both cases can run together.

Tested

  • Rebased onto current main at 4a50cafc7af8b5a842c85a3794b286232495068d; proposed commit f1ff7d05a75c4a8526afc9838095ae21459c3bb9.
  • cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo configured successfully.
  • cmake --build runtime/build --target vk_queue_query_sync_test -j2 passed.
  • ctest --test-dir runtime/build -R '^vk_queue_query_sync$' --output-on-failure: 1/1 passed.
  • Five direct runs of runtime/build/vk_queue_query_sync_test: 5/5 passed.
  • Pre-fix control in a scratch copy, reversing only the #408 completed_retire_ticket() hunk: the new test failed at retire_context.is_device_lost().
  • python -I scripts/check_no_game_data.py runtime/test/vk_queue_query_sync_test.cpp passed.
  • git diff --check HEAD^ HEAD passed.
  • LEONIDA_VK_VALIDATION=1 skipped because VK_LAYER_KHRONOS_validation is not installed on this host.

GPUs tested: NVIDIA GeForce RTX 5090 Laptop GPU, NVIDIA 620.73.04, CachyOS 7.3.5-2-cachyos.

AI-assisted: yes

Checklist

  • Based on current main at 4a50cafc7af8b5a842c85a3794b286232495068d and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • New translator rule in docs/design.md (n/a for this test-only change).

🔄 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/1298 **Author:** [@Okachamie](https://github.com/Okachamie) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test-retire-ticket-device-loss` --- ### 📝 Commits (1) - [`f1ff7d0`](https://github.com/ubiquitarianism/leonida/commit/f1ff7d05a75c4a8526afc9838095ae21459c3bb9) tests: cover retire-ticket device loss ### 📊 Changes **1 file changed** (+27 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/vk_queue_query_sync_test.cpp` (+27 -3) </details> ### 📄 Description Claimed in the coordination issue as: [TEST-RETIRE-TICKET-DEVICE-LOSS](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144846738) ### What and why `VulkanContext::completed_retire_ticket()` can be the first Vulkan operation to discover `VK_ERROR_DEVICE_LOST`. The merged #408 fix marks the context lost and retires nothing in that case, but the existing regression injects the error into the queue's own progress-semaphore query instead. Which query observes the loss first depends on the driver, so the current test can pass on NVIDIA while failing on AMD. Add a deterministic case with a fresh context and one pending submission. Inject `VK_ERROR_DEVICE_LOST` into the retire-ticket counter query, then require a zero completed ticket, a lost context, and exactly one intercepted error. The existing progress-query case now compares interception-count deltas so both cases can run together. ### Tested - Rebased onto current `main` at `4a50cafc7af8b5a842c85a3794b286232495068d`; proposed commit `f1ff7d05a75c4a8526afc9838095ae21459c3bb9`. - `cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo` configured successfully. - `cmake --build runtime/build --target vk_queue_query_sync_test -j2` passed. - `ctest --test-dir runtime/build -R '^vk_queue_query_sync$' --output-on-failure`: 1/1 passed. - Five direct runs of `runtime/build/vk_queue_query_sync_test`: 5/5 passed. - Pre-fix control in a scratch copy, reversing only the #408 `completed_retire_ticket()` hunk: the new test failed at `retire_context.is_device_lost()`. - `python -I scripts/check_no_game_data.py runtime/test/vk_queue_query_sync_test.cpp` passed. - `git diff --check HEAD^ HEAD` passed. - `LEONIDA_VK_VALIDATION=1` skipped because `VK_LAYER_KHRONOS_validation` is not installed on this host. GPUs tested: NVIDIA GeForce RTX 5090 Laptop GPU, NVIDIA 620.73.04, CachyOS 7.3.5-2-cachyos. AI-assisted: yes ### Checklist - [x] Based on current `main` at `4a50cafc7af8b5a842c85a3794b286232495068d` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [ ] New translator rule in `docs/design.md` (n/a for this test-only change). --- <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#1328
No description provided.