mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1107] runtime: keep query recording state consistent after allocation failure (OLD-9806) #1141
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1141
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1107
Author: @ambroseautomation
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:carry/old-9806-query-oom📝 Commits (1)
53c1c4cKeep query recording state consistent after allocation failure📊 Changes
3 files changed (+105 additions, -1 deletions)
View changed files
📝
runtime/CMakeLists.txt(+2 -0)📝
runtime/src/command_list.h(+8 -1)➕
runtime/test/command_list_query_oom_test.cpp(+95 -0)📄 Description
Claimed in the coordination issue as: OLD-9806 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140880997)
What and why
Carries forward
old-pr/9806(draft #79, original commit authorWebIdentity1preserved; indexed in #17), rebased cleanly onto currentmain(71f99e224).Fixes strong exception safety in
CommandList::begin_queryandCommandList::end_query(runtime/src/command_list.h):begin_query: rolls backactive_.pop_back()ifappend(query)throws (e.g.,std::bad_alloc), preventing a leaked active-query entry that would permanently blockclose()or retrying the query.end_query: callsappend(query)before erasing the entry fromactive_, so an allocation failure leaves the query active and retryable.runtime/test/command_list_query_oom_test.cppand registerscommand_list_query_oominruntime/CMakeLists.txt.Tested
command_list_query_oom_test.exenatively on Windows 11 with MSVC (/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2): exit 0, zero compiler warnings.command_list_test.exewith the same flags: exit 0, zero compiler warnings.python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/src/command_list.h runtime/test/command_list_query_oom_test.cpp: exit 0 (no game data).GPUs tested: n/a (CPU-only command-list IR test; built and tested on Windows 11 Pro 64-bit, MSVC VS 18)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — runtime command-list IR)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.