Inferred hair table: match assets by piece names, clean up pieces #545

Manually merged
github merged 1 commit from github-bot/gh-545 into gh-pr/545/base 2026-11-28 06:00:02 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-28 05:44 UTC · original
holdmysocks:people/hair-guess → master · +173 −44 · 1 files · 1 commits · merged 2026-11-28 05:55 UTC

When the stored hair link can't be read, SixNG guesses the hair table. This makes the guess much better.

Changes

  • An asset is tied to the placeholder its piece ids hash from (placeholder base + piece word, using the piece-word list we already have). Tag words are used only when no piece id resolves. This cuts ambiguous assets from 103 to 12.
  • Groom chains that hold the start of another piece are cut. A file with no fewer strands than the one before it starts a new piece (lashes, for example). Chains of two files, or of five or more, are cut at their largest root-box jump.
  • LODs left behind as separate pieces join one of the three pieces before them that has the same root box (to 0.5 mm), the same bones and more strands.
  • In the walk, a run one piece short is likelier than one piece long (−2 vs −4.5). A listed piece whose data another piece already has is stored only once.
  • Hair cache version goes to 6, so old inferred tables are rebuilt.

Measured against the stored link on the base game:

  • Exact placeholder matches: 298 → 487 of 878.
  • Hair: 203 → 370. Beard: 63 → 81. Brows unchanged at 21/25. Lashes still 2/31.
  • Links at confidence 0.8 and up are 193/208 right.

Not fixed: assets the archive stores away from their name order (for example Vicki's bun, still taken by the asset that sorts just before it). Their real pieces get absorbed by neighbours, so order and counts can't place them. I tried a post-pass that would move them into free runs, but it never fired, so it's not included.

Tests: core 409, gui 68, cli pass. New tests: odd_chains_split, split_lods_join.

**@⁠holdmysocks** on GitHub · 2026-11-28 05:44 UTC · [original](https://github.com/holdmysocks/SixNG/pull/545) `holdmysocks:people/hair-guess` → `master` · +173 −44 · 1 files · 1 commits · merged 2026-11-28 05:55 UTC When the stored hair link can't be read, SixNG guesses the hair table. This makes the guess much better. **Changes** - An asset is tied to the placeholder its piece ids hash from (placeholder base + piece word, using the piece-word list we already have). Tag words are used only when no piece id resolves. This cuts ambiguous assets from 103 to 12. - Groom chains that hold the start of another piece are cut. A file with no fewer strands than the one before it starts a new piece (lashes, for example). Chains of two files, or of five or more, are cut at their largest root-box jump. - LODs left behind as separate pieces join one of the three pieces before them that has the same root box (to 0.5 mm), the same bones and more strands. - In the walk, a run one piece short is likelier than one piece long (−2 vs −4.5). A listed piece whose data another piece already has is stored only once. - Hair cache version goes to 6, so old inferred tables are rebuilt. **Measured** against the stored link on the base game: - Exact placeholder matches: 298 → 487 of 878. - Hair: 203 → 370. Beard: 63 → 81. Brows unchanged at 21/25. Lashes still 2/31. - Links at confidence 0.8 and up are 193/208 right. **Not fixed:** assets the archive stores away from their name order (for example Vicki's bun, still taken by the asset that sorts just before it). Their real pieces get absorbed by neighbours, so order and counts can't place them. I tried a post-pass that would move them into free runs, but it never fired, so it's not included. **Tests:** core 409, gui 68, cli pass. New tests: `odd_chains_split`, `split_lods_join`.
Without the stored link the hair table is guessed. The guess now
- ties an asset to the placeholder whose name its piece ids hash from
  (base + piece word), before falling back to tag words;
- cuts groom chains that hold the start of another piece: a file with no
  fewer strands than the one before, and chains of two or five or more
  files at their largest root-box jump;
- joins LODs left as pieces to one of the three pieces before them with
  the same root box, bones and more strands;
- makes a run one piece short likelier than one piece long.

Against the stored link on the base game this lifts exact matches from
298 to 487 of 878 placeholders; links at confidence 0.8 and up are 93%
right. Cache version 6 rebuilds old inferred tables.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:54:25 +00:00
github-bot changed target branch from master to gh-pr/545/base 2026-11-28 06:00:01 +00:00
github manually merged commit fe5546f48c into gh-pr/545/base 2026-11-28 06:00:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.