Rename the precondition helpers to short_circuit - #9406
Conversation
These helpers do not check a precondition. They compute the answer for the inputs that need no encoding-specific work and return it, so a caller treats `Some` as done. Every one of their doc comments already explained the name by reaching for a different word, which is the name they should have had. Renames all five, in `slice`, `dict::take`, `filter`, `fill_null`, and `between`, so one grep still finds the family. Rewords the shared doc template, which would otherwise read as "the short circuit short-circuits", and gives the `slice` helper the doc comment the other four already had. Updates the messages that name the mechanism, and leaves the unrelated uses of "precondition" that describe a real caller contract. Signed-off-by: "Connor" <connor@spiraldb.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Kc2AuwyEzVQBJLMbfVV36
Merging this PR will degrade performance by 0.95%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | words_gather_scalar[65536] |
8.3 µs | 9.4 µs | -12.1% |
| ❌ | Simulation | compress_fsst[(1000, 64, 8)] |
1 ms | 1.2 ms | -11.15% |
| ⚡ | Simulation | search_index_in_range_chunked |
5.8 ms | 5.2 ms | +12.06% |
| ⚡ | WallTime | words_gather_dispatch[1024] |
33 ns | 30 ns | +10% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ct/rename-precondition-short-circuit (9363149) with develop (1a493b6)2
Footnotes
-
89 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. ↩
-
No successful run was found on
ct/remove-to-compare-operator(41a7eaa) during the generation of this report, sodevelop(1a493b6) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Rationale for this change
These helpers do not check a precondition. They compute the answer for the inputs that need no encoding-specific work and return it, so a caller treats
Someas done. Every one of their doc comments already explained the name by reaching for a different word:StrictComparison::to_compare_operator#9405What changes are included in this PR?
Renames all five helpers, in
slice,dict::take,filter,fill_null, andbetween, so one grep still finds the family. Rewords the shared doc template, which would otherwise read as "the short circuit short-circuits", and gives theslicehelper the doc comment the other four already had.Also updates the messages that name the mechanism, including a
vortex_expectinvortex-fastlanes. The unrelated uses of "precondition" that describe a real caller contract are left alone, such asFilterKerneland theunsafeblocks.What APIs are changed? Are there any user-facing changes?
No API change and no behavior change. Every helper is private or
pub(super).Generated by Claude Code