Files
leleka/crates/cuda-model
Pavlo RatushnyiandClaude Sonnet 5.5 3a3e3d6569 prefill ring prefetch: stage into the first free unreserved slot (fix stage.slot_not_gathered at sources > slots)
pkg-s16 (51b36adf7), 9/30 requests: RING-REFUSE layer=46|47 check=stage.slot_not_gathered reserved=0
slots=384 sources=410..460. With prefetch hits the copies skip the hit sources, so once a layer's sources exceed
the ring the wrap reaches a slot holding an earlier source's copy that is not gathered yet; the stage_room
shortcut (reserved == 0) then let stage_one refuse.

- stage_target (leleka-cuda-model ring_prefetch) searches forward, wrapping, for the first slot that is not
  reserved and free (never filled or gathered); without a prefetch it is stage_next itself (the literal ring:
  copies and gathers in one order, lookahead one short of the ring).
- Ring::stage_room: no reserved shortcut; "no copy needed or stage_target finds a slot", so the walk waits for
  a gather instead of refusing.
- Host tests: 200 seeds of 460 sources / 384 slots with random prefetch hits among the first 300, other sizes;
  the model asserts no stage onto a reserved or unread slot and that stage_target refuses only when no
  unreserved slot is free (both fail with the old stage_target). 18 tests.

Switch stays OFF by default. Not run on a GPU.

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