Skip to content

[XLS] Add a more-precise model of OneHot for IntervalSets #2227

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

Merged
merged 1 commit into from
May 21, 2025

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented May 20, 2025

[XLS] Add a more-precise model of OneHot for IntervalSets

Rather than converting our IntervalSets to ternary values, trying to model the impact of one_hot there, then converting back with poor resolution - we instead test if each possible result bit can be set, and add it to our resulting IntervalSet if it can.

NOTE: The runtime performance of this should be O(I*n^2), where I is the number of intervals in the input val, and n is val.BitCount(), since CoversTernary runs in O(I*n) time.

@copybara-service copybara-service bot force-pushed the test_761253861 branch 3 times, most recently from 86f3083 to 095518f Compare May 21, 2025 17:16
Rather than converting our IntervalSets to ternary values, trying to model the impact of `one_hot` there, then converting back with poor resolution - we instead test if each possible result bit can be set, and add it to our resulting IntervalSet if it can.

NOTE: The runtime performance of this should be `O(I*n^2)`, where `I` is the  number of intervals in the input `val`, and `n` is `val.BitCount()`, since `CoversTernary` runs in `O(I*n)` time.
PiperOrigin-RevId: 761588016
@copybara-service copybara-service bot merged commit 4edd63c into main May 21, 2025
@copybara-service copybara-service bot deleted the test_761253861 branch May 21, 2025 17:58
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.

1 participant