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

Revert Ref.read Ref.write to untracked because they're shared between IO and Scope interfaces. #5474

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented Dec 3, 2024

Overview

When adding the new Ref instructions I had incidentally changed Ref.read and Ref.write from Untracked -> Tracked;
This caused tests in base to fail because they're triggering sandboxed IO detection.

In theory operations on Ref IO should be tracked and on Ref Scope should be untracked, but since they both use the same builtins underneath that's not currently possible.

This PR reverts the tracking to this state:

Untracked "Ref.read" 
Untracked "Ref.write" 
Tracked "Ref.readForCas" 
Tracked "Ref.Ticket.read" 
Tracked "Ref.cas" 

Which seems a bit strange, but is the most conservative we can make it at the moment.

It's notable that readForCas, Ticket.read and Ref.cas only apply to IO refs anyways, but weirdly Ticket.read doesn't actually have IO in its type even though it uses IO in the runtime implementation and is marked as Tracked.

The logic for now is just to revert it to what we had before 🤷🏼

Implementation notes

Swap the tracking back to its previous state

Test coverage

  • run the base tests.

@ceedubs
Copy link
Contributor

ceedubs commented Dec 3, 2024

weirdly Ticket.read doesn't actually have IO in its type even though it uses IO in the runtime implementation and is marked as Tracked

That does sound a bit suspicious. @SystemFw and @dolio was that an intentional choice?

@SystemFw
Copy link
Contributor

SystemFw commented Dec 3, 2024

I don't think it should have IO in its type, it's basically an immutable Box. Can you point me to where it uses IO in its implementation?

@ChrisPenner
Copy link
Contributor Author

@SystemFw ah, never mind, I was mistaken 👍🏼

@ChrisPenner ChrisPenner marked this pull request as ready for review December 3, 2024 21:06
@ChrisPenner ChrisPenner merged commit 67575ee into trunk Dec 3, 2024
32 checks passed
@ChrisPenner ChrisPenner deleted the cp/untracked-ref branch December 3, 2024 21:08
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