Skip to content
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

Migrate DataTree to the new IR #3818

Merged
merged 174 commits into from
Feb 5, 2024
Merged

Conversation

tybug
Copy link
Member

@tybug tybug commented Dec 19, 2023

Another step towards #3086.

Potential follow-up work to this PR:

Conversations of note:

@tybug tybug requested a review from Zac-HD as a code owner December 19, 2023 02:49
in a previous iteration I did not call kill_branch when discarding. I've since addressed this in (I believe) a more principled way, by removing sub-ir examples and thus discards.
@tybug tybug changed the title Migrate DataTree to new IR Migrate DataTree to the new IR Dec 19, 2023
Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

The approach makes sense, and it looks like a good start!

Due to holiday season I'm going to unsubscribe from notifications on push, so please @-mention me to request review again when that would be useful (or at latest when CI is green) 🚀

Copy link
Member Author

@tybug tybug left a comment

Choose a reason for hiding this comment

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

@Zac-HD round two! I still have failing tests to address and things to investigate, but I've left some comments I've run into since the last update. Tests are looking a fair bit greener than last time 🙂

@tybug
Copy link
Member Author

tybug commented Feb 1, 2024

There looks to be some infinite loops (or very slow tests) here 😕. See https://github.com/HypothesisWorks/hypothesis/actions/runs/7733984648/job/21087140454?pr=3818, which I cancelled after 3.5 hours. I'll try to narrow it down locally.

@tybug
Copy link
Member Author

tybug commented Feb 2, 2024

tracked the infinite loop down and fixed it: 5058f50

@tybug
Copy link
Member Author

tybug commented Feb 3, 2024

Seems to be a remaining flake:

File "/home/runner/work/hypothesis/hypothesis/hypothesis-python/tests/cover/test_error_in_draw.py", line 28, in test_error_is_in_finally
    assert "[0, 1, -1]" in "\n".join(err.value.__notes__)
AssertionError: assert '[0, 1, -1]' in 'Falsifying example: test(\n    d=data(...),\n)\nDraw 1: [1, 0, -20]'
 +  where 'Falsifying example: test(\n    d=data(...),\n)\nDraw 1: [1, 0, -20]' = <built-in method join of str object at 0x7f6f9665fe98>(['Falsifying example: test(\n    d=data(...),\n)', 'Draw 1: [1, 0, -20]'])
 +    where <built-in method join of str object at 0x7f6f9665fe98> = '\n'.join
 +    and   ['Falsifying example: test(\n    d=data(...),\n)', 'Draw 1: [1, 0, -20]'] = ValueError().__notes__
 +      where ValueError() = <ExceptionInfo ValueError() tblen=4>.value

but I ran this locally, n ~= 10k, and it never failed. Maybe my transcription was unfaithful?

There's also this failure, which I don't know how to interpret. Is INTERNALERROR indicative of a pytest-level failure?

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

(short review because it's late, forgive terseness - I thought you'd prefer this now than a more effusive review next week)

  • love it and looking forward to merging real soon now. Some style nitpicks in comments.
  • I think the INTERNAL ERRORs look like they're transient flakes? Suspicious that it's only on Windows, we might have gotten a bad worker or something. Hopefully vanishes on retry.
  • From checking CI times this might be a slight slowdown? I think it's acceptable for now to get this in, and we can profile + optimize once we finish the big port - the design is not intrinsically any slower than the status quo (quite the opposite)

@tybug
Copy link
Member Author

tybug commented Feb 4, 2024

I appreciate the early review here ❤️. I'll never complain about productive-but-direct reviews 🙂

From checking CI times this might be a slight slowdown? I think it's acceptable for now to get this in, and we can profile + optimize once we finish the big port - the design is not intrinsically any slower than the status quo (quite the opposite)

I noticed this the other day as well. From some light profiling it seems that simulate_test_function is now almost twice as expensive in some cases, due to creating examples while simulating via draw_*. It looks like this is especially impactful in the targeting phase?

Here's some profiling results for test_targeting_increases_max_length. Apologies for cropped screenshots, no reproducing code, etc. this was all a bit ad-hoc.

master this pr
image image

sub-ir examples go away when we migrate the shrinker, and this doesn't seem debilitating performance wise, so I'm ok with just moving forward here if you are. We could try threading a "dont start or stop examples" var through to draw_* if we wanted a stopgap measure, but I'm only moderately certain doing so wouldn't break things elsewhere (and it would be a bit messy to get right with all the places that need it).

@Zac-HD
Copy link
Member

Zac-HD commented Feb 5, 2024

Yep, let's just move forward.

I just merged the Black 2024 update so that's the formatting issue, and I think I've worked out the pytest crash too - I'll push a fix for those once the current merge finishes. And then if it's green... 🤞

@Zac-HD Zac-HD merged commit 30ded43 into HypothesisWorks:master Feb 5, 2024
48 checks passed
@Zac-HD
Copy link
Member

Zac-HD commented Feb 5, 2024

🥳🥳🥳🥳🥳🥳

@tybug tybug deleted the datatree-ir branch February 5, 2024 03:22
@tybug
Copy link
Member Author

tybug commented Feb 5, 2024

woo!

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.

3 participants