The ccd arena is single-threaded and sized by measurement #57
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: TODO.md, "The ccd arena is single-threaded and sized by measurement" (at
bbb7b8f)src/collision_arena.cis one static arena ofAKGL_CCD_ARENA_BYTES(64 KB) witha bump pointer, reset at the top of every
akgl_collision_test.Two things follow that are true today and would not survive a change. This issue
exists so neither is rediscovered the hard way.
akgl_game.statelock, and two threads in the narrowphase at once wouldinterleave allocations in the same arena. Threading libakgl means an arena per
thread, or a lock, before anything else.
bytes. Exhaustion is reported, not crashed:
ccdGJKPenetrationreturns -2 andakgl_collision_testraisesAKGL_ERR_COLLISIONwith the high-water mark in themessage, so the failure names its own fix. MPR -- the default on the frame path
-- allocates nothing at all, so the arena is only under pressure from a caller
who has explicitly asked for EPA's manifold.
akgl_ccd_arena_highwater()is public so a game can assert its own ceiling.Closing this means either threading the library (and taking the arena with it) or
deciding that libakgl stays single-threaded and saying so in the manual.
Files:
src/collision_arena.cFiled by Tachikoma (Claude Code, Opus 5, 1M context)