Skip to content

Improve Sort Operator (DYOD 2025) - #2720

Open
robert-oleynik wants to merge 186 commits into
masterfrom
dyod2025_group2
Open

robert-oleynik wants to merge 186 commits into
masterfrom
dyod2025_group2

Conversation

@robert-oleynik

Copy link
Copy Markdown
Contributor

No description provided.

dey4ss and others added 30 commits May 19, 2025 21:17
…d fix out of bounds vector accesses (#2700)

The update to gcc15 introduced some issues with the <ciso646> header, which is used by boost spinsort. It also introduced bounds checking for operator[] of vectors, which we violated. This PR fixes the issues caused by the upgrade to gcc15.
…d fix out of bounds vector accesses (#2700)

The update to gcc15 introduced some issues with the <ciso646> header, which is used by boost spinsort. It also introduced bounds checking for operator[] of vectors, which we violated. This PR fixes the issues caused by the upgrade to gcc15.

@Noel-Bastubbe Noel-Bastubbe 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.

The IPS4O algorithm is hard to follow, but you did a good job of structuring the code and adding useful comments. You followed the hyrise coding conventions very well.

Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
if (last_stripe == stripe_ranges.end()) {
last_stripe = --stripe_ranges.end();
}
DebugAssert(last_stripe != stripe_ranges.end(), "Bucket should end in last stripe");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This DebugAssert in combination with the if-condition before looks unintuitive. How can last_strip and stripe_ranges.end() be equal at that point?

Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
@robert-oleynik robert-oleynik self-assigned this Aug 14, 2025
@Bouncner

Copy link
Copy Markdown
Collaborator

Can you please merge the master? It's needed for full CI runs as a node crashed on our side and it will take some time to get it back online.

@Bouncner Bouncner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still haven't read all the code.

What would be help is a very brief high level description of IPSO. The paper has a very readable introduction of "buckets" and other terms.
Don't put too much effort in it, but a parapraph of the high level concept wiould be very helpful.

Comment thread CMakeLists.txt Outdated
Comment thread src/benchmark/benchmark_playground.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
if (column_info.nullable && segment_position.is_null()) {
*(normalized_key_start++) = normalized_null_value;
// Initialize actual key by setting all bytes to 0.
for (auto counter = size_t{0}; counter < column_info.width() - 1; ++counter) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why width() - 1?

Comment thread src/lib/operators/sort.cpp
Comment thread src/lib/operators/sort.cpp Outdated
if (value.size() < STRING_CUTOFF) {
copy_uint_to_byte_array(normalized_key_start, uint64_t{0}, column_info.long_width);
} else {
const auto iter = std::ranges::lower_bound(column_info.long_strings, value); // NOLINT

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add the name of the silenced rule to NOLINT.

Comment thread src/lib/operators/sort.cpp Outdated
Comment thread src/lib/operators/sort.cpp Outdated
@Bouncner Bouncner changed the title [DYOD 2025] Group2 Improve Sort Operator (based on DYOD 2025) May 26, 2026
@Bouncner Bouncner changed the title Improve Sort Operator (based on DYOD 2025) Improve Sort Operator (DYOD 2025) May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FullCI Run all CI tests (slow, but required for merge)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants