Skip to content

box: fix drop_while integration with index:pairs#10736

Merged
sergepetrenko merged 2 commits intomasterfrom
drewdzzz/pairs_drop_while
Oct 30, 2024
Merged

box: fix drop_while integration with index:pairs#10736
sergepetrenko merged 2 commits intomasterfrom
drewdzzz/pairs_drop_while

Conversation

@drewdzzz
Copy link
Contributor

Since our index iterators are stateful (can return different values with the same state passed), old luafun drop_while implementation didn't work well with them - it was skipping an extra element. The PR bumps luafun and resolves this issue.

Closes #6403

@drewdzzz drewdzzz requested a review from a team as a code owner October 23, 2024 15:58
@coveralls
Copy link

coveralls commented Oct 23, 2024

Coverage Status

coverage: 87.305%. remained the same
when pulling 51e1cf8 on drewdzzz/pairs_drop_while
into 511e0f5
on master
.

Copy link
Collaborator

@Buristan Buristan left a comment

Choose a reason for hiding this comment

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

Hi, Andrey!
Thanks for the patchset!
I will proceed with the review per-patch below.

Side note: I'd rather add the benchmark in separate PR to compare results before submodule bump and after, but this is insignificant due to our unstable results since we are not using only one specific machine for it.


[PATCH 1/2] luafun: bump submodule

LGTM, except a few nits regarding the commit message and the comments.

with the same state passed), old drop_while implementation didn't

Typo: s/old/the old/

Note that there are still methods that doesn't work correctly with

Typo: s/doesn't/don't/

Copy link
Collaborator

@Buristan Buristan left a comment

Choose a reason for hiding this comment

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

[PATCH 2/2] perf: introduce perf test for luafun

Thanks for the patch!
I'm glad to see that we are adding new benchmarks:)!

Please consider my comments below.

You've mentioned several special cases in luafun/luafun@90967c98. Are they insingnificant (or too syntetic) to be added?

@Buristan Buristan assigned drewdzzz and unassigned Buristan Oct 24, 2024
@Totktonada Totktonada removed their assignment Oct 24, 2024
@drewdzzz drewdzzz force-pushed the drewdzzz/pairs_drop_while branch 2 times, most recently from 203093d to 406b477 Compare October 28, 2024 14:39
The commit bumps luafun to the new version with a bunch of bugfixes:
* Now `chain` works correctly with iterators without `param`.
* Now `drop_while` supports stateful iterators.
* The module is populated with missing `maximum_by` alias of `max_by`.
* Now `nth` and `length` work correctly with other luafun iterators.

Since our index iterators are stateful (can return different values
with the same `state` passed), the old `drop_while` implementation
didn't work well with them - it was skipping an extra element.
The bump resolves this issue.

Note that there are still methods that don't work correctly with
`index:pairs` - `cycle`, `head` and `is_null`.

Closes #6403

NO_DOC=bugfix
When fixing `drop_while` function in `luafun` submodule, we wrote a
benchmark to choose the most efficient solution - let's put it to our
perf test suite. The commit creates a new perf test for `luafun` module
and puts there above-mentioned benchmark.

NO_TEST=perftest
NO_CHANGELOG=perftest
NO_DOC=perftest
@drewdzzz drewdzzz force-pushed the drewdzzz/pairs_drop_while branch from 406b477 to 51e1cf8 Compare October 28, 2024 14:42
@drewdzzz
Copy link
Contributor Author

drewdzzz commented Oct 28, 2024

Added other cases from original benchmark - drop_all and drop_none subcases.

@drewdzzz drewdzzz requested a review from Buristan October 28, 2024 15:24
@drewdzzz drewdzzz assigned Buristan and unassigned drewdzzz Oct 28, 2024
Copy link
Collaborator

@Buristan Buristan left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes!
LGTM!
I asked Alexander to take one more look at the PR since new benchmarks were added.

@Buristan Buristan requested a review from Totktonada October 29, 2024 08:21
@Buristan Buristan added the full-ci Enables all tests for a pull request label Oct 29, 2024
@Buristan Buristan assigned Totktonada and unassigned Buristan Oct 29, 2024
Copy link
Contributor

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

I've no objections. Thanks for the updates!

@Totktonada Totktonada removed their assignment Oct 29, 2024
@drewdzzz
Copy link
Contributor Author

Who will merge the patch?
Also, should be cherry-picked to 3.2 and 2.11 (I don't put the label not to trigger full-CI again).

@Totktonada
Copy link
Contributor

In my understanding of the process it is in the responsibility of @sergepetrenko.

@sergepetrenko sergepetrenko merged commit 6ae595f into master Oct 30, 2024
@sergepetrenko sergepetrenko deleted the drewdzzz/pairs_drop_while branch October 30, 2024 12:58
@sergepetrenko
Copy link
Collaborator

sergepetrenko commented Oct 30, 2024

Backports (decided to backport the perf test as well for the sake of possible future perf comparisons. Only backported the perf test to 3.2 because 2.11 lacks the necessary infrastructure).
3.2 #10767
2.11 #10768

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

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

box.space[YOUR_SPACE]:pairs:drop_while() does not work properly

6 participants