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

[SR-257] Resilient value type support -- umbrella bug #42879

Closed
slavapestov opened this issue Dec 17, 2015 · 2 comments
Closed

[SR-257] Resilient value type support -- umbrella bug #42879

slavapestov opened this issue Dec 17, 2015 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@slavapestov
Copy link
Member

Previous ID SR-257
Radar None
Original Reporter @slavapestov
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug
Assignee @slavapestov
Priority Medium

md5: 71461af5f8e45929bf61f8ab976cb55c

is blocked by:

  • SR-260 Add availability information to @_fixed_layout attribute
  • SR-256 [Resilience] Resilient case numbering
  • SR-258 Resilient class layout
  • SR-259 Resiliently-typed global variables
  • SR-261 Plumb ResilienceExpansion through SIL type lowering
  • SR-262 Write before/after tests for resilience
  • SR-264 Sort out lazy emission of accessors for fixed-layout structs
  • SR-265 Sort resilient enum cases, protocol requirements, virtual methods, etc by availability
  • SR-267 Don't build standard library with -sil-serialize-all
  • SR-268 Add build flag for building standard library with resilience enabled
  • SR-269 Implement ResilienceDomain abstraction
  • SR-263 Implement a general solution to prevent deadlocks when generic types rely on their own metadata recursively

Issue Description:

The goal here is to make client code resilient to changes in the internal representation of library types. In particular, we want the following changes to be resilient by default:

  • Adding a public or internal stored property to a struct

  • Removing a private or internal stored property from a struct, as long as it is not used from @transparent functions

  • Changing a struct stored property into a computed property, or vice versa

  • Adding a payload or no-payload case to an enum

  • Removing an internal case from an enum (not supported by Sema, but the calling convention changes are independent of that)

  • Adding a public or internal stored property to a class

  • Removing a private or internal stored property from a class, as long as it is not used from @transparent functions

  • Changing a class stored property into a computed property, or vice versa

  • Changing a global variable from a stored to computed or vice versa

To allow optimization, the @_fixed_layout attribute communicates the intent that the layout of a type is part of the interface and will not change. The layout is defined as follows:

  • For structs, the ordering and types of all stored properties must never change

  • For enums, the total set of all payload and no-payload cases must never change

Note that @_fixed_layout types can contain resiliently-typed properties or payloads, and have a dynamic size as a result.

@Dante-Broggi
Copy link
Contributor

Shouldn't this be on the ABI Dashboard?

@bob-wilson
Copy link

I don't think so. We're planning to add most of the support for resilience at the same time we stabilize the ABI, but otherwise, they're mostly orthogonal features. We could hypothetically freeze the ABI without any support for resilience at all (not that we would choose to do that).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants