upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/d3d12_queue_handover_test.cpp
AgeCommit message (Collapse)Author
7 daystests: derive every test's scratch folder from test_temp_dir::temp_dir, not ↵thiefyzheng
GetTempPath (TEST-TEMPDIR-STRIPPED-ENV) With TMP, TEMP and USERPROFILE all unset, GetTempPathW returns C:\Windows\, and the throwing create_directories/copy_file/ofstream on C:\Windows\leonida_* aborts with 0xc0000409 before the test body runs. runtime/test/test_temp_dir.h grows one entry, testfiles::temp_dir(): LEONIDA_TEST_DIR when set, the current directory when the temp environment is stripped (Windows), else the standard temp resolution. Fifty-two test files and the tiny_game fixture that called GetTempPathA/W or temp_directory_path directly now use it; d3d12_queue_handover_test.cpp also checks the _sopen_s result in capture_stderr instead of silently returning empty stderr. One runtime source function needed the same fallback because tests exercise it: tls_host_clone_dir in runtime/src/pe_loader.cpp (the loader_tls tests). Rebased onto current main after its D3D-448 additions to d3d12_mesh_test.cpp (3-way; the mesh test keeps both). Verification on a Windows VM: stripped environment - the previously crashing d3d12 tests exit 77 (no usable Vulkan device) instead of aborting, file_system_test runs all 505 checks and loader_test all 95 with zero failures; normal environment - identical outcomes; LEONIDA_TEST_DIR honored under a fully stripped environment (the scratch folder observed mid-run inside it, cleaned up after the pass). The finding is whoalin1's (coordination issue #14, 02:37:44Z). AI-assisted.
13 daysQueue holds: second review fixes (claim after submit, presenter locking and ↵AlxcBTW
bound, teardown pump, tests) - A Signal counts as submitted only after vkQueueSubmit succeeded: a failed submit releases no waiter and the retry goes through. - ~VulkanQueue pumps after dropping held work; fence keep-alives are also drained in wait() and marker(). - VulkanPresenter: counters are atomics, read_back/enable_capture take the presenter mutex, set_abort has its own mutex, a deferred present reports not tearing, and at most 8 presents queue up before the caller waits. - Tests: three presents (blit, blank, composed) queued behind held work run in order, a present behind a destroyed queue's held work runs, a failed Signal does not release its waiters; the handover modes also run on the host runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysQueue holds: review fixes (Present ordering, pins, timeline monotonicity, ↵AlxcBTW
fence lifetime, teardown, docs) - Present is queued behind held work (QueueHolds::after_held) and submitted in order by the releasing thread. - Held batches keep the pipeline states and root signatures of their lists; fences a queue waits on or signals are kept until the submission has completed on the GPU (a D3D12 queue holds them). - A held Signal released below an unheld one on the same fence leaves the Vulkan signal out (claimed under the submit lock). - A queue destroyed with held Signals completes the CPU waits on their fences and reports it. - A failed held batch is reported (take_held_failure, last_execute_result), its waits stay for the next submission, and the Signal behind it still signals. - d3d12_queue_handover_test: pairs, two-thread signalling stress, held Signal of a released fence, shared fence, teardown with a CPU waiter; --two-queues and --shared-queue modes on a caller-owned device. - Tests for each fix in vk_presenter_sync_test, vk_queue_query_sync_test and d3d12_m4_compute_test; docs section 4.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysD3D12 queues: hold a batch that waits for a Signal not yet submitted, so ↵AlxcBTW
layouts follow dependency order A queue's ExecuteCommandLists is replayed against one LayoutTracker in call order, so a batch that waits (cross-queue) for a Signal submitted later was recorded against layouts from before the work it waits for. Track, per fence, the highest Signal value submitted (CPU Signal and the creation value count); a queue holds a batch, and what follows it, while a Wait names a higher value, and the thread that submits the satisfying Signal releases the held work in dependency order on its own VkQueue. Reports a queue destroyed with held work and a fence released under a waiter; nothing blocks. Adds d3d12_queue_handover_test (27 queue-type assignments x 6 submission orders, two producers, CPU Signal cases, never-signaled and released fences, byte-exact against the host runtime) and updates docs section 4.4 and the M4 row. Two existing tests that used an unsignaled Wait as a GPU gate or expected a synchronous submit failure under a pending Wait now declare the Signal first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>