Skip to content

Implement better diff for run-tests.php #10875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

iluuu1994
Copy link
Member

@iluuu1994 iluuu1994 commented Mar 18, 2023

Diffing algorithm is borrowed from sebastian/diff

Fixes GH-10806

@mvorisek Does this fix the problem for you?

Diffing algorithm is borrowed from bless_tests.php

Fixes phpGH-10806
@iluuu1994 iluuu1994 force-pushed the run-tests-better-diff branch from 0996960 to e5e8366 Compare March 18, 2023 11:02
@nielsdos
Copy link
Member

Nit: I think it would be a bit nicer if the diffing code of bless_tests.php and the now run-tests.php was extracted to a separate .php file that can be included, to reduce duplication. :)

@iluuu1994
Copy link
Member Author

The file is part of the distribution and might be copied separately, I wanted to avoid a new file that has to be copied for it to stay functional. Maybe we could create a functional diff file though that can be patched to avoid the diffing in bless.php.

@nielsdos
Copy link
Member

Aha okay, TIL. Best to ignore my comment then :-)

@mvorisek
Copy link
Contributor

Thank you. I can confirm this PR fixes the issue described in #10806.

to reduce duplication

I wanted to avoid a new file that has to be copied for it to stay functional.

AFAK this is required for run-tests.php, bless_tests.php is internal file only, what about including run-tests.php from bless_tests.php and dedupling bless_tests.php instead?

@iluuu1994 iluuu1994 force-pushed the run-tests-better-diff branch from 3676918 to f82ee7a Compare March 19, 2023 00:13
@iluuu1994
Copy link
Member Author

iluuu1994 commented Mar 19, 2023

Turns out that algorithm uses a lot of memory (~200MB for a failing ASAN test, which is why the ASAN build crashed). I've switched it out for sebastian/diff with the MemoryEfficientLongestCommonSubsequenceCalculator. It still needs to be cleaned up, so no need for a review just yet.

@iluuu1994 iluuu1994 force-pushed the run-tests-better-diff branch from f82ee7a to cfdcd74 Compare March 19, 2023 09:26
@iluuu1994 iluuu1994 force-pushed the run-tests-better-diff branch from 353e518 to 15b87e6 Compare March 19, 2023 09:41
@iluuu1994
Copy link
Member Author

This should be ready. Since it's using a different algorithm from bless_tests.php uniforming them is no longer relevant, or can be done in a separate step.

@iluuu1994
Copy link
Member Author

@mvorisek Sorry, since I basically completely changed the implementation it would be great if you could retest if this solves the problem for you.

@iluuu1994 iluuu1994 closed this in ac961bb Mar 22, 2023
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.

run-tests.php diff dump is broken
3 participants