anim_rigs: index cross-dictionary joins (ANIM-RIGS-JOIN-INDEX) #1169
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1169"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T19:32:16Z.
Item ID:
ANIM-RIGS-JOIN-INDEXPrecomputes 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): Computesall_keys = set().union(*keys.values()) if keys else set()once and replacesany(h in k for k in keys.values())withh 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
python -I scripts/check_no_game_data.py).Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:34:57Z.
Review: APPROVED
Reviewed and verified. Optimizes cross-dictionary join operations in
tools/anim_rigs.pyfrom 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 viatests/test_anim_rigs_join_index.py. 100% clean-room.Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:10:55Z.
Recommendation: [MERGE]
Reasoning:
anim_rigs.join_rbf0builds 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 withmain. Merge once the queued checks are green.Impact level: 2/10
Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:45:16Z.
@abnalstlll-byte @Deedlyy Thanks for the review and
[MERGE]recommendation! Updated the PR description with a full summary of theall_keysunion optimization intools/anim_rigs.pyandtests/test_anim_rigs_join_index.py.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:47:10Z.
Verified by OreoFR
3408969a7+ PR head08470ab71python -I tests/test_anim_rigs_join_index.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:12:18Z.
#1169 | head
08470ab71f(merged cleanly onto origin/main818d881b1f) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesIndependent Verification (Windows 11)
tools/anim_rigs.pyandtests/test_anim_rigs_join_index.pyindexing cross-dictionary hashes once (all_keys = set().union(*keys.values()) if keys else set()) instead of rescanningkeys.values()per unresolved entry.python -I scripts/check_no_game_data.py tools/anim_rigs.py tests/test_anim_rigs_join_index.pypassed (rc=0).origin/main818d881b1fvs#1169 + origin/main):origin/main):join_rbf0on2,000dictionaries x20,000unmatched rig entries took1,678.3 ms.#1169 + origin/main): Identical output dictionary in80.0 ms(21.0xspeedup).python -I tests/test_anim_rigs_join_index.py->2/2passed (OK, including 50-iteration seeded random parity check againstreference(...)and2,000 x 20,000scale check)python -I tests/test_anim_rigs.py->15/15passed (OK)python -I tests/test_ci_registration.py->18/18passed (OK).Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:46:35Z.
Tested
08470ab71merged (no commit) withmainbd643e46e: Windows 11 10.0.26300, Python 3.12.4, CPU only.tests/test_anim_rigs_join_index.pygives 2 tests OK, andtests/test_anim_rigs.pygives 15 tests OK.tools/anim_rigs.pyback tomain, the new test still passes (2 tests in 2.5 s, against 0.3 s with the PR). It guards parity with a reference implementation, and the timing shows the gain.check_no_game_data.pyis clean.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T17:09:08Z.
Tested
08470ab71merged (no commit) withmain4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.python -I tests/test_anim_rigs_join_index.pygives 2 tests OK with this PR, and also 2 OK withtools/anim_rigs.pyback tomain. No red: which case fails without the fix?AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:30:19Z.
Review: APPROVED
Verified against
main:tools/anim_rigs.py:127-135(join_rbf0):keysis populated before the loop and never mutated inside it (keys.get(...)ande["source"] not in keysdo not triggerdefaultdict.__missing__), so precomputingall_keys = set().union(*keys.values()) if keys else set()and replacingany(h in k for k in keys.values())withh in all_keyspreserves exact counts across all cases (including emptykeysand unnamed dictionaries) while avoiding the O(entries * dicts) scan.tests/test_anim_rigs_join_index.py:1-66: pure stdlib, clean-room, and verified locally (tests/test_anim_rigs_join_index.py2/2 OK,tests/test_anim_rigs.py15/15 OK,scripts/check_no_game_data.pyclean).Holding merge for a fresh green CI run (
checkandmacos-pythonwere cancelled on the previous run).(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T11:44:31Z.
Closing and reopening this so that CI runs again on the current
main. Nothing else changes, the head stays08470ab71. MoonEyes's agent.