Files
leleka/crates/cuda-driver/tests
Pavlo RatushnyiandClaude Sonnet 5.5 f029f7b1ec cuda-driver, engine-qwen35-cuda: DeviceRef shared handles replace the verify-window borrows (ledger Q7, B1)
The verify-window aggregates borrowed every weight, scratch and history buffer from the cache that owns
it (&'a DeviceBuffer), so a recorded graph set could not be stored next to its owner and was dropped and
recorded again for every request. DeviceRef<'ctx> is an Rc handle to the allocation (own, or a range of
a slab it keeps alive): Clone is one count increment, Deref reaches the DeviceBuffer the kernels take, a
release while another holder remains frees nothing.

OriginalVerifyWindowResources<'ctx>, OriginalVerifyResources, the GDN/QSA journals, the GR/MoE/proj/QSA
bindings and the RoPE tables carry no 'a any more; DecodeResources<'ctx> likewise. The engine caches
(dense: Vec<DeviceRef>, MoE: EncodedWeight::Raw(DeviceRef)) hand out clones in the assembly only;
seed_ple_history writes through the handle (copy_from_shared). Nothing changes on the existing paths:
same kernels, same arguments, same order. A guard test keeps .clone() out of the window and journal
modules, which only dereference.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:18:35 +01:00
..