Commit 1faadd5
fix: drop arbitrary 20x cap on r3/v1 decompressed size
ZstdCompressor.compress() (used by the gateway-side r3_serializer)
embeds the uncompressed size in the frame header, so passing
max_output_size=len(compressed)*20 was both unnecessary and incorrect:
highly compressible router-replay payloads (e.g. tokens routing to a
small subset of experts) routinely exceed a 20:1 ratio, and would have
failed deserialization with ZstdError.
Removing the cap lets the library auto-allocate from the embedded
content size. Verified locally: a 64 KiB zero-filled matrix payload
compresses to ~35 bytes (>1800x ratio) and now deserializes cleanly.
Adds a regression test covering the high-compression case.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 8caac53 commit 1faadd5
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | | - | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
269 | 293 | | |
270 | 294 | | |
271 | 295 | | |
| |||
0 commit comments