Commit Graph

2015 Commits

Author SHA1 Message Date
Karoy Lorentey
241f006ddc [test] Fix ~10% false pass rate without local hash seeds 2018-03-16 14:58:24 +00:00
Karoy Lorentey
571522e340 Merge pull request #15269 from lorentey/static-snow
[test] Merge hash determinism/randomisation tests
2018-03-16 10:32:51 +00:00
swift-ci
e83018c491 Merge pull request #15277 from lorentey/avalanche 2018-03-15 17:03:37 -07:00
Andrew Trick
afbcbfdfa7 Merge pull request #13071 from glessard/umbp-nonmutating-swapat
nonmutating swapAt implementations for UnsafeMutable(Raw)BufferPointer
2018-03-15 16:35:47 -07:00
Karoy Lorentey
05168d7fae [test] Merge hash determinism/randomisation tests 2018-03-15 20:48:39 +00:00
Karoy Lorentey
ec15f7e3e4 [test] Update hash avalanche test
Differentiate between 32-bit and 64-bit inputs. Previously the test was always feeding 64-bit integers to the hasher.
2018-03-15 18:52:44 +00:00
Karoy Lorentey
acfc1b90d4 [test] Test that hashed collections use local hash seeds 2018-03-15 16:30:44 +00:00
David Zarzycki
89b524000b [Testing] Mark two latent long tests as 'long_test'
This improves 'ninja check-swift-validation' performance by about 2.9x
on my Linux desktop. Also, move them to validation-test where the other
long tests live.
2018-03-14 16:17:27 -04:00
Karoy Lorentey
b0108336f7 Merge pull request #15207 from lorentey/seedless-hashes
[runtime] Add better control over the random hashing seed
2018-03-13 19:46:51 +00:00
Karoy Lorentey
e5eed66b67 [test] Add tests verifying hash randomization. Update tests for new names. 2018-03-13 16:29:43 +00:00
Andrew Trick
bf0463cdc1 Disable Lazy.swift on Ubuntu 16.04.
Even without ASAN this failes with "corrupted double-linked list".

<rdar://problem/35797159> [Associated Type Inference] Swift CI: 1. OSS - Swift ASAN - Ubuntu 16.04 (master) heap-use-after-free ASTContext::getSpecializedConformance llvm::FoldingSetBase::InsertNode
2018-03-13 08:59:51 -07:00
Andrew Trick
725da7f303 Disable Lazy.swift under Linux ASAN.
Waiting for a fix for <rdar://35797159> [Associated Type Inference]
Swift CI: 1. OSS - Swift ASAN - Ubuntu 16.04 (master)
heap-use-after-free ASTContext::getSpecializedConformance
llvm::FoldingSetBase::InsertNode
2018-03-12 15:29:31 -07:00
Joe Groff
3fd2d2165e Merge pull request #15145 from jckarter/trimming-metadata
Trimming metadata
2018-03-12 06:55:59 -07:00
Joe Groff
f01af883fc IRGen: Use known value witness tables for common type layouts.
If a type has the same layout as one of the basic integer types, or has a single refcounted pointer representation, we can use prefab value witness tables from the runtime instead of instantiating new ones. This saves quite a bit of code size, particularly in the Apple SDK overlays, where there are lots of swift_newtype wrappers and option set structs.
2018-03-11 11:04:37 -07:00
Karoy Lorentey
8cf5bc8bdc [stdlib] Switch to using SipHash-1-3 as the standard hash function
Beyond switching hashing algorithms, this also enables per-execution hash seeds, fulfilling a long-standing prophecy in Hashable’s documentation.

To reduce the possibility of random test failures, StdlibUnittest’s TestSuite overrides the random hash seed on initialization.

rdar://problem/24109692
rdar://problem/35052153
2018-03-09 14:48:59 +00:00
Karoy Lorentey
42cab58554 [stdlib] Dictionary, Set: Use resilient hashing
This switches the primary hashing interface from hashValue to _hash(into:).
2018-03-09 14:35:19 +00:00
Karoy Lorentey
54b857ed0b [stdlib] Hashable: Add support for resilient hashing
Introduce _Hasher, representing an opaque hash compression function.

Add the method _hash(into:) as a Hashable requirement, decoupling the choice of hash function from Hashable's implementation. The default implementation of _hash(into:) has a default implementation that simply feeds hashValue to the hasher.

Add _hash(into:) implementations for the default integer types. Note that Int.hashValue does not return self anymore.

Add struct _LegacyHasher, emulating Swift 4.1 hashes in the new interface.
2018-03-09 14:34:57 +00:00
swift-ci
9bda1e5c55 Merge pull request #13340 from glessard/umbp-failearlyrangecheck 2018-03-08 05:38:39 -08:00
Karoy Lorentey
b52a94d789 [test] Fix tests relying on specific hash values or Set/Dictionary orderings
We shouldn't need to update regular tests if/when we modify the hash function.
2018-03-07 16:44:43 +00:00
Guillaume Lessard
0c95f902f0 restore debug-mode bounds checking to *BufferPointer.swapAt 2018-03-06 09:04:17 -07:00
Guillaume Lessard
116de2b3b2 non-mutating swapAt implementations for UnsafeMutable(Raw)BufferPointer 2018-03-06 09:04:16 -07:00
swift-ci
abbaa47614 Merge pull request #12504 from glessard/umbp-nonmutating-setter 2018-03-06 06:37:58 -08:00
Ben Cohen
7c99c68672 Add test for ArraySlice.popLast 2018-03-02 13:32:27 -08:00
Ben Cohen
2380950fa7 [stdlib] Collapse DropWhileBidirectionalCollection and de-gyb DropWhile.swift (#14906)
Collapse DropWhileBidirectionalCollection and de-gyb DropWhile.swift
2018-03-02 07:53:06 -08:00
Ben Cohen
f50afde523 Collapse PrefixWhileBidirectionalCollection and de-gyb PrefixWhile.swift (#14910) 2018-03-01 14:13:48 -08:00
Lance Parker
e0e50e9b3e Add failing test 2018-02-28 11:27:40 -08:00
Lance Parker
7cc222e271 Ditched the simple/complex test distinction as they all pass now (#20) 2018-02-19 10:09:24 -08:00
Lance Parker
0661de22a2 [stdlib]Un-revert string comparison (#14694)
Restore (un-revert) sting comparison, with fixes

More exhaustive testing of opaque strings, which consistently reproduces prior sporadic failure. Shims fixups. Some test tweaking.
2018-02-18 10:50:33 -08:00
Lance Parker
abe6a6d177 Revert string comparison (#14657) 2018-02-15 14:37:43 -08:00
Lance Parker
49bc1459ae Update string comparison tests 2018-02-14 15:44:11 -08:00
Ben Cohen
415d90c72c Move collection compat test that needs StdlibCollectionUnittest to validation-test 2018-02-05 13:19:41 -08:00
Ben Cohen
9ee856f386 [stdlib][WIP] Eliminate (Closed)CountableRange using conditional conformance (#13342)
* Make Range conditionally a Collection

* Convert ClosedRange to conditionally a collection

* De-gyb Range/ClosedRange, refactoring some methods.

* Remove use of Countable{Closed}Range from stdlib

* Remove Countable use from Foundation

* Fix test errors and warnings resulting from Range/CountableRange collapse

* fix prespecialize test for new mangling

* Update CoreAudio use of CountableRange

* Update SwiftSyntax use of CountableRange

* Restore ClosedRange.Index: Hashable conformance

* Move fixed typechecker slowness test for array-of-ranges from slow to fast, yay

* Apply Doug's patch to loosen test to just check for error
2018-02-01 20:59:28 -08:00
Ben Cohen
072aedcdb7 Use LifetimeTracked for Array.popLast test (#14334) 2018-02-01 19:47:28 -08:00
Karoy Lorentey
77992d37f0 Merge pull request #14033 from lorentey/rdar/35995647
[Foundation] Coalesce duplicate String keys in bridged NSDictionary and NSSet
2018-01-31 11:57:31 +00:00
Greg Parker
e223f1fc9b [IRGen][runtime] Simplify runtime CCs and entry point ABIs (#14175)
* Remove RegisterPreservingCC. It was unused.
* Remove DefaultCC from the runtime. The distinction between C_CC and DefaultCC
  was unused and inconsistently applied. Separate C_CC and DefaultCC are
  still present in the compiler.
* Remove function pointer indirection from runtime functions except those
  that are used by Instruments. The remaining Instruments interface is
  expected to change later due to function pointer liability.
* Remove swift_rt_ wrappers. Function pointers are an ABI liability that we
  don't want, and there are better ways to get nonlazy binding if we need it.
  The fully custom wrappers were only needed for RegisterPreservingCC and
  for optimizing the Instruments function pointers.
2018-01-29 13:22:30 -08:00
Karoy Lorentey
92a2f9cb8f Merge pull request #14027 from lorentey/rdar/36619317
[stdlib] Set, Dictionary: Take the max load factor into account in `.init(minimumCapacity:)`
2018-01-24 11:31:17 +00:00
Karoy Lorentey
a68b860b41 [test] Use the public capacity in tests, not the internal bucket count. 2018-01-23 17:23:42 +00:00
Karoy Lorentey
b8d8949166 String & String views: Add bounds checking to range subscripts. 2018-01-21 12:40:21 -08:00
Karoy Lorentey
90e894729a [StringGuts] Linux support
Add support for compiling StringGuts without the Objective-C runtime.
2018-01-21 12:37:36 -08:00
Michael Ilseman
3be2faf5d3 [String] Initial implementation of 64-bit StringGuts.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
2018-01-21 12:32:26 -08:00
Michael Ilseman
75463e30f3 [stdlib] Rename _StringCore to _LegacyStringCore. NFC.
In grand LLVM tradition, the first step to redesigning _StringCore is
to first rename it to _LegacyStringCore. Subsequent commits will
introduce the replacement, and eventually all uses of the old one will
be moved to the new one.

NFC.
2018-01-21 12:28:56 -08:00
Karoy Lorentey
c64c4bacb2 [test] Don’t use isEqual(to:) 2018-01-20 00:55:21 +00:00
Karoy Lorentey
9e4dcd8bae [Foundation] Coalesce duplicate keys in String-keyed NSDictionary and NSSet instances
NSString has a stricter concept of equality than Swift’s String, so it is possible to construct NSDictionary/NSSet instances that contain duplicate keys according to Swift’s definition of string equality. This change improves how we handle these cases by coalescing the duplicate keys (keeping a single value).

rdar://problem/35995647
2018-01-19 22:35:59 +00:00
Karoy Lorentey
3b1bae9ca2 [stdlib] Set, Dictionary: Take the max load factor into account in .init(minimumCapacity:)
rdar://problem/36619317
2018-01-19 17:38:16 +00:00
Ben Cohen
ca6c6b1d36 [stdlib] Cleanup DefaultIndices, delete dead code (#13952)
* Remove a bunch of Default(Bidirectional|RandomAccess)Indices usage from stdlib and test

* Remove some DefaultRandomAccessIndices and IndexDistance usage from Foundation

* Remove no-longer-used internal type in Existentials.swift

* Get rid of indicesForTraversal
2018-01-15 13:48:08 -08:00
John McCall
b3b6894ed6 Remove these now-unnecessary autoreleasepools; this seems to no
longer cause problems.

rdar://27528234
2018-01-12 23:08:19 -05:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Max Moiseev
a77ae373b8 Revert "Disable ModelIO test on ios" 2018-01-03 14:50:13 -08:00
Doug Gregor
fc253e8a23 [Stdlib] Fix requirements on FlattenCollectionIndex.
FlattenCollectionIndex recently became a typealias, but overstated its
requirements.
2017-12-21 10:07:11 -08:00
Doug Gregor
cf89ea77f1 Introduce _Default_Indices typealias into RandomAccessCollection.
Use the new `_Default_Foo` typealias trickery to define a conditional
default type witness for the collection `Indices` associated type, so
`Indices` becomes `CountableRange<Index>` when the `Index` type is
`Strideable` with `Int` as its `Stride` type.

This fixes the major regression with associated type inference for
“minimal” random access collection types with `Int` index types, which
has come up in a number of places.

Note that I dropped the `@_implements` requirement because `_Default_Foo`
is already off in its own namespace, and eventually we should get a real
syntax for this.

Fixes rdar://problem/35035322.
2017-12-20 23:11:51 -08:00