-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Reflection] Support OpaqueExistential in RecordTypeInfo::readExtraInhabitantIndex #35433
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
[Reflection] Support OpaqueExistential in RecordTypeInfo::readExtraInhabitantIndex #35433
Conversation
This is an initial working version for macOS x86-64, in a specific case I was debugging in lldb. Still todo are:
|
@swift-ci test |
Nice! This is simpler than I thought it would be. (To be honest, I've not looked at this code in a little while...). I see a couple of other unimplemented cases that we might be able to fill in fairly quickly. I'll sketch out some test cases this afternoon to help push this forward. |
test cases sound great, thanks |
95b9897
to
1e58387
Compare
I've changed the base branch to |
I'm hoping to merge this soon, and then to cherry pick it to release/5.4. Are you ok with doing the other cases in a separate change because of this? I can add some tests for this case. Based on #30635, is |
Authored by Tim Kientzle @tbkka
@swift-ci test |
Build failed |
Ugh. Looks like I made a lot of obvious dump copy/paste errors in the 32-bit version. I'll work on that this afternoon... |
I'm surprised that Linux passed here. I'll have to double-check, but I thought Linux only had 4k extra inhabitants in 64-bit pointers, where macOS has 4G. |
…readExtraInhabitantIndex' of https://github.com/apple/swift into Reflection-Support-OpaqueExistential-in-RecordTypeInfo-readExtraInhabitantIndex
@swift-ci Please test macOS |
I did some fixes in 7ed7122, and I'll run the tests locally to iterate on them faster. |
I see we're both on it haha |
Build failed |
looking |
@swift-ci Please test macOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me. "Just" need to finish filling out the test suite for it.
Thanks for pushing this forward...
Thanks!
@tbkka Are you intending for "filling out the test suite" to be done in this PR or in a follow up?
thanks for your guidance. |
@swift-ci test Linux |
Sorry, I probably should have said "get this test suite to pass." I think the test we have is sufficient coverage, but it may still have some warts. More tests can follow in a subsequent PR, I think. |
The new test you wrote pass for the different architectures:
|
Removed |
@rjmccall and @jckarter – Is there any reason why different Linux platforms would have different extra inhabitant counts? This new test isn't passing on my Fedora 33 (x86-64) box and the test seems to assume that the maximum number of extra inhabitants for 64-bit platforms are all the same (which isn't true). |
Now I'm wondering if the tests are executed on the Linux build bots at all (as opposed to just my "unified build" setup). Let's find out: #35512 |
Ding. This test isn't triggering on the Linux bots but it is on my cmake / unified build:
I'm going to commit a workaround that unbreaks unified builds: #35513 |
@swift-ci Please test Linux |
On Linux, pointers only have 4096 extra inhabitants. that requires some finessing of the test. I'll work on that. |
Thanks. Do you think you'll have a fix soon or should I merge the workaround? |
Just in case this is something obvious — AFAIK the reflection tests are part of the validation tests. Is your bot running these? |
Yes, my bot always runs the validation tests. (They just take a few seconds.) I thought some of the Swift bots run the validation tests. Is that still true? |
I thought that "swift-ci test" ran validation tests "swift-ci smoke test" did not. But I may have misunderstood. Please merge a workaround for now. I may not get a fix ready until tomorrow. |
Support
OpaqueExistential
inRecordTypeInfo::readExtraInhabitantIndex()
.This missing support was identified when calling
projectEnumValue()
with a type ofAny?
. In that case, theprojectEnumValue
was returningfalse
becausereadExtraInhabitantIndex
returned false. ForOpaqueExistential
s,readExtraInhabitantIndex
should look at the type field (named "metadata"), and use that to determine extra inhabitants.Unblocks rdar://68171421