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

DynamicCastRework, Part 2: Test Suite #33473

Closed

Conversation

tbkka
Copy link
Contributor

@tbkka tbkka commented Aug 14, 2020

This validation test exercises a large matrix of types and invariants for
dynamic casting. It's formulated as a Python script that emits a number of
Swift test programs, compiles, and executes them. The programs are compiled in
Swift 4 and 5 mode, with -O and -Onone.

The invariants used by these tests follow the specification presented
in PR #33010. It should be easy to add more as desired.

I've tried to design this in such a way that CI logs can provide enough
information to narrowly identify the problem area: Separate test cases
are generated for each invariant and each type (in particular, this helps
with compiler crashes that report the full body of the function in question).
The files and test suites are named to identify the optimization mode.

The goal of this test suite is to cover a broad cross-section of casting
capabilities and combinations, and to make it easy to expand the matrix of
combinations. New invariants can easily be added and applied to many types;
as new types are added to this test, they can exploit the existing invariants
and be exercised across all optimization modes.

@tbkka
Copy link
Contributor Author

tbkka commented Aug 14, 2020

A few important notes:

  1. This is another part of the work begun with PR Overhaul swift_dynamicCast #29658.
  2. This is the broadest of the test work from that effort, but there are many other test changes and additions that will land with the various code changes.
  3. I expect this test suite will cover everything from the specification in PR DynamicCast Rework, Part 1: Specification #33010 by the time it is merged.
  4. This PR will only be merged after the associated code changes are merged.

@tbkka
Copy link
Contributor Author

tbkka commented Aug 14, 2020

@swift-ci Please test Linux

@tbkka
Copy link
Contributor Author

tbkka commented Aug 14, 2020

Please test with the following pull request:
#29658

@swift-ci Please test macOS platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2ca7e86b20be7c1a01eaefb0aa68d2fafc4e7847

@tbkka
Copy link
Contributor Author

tbkka commented Aug 14, 2020

@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2ca7e86b20be7c1a01eaefb0aa68d2fafc4e7847

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2ca7e86b20be7c1a01eaefb0aa68d2fafc4e7847

@tbkka
Copy link
Contributor Author

tbkka commented Aug 14, 2020

@swift-ci Please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2ca7e86b20be7c1a01eaefb0aa68d2fafc4e7847

@tbkka
Copy link
Contributor Author

tbkka commented Aug 17, 2020

@swift-ci Please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 60f3bfd9302ccca60c3668c23acb976f017c407e

@atrick
Copy link
Contributor

atrick commented Aug 17, 2020

It's very exciting to see a tested, hopefully complete, specification shared by the runtime and optimizer!

@tbkka
Copy link
Contributor Author

tbkka commented Aug 20, 2020

/pull/33561
@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3cff56feb665638b49d99d2a50e4b2b2837730b8

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 994971113f931b4bc2e90e4cf34be27ee36fbc0b

@tbkka
Copy link
Contributor Author

tbkka commented Sep 1, 2020

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Sep 1, 2020

Build failed
Swift Test OS X Platform
Git Sha - 994971113f931b4bc2e90e4cf34be27ee36fbc0b

@swift-ci
Copy link
Contributor

swift-ci commented Sep 1, 2020

Build failed
Swift Test Linux Platform
Git Sha - 994971113f931b4bc2e90e4cf34be27ee36fbc0b

@shahmishal
Copy link
Member

Please update the base branch to main by Oct 5th otherwise the pull request will be closed automatically.

  • How to change the base branch: (Link)
  • More detail about the branch update: (Link)

@tbkka tbkka changed the base branch from master to main October 1, 2020 22:12
tbkka added 3 commits November 2, 2020 10:43
This validation test exercises a large matrix of types and invariants for
dynamic casting.  It's formulated as a Python script that emits a number of
Swift test programs, compiles, and executes them.  The programs are compiled in
Swift 4 and 5 mode, with -O and -Onone.

The invariants used by these tests follow the specification presented
in PR swiftlang#33010.  It should be easy to add more as desired.

I've tried to design this in such a way that CI logs can provide enough
information to narrowly identify the problem area:  Separate test cases
are generated for each invariant and each type (in particular, this helps
with compiler crashes that report the full body of the function in question).
The files and test suites are named to identify the optimization mode.

The goal of this test suite is to cover a broad cross-section of casting
capabilities and combinations, and to make it easy to expand the matrix of
combinations.  New invariants can easily be added and applied to many types;
as new types are added to this test, they can exploit the existing invariants
and be exercised across all optimization modes.
@tbkka tbkka force-pushed the tbkka/dynamicCastRework-pt2-ValidationTest branch from c46f696 to 5ddd0ff Compare November 2, 2020 18:45
@tbkka
Copy link
Contributor Author

tbkka commented Nov 2, 2020

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 2, 2020

Build failed
Swift Test Linux Platform
Git Sha - 5ddd0ff

@swift-ci
Copy link
Contributor

swift-ci commented Nov 2, 2020

Build failed
Swift Test OS X Platform
Git Sha - 5ddd0ff

@tbkka
Copy link
Contributor Author

tbkka commented Oct 7, 2021

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Oct 7, 2021

Build failed
Swift Test Linux Platform
Git Sha - 5ddd0ff

@swift-ci
Copy link
Contributor

swift-ci commented Oct 7, 2021

Build failed
Swift Test OS X Platform
Git Sha - 5ddd0ff

@tbkka
Copy link
Contributor Author

tbkka commented Feb 7, 2023

An improved version of this work has been merged via other PRs.

@tbkka tbkka closed this Feb 7, 2023
@tbkka tbkka deleted the tbkka/dynamicCastRework-pt2-ValidationTest branch August 1, 2024 16:36
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