Skip to content

feat(file): a coalescing IO service for planning-protocol scans - #10463

Closed
joseph-isaacs wants to merge 1 commit into
developfrom
ji/scan-v2-io
Closed

joseph-isaacs wants to merge 1 commit into
developfrom
ji/scan-v2-io

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Carved out of #10339 alongside the plan PR (#10462) and the planning PR. This PR is independent: it targets develop directly and does not depend on #10462. It adds the IO layer that the planner-driven scan reads through. Nothing drives it until the planning PR.

Changes

  • FileIoService. Coalesces the ranges a batch of planning-protocol requests or announcements asks for. Each range is read once for every session interested in it, and a dropped session's interest is withdrawn.
  • FileScanIo. Serves the same protocol through the file's segment source and read driver, sharing pending reads between live consumers.
  • Local and object-store reads.
    • Local files reuse their handles and admit native reads up to a bound.
    • Object-store reads stream completions as they land.
  • Read driver. Keeps its coalescing scratch between passes and can leave optional requests out of coalescing (VORTEX_SCAN_IO_COALESCE_OPTIONAL).
  • Segment caches. Can answer synchronously through SegmentCache::get_if_ready.
  • Tracing. Request trace ids.
  • Wiring. A file opened over a reader carries the service as VortexFile::scan_io; FileIoService is opt-in through its env settings.

Tests:

  • Unit tests for coalescing, shared reads, withdrawal and wake-ups are in segments::{io_service, scan_io}.
  • The end-to-end tests that scan through these services move to the planning PR, since they need the V2 scan.

Checks run:

  • cargo check -p vortex-io -p vortex-file -p vortex-layout --all-targets --all-features (after moving onto develop)
  • Earlier, on the stacked base: cargo clippy -p vortex-io -p vortex-file -p vortex-layout --all-targets --all-features -- -D warnings, cargo +nightly-2026-09-10 fmt, cargo test -p vortex-io -p vortex-file -p vortex-layout --lib

🤖 Generated with Claude Code

https://claude.ai/code/session_01N4PmceDHg8rFe5bgkhGFU9

@codspeed

codspeed Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 15%

⚠️ 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.

⚠️ 12 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚡ 6 improved benchmarks
✅ 2213 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ WallTime threshold_neon[64] 5.6 µs 4.5 µs +25.71%
⚡ WallTime threshold_neon[80] 5.6 µs 4.9 µs +14.9%
⚡ WallTime filter_neon[64] 3.3 µs 2.8 µs +14.9%
⚡ WallTime starts_with_avx512[8, VarBin] 46.2 µs 40.7 µs +13.57%
⚡ WallTime threshold_neon[8] 3.4 µs 3 µs +10.79%
⚡ WallTime starts_with_avx512[64, VarBin] 59.7 µs 53.9 µs +10.76%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ji/scan-v2-io (22871ce) with develop (ce04bf9)

Open in CodSpeed

Serves the planning protocol's `IoService` reads of a file:

- `FileIoService` coalesces the ranges a batch of requests or announcements
  asks for, reads each range once for every session interested in it, and
  withdraws a dropped session's interest. `FileScanIo` serves the same
  protocol through the file's segment source and read driver.
- Local files reuse their handles and admit native reads up to a bound;
  object-store reads stream completions as they land.
- The read driver keeps its coalescing scratch between passes and can
  leave optional requests out of coalescing.
- Segment caches can answer synchronously from `get_if_ready`.
- Request tracing ids for diagnostics.

A file opened over a reader carries the service as `VortexFile::scan_io`.
Nothing drives it yet; the planning scan that does follows separately.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P1oQtzTgSzkvrGDKisoNko
Signed-off-by: Claude <[email protected]>

Copy link
Copy Markdown
Contributor Author

Closing as superseded: this is the same change as #10548. V2 scans on develop read through SegmentScanIo over the file's SegmentSource, which uses the existing coalescing driver.


Generated by Claude Code

@robert3005
robert3005 deleted the ji/scan-v2-io branch November 10, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants