Commit Graph

2 Commits

Author SHA1 Message Date
8477ea698b Repoint every stale TODO.md citation in the tree
Some checks failed
libakgl CI Build / cmake_build (push) Successful in 7m48s
libakgl CI Build / memory_check (push) Successful in 12m49s
libakgl CI Build / performance (push) Failing after 41m22s
libakgl CI Build / mutation_test (push) Successful in 27m0s
A sweep of all 265 tracked files, not just the ones the migration touched.

Two cross-repository citations named deps/libakerror/TODO.md item 8, a
numbering that has not existed for two releases; both now name libakerror
issue #18. Three tutorial and plan references pointed at TODO.md for defects
that are tracked: the invisible-on-frame-one actor is #39, the control map
traps are #81, and the pkg-config gap is #17.

plan.md is a live instruction document for writing the manual and still told
its reader to file findings in TODO.md; it says the tracker now.

Filed while sweeping: a zeroed akgl_ControlMap matches gamepad South, because
SDL_GAMEPAD_BUTTON_SOUTH is 0 and the two arms of the match are one
expression, and handler_on/handler_off are called without a NULL check. Both
are documented as workarounds in chapter 21 and neither had an issue. #81.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Andrew Kesterson <andrew@aklabs.net>
2026-08-02 22:01:27 -04:00
e91fd4d3eb Record what writing the manual found: 18 defects and 27 false claims
Twenty-one chapters and two games were written against src/ rather than against
the header comments, and the exercise turned up two classes of problem. Both are
recorded here because publishing a problem you cannot fix yet is a contribution,
and because the second class is the more dangerous one: every item in it was
documented, in a header, incorrectly.

The one to fix first is defect 1. akgl_game_update calls
akgl_physics->simulate() with no NULL check and akgl_default_physics is zeroed
BSS, so a program that never calls an initializer segfaults on its first frame
-- measured, exit 139, not an AKERR_NULLPOINTER. physics.h tells the reader
akgl_game_init selects a backend from a `physics.engine` property, which is
false in both halves, so a caller who believes the header writes exactly the
program that crashes. That is the worst first-contact experience in the library
and the fix is a NULL check.

Defect 2 is the subtlest. A child actor's offset is counted twice: physics.c
writes x as parent->x + vx, an absolute coordinate, and actor.c then draws at
parent->x + obj->x while actor_visible three lines above treats obj->x as
absolute. Two readings of one field inside one function, and actor.h documents
both of them without noticing. Confirmed by rendering the frame with and
without the guard and hashing the readback.

The rest run from silent invisibility (an actor on layer >= 16 is updated and
simulated and never drawn; a map-spawned actor has no facing bit and so no
sprite) through dead API (speedtime is loaded, mis-cast, and read by nothing;
there is no way to play a sound effect from a file at all) to asset provenance:
tests/assets/World_A1.png and util/assets/Actor1.png carry RPG Maker's default
filenames with no licence file, and util/assets/littleguy.json -- the sample
data for the one demo the library ships -- does not load.

The second section lists the 27 header comments that describe code that has
since changed. Nothing catches these: WARN_IF_UNDOCUMENTED proves a symbol has
a comment, not that the comment is true, and check_api_surface.sh strips
comments precisely because prose is not a declaration. Doxygen publishes them.

A third section marks entries in this file that are themselves stale, including
item 15, which describes a leak that src/util.c already fixes with exactly the
technique the item proposes. AGENTS.md warns that this file "carried eleven
entries describing code that had already changed"; that is still accumulating,
and a premise nobody has re-checked is where the next defect is hiding.

plan.md is the plan the work was executed from, kept because it records the
decisions and, in three places, corrections to itself -- including getting the
error-code count wrong in the document whose purpose was fixing wrong
documentation.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Andrew Kesterson <andrew@aklabs.net>
2026-08-01 20:59:20 -04:00