Commit d863aeb
committed
Add tests for per-request DRY sampling (C++ parse round-trips + model integration)
Two layers of coverage for the new InferenceParameters.withDry* feature, beyond
the existing InferenceParametersTest JSON-emission unit tests:
C++ (deterministic, no model — src/test/cpp/test_server.cpp, +5 → 194):
Happy-path ParamsFromJsonCmpl.Dry* tests pin that the exact JSON keys the Java
withers emit (dry_multiplier / dry_base / dry_allowed_length /
dry_penalty_last_n / dry_sequence_breakers) are the keys server-schema.cpp reads
into common_params_sampling. Verified against the b9829 parser; DRY parsing is
vocab-independent so they run with nullptr vocab like the existing schema tests.
An upstream field rename now fails here instead of silently disabling the feature.
Total C++ suite 454 → 459.
Java (model-gated — LlamaModelTest.testDrySamplingAltersRepetitiveGeneration):
End-to-end proof that the dry_* fields actually reach the native sampler. Greedy
decoding (withTopK(1)) + a fixed seed make two completions of the same
repetition-saturated prompt byte-identical unless the sampler changes; a strong
DRY config (multiplier 4.0, allowed_length 2, penalty_last_n -1) must diverge
from the DRY-disabled baseline. Self-skips via the class @BeforeAll
assumeTrue(model present), so it runs only in CI (codellama-7b.Q2_K), exactly
like the other model tests.
Updated the C++ test counts + test_server.cpp scope note in CLAUDE.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NoVagFhnb7af9DFSDzpsuY1 parent 6139223 commit d863aeb
3 files changed
Lines changed: 83 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
952 | | - | |
| 952 | + | |
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
958 | | - | |
| 958 | + | |
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1760 | 1760 | | |
1761 | 1761 | | |
1762 | 1762 | | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
1763 | 1801 | | |
1764 | 1802 | | |
1765 | 1803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
125 | 168 | | |
126 | 169 | | |
127 | 170 | | |
| |||
0 commit comments