deps/tg has no consumer: write the region-query API or git rm it #55

Open
opened 2026-08-02 18:33:41 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md, "tg is vendored and has no consumer" (at bbb7b8f)

deps/tg is pinned at v0.7.9 and nothing in the tree uses it.

It was evaluated alongside deps/libccd for the collision work and lost, for two
reasons that are properties of the library rather than preferences:

  • It is 2D permanently. Its own documentation says the z coordinate is "only
    carried along and serve[s] no other purpose than to be available for when it's
    desired to export to an output representation"; no predicate reads it. libccd is
    natively 3D, so the 2D case is a restriction that lifts later.
  • Its predicates return bool. Resolving a collision needs a minimum
    translation vector, and tg_geom_intersects cannot supply one.

Secondary: every coordinate in its API is double against libakgl's float32_t;
tg.c is a single 16,000-line amalgamation that embeds a second JSON parser next
to the jansson already vendored; and it ships no build system, so
akgl_add_vendored_dependency would silently do nothing for it.

It is kept rather than dropped because there is one job it does that libccd
structurally cannot: indexed point-in-polygon against concave polygons with
holes.
GJK and MPR are convex-only, always. A trigger volume or walkable region
authored as a concave Tiled polygon is the case, and tg answers it at 10M+
ops/sec with its own segment index.

This issue is the deadline. Either that consumer appears, or deps/tg comes
out. A vendored dependency with no caller is a question every future reader has to
answer, and 6 MB of it is cloned by every recursive checkout in CI. Closing it
means either writing the region-query API or git rm -- not leaving it open.

Files: deps/tg, CMakeLists.txt


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

**Source:** TODO.md, "tg is vendored and has no consumer" (at bbb7b8f) `deps/tg` is pinned at v0.7.9 and **nothing in the tree uses it.** It was evaluated alongside `deps/libccd` for the collision work and lost, for two reasons that are properties of the library rather than preferences: - **It is 2D permanently.** Its own documentation says the z coordinate is "only carried along and serve[s] no other purpose than to be available for when it's desired to export to an output representation"; no predicate reads it. libccd is natively 3D, so the 2D case is a restriction that lifts later. - **Its predicates return `bool`.** Resolving a collision needs a minimum translation vector, and `tg_geom_intersects` cannot supply one. Secondary: every coordinate in its API is `double` against libakgl's `float32_t`; `tg.c` is a single 16,000-line amalgamation that embeds a second JSON parser next to the jansson already vendored; and it ships no build system, so `akgl_add_vendored_dependency` would silently do nothing for it. It is kept rather than dropped because there is one job it does that libccd structurally cannot: **indexed point-in-polygon against concave polygons with holes.** GJK and MPR are convex-only, always. A trigger volume or walkable region authored as a concave Tiled polygon is the case, and tg answers it at 10M+ ops/sec with its own segment index. **This issue is the deadline.** Either that consumer appears, or `deps/tg` comes out. A vendored dependency with no caller is a question every future reader has to answer, and 6 MB of it is cloned by every recursive checkout in CI. Closing it means either writing the region-query API or `git rm` -- not leaving it open. **Files:** `deps/tg`, `CMakeLists.txt` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 1.0.0 milestone 2026-08-02 18:33:41 -04:00
tachikoma added the packagingdesign-decisionblast-radius:medium labels 2026-08-02 18:33:41 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:24 -04:00
Sign in to join this conversation.