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

[Breaking Change] Simplify Refcounting #7448

Merged
merged 11 commits into from
Jan 11, 2025
Merged

[Breaking Change] Simplify Refcounting #7448

merged 11 commits into from
Jan 11, 2025

Conversation

bhansconnect
Copy link
Collaborator

Instead of -max_size to -1 for regular refcounts, use 1 to max_size. 0 still means constant refcount.
The highest bit is used to signify atomic refcounting required. This does not turn on any sort of atomic refcounting.

WARNING: This is a breaking change for plaforms that interact with roc refcounts. The platforms will still initialize refcounts to -max_size which is now wrong.

cc: @Anton-4 for thoughts on when to submit this.

Instead of -max_size to -1 for regular refcounts, use 1 to max_size.
0 still means constant refcount.
The highest bit is used to signify atomic refcounting required.
This does not turn on any sort of atomic refcounting.
@bhansconnect
Copy link
Collaborator Author

I must be missing a refcount change somewhere. As such, nqueens is not mutating in place. Thus a huge regression.

@bhansconnect
Copy link
Collaborator Author

Hmm... The regression must be linux or x86_64 specific. I am not seeing a regression on my m1 mac. Will do more testing later.

@bhansconnect
Copy link
Collaborator Author

Benchmarking fixed. Even improves perf by a tiny bit.

ayazhafiz
ayazhafiz previously approved these changes Jan 2, 2025
@@ -131,74 +127,7 @@ impl<'ctx> PointerToRefcount<'ctx> {
.allocation_alignment_bytes(layout_interner)
.max(env.target.ptr_width() as u32);

let context = env.context;
Copy link
Member

Choose a reason for hiding this comment

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

Very nice

@Anton-4
Copy link
Collaborator

Anton-4 commented Jan 3, 2025

@lukewilliamboswell lukewilliamboswell changed the title Simplify Refcounting [Breaking Change] Simplify Refcounting Jan 5, 2025
@Anton-4
Copy link
Collaborator

Anton-4 commented Jan 10, 2025

@lukewilliamboswell should we merge this now?

@bhansconnect bhansconnect merged commit 10ea93e into main Jan 11, 2025
19 checks passed
@bhansconnect bhansconnect deleted the simplify-refcount branch January 11, 2025 05:26
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.

4 participants