ludic/changes/render3d-zero-per-frame.md
Orkuncakilkaya 866037a0d7 fix(render3d): nothing allocated in the steady state - the Vulkan allocator reuses its records
gvk_mem_new made a one-slot []pointer per allocation, and turned the requirement's size and
alignment into strings to read them as ints; gvk_list_drop_last rebuilt the spare-record list to
drop its last entry; gvk_mem_id did the string round trip on every free. One slot is kept
(gvk_map_slot), int() truncates a long, the spare list pops. Every Text.to_int(string(x)) in
render3d is int(x) now.

Vk.heap_bytes() (vk_mac.ll: malloc_zone_statistics' size_in_use; 0 on Windows) and
examples/rendering/steady.ludic, in the suite: a buffer released and made again 5000 times and
600 whole frames gain 0 bytes each - the allocator before this, 1,120,000 over the 5000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:14:56 +03:00

662 B

bump: patch type: fix render3d allocates nothing in its steady state. A buffer released and made again - what a streamed or growing buffer does every few frames - left about 224 bytes behind each time: the Vulkan allocator made a one-slot list per allocation, turned two 64-bit sizes into strings to read them as ints, and rebuilt its spare-record list whole to drop the last entry. It now keeps one slot, converts with int(), and pops. Vk.heap_bytes() reads malloc's live bytes (macOS), and examples/rendering/steady.ludic holds render3d to zero: 5000 buffer rounds and 600 whole frames, 0 bytes each (the unfixed allocator: 1,120,000 over the 5000).