awc_names: number family members by their suffix (AWC-NAMES-FAMILY-SUFFIX-NUMBER) #2384
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2384"
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 syfyra on 2026-11-26T16:46:19Z.
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
Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-26T17:28:36Z.
Review: COMMENTED
Verified on the PR branch: python3 -m unittest tests.test_awc_names -v -> 37 tests OK (1 skip), including the new case that a digit ending a base ('amb_1') is not counted as a member suffix. The change scopes family_ok to n[len(salt)+len(base):] so only real suffixes are numbered; direct test evidence supports it. However this branch carries 522 commits not on current main, so I am not approving until it is rebased onto main — merging as-is would drag in a large unrelated history. Please rebase and re-run the suite.
Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-26T18:40:01Z.
Review: COMMENTED
macOS arm64 check of #2384 (AWC-NAMES-FAMILY-SUFFIX-NUMBER). A tools-only name-classifier change.
Tested head
762b14179with its diff applied to a copy ofmainbdbc7e923(branch 10 commits behind; clean).Environment: Apple M3 Pro, arm64, macOS 27.2.1, CPython 3.15.2.
Result
python -I tests/test_awc_names.py: 37 tests, OK (skipped=1).tools/awc_names.pyput back tomain's): 1 failure,test_a_digit_that_ends_the_base_is_not_a_member_number [amb_1]-mainbuilds anamb_1+amb_1_02family, the change does not.python -I scripts/run_semantic_tests.py tests/semantic: 500 files / 6,367 tests / 0 failed, same asmain.Review
len(salt) + len(base)is safe because_attack_splitbuilds the members of(bank, base)assalt + base + suffixitself; the suffix is whatfamily_okis meant to number, and it now matches the behaviour for bases that do not end in a digit (horn+horn_02)."", whichfamily_okalready treats as "no number", soamb_1+amb_1_02is not a family;amb_1_01+amb_1_02and the three-memberamb_1+amb_1_02+amb_1_05cases still are, and the test checks both directions.ambandamb_1) lands in two family buckets with different suffixes ("_1_02"vs"_02"), so the more specific base still gets the right numbering; the test'shorncase covers the shared-prefix direction.I found no bug in the change.
python -I scripts/check_no_game_data.pyon both changed files: clean.No game files. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T04:16:39Z.
VERIFY-2384 — Linux, Python 3.15, CPU only, no game files
Claimed as
VERIFY-2384(+13/-0 test, +5/-2 tool). Two-step method: merge into a clean worktree atmain(9d231d37), then take only the test file onto cleanmain.python -I tests/test_awc_names.pymainmain+ this pull requestmain+ only this pull request's test fileThe failure on the last row is an
AssertionError, not an import or attribute error, so the test is exercising the changed code rather than merely failing to load it. Reverse control holds: the change is what turns it green.Verified. Nothing found against it; merges cleanly with
mainat9d231d37.AI-assisted: yes — MiMo-V2.6-Flash (OpenCode).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:03:32Z.
Review: COMMENTED
Draft review against current
main: slicingn[len(salt) + len(base):]so trailing base digits are not mistaken for family member numbers intools/awc_names.py:297-302looks clean and clean-room verified. Still Draft with no CI run yet — please mark Ready for Review so CI runs green.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:34:50Z.
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.
(AI-assisted triage.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:06:54Z.
Review: APPROVED
Now ready for review and
MERGEABLE(1 commit). Clean-room verified: scoping family member numbering to the post-base suffix intools/awc_names.py:297-302with tests intests/test_awc_names.pyis clean and verified (@wavehs,@imShangLi,@MSedgeMC).Approving — ready to merge once CI runs green on current
main.(AI-assisted review.)