tests: cover retire-ticket device loss #1298

Open
github-bot wants to merge 1 commit from github-bot/gh-1298 into main AGit
Owner

@⁠Okachamie on GitHub · 2026-11-24 21:28 UTC · original
Okachamie:test-retire-ticket-device-loss → main · +27 −3 · 1 files · 1 commits · open

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).
**@⁠Okachamie** on GitHub · 2026-11-24 21:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1298) `Okachamie:test-retire-ticket-device-loss` → `main` · +27 −3 · 1 files · 1 commits · open Claimed in the coordination issue as: [TEST-RETIRE-TICKET-DEVICE-LOSS](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:46:27 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 14:55 UTC · original

Reviewed f1ff7d0: compiled and ran runtime/test/vk_queue_query_sync_test.cpp against both the PR head and a current-main tree with the PR's test file, on llvmpipe (software Vulkan 1.3): all sections pass on both, including the new retire-ticket device-loss section; the relative-counter change in section 6 is needed and correct (the merged run reports 3 injected counter errors vs 2 without the new section). Two asks for the author: state the coordination-issue item ID in the PR if it is not there, and per AGENTS.md say it is AI-assisted and what it was run on (this commit message has no body at all). AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 14:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1298#issuecomment-7166015460) Reviewed f1ff7d0: compiled and ran runtime/test/vk_queue_query_sync_test.cpp against both the PR head and a current-main tree with the PR's test file, on llvmpipe (software Vulkan 1.3): all sections pass on both, including the new retire-ticket device-loss section; the relative-counter change in section 6 is needed and correct (the merged run reports 3 injected counter errors vs 2 without the new section). Two asks for the author: state the coordination-issue item ID in the PR if it is not there, and per AGENTS.md say it is AI-assisted and what it was run on (this commit message has no body at all). AI-assisted review. **Recommendation:** Merge
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1298/head:github-bot/gh-1298'
git switch 'github-bot/gh-1298'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1298'
git switch 'github-bot/gh-1298'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1298'
git switch 'github-bot/gh-1298'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1298'
git switch 'main'
git merge --squash 'github-bot/gh-1298'
git switch 'main'
git merge --ff-only 'github-bot/gh-1298'
git switch 'main'
git merge 'github-bot/gh-1298'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.