Commit 40dcf54
feat(compare): one narrative paragraph per interactivity target with templated variety
compareTableNarrative now returns string[] — one paragraph per ssrRow (3
default targets, so 3 paragraphs per slug page). Each paragraph picks a
template from a per-situation pool:
- PER_DOLLAR_BOTH_TEMPLATES — 6 variants for the cost-only narrative
- PER_DOLLAR_TIED_TEMPLATES — 3 variants for the near-tie case
- PER_DOLLAR_ZERO_TEMPLATES — 2 variants for zero-cost edge case
- PER_DOLLAR_SINGLE_TEMPLATES — 3 variants for one-GPU-only rows
- FULL_BOTH_TEMPLATES — 6 variants for cost+throughput narrative
- FULL_SINGLE_TEMPLATES — 3 variants for one-GPU-only rows in full mode
Template selection is SSR-deterministic via pickRotated(pool, pageSeed,
rowIndex): the per-page hash picks where to START in the rotation; rowIndex
advances by 1 from there. Result:
- Same page renders the same 3 paragraphs every request (SSR + hydration
agree, crawlers see stable text)
- Different pages start at different points in the rotation → catalog
reads with variety
- Within a page, the 3 paragraphs always use 3 *distinct* templates —
rotation avoids the birthday-problem collisions that random sampling
of 3 from 6 produces
Page-client renders the paragraph array, with the "(default selection)"
caveat appended only to the last paragraph so the block reads as one piece
of prose instead of three separate footnotes.
Verified live: /compare-per-dollar/deepseek-v4-b200-vs-mi355x renders three
different templates at 17/30/42 tok/s/user;
/compare-per-dollar/kimi-k26-mi300x-vs-mi355x starts at a different template
and also rotates through three distinct ones at 21/28/36 tok/s/user.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 10473c3 commit 40dcf54
3 files changed
Lines changed: 362 additions & 99 deletions
File tree
- packages/app/src
- app
- compare-per-dollar/[slug]
- compare/[slug]
- lib
Lines changed: 26 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
141 | | - | |
142 | | - | |
143 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
144 | 147 | | |
145 | 148 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
153 | 166 | | |
154 | 167 | | |
155 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
| |||
0 commit comments