hal/gpu-tests.lisp
Model a release callback which recursively destroys another owner.
Recursive maintenance cannot overtake the outer detached batch, and device teardown cannot mistake that detached batch for emptiness.
The older failure stays before work enqueued by a callback, and the callback child is deliberately not visited in the same maintenance pass.
Retry resumes at step two; the successful destructive step is not run twice, and the follower runs only after the whole owner retires.
Test whether two compatible scalars are equal.
(data)Return the CFFI element type and byte size for a one-dimensional DATA array of single-floats or unsigned 8-, 16-, 32-, or 64-bit integers.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
(device native-object owner descriptor)Wrap a platform texture and its retained OWNER in the HAL.
(thunk)(thunk)(&optional (stream *standard-output*))Logical negation of one test or raw truth value.
Raise a dimensionless value to a dimensionless power.
(queue swapchain image-index
&key (wait-semaphores #()) present-id present-stage time-domain-id
target-time target-time-domain-present-stage)(ledger resource ready-after teardown)Transfer RESOURCE's native teardown to LEDGER and return its entry. The caller holds its queue lock. This append must happen before the public wrapper is marked destroyed or its leak finalizer is cancelled.
(ledger completed-frontier &key (operation :maintain-queue))Attempt the eligible FIFO prefix in LEDGER at COMPLETED-FRONTIER. Only a successful eligible prefix leaves the ledger. The first ineligible or failed entry is a FIFO barrier: it and the entire unattempted suffix remain ahead of ownership transferred recursively by teardown callbacks.
Structured evidence that native GPU ownership could not be retired.
(ledger &key (operation :destroy-device))(&rest steps)Return a retryable closure over ordered, individually idempotent STEPS. Each zero-argument step is removed only after it returns normally. A retry therefore resumes at the failing native call without repeating any earlier destructive call which already succeeded.
(device owner teardown)Durably route a finalizer's OWNER through DEVICE or the fallback ledger. The fallback ledger takes ownership before any attempt. Its retryable routing step records when a backend queue has accepted OWNER, so a warning promoted to an error cannot cause a later retry to transfer the same native owner twice.
(ledger resource ready-after teardown invalidate &optional custodian)Durably enqueue native ownership, then logically invalidate RESOURCE. INVALIDATE is called only after LEDGER owns the complete teardown. Queue implementations call this while holding the lock which also guards LEDGER.
(resource teardown invalidate &key (operation :destroy))Perform TEARDOWN without a live queue, then invalidate RESOURCE. An error leaves the wrapper and its leak finalizer live and is re-signaled as a structured GPU-NATIVE-RETIREMENT-ERROR retaining the original cause.
The lazy process-wide retirement custodian service thread, or NIL.
Whether retaining a queue custodian starts eventual background service.
Newest best-effort worker start error; queue custody remains unaffected.
(ledger custodian)
The failed view is an ownership barrier: its texture and every later entry remain untouched until the view succeeds.