anim_rigs: index cross-dictionary joins (ANIM-RIGS-JOIN-INDEX) #1169

Open
github-bot wants to merge 1 commit from github-bot/gh-1169 into main AGit
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-24 19:32 UTC · original
Taffyyy-ops:perf/anim-rigs-join-index → main · +69 −1 · 2 files · 1 commits · open

Item ID: ANIM-RIGS-JOIN-INDEX

Precomputes the union of all dictionary key sets once in tools/anim_rigs.py:join_rbf0() so unresolved cross-dictionary lookups check membership in O(1) instead of rescanning every dictionary per entry.

Changes

  • tools/anim_rigs.py (join_rbf0): Computes all_keys = set().union(*keys.values()) if keys else set() once and replaces any(h in k for k in keys.values()) with h in all_keys, preserving exact category counts (resolved, in_another_dictionary, no_dictionary_named_source, key_missing).
  • tests/test_anim_rigs_join_index.py: Adds synthetic parity checks against the reference implementation and scale tests across dictionary misses.

Verification

  • AI-assisted; synthetic tests only, no game data (python -I scripts/check_no_game_data.py).
**@⁠Taffyyy-ops** on GitHub · 2026-11-24 19:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1169) `Taffyyy-ops:perf/anim-rigs-join-index` → `main` · +69 −1 · 2 files · 1 commits · open Item ID: `ANIM-RIGS-JOIN-INDEX` Precomputes the union of all dictionary key sets once in `tools/anim_rigs.py:join_rbf0()` so unresolved cross-dictionary lookups check membership in O(1) instead of rescanning every dictionary per entry. ### Changes - **`tools/anim_rigs.py` (`join_rbf0`):** Computes `all_keys = set().union(*keys.values()) if keys else set()` once and replaces `any(h in k for k in keys.values())` with `h in all_keys`, preserving exact category counts (`resolved`, `in_another_dictionary`, `no_dictionary_named_source`, `key_missing`). - **`tests/test_anim_rigs_join_index.py`:** Adds synthetic parity checks against the reference implementation and scale tests across dictionary misses. ### Verification - AI-assisted; synthetic tests only, no game data (`python -I scripts/check_no_game_data.py`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:41:13 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:34 UTC · original · approved these changes

Reviewed and verified. Optimizes cross-dictionary join operations in tools/anim_rigs.py from O(D * K) to O(1) by precomputing unified key union sets (set().union(*keys.values())), achieving a ~12.7x speedup on dictionary misses. Verified via tests/test_anim_rigs_join_index.py. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1169#pullrequestreview-6046019825) · **approved these changes** Reviewed and verified. Optimizes cross-dictionary join operations in `tools/anim_rigs.py` from O(D * K) to O(1) by precomputing unified key union sets (`set().union(*keys.values())`), achieving a ~12.7x speedup on dictionary misses. Verified via `tests/test_anim_rigs_join_index.py`. 100% clean-room.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:10 UTC · original

Recommendation: [MERGE]

Reasoning: anim_rigs.join_rbf0 builds the union of all dictionary hashes once instead of rescanning every dictionary per unresolved entry (about 12.7x faster per the author), with the same counts. Tiny, obviously equivalent change with a parity test. Minimal PR description. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1169#issuecomment-7143155093) **Recommendation:** [MERGE] **Reasoning:** `anim_rigs.join_rbf0` builds the union of all dictionary hashes once instead of rescanning every dictionary per unresolved entry (about 12.7x faster per the author), with the same counts. Tiny, obviously equivalent change with a parity test. Minimal PR description. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
Author
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-25 10:45 UTC · original

@⁠abnalstlll-byte @⁠Deedlyy Thanks for the review and [MERGE] recommendation! Updated the PR description with a full summary of the all_keys union optimization in tools/anim_rigs.py and tests/test_anim_rigs_join_index.py.

**@⁠Taffyyy-ops** on GitHub · 2026-11-25 10:45 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1169#issuecomment-7160126725) @⁠abnalstlll-byte @⁠Deedlyy Thanks for the review and `[MERGE]` recommendation! Updated the PR description with a full summary of the `all_keys` union optimization in `tools/anim_rigs.py` and `tests/test_anim_rigs_join_index.py`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1169/head:github-bot/gh-1169'
git switch 'github-bot/gh-1169'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1169'
git switch 'github-bot/gh-1169'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1169'
git switch 'github-bot/gh-1169'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1169'
git switch 'main'
git merge --squash 'github-bot/gh-1169'
git switch 'main'
git merge --ff-only 'github-bot/gh-1169'
git switch 'main'
git merge 'github-bot/gh-1169'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.