feat: separate dictionary safety and correctness validation - #24
Conversation
Signed-off-by: Francesco Gargiulo <gargiulo.fr@gmail.com>
Signed-off-by: Francesco Gargiulo <gargiulo.fr@gmail.com>
|
|
Merging this PR will regress 4 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | decompress_all[("l_comment", 16)] |
14.3 ms | 19.4 ms | -26.3% |
| ❌ | WallTime | decompress_all[("o_comment", 12)] |
11.1 ms | 14.8 ms | -25.17% |
| ❌ | WallTime | decompress_all[("o_comment", 16)] |
13 ms | 16.7 ms | -22.08% |
| ❌ | WallTime | decompress_all[("l_comment", 12)] |
12 ms | 15.4 ms | -21.77% |
| ⚡ | WallTime | decompress_all[16] |
514.9 µs | 395.3 µs | +30.26% |
| ⚡ | WallTime | decompress_all[12] |
489.4 µs | 379.6 µs | +28.91% |
| ⚡ | WallTime | decompress_all[("p_name", 12)] |
769.1 µs | 630.6 µs | +21.96% |
| ⚡ | WallTime | train_and_compress[12] |
39.2 ms | 32.8 ms | +19.57% |
| ⚡ | WallTime | decompress_all[("p_name", 16)] |
701.8 µs | 588.6 µs | +19.24% |
| ⚡ | WallTime | train_and_compress[16] |
42.1 ms | 35.6 ms | +18.41% |
| ⚡ | WallTime | train_and_compress[("o_comment", 16)] |
507.8 ms | 441.6 ms | +14.98% |
| ⚡ | WallTime | train_and_compress[("p_name", 16)] |
42.2 ms | 37 ms | +14.02% |
| ⚡ | WallTime | train_and_compress[("l_comment", 12)] |
481.3 ms | 426.4 ms | +12.88% |
| ⚡ | WallTime | train_and_compress[("o_comment", 12)] |
401.5 ms | 357.4 ms | +12.33% |
| ⚡ | WallTime | train_and_compress[("l_comment", 16)] |
591.5 ms | 534.3 ms | +10.72% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/safety-correctness-validation (d3607a0) with develop (3f71342)
Footnotes
-
2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Summary
WideDictionary.Motivation
Consumers such as Vortex need to guarantee memory safety during decoding without paying the cost of full semantic validation. Malformed dictionaries may produce incorrect results, but must not cause out-of-bounds reads, writes, or non-terminating tokenization.
Testing
cargo build --all-features --all-targetscargo fmt --all --checkcargo clippy --all-features --all-targetscargo doc --no-deps --all-features --document-private-itemscargo test --workspace --all-featuresAll checks passed.