Skip to content

chore(generator): remove write-only twinOf and consumedEnd - #77

Merged
gkurt merged 1 commit into
gkurt:mainfrom
irontaek:chore/generator-write-only-collections
Oct 9, 2026
Merged

gkurt merged 1 commit into
gkurt:mainfrom
irontaek:chore/generator-write-only-collections

Conversation

@irontaek

@irontaek irontaek commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Two collections in the geometry pipeline are filled but never read:

  • partitionFaces() (geometry/partition.ts) builds twinOf for every half-edge pair, but nextEdge() and the face walk only use outgoing and halfEdges.
  • assembleStrokes() (geometry/strokes.ts) adds both ends of each walked segment to consumedEnd, but the walk checks consumedSeg and link, never consumedEnd.

This PR deletes both (10 lines, deletion only). No behavior change, so bundles and scoreboard baselines should not move.

Checked locally:

  • bun --conditions=tegaki@dev test src/geometry in packages/generator: 252 pass, 0 fail. One earlier run hit a 5s timeout on a single test; it did not reproduce on rerun, and the unmodified tree also passed 252/252.
  • tsgo at the root: no errors
  • biome lint on the two files: clean

https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq

partitionFaces() fills twinOf and assembleStrokes() fills consumedEnd,
but neither is ever read; nextEdge() and walkFrom() rely on outgoing,
link and consumedSeg instead.

Claude-Session: https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq
@gkurt

gkurt commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Hey. Thanks a lot for the simplification. I will merge it.

Just curious. Did you notice any performance issues or bugs caused by this?

@irontaek

irontaek commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! No, I didn't see any bug or measurable slowdown from it. Both were flagged by a static check I run for collections that are written but never read, and I confirmed by hand that nothing reads them. The only cost was a few extra Map/Set inserts per glyph, so this is just cleanup.

@gkurt
gkurt merged commit 6d09699 into gkurt:main Oct 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants