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 generate_novel_prefix to the typed choice sequence #4172

Merged
merged 4 commits into from
Nov 15, 2024

Conversation

tybug
Copy link
Member

@tybug tybug commented Nov 14, 2024

Depends on #4173. Uses NodeTemplate to implement "please give me the simplest possible node".

Changing the randomness interpretation in the prefix flushed out a few (likely latent?) issues with our deterministic with deterministic_PRNG tests. I've marked these, and plan to return to them when the ir settles, but can bump them up in priority if you think they're important.

@tybug tybug requested a review from Zac-HD as a code owner November 14, 2024 04:18
@tybug
Copy link
Member Author

tybug commented Nov 14, 2024

OK, I think I clearly need to split this out into (1) implement NodeTemplate and (2) migrate generate_novel_prefix.

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.

Exciting times!

Comment on lines +206 to +211
# TODO_IR the shrinker gets stuck when the first failure is math.inf, because
# downcasting inf to a float32 overflows, triggering rejection sampling which
# is then immediately not a shrink (specifically it overruns the attempt data).
#
# this should be resolved by adding float widths to the ir.
assert xp.sum(smallest) in (1, 50) or all(math.isinf(v) for v in smallest)
Copy link
Member

Choose a reason for hiding this comment

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

Ouch! Makes sense, but it's going to be pretty annoying especially with #3959 on the wishlist...

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah...I can take a look at that issue ~next. It will either be relatively simple (downcast at the ir layer and float_to_int "just works") or very annoying because of solved-by-ir interactions.

Copy link
Member

Choose a reason for hiding this comment

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

If it doesn't turn out to be simple, I'd leave it for later - finishing off the IR migrations is higher priority.

TIME_INCREMENT = 0.001
TIME_INCREMENT = 0.0001
Copy link
Member

Choose a reason for hiding this comment

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

Say more about what prompted this?

Copy link
Member Author

Choose a reason for hiding this comment

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

NodeTemplate("simplest", ...) uses buffer_to_ir which instantiates ConjectureData which calls time.time(), invoking _consistently_increment_time even though little work is actually happening. post-IR we should be able to revert this.

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.

2 participants