Skip to content

feat(pipeline-io): arena sort steps + N+2 coordination pipeline - #474

Merged
nh13 merged 1 commit into
feat-runallfrom
nh/sort-4-pipeline-io
Jul 7, 2026
Merged

nh13 merged 1 commit into
feat-runallfrom
nh/sort-4-pipeline-io

Conversation

@nh13

@nh13 nh13 commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

The typed-step sort pipeline over the arena engine: ReadBlocks admit, InflateToArena, FindBoundariesAndSort, SpillGather / SpillCompress / SpillWrite, and the detached SortMerge — wired for the N+2 model (serial coordination on a dedicated driver thread, N pool workers on pure de/compression). Removes the old and_spill step.

Intermediate PR (red CI expected): see the stack note below.


About this stack

This is a 6-PR stack that unifies the fgumi sort engine onto a single arena-based engine for all four sort orders (coordinate, queryname, template-coordinate, natural), retires the legacy sorters, and adds the N+2 threading model (serial coordination on dedicated driver threads, N pool workers on pure de/compression). The work is split one commit per crate to keep each diff small and reviewable.

Merge bottom-up:

  1. nh/sort-1-pipeline-core → feat-runall
  2. nh/sort-2-bgzf-verify → nh/sort-1-pipeline-core
  3. nh/sort-3-arena-engine → nh/sort-2-bgzf-verify
  4. nh/sort-4-pipeline-io → nh/sort-3-arena-engine
  5. nh/sort-5-cli → nh/sort-4-pipeline-io
  6. nh/sort-6-chains-wiring → nh/sort-5-cli

CI note: PRs 3–5 are the atomic engine-swap block — removing the legacy sorters leaves the workspace uncompilable until the consumers land in PR 6, so their standalone CI is red by construction. Correctness and the full green build are verified at the stack tip (PR 6): the whole suite passes (2258 tests), and sort output is byte-identical across all four orders (validated against the legacy engine and against main). Supersedes the single-squash PR #470.

Summary by CodeRabbit

  • New Features
    • Added a phase-separated sort pipeline with new stages for buffering, spill compression, spill gathering, spill writing, and configurable merge outputs (record-batch or framed-block).
    • Added reusable boundary scanning utilities for framed BGZF streams.
    • Added optional detached execution for selected steps.
  • Bug Fixes
    • Strengthened fail-closed validation for spill sequencing, merge lane mismatches, and incomplete/truncated boundary data.
    • Normalized decompression tuning edge cases (including zero-output budgets).
  • Performance
    • Added a serial-ingest microbenchmark for Phase-1 ingest comparisons.
  • Breaking Changes
    • Removed the legacy SortAndSpill/SortBamFile public API in favor of new pipeline steps.

@nh13
nh13 had a problem deploying to github-actions July 2, 2026 23:21 — with GitHub Actions Failure
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bcaaed85-9e9a-4665-afed-53bd52894bda

📥 Commits

Reviewing files that changed from the base of the PR and between 65ea7ca and 581657a.

📒 Files selected for processing (25)
  • CLAUDE.md
  • crates/fgumi-pipeline-io/Cargo.toml
  • crates/fgumi-pipeline-io/benches/serial_ingest.rs
  • crates/fgumi-pipeline-io/src/boundaries.rs
  • crates/fgumi-pipeline-io/src/lib.rs
  • crates/fgumi-pipeline-io/src/sink/write_bgzf.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/arena_ingest.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/merge.rs
  • crates/fgumi-pipeline-io/src/sort/merge/tests.rs
  • crates/fgumi-pipeline-io/src/sort/mod.rs
  • crates/fgumi-pipeline-io/src/sort/protocol.rs
  • crates/fgumi-pipeline-io/src/sort/sort_buffer.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write/tests.rs
  • crates/fgumi-pipeline-io/src/sort/tests.rs

Walkthrough

Replaces the legacy monolithic sort path with arena-backed ingest, split spill processing, tunable decompression, generic merge framing, detached writer support, and updated parity tests plus benchmark wiring.

Changes

Sort pipeline redesign

Layer / File(s) Summary
Protocol and export wiring
crates/fgumi-pipeline-io/src/boundaries.rs, crates/fgumi-pipeline-io/src/sort/protocol.rs, crates/fgumi-pipeline-io/src/lib.rs, crates/fgumi-pipeline-io/src/sort/mod.rs
BoundaryState scans BAM record limits and finalizes leftovers, MemoryChunkErased moves to arena-backed storage with updated heap sizing, and the crate/module exports are rewritten around the new pipeline surface.
Buffered ingest and inline spill compression
crates/fgumi-pipeline-io/src/sort/sort_buffer.rs, crates/fgumi-pipeline-io/src/sort/compress_spill.rs, crates/fgumi-pipeline-io/src/sort/compress_spill/tests.rs
SortBuffer stages arena-backed spill/residual outputs, and CompressSpill writes spill chunks inline while preserving routing metadata and backpressure behavior.
Block-parallel spill split
crates/fgumi-pipeline-io/src/sort/spill_gather.rs, crates/fgumi-pipeline-io/src/sort/spill_compress.rs, crates/fgumi-pipeline-io/src/sort/spill_write.rs and their tests.rs
SpillGather frames spill records into dense block ordinals, SpillCompress compresses ordered block events, and SpillWrite finalizes per-file spill output with contiguous file checks.
Spill decompression and generic merge
crates/fgumi-pipeline-io/src/sort/spill_decompress.rs, crates/fgumi-pipeline-io/src/sort/merge.rs and their tests
SortSpillDecompress adds tunable refill scheduling and block-parallel admission, while SortMerge becomes generic over output framing and adds fail-closed lane checks plus stats emission.
Parity tests, benchmark, and manifest wiring
crates/fgumi-pipeline-io/src/sort/tests.rs, crates/fgumi-pipeline-io/benches/serial_ingest.rs, crates/fgumi-pipeline-io/Cargo.toml
Pipeline parity tests move to the new phase-separated chain, a Criterion ingest benchmark is added, and Cargo feature/dev-dependency/bench wiring is updated.
Detached BGZF writer mode
crates/fgumi-pipeline-io/src/sink/write_bgzf.rs
WriteBgzfFile gains opt-in detached execution and switches its advertised step profile and detached-group selection accordingly.
Unsafe-code policy docs
CLAUDE.md
The approved unsafe sites for the arena ingest path are documented with their safety invariants.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: fgumi runall

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: arena-based sort steps plus the N+2 coordination pipeline.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nh/sort-4-pipeline-io

Comment @coderabbitai help to get the list of available commands.

@nh13
nh13 force-pushed the nh/sort-3-arena-engine branch from e4354d1 to 5832bac Compare July 3, 2026 00:12
@nh13
nh13 force-pushed the nh/sort-4-pipeline-io branch from ec74763 to e459eca Compare July 3, 2026 00:12
@nh13
nh13 had a problem deploying to github-actions July 3, 2026 00:12 — with GitHub Actions Failure
@nh13
nh13 had a problem deploying to github-actions July 3, 2026 00:12 — with GitHub Actions Failure
@nh13

nh13 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13

nh13 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

1 similar comment
@nh13

nh13 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13

nh13 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/fgumi-pipeline-io/benches/serial_ingest.rs`:
- Line 1: The bench crate root in serial_ingest is missing the crate-level
unsafe ban, so add the same crate-root deny attribute used by sibling benches to
keep parity with the coding guideline. Update the top of serial_ingest.rs,
alongside the existing bench crate declaration, to include the unsafe-code
denial at crate root so this benchmark crate is covered by the same policy.

In `@crates/fgumi-pipeline-io/src/sort/compress_spill.rs`:
- Around line 138-139: The intra-doc links in the module and function comments
are stale because fgumi_sort::write_sorted_chunk is no longer the target. Update
the documentation around compress_spill and the dispatch helper to reference
write_sorted_chunk_inmem and write_spill instead, using the existing doc
comments near the MemoryChunkErased dispatch logic so the links resolve
correctly.

In `@crates/fgumi-pipeline-io/src/sort/sort_buffer.rs`:
- Around line 318-334: The SortBuffer batch ingestion path is accumulating
multiple spill events in pending during a single RecordBatch, which lets memory
grow beyond a single chunk. Update the push loop in SortBuffer::push_batch
(around the sorter.push/take_sorted_chunk flow) so staged spills are drained or
yielded before continuing to ingest the rest of the batch, or otherwise bound
the upstream RecordBatch size, using the existing SortChunkEvent::Spill and
next_seq mechanics to keep retained memory near one memory_limit chunk.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7c20d957-21fe-44ba-a1cb-09815e522802

📥 Commits

Reviewing files that changed from the base of the PR and between 5832bac and e459eca.

📒 Files selected for processing (23)
  • crates/fgumi-pipeline-io/Cargo.toml
  • crates/fgumi-pipeline-io/benches/serial_ingest.rs
  • crates/fgumi-pipeline-io/src/boundaries.rs
  • crates/fgumi-pipeline-io/src/lib.rs
  • crates/fgumi-pipeline-io/src/sink/write_bgzf.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/arena_ingest.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/merge.rs
  • crates/fgumi-pipeline-io/src/sort/mod.rs
  • crates/fgumi-pipeline-io/src/sort/protocol.rs
  • crates/fgumi-pipeline-io/src/sort/sort_buffer.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write/tests.rs
  • crates/fgumi-pipeline-io/src/sort/tests.rs
💤 Files with no reviewable changes (2)
  • crates/fgumi-pipeline-io/src/sort/and_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill.rs

Comment thread crates/fgumi-pipeline-io/benches/serial_ingest.rs
Comment thread crates/fgumi-pipeline-io/src/sort/compress_spill.rs Outdated
Comment thread crates/fgumi-pipeline-io/src/sort/sort_buffer.rs
@nh13

nh13 commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13
nh13 force-pushed the nh/sort-3-arena-engine branch from 5832bac to 2d1e439 Compare July 5, 2026 01:45
@nh13
nh13 force-pushed the nh/sort-4-pipeline-io branch from e459eca to 9a11221 Compare July 5, 2026 01:45
@nh13
nh13 had a problem deploying to github-actions July 5, 2026 01:45 — with GitHub Actions Failure
@nh13
nh13 had a problem deploying to github-actions July 5, 2026 01:45 — with GitHub Actions Failure
@nh13
nh13 force-pushed the nh/sort-3-arena-engine branch from 2d1e439 to bf8e3d7 Compare July 5, 2026 01:54
@nh13
nh13 force-pushed the nh/sort-4-pipeline-io branch from 9a11221 to 41d6ad5 Compare July 5, 2026 01:54
@nh13
nh13 had a problem deploying to github-actions July 5, 2026 01:54 — with GitHub Actions Failure
@nh13
nh13 had a problem deploying to github-actions July 5, 2026 01:54 — with GitHub Actions Failure
@nh13
nh13 force-pushed the nh/sort-3-arena-engine branch from bf8e3d7 to 952ead0 Compare July 5, 2026 02:05
@nh13
nh13 force-pushed the nh/sort-4-pipeline-io branch from 41d6ad5 to 083a0de Compare July 5, 2026 02:08
@nh13
nh13 had a problem deploying to github-actions July 5, 2026 02:08 — with GitHub Actions Failure
@nh13
nh13 force-pushed the nh/sort-4-pipeline-io branch from 083a0de to dbc363a Compare July 5, 2026 04:03
@nh13
nh13 force-pushed the nh/sort-3-arena-engine branch from 952ead0 to 906ae33 Compare July 5, 2026 04:03
@nh13
nh13 had a problem deploying to github-actions July 5, 2026 04:03 — with GitHub Actions Failure
@nh13

nh13 commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13

nh13 commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13

nh13 commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
crates/fgumi-pipeline-io/src/sort/sort_buffer.rs (1)

303-341: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

pending can still stack multiple sealed chunks within one RecordBatch.

ingest_one_batch never stops once push() reports buffer_full; it keeps draining the rest of batch.iter_record_bytes(), sealing+staging a new Spill event into the unbounded self.pending VecDeque each time. If a single RecordBatch is large relative to memory_limit, this can stack several full sorted chunks in pending before try_run gets a chance to call emit_pending, contradicting the doc's "holding at most ~one spill chunk plus the live buffer" (lines 14-17). A near-identical pattern was flagged as a major/stability issue on a prior revision and marked resolved via bounding RecordBatch upstream — worth confirming that bound still holds here, since simply break-ing out of this loop would silently drop the batch's unconsumed records rather than fix the memory bound.

Please confirm RecordBatch byte/record caps stay well under memory_limit so at most one seal fires per ingest_one_batch call in practice.

🔎 Verification script
#!/bin/bash
# Locate RecordBatch's size/byte cap relative to memory_limit
rg -nP --type=rust -C4 'struct RecordBatch\b|impl RecordBatch\b' crates/fgumi-pipeline-io/src/types.rs
rg -nP --type=rust -C4 'RecordBatch::(new|with_capacity)|max_bytes|batch_bytes|target_batch' crates/fgumi-pipeline-io/src
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/fgumi-pipeline-io/src/sort/sort_buffer.rs` around lines 303 - 341,
`ingest_one_batch` in `SortBuffer` can enqueue multiple `SortChunkEvent::Spill`
entries in `pending` if a single `RecordBatch` is large, so verify the upstream
`RecordBatch` sizing/caps keep batches safely below `memory_limit` and ensure
the documented “at most ~one spill chunk plus the live buffer” invariant still
holds. Check the `RecordBatch` construction path and any byte/record limits used
by the pipeline, and if the cap is not guaranteed then adjust the batch-bound
logic rather than changing `ingest_one_batch` to stop early and drop remaining
records.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@crates/fgumi-pipeline-io/src/sort/sort_buffer.rs`:
- Around line 303-341: `ingest_one_batch` in `SortBuffer` can enqueue multiple
`SortChunkEvent::Spill` entries in `pending` if a single `RecordBatch` is large,
so verify the upstream `RecordBatch` sizing/caps keep batches safely below
`memory_limit` and ensure the documented “at most ~one spill chunk plus the live
buffer” invariant still holds. Check the `RecordBatch` construction path and any
byte/record limits used by the pipeline, and if the cap is not guaranteed then
adjust the batch-bound logic rather than changing `ingest_one_batch` to stop
early and drop remaining records.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bb08f119-7109-4ca9-bcb1-a48867ff463b

📥 Commits

Reviewing files that changed from the base of the PR and between cad863f and 36bed4c.

📒 Files selected for processing (25)
  • CLAUDE.md
  • crates/fgumi-pipeline-io/Cargo.toml
  • crates/fgumi-pipeline-io/benches/serial_ingest.rs
  • crates/fgumi-pipeline-io/src/boundaries.rs
  • crates/fgumi-pipeline-io/src/lib.rs
  • crates/fgumi-pipeline-io/src/sink/write_bgzf.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/arena_ingest.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/merge.rs
  • crates/fgumi-pipeline-io/src/sort/merge/tests.rs
  • crates/fgumi-pipeline-io/src/sort/mod.rs
  • crates/fgumi-pipeline-io/src/sort/protocol.rs
  • crates/fgumi-pipeline-io/src/sort/sort_buffer.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write/tests.rs
  • crates/fgumi-pipeline-io/src/sort/tests.rs
💤 Files with no reviewable changes (2)
  • crates/fgumi-pipeline-io/src/sort/and_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill.rs

@nh13
nh13 force-pushed the nh/sort-4-pipeline-io branch from 36bed4c to 65ea7ca Compare July 7, 2026 15:25
@nh13
nh13 had a problem deploying to github-actions July 7, 2026 15:25 — with GitHub Actions Failure
@nh13

nh13 commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nh13

nh13 commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
crates/fgumi-pipeline-io/src/sort/tests.rs (1)

2-5: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Module doc still references the retired SortAndSpill chain.

This line still reads "(SortAndSpill → SortSpillDecompress → SortMerge)." This is the exact text a previous review flagged as stale (noted as addressed in an earlier commit), but it's back/still present here — it doesn't mention SortBuffer/CompressSpill, which per the code (Line 417-419) is the actual production chain now.

📝 Suggested doc update
-//! (`SortAndSpill` → `SortSpillDecompress` → `SortMerge`).
+//! (`SortBuffer` → `CompressSpill` → `SortSpillDecompress` → `SortMerge`).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/fgumi-pipeline-io/src/sort/tests.rs` around lines 2 - 5, Update the
module-level docs in sort/tests.rs to reflect the current production pipeline
instead of the retired `SortAndSpill` chain. Specifically, revise the comment
near the top of the file that mentions `SortAndSpill` → `SortSpillDecompress` →
`SortMerge` so it matches the actual chain used by `RawExternalSorter`/the
streaming sort flow, including `SortBuffer` and `CompressSpill`. Keep the
wording aligned with the existing parity-oracle note around `sort_via_legacy` so
the docs accurately describe the current behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/fgumi-pipeline-io/src/sort/tests.rs`:
- Around line 189-203: The `drive_sort_buffer_pipeline` doc comment is stale and
still says the harness is “Coordinate-only,” which conflicts with
`sort_buffer_chain_matches_legacy_all_orders` using `TemplateCoordinate` and
`Queryname` via the same helper. Update the comment on
`drive_sort_buffer_pipeline` to describe the full set of supported sort orders
or remove the coordinate-only claim so the documentation matches the test matrix
and the current `SortBuffer` behavior.

---

Duplicate comments:
In `@crates/fgumi-pipeline-io/src/sort/tests.rs`:
- Around line 2-5: Update the module-level docs in sort/tests.rs to reflect the
current production pipeline instead of the retired `SortAndSpill` chain.
Specifically, revise the comment near the top of the file that mentions
`SortAndSpill` → `SortSpillDecompress` → `SortMerge` so it matches the actual
chain used by `RawExternalSorter`/the streaming sort flow, including
`SortBuffer` and `CompressSpill`. Keep the wording aligned with the existing
parity-oracle note around `sort_via_legacy` so the docs accurately describe the
current behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 590fc81d-ee93-4d8e-b4d9-18f4341bb9d2

📥 Commits

Reviewing files that changed from the base of the PR and between 36bed4c and 65ea7ca.

📒 Files selected for processing (25)
  • CLAUDE.md
  • crates/fgumi-pipeline-io/Cargo.toml
  • crates/fgumi-pipeline-io/benches/serial_ingest.rs
  • crates/fgumi-pipeline-io/src/boundaries.rs
  • crates/fgumi-pipeline-io/src/lib.rs
  • crates/fgumi-pipeline-io/src/sink/write_bgzf.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/arena_ingest.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill.rs
  • crates/fgumi-pipeline-io/src/sort/compress_spill/tests.rs
  • crates/fgumi-pipeline-io/src/sort/merge.rs
  • crates/fgumi-pipeline-io/src/sort/merge/tests.rs
  • crates/fgumi-pipeline-io/src/sort/mod.rs
  • crates/fgumi-pipeline-io/src/sort/protocol.rs
  • crates/fgumi-pipeline-io/src/sort/sort_buffer.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_compress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress.rs
  • crates/fgumi-pipeline-io/src/sort/spill_decompress/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather.rs
  • crates/fgumi-pipeline-io/src/sort/spill_gather/tests.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write.rs
  • crates/fgumi-pipeline-io/src/sort/spill_write/tests.rs
  • crates/fgumi-pipeline-io/src/sort/tests.rs
💤 Files with no reviewable changes (2)
  • crates/fgumi-pipeline-io/src/sort/and_spill.rs
  • crates/fgumi-pipeline-io/src/sort/and_spill/tests.rs

Comment thread crates/fgumi-pipeline-io/src/sort/tests.rs
The typed-step sort pipeline over the arena engine: ReadBlocks admit,
InflateToArena, FindBoundariesAndSort, SpillGather / SpillCompress /
SpillWrite, and the detached SortMerge — wired for the true N+2 model
(serial coordination on a dedicated driver thread, N pool workers on pure
de/compression). Removes the old and_spill step.

NOTE: intermediate commit of a stacked split (see commit 3).
@nh13
nh13 force-pushed the nh/sort-4-pipeline-io branch from 65ea7ca to 581657a Compare July 7, 2026 18:37
@nh13
nh13 had a problem deploying to github-actions July 7, 2026 18:37 — with GitHub Actions Failure
@nh13
nh13 merged commit 1de476a into feat-runall Jul 7, 2026
3 of 9 checks passed
@nh13
nh13 deleted the nh/sort-4-pipeline-io branch July 7, 2026 18:38
@nh13
nh13 restored the nh/sort-4-pipeline-io branch July 7, 2026 18:39
@nh13
nh13 deleted the nh/sort-4-pipeline-io branch July 7, 2026 18:40

This branch had an error being deployed

1 failed deployment
github-actions — 581657a6 Deployed Jul 7, 2026 by nh13 via coverage #1971
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.

1 participant