Skip to content

[Type checker] Introduce directional path consistency algorithm #4485

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

Merged
merged 1 commit into from
Aug 24, 2016

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Aug 24, 2016

What's in this pull request?

Improvements to the TypeChecker, namely DPC
(directional path consistency) algoritm which tries to
solve individual sub-expressions and combine
resolved types as a way to reduce pre-existing OSR domains. Solving
is done bottom-up so each consecutive sub-expression tightens
possible solution domain even further.

Resolved bug number: (SR-139)

Resolved bug number: (SR-838)

Resolved bug number: (SR-2102)

And most likely at least couple of others related to "expression is too complex" I haven't seen yet.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

A smoke test on macOS does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library only for macOS. Simulator standard libraries and
    device standard libraries are not built.
  3. lldb is not built.
  4. The test and validation-test targets are run only for macOS. The optimized
    version of these tests are not run.

A smoke test on Linux does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library incrementally.
  3. lldb is built incrementally.
  4. The swift test and validation-test targets are run. The optimized version of these
    tests are not run.
  5. lldb is tested.

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

DPC algoritm tries to solve individual sub-expressions and combine
resolved types as a way to reduce re-existing OSR domains. Solving
is done bottom-up so each consecutive sub-expression tightens
possible solution domain even further.

DPC algoritm tries to solve individual sub-expressions and combine
resolved types as a way to reduce pre-existing OSR domains. Solving
is done bottom-up so each consecutive sub-expression tightens
possible solution domain even further.
@xedin
Copy link
Contributor Author

xedin commented Aug 24, 2016

/cc @DougGregor

@rudkx
Copy link
Contributor

rudkx commented Aug 24, 2016

@swift-ci Smoke test macOS.

@rudkx rudkx merged commit f683d84 into swiftlang:master Aug 24, 2016
@shahmishal
Copy link
Member

@xedin We are seeing test failure on Linux:

https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04/7148/consoleFull#-1683772281fca400bf-2f4a-462e-b517-e058d770b2d7

FAIL: Swift(linux-x86_64) :: Sema/complex_expressions.swift (2254 of 8498)
******************** TEST 'Swift(linux-x86_64) :: Sema/complex_expressions.swift' FAILED ********************
Script:
--
/home/buildnode/disk2/workspace/oss-swift-incremental-RA-linux-ubuntu-14_04/buildbot_incremental/swift-linux-x86_64/bin/swift -frontend -target x86_64-unknown-linux-gnu  -parse -verify -disable-objc-attr-requires-foundation-module /home/buildnode/disk2/workspace/oss-swift-incremental-RA-linux-ubuntu-14_04/swift/test/Sema/complex_expressions.swift
--
Exit Code: 1

Command Output (stderr):
--
/home/buildnode/disk2/workspace/oss-swift-incremental-RA-linux-ubuntu-14_04/swift/test/Sema/complex_expressions.swift:39:8: error: unexpected error produced: no such module 'Foundation'
import Foundation
       ^
<unknown>:0: error: fatal error encountered while in -verify mode

--

********************

@shahmishal
Copy link
Member

shahmishal commented Aug 25, 2016

@xedin @rudkx Is it ok if I revert this PR?

@xedin
Copy link
Contributor Author

xedin commented Aug 25, 2016

@shahmishal @rudkx I think it would be better to maybe figure out why MacOS allows to "import Foundation" and linux doesn't? I got that code from SR-2102, I can also restructure the test so it doesn't require it, since sin is what is contained in Foundation.

@rudkx
Copy link
Contributor

rudkx commented Aug 25, 2016

Please revert for now so we can keep the bots happy. We can resubmit once the test is fixed.

@jrose-apple
Copy link
Contributor

Swift tests aren't allowed to reference Foundation on Linux, because on Linux you should be able to run the tests without having built Foundation

@xedin
Copy link
Contributor Author

xedin commented Aug 25, 2016

Thanks for clarification, @jrose-apple! I obviously didn't know that... Meanwhile I've reformatted the test and removed Foundation dependency with equivalent function overloads... Going to submit it as separate PR and link it here for reference as well.

aaditya-chandrasekhar pushed a commit to val-verde/swift that referenced this pull request Sep 30, 2022
* Use Yams 4.0.2 to fix Ubuntu 18.04 build

Currently, as can be seen from logs at https://github.com/swiftwasm/swift/runs/6178363121?check_suite_focus=true compilation of Yams fails with this error:

```
/home/runner/work/swift/swift/yams/Sources/Yams/YamlError.swift  -Xlinker -soname -Xlinker libYams.so  -L /home/runner/work/swift/swift/host-build/Ninja-Release/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/yams/lib  -L /home/runner/work/swift/swift/host-build/Ninja-Release/foundation-linux-x86_64/lib   -L /usr/lib/gcc/x86_64-linux-gnu/7 -Xlinker -rpath -Xlinker /home/runner/work/swift/swift/host-build/Ninja-Release/foundation-linux-x86_64/lib:  lib/libCYaml.a  -ldispatch  /home/runner/work/swift/swift/host-build/Ninja-Release/foundation-linux-x86_64/lib/libFoundation.so  -lswiftDispatch  -lgcc  -lgcc_s  -lc  -lgcc  -lgcc_s && :
23585
/usr/bin/ld.gold: error: lib/libCYaml.a(api.c.o): requires dynamic R_X86_64_PC32 reloc against 'yaml_realloc' which may overflow at runtime; recompile with -fPIC
23586
/usr/bin/ld.gold: error: lib/libCYaml.a(scanner.c.o): requires dynamic R_X86_64_PC32 reloc against 'yaml_parser_fetch_more_tokens' which may overflow at runtime; recompile with -fPIC
23587
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
23588
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
```

* Use Yams 5.0.1 in `swiftwasm-release/5.7` scheme
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