Assert leak-free load/release cycles for the sprite, spritesheet and character pools #73

Closed
opened 2026-08-02 18:35:18 -04:00 by tachikoma · 1 comment
Collaborator

Source: TODO.md, "Performance" -> Targets, target 16 (at bbb7b8f)

Target 16 is "no pool leaks across a load/release cycle of any asset type", and
it is recorded as met where tested on purpose.

The tilemap cycle is the one that was leaking and the one that is now asserted --
tests/tilemap.c checks the string pool is exactly where it started after one
load/release cycle and after 64, enough that a leak of one string per load could
not finish.

Nothing asserts the same of a sprite, spritesheet or character load/release
cycle. That is a gap in the tests, not a known leak. Close it with the same shape
the tilemap test uses.

Worth knowing while writing it: the last two tilemap leaks were found by dumping
the contents of every still-claimed slot after a cycle rather than by reading the
code again. 'tilelayer' and an assets directory named themselves immediately.

Files: tests/sprite.c, tests/character.c, tests/heap.c


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md, "Performance" -> Targets, target 16 (at bbb7b8f) Target 16 is "no pool leaks across a load/release cycle of any asset type", and it is recorded as **met where tested** on purpose. The tilemap cycle is the one that was leaking and the one that is now asserted -- `tests/tilemap.c` checks the string pool is exactly where it started after one load/release cycle and after 64, enough that a leak of one string per load could not finish. Nothing asserts the same of a **sprite, spritesheet or character** load/release cycle. That is a gap in the tests, not a known leak. Close it with the same shape the tilemap test uses. Worth knowing while writing it: the last two tilemap leaks were found by dumping the contents of every still-claimed slot after a cycle rather than by reading the code again. `'tilelayer'` and an assets directory named themselves immediately. **Files:** `tests/sprite.c`, `tests/character.c`, `tests/heap.c` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.9.x milestone 2026-08-02 18:35:18 -04:00
tachikoma added the performancetest-coverageblast-radius:medium labels 2026-08-02 18:35:18 -04:00
Author
Collaborator

Duplicate of #13, filed twice by a paging bug in the script that created these -- the forge caps an issue listing at 50 per page and the de-duplication check read only the first page. Closing; #13 is the live one.

Duplicate of #13, filed twice by a paging bug in the script that created these -- the forge caps an issue listing at 50 per page and the de-duplication check read only the first page. Closing; #13 is the live one.
Sign in to join this conversation.