docs: two families claiming one AWC id, the larger keeps it (DOC-AWC-FAMILY-CLAIM-RULE) #2385

Merged
syfyra merged 1 commit from upstream-pr/2385 into main 2026-12-01 15:22:00 +00:00
syfyra commented 2026-11-26 16:49:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by syfyra on 2026-11-26T16:49:31Z.


Claimed in the coordination issue as: DOC-AWC-FAMILY-CLAIM-RULE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198130080)

What and why

docs/audio.md (AWC names section) said: when two accepted families claim the same id in one bank, "the first family in sorted base order keeps it". Since 58a981e25, tools/awc_names.py _attack_split keeps the larger family:

prev = family_hits.get((b, i))
if prev is None or size > prev[2]:
    family_hits[(b, i)] = (name, "family", size)

The first base wins only between families of the same size, because Dictionary.bases is sorted and an equal-size later claim does not replace the first. The sentence now says that. The measured count (3 rows) is about which ids are contested, not who keeps them, so it stays.

Doc only; found while fixing #2384 (AWC-NAMES-FAMILY-SUFFIX-NUMBER), kept separate as its own topic. Merges cleanly with #1072, the only open PR that changes docs/audio.md.

Tested

  • The tests/test_docs_*.py files all pass.
  • scripts/check_no_game_data.py docs/audio.md.

GPUs tested: n/a (documentation)

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5513973729 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2385). Originally posted by [syfyra](https://github.com/syfyra) on 2026-11-26T16:49:31Z. --- Claimed in the coordination issue as: DOC-AWC-FAMILY-CLAIM-RULE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198130080) ### What and why `docs/audio.md` (AWC names section) said: when two accepted families claim the same id in one bank, "the first family in sorted base order keeps it". Since 58a981e25, `tools/awc_names.py` `_attack_split` keeps the **larger** family: ```python prev = family_hits.get((b, i)) if prev is None or size > prev[2]: family_hits[(b, i)] = (name, "family", size) ``` The first base wins only between families of the same size, because `Dictionary.bases` is sorted and an equal-size later claim does not replace the first. The sentence now says that. The measured count (3 rows) is about which ids are contested, not who keeps them, so it stays. Doc only; found while fixing #2384 (AWC-NAMES-FAMILY-SUFFIX-NUMBER), kept separate as its own topic. Merges cleanly with #1072, the only open PR that changes `docs/audio.md`. ### Tested - The `tests/test_docs_*.py` files all pass. - `scripts/check_no_game_data.py docs/audio.md`. GPUs tested: n/a (documentation) AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wavehs commented 2026-11-26 18:41:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-26T18:41:33Z.

Review: COMMENTED


macOS arm64 check of #2385 (DOC-AWC-FAMILY-CLAIM-RULE). One paragraph in docs/audio.md; no code changes.

Tested head fef08ed6c with its diff applied to a copy of main bdbc7e923 (branch 10 commits behind; clean).

Environment: Apple M3 Pro, arm64, macOS 27.2.1, CPython 3.15.2.

The claim matches the code
tools/awc_names.py:301-303 keeps a family hit unless the new one is strictly larger: if prev is None or size > prev[2]. Dictionary.bases() (:259-260) returns sorted(...), and _attack_split inserts the families in that order, so an equal size does not overwrite the first (sorted-base) family. That is exactly the new sentence: larger keeps the id, ties go to the first in sorted base order.

Checks run

  • All tests/test_docs_*.py and tests/test_i18n_index.py pass on the applied tree (the CI documentation set for a Markdown change); no file failed.
  • python -I scripts/check_no_game_data.py docs/audio.md: clean.

Negative control
There is none to run: reverting the sentence leaves every documentation test green, because no test pins this prose. I checked the statement against the _attack_split code above instead, which is the best available control for a doc-only change; the alternative would be a test that builds two colliding families, and awc_names only finds collisions by joaat search, so that is not a cheap fixture.

No game files. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6079101177 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2385#pullrequestreview-6079101177). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-26T18:41:33Z. **Review:** COMMENTED --- **macOS arm64 check of #2385** (DOC-AWC-FAMILY-CLAIM-RULE). One paragraph in `docs/audio.md`; no code changes. Tested head `fef08ed6c` with its diff applied to a copy of `main` `bdbc7e923` (branch 10 commits behind; clean). Environment: Apple M3 Pro, arm64, macOS 27.2.1, CPython 3.15.2. **The claim matches the code** `tools/awc_names.py:301-303` keeps a family hit unless the new one is strictly larger: `if prev is None or size > prev[2]`. `Dictionary.bases()` (`:259-260`) returns `sorted(...)`, and `_attack_split` inserts the families in that order, so an equal size does not overwrite the first (sorted-base) family. That is exactly the new sentence: larger keeps the id, ties go to the first in sorted base order. **Checks run** - All `tests/test_docs_*.py` and `tests/test_i18n_index.py` pass on the applied tree (the CI documentation set for a Markdown change); no file failed. - `python -I scripts/check_no_game_data.py docs/audio.md`: clean. **Negative control** There is none to run: reverting the sentence leaves every documentation test green, because no test pins this prose. I checked the statement against the `_attack_split` code above instead, which is the best available control for a doc-only change; the alternative would be a test that builds two colliding families, and `awc_names` only finds collisions by joaat search, so that is not a cheap fixture. No game files. AI-assisted.
MSedgeMC commented 2026-11-27 15:13:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T15:13:23Z.

Review: COMMENTED


Verified on the PR branch: python3 -m unittest discover -s tests -p 'test_docs_*.py' -> 52 tests OK. The documented rule matches tools/awc_names.py: family_hits is updated only when size > prev[2], so the larger family keeps a contested id and equal-size families keep the previously seen (sorted-base-order) entry. Not approving yet: the branch is 522 commits behind current main, so a rebase is needed first.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6090190339 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2385#pullrequestreview-6090190339). Originally posted by [MSedgeMC](https://github.com/MSedgeMC) on 2026-11-27T15:13:23Z. **Review:** COMMENTED --- Verified on the PR branch: python3 -m unittest discover -s tests -p 'test_docs_*.py' -> 52 tests OK. The documented rule matches tools/awc_names.py: family_hits is updated only when size > prev[2], so the larger family keeps a contested id and equal-size families keep the previously seen (sorted-base-order) entry. Not approving yet: the branch is 522 commits behind current main, so a rebase is needed first.
aslan2142 commented 2026-12-01 11:00:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:00:49Z.

Review: COMMENTED


Reviewed docs/audio.md against tools/awc_names.py: the updated tie-breaking rule (larger family wins; sorted base order breaks equal-size ties) matches _attack_split cleanly, passes clean-room inspection, and applies cleanly onto current main.

Please mark ready for review and trigger CI (change-scope + no-game-data) so it can be merged.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6129923723 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2385#pullrequestreview-6129923723). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:00:49Z. **Review:** COMMENTED --- Reviewed `docs/audio.md` against `tools/awc_names.py`: the updated tie-breaking rule (larger family wins; sorted base order breaks equal-size ties) matches `_attack_split` cleanly, passes clean-room inspection, and applies cleanly onto current `main`. Please mark ready for review and trigger CI (`change-scope` + `no-game-data`) so it can be merged. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 12:35:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:35:02Z.


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.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7311349678 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2385#issuecomment-7311349678). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:35:02Z. --- 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.)*
aslan2142 commented 2026-12-01 13:07:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:07:05Z.

Review: APPROVED


Now ready for review and MERGEABLE (1 commit). Clean-room verified: documents the contested AWC family tie-break rule in docs/audio.md matching tools/awc_names.py:301-303 (@wavehs, @MSedgeMC).

Approving — ready to merge once CI runs green on current main.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6131840927 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2385#pullrequestreview-6131840927). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T13:07:05Z. **Review:** APPROVED --- Now ready for review and `MERGEABLE` (1 commit). Clean-room verified: documents the contested AWC family tie-break rule in `docs/audio.md` matching `tools/awc_names.py:301-303` (`@wavehs`, `@MSedgeMC`). Approving — ready to merge once CI runs green on current `main`. *(AI-assisted review.)*
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2385
No description provided.