mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #2384] awc_names: number family members by their suffix (AWC-NAMES-FAMILY-SUFFIX-NUMBER) #2388
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2388
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2384
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/awc-names-family-suffix-number📝 Commits (1)
762b141awc_names: number family members by their suffix (AWC-NAMES-FAMILY-SUFFIX-NUMBER)📊 Changes
2 files changed (+18 additions, -2 deletions)
View changed files
📝
tests/test_awc_names.py(+13 -0)📝
tools/awc_names.py(+5 -2)📄 Description
Claimed in the coordination issue as: AWC-NAMES-FAMILY-SUFFIX-NUMBER (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198059484)
What and why
tools/awc_names.pynames AWC bank ids by dictionary attack. A family is a base whose numbered suffixes ('',_00.._40,_1.._9) hit ids in one bank. The module docstring anddocs/audio.mdrequire "at least 3 members, or 2 with adjacent numbers", because chance hits rarely land on adjacent numbers.family_okread each member's number from the whole name (FAMILY_NUMBERonsalt + base + suffix). When the base itself ends in a digit, its unsuffixed member got a number too:family_okonmainhorn+horn_02amb_1+amb_1_02Dictionary bases can end in a digit token (
wordyaccepts digit tokens), so such a pair could be reported as a named family on chance hits. The salted control run that sizes the family rule does not catch it, because the control uses the same reading._attack_splitnow handsfamily_okthe members' suffixes (name[len(salt) + len(base):]), so a digit that belongs to the base never counts as a member number. Bases without a trailing digit are unaffected, andfamily_ok's own behaviour on full names (its existing test) is unchanged.Different topic from #780 (write mode on replace, same files); the two merge cleanly.
Tested
Windows 11, Python 3.14.7, synthetic dictionary and ids only:
python -I tests/test_awc_names.py: 37 tests OK. Newtest_a_digit_that_ends_the_base_is_not_a_member_number:amb_1+amb_1_02andhorn+horn_02in one bank are both rejected; onmainthe first is accepted and the test fails.amb_1_01+amb_1_02(adjacent suffixes) andamb_1+amb_1_02+amb_1_05(three members) are still accepted.python -m compileall;scripts/check_no_game_data.pyon both files.Not changed here:
docs/audio.mdline 329 says that when two accepted families claim one id, "the first family in sorted base order keeps it", while the code has kept the larger family since58a981e25. That is a separate doc fix.GPUs tested: n/a (CPU-only tool)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.