Skip to content

Queue phrase alignment after the last kind-word round, and let it wait while one is pending - #926

Merged
WaylandYang merged 3 commits into
devfrom
fix/alignment-waits-for-kind-words
Sep 25, 2026
Merged

WaylandYang merged 3 commits into
devfrom
fix/alignment-waits-for-kind-words

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

First of the alignment-cost cuts after #918/#920.

Kind-word alignment queued phrase alignment at the end of every round, including a round that had just queued another round of itself because new words had arrived. On the typed-graph bench (run 3) the second kind-word round (562 words) and the first phrase round (1010 signatures) ran side by side; the kind words re-bound classes under the signatures, their fingerprints changed, and the next phrase round re-decided 713 of them. Two fifths of the phrase decisions in that run were repeats.

  • Kind-word alignment queues phrase alignment only from a round that queues no further round of itself.
  • Phrase alignment, whichever entry queued it, checks for a queued or running kind-word job on its base before taking its lock; if there is one it queues itself for half a minute later (enqueue_unless_queued_after, at most one queued) and returns.
  • jobs::pending_for_kb looks a job kind up by the base in its payload, since a reask payload carries an extra key.

No decision changes; only when the phrase rounds run. Verified: the kind-word reask test asserts phrase alignment is not queued while a reask is pending and is queued from the final round; a new phrase test asserts nothing is asked while a kind-word job is queued, one deferred round exists, and the votes are asked once it is gone. Alignment suites 14/14 and 11/11, workspace clippy clean. A bench group on this branch follows in the README before merging.

🤖 Generated with Claude Code

WaylandYang and others added 2 commits September 26, 2026 04:38
…t while one is pending

Kind-word alignment queued phrase alignment at the end of every round,
including a round that had just queued another round of itself because
new words had arrived. On the typed-graph bench the second kind-word
round (562 words) and the first phrase round (1010 signatures) then ran
side by side; the kind words re-bound classes under the signatures, the
signatures' fingerprints changed, and the next phrase round re-decided
713 of them. Two fifths of the phrase decisions were repeats.

Kind-word alignment now queues phrase alignment only from a round that
queues no further round of itself (no new or stale words, and no reask
pending or reasks exhausted). Phrase alignment, whichever entry queued
it, checks for a queued or running kind-word job on its base before it
takes its lock and, if there is one, queues itself for half a minute
later and returns.

Tests: the kind-word reask test asserts that phrase alignment is not
queued while a reask is pending and is queued from the final round; a
phrase test asserts nothing is asked while a kind-word job is queued,
one deferred phrase round exists, and the votes are asked once the
kind-word job is gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
…00 facts by default

Two groups on the branch and one on dev at the same hour, same corpus,
model and judge. Signatures are clean (about 1000 transitional "none"
rows gone, phrase decisions 1847 to 980), recall unchanged, tokens
nearly unchanged because the repeated decisions were cheap. With 600
judged facts the branch and dev are indistinguishable (77.2 / 81.8
against 81.7 / 82.0); with 200 the same base scored 70.6 and 81.8, so
--judge now defaults to 600 and the README says earlier precisions are
200-sample figures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
@WaylandYang

Copy link
Copy Markdown
Contributor Author

Measured before merging (README, 第五次真跑): two groups on this branch and one dev control at the same hour. Signatures are clean (about 1000 transitional none rows gone; phrase decisions 1847 → 980), recall unchanged, tokens nearly unchanged because the repeated decisions were cheap. Judged precision with 600 facts: 77.2% / 81.8% on the branch against 81.7% / 82.0% on dev, indistinguishable; the 200-sample figures swung by ten points on the same base, so the bench's default is now 600.

@WaylandYang
WaylandYang merged commit b3919ca into dev Sep 25, 2026
7 checks passed
@WaylandYang
WaylandYang deleted the fix/alignment-waits-for-kind-words branch September 25, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant