Skip to content

Rename the precondition helpers to short_circuit - #9406

Draft
connortsui20 wants to merge 1 commit into
ct/remove-to-compare-operatorfrom
ct/rename-precondition-short-circuit
Draft

Rename the precondition helpers to short_circuit#9406
connortsui20 wants to merge 1 commit into
ct/remove-to-compare-operatorfrom
ct/rename-precondition-short-circuit

Conversation

@connortsui20

Copy link
Copy Markdown
Member

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 Some as done. Every one of their doc comments already explained the name by reaching for a different word:

Returns Some(result) if the precondition short-circuits the filter operation

What changes are included in this PR?

Renames all five helpers, 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.

Also updates the messages that name the mechanism, including a vortex_expect in vortex-fastlanes. The unrelated uses of "precondition" that describe a real caller contract are left alone, such as FilterKernel and the unsafe blocks.

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

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
@codspeed-hq

codspeed-hq Bot commented Aug 13, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 0.95%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
❌ 2 regressed benchmarks
✅ 1990 untouched benchmarks
⏩ 89 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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

Open in CodSpeed

Footnotes

  1. 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.

  2. No successful run was found on ct/remove-to-compare-operator (41a7eaa) during the generation of this report, so develop (1a493b6) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants