Commit 36dd37b
feat(pcs): PCS_DUMP_PRE / _SEG / _CAP — compare all four heads, not one
Mirrors CrispEmbed 381857ab into both copies of pcs.cpp here (the shared
crisp_punc one and the src/ fallback), which test-copies-in-sync requires and
verifies.
PCS_DUMP_LOGITS covered post-punc only, so the pre, sentence-boundary and
truecase heads could be checked solely through their effect on the restored
string. Measured against a reference dumped from the model's own driving code
(the punctuators package, via CrispEmbed's tools/dump_pcs_reference.py), plain
q4_k gets all 67 post-punc decisions right and still turns "I'm OK" into
"I'm ok" — visible, but with one head dumped, unattributable. With all four:
post 67/67 pre 67/67 seg 67/67 cap 66/67 (token 37)
One token, one head: q4_k leaves the punctuation path alone and the whole cost
is the truecase head.
Written in one block after every head has finished, so the dumps are aligned by
construction rather than by three call sites agreeing about ordering. Append
mode matches PCS_DUMP_LOGITS.
PCS_DUMP_SEG deliberately has two columns — the 0.05-thresholded boundary (the
ONNX seg_preds output) and the hard argmax that conditions the truecase head —
because a bug in either produces wrong text and they disagree by design.
PCS_DUMP_CAP is per CHARACTER of the token, ▁ included, not one flag per token.
Verified: test-copies-in-sync 47/47, format.sh OK on 583 files, and CrispEmbed
built against this copy scores 67/67 on every head.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent afe300d commit 36dd37b
2 files changed
Lines changed: 100 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
796 | 797 | | |
797 | 798 | | |
798 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
799 | 849 | | |
800 | 850 | | |
801 | 851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
796 | 797 | | |
797 | 798 | | |
798 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
799 | 849 | | |
800 | 850 | | |
801 | 851 | | |
| |||
0 commit comments