Commit Graph
2043 Commits
Author SHA1 Message Date
Karoy Lorentey d6d73d786c Merge pull request #767 from Joseph-Cursio/bitset-counted-check-bidirectional
[BitCollections] Check BitSet.Counted's BidirectionalCollection conformance
2026-10-21 15:42:41 -07:00
Karoy Lorentey b905c889ff Merge pull request #759 from Joseph-Cursio/check-set-algebra-sequences
Check the set predicates and isEqualSet(to:) against plain sequences
2026-10-15 12:39:57 -07:00
Karoy Lorentey 072a7a1643 Merge pull request #758 from Joseph-Cursio/sortedset-check-set-algebra
[SortedCollections] Check SortedSet's SetAlgebra conformance
2026-10-15 12:39:33 -07:00
Karoy Lorentey f0c713391c Merge pull request #761 from aniketatgithub/fix-sortedset-insert-update-760
SortedSet: keep the existing member on insert, replace it on update(with:)
2026-10-15 12:38:55 -07:00
Joseph CursioandClaude Opus 5.5 a727e193c7 Check BitSet.Counted's BidirectionalCollection conformance
BitSet.Counted keeps its own count and forwards its index operations to
BitSet, but no test ran it through a collection checker. Run
checkBidirectionalCollection on it with the same inputs as BitSet's
test_collection_strides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 05:59:44 -05:00
Karoy Lorentey 50583b7adf Merge pull request #766 from glessard/inputspan-removeall
Fix implementation of `InputSpan.removeAll()`
2026-10-14 18:03:39 -07:00
Guillaume Lessard 4ff4e75436 Fix implementation of removeAll() 2026-10-14 17:28:49 -07:00
Guillaume Lessard 9ebb1ae5a3 Test InputSpan’s removeAll() method 2026-10-14 17:28:48 -07:00
Aniket 7353b0ca86 SortedSet: keep the existing member on insert, replace it on update(with:)
Signed-off-by: Aniket <aniketkomailkro@gmail.com>
2026-10-14 08:21:27 +00:00
Joseph CursioandClaude Opus 5.5 2f2c59a39b checkSetAlgebra: Repeat the sequence enough to expose counted duplicates
Doubling the other model's elements only exposes an implementation that
counts occurrences instead of distinct members when the two sets share
at least half of the receiver's elements, which depended on the models
a test happened to pick. A BitSet.isStrictSubset that counted
duplicates passed every model pair. Repeat the other model
`xm.count + 2` times instead, so a shared element always appears more
often than the receiver has members.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:59:19 -05:00
Joseph CursioandClaude Opus 5.5 edaba634e4 checkSetAlgebra: Also pass a sequence that underestimates its count
Every sequence the checker passed reported its exact count, so an
implementation that trusts underestimatedCount went unnoticed: an empty
TreeSet whose isEqualSet returned `other.underestimatedCount == 0`
passed every test. Also check the predicates and isEqualSet against a
single-pass MinimalSequence, whose underestimatedCount is 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:17:24 -05:00
Joseph CursioandClaude Opus 5.5 13c9b46f1d Check BitSet.Counted's SetAlgebra conformance
BitSet.Counted's tests declare SetAPIExtras, but it was never run
through checkSetAlgebra. Use the same models as BitSet's test. With the
isEqualSet check from the previous commit, this fails if #749's fix is
reverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:10:12 -05:00
Joseph CursioandClaude Opus 5.5 9d4284eb0e checkSetAlgebra: Check isEqualSet(to:) for SetAPIExtras types
No checker exercised isEqualSet(to:), and no test passed it a sequence
with duplicates, so #749's bug, where BitSet.Counted rejected such
sequences, went unnoticed until it was reported. Add a checkSetAlgebra
overload for SetAPIExtras types that also checks isEqualSet against the
models: given another Self, an Array, an Array with duplicates, and a
Set, which takes the _UniqueCollection path in the types that have one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:10:12 -05:00
Joseph CursioandClaude Opus 5.5 d54c0be657 checkSetAlgebra: Check the predicates against plain sequences too
The five predicates were only ever given another Self, so a type whose
Sequence-taking overloads first check for Self never ran their
general path under the checker. Check them against an Array of the
other model, with and without duplicates, as the set operations
already are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:10:12 -05:00
Joseph CursioandClaude Opus 5.5 722b029996 Check SortedSet's SetAlgebra conformance
SortedSet declares SetAPIChecker since #746, but was never run through
checkSetAlgebra. The models are the same as TreeSet's and OrderedSet's,
plus three larger ones so that the sets span more than one B-tree level
in debug builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 19:00:13 -05:00
Karoy Lorentey 35a1edcb8e Merge pull request #757 from lorentey/work/enable-traits-in-cmake
CMake: Enable UnstableContainersPreview and UnstableHashedContainers by default
1.7.3
2026-10-12 13:35:52 -07:00
Karoy Lorentey e42143e2f4 CMake: Enable UnstableContainersPreview and UnstableHashedContainers by default 2026-10-12 12:59:30 -07:00
Karoy Lorentey ce32cbc5a2 Merge pull request #756 from lorentey/build-config-cleanups
1.7.3: Clean up minor issues in build configuration
2026-10-12 12:44:49 -07:00
Karoy Lorentey 891f7b6b8d Package: Stop enabling obsolete BorrowingSequence feature
Also, don’t enable SuppressedAssociatedTypesWithDefaults below Swift 6.4.
2026-10-12 12:24:56 -07:00
Karoy Lorentey 24339ad6a3 CMake: Remove obsolete references to source variables 2026-10-12 12:24:03 -07:00
Karoy Lorentey d04869f2a6 Merge pull request #755 from hamed75kazemii/fix-replace-subrange-multiple-spans
Copy every source span in replaceSubrange(copying:)
2026-10-12 12:11:47 -07:00
Karoy Lorentey 35aedf3937 Remove unnecessary explanation 2026-10-12 11:29:41 -07:00
hamedandCursor a4f5085a7c Copy every source span in replaceSubrange(copying:).
The replacement callback took a single span and then required the source count to be exhausted, so a container stored in more than one span trapped.

Fixes #751

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-10 22:56:07 +03:30
Karoy Lorentey 935f696a54 Merge pull request #753 from lorentey/cmake-toolchain-revival
Revive configuration for Foundation toolchain module builds
2026-10-08 19:08:02 -07:00
Karoy Lorentey 961043b4b2 Fix _RopeModule’s CMake config in single-module mode 2026-10-08 18:51:51 -07:00
Karoy Lorentey 320dba8df9 [CI] cmake-build: Build in single-module mode and Foundation toolchain module mode 2026-10-08 18:38:24 -07:00
Karoy Lorentey 463946edae ContainersPreview: Adjust import statements in Foundation toolchain module mode 2026-10-08 18:32:47 -07:00
Karoy Lorentey 9cabf522ec CMake: Fix building ContainersPreview as a Foundation toolchain module 2026-10-08 18:32:15 -07:00
Karoy Lorentey e9da0fb277 Merge pull request #752 from parkera/parkera/embedded_bigstring
Build BigString in Embedded Swift - with a custom implementation of grapheme walking instead of using the stdlib
2026-10-08 18:29:51 -07:00
Karoy Lorentey 6c138f92d8 Merge pull request #742 from Joseph-Cursio/sortedcollections-hashable
[SortedCollections] Check the BidirectionalCollection, Equatable and Hashable conformances
2026-10-08 17:33:06 -07:00
Karoy Lorentey 34151d7731 Merge pull request #746 from aniketatgithub/fix-sortedset-sequence-setalgebra
SortedSet: generalize set operations to arbitrary Sequences
2026-10-08 17:31:51 -07:00
Karoy Lorentey 260c04cc17 Merge pull request #749 from kwy404/fix-counted-isequalset-sequence
[BitCollections] Fix BitSet.Counted.isEqualSet(to:) rejecting sequences with duplicates
2026-10-08 17:31:15 -07:00
Tony Parker 500233e8c0 Use _addressString in debug description 2026-10-08 17:28:56 -07:00
Karoy Lorentey 75cd22c7aa Update comments
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2026-10-08 17:07:58 -07:00
Tony Parker d014985b5f Build BigString in Embedded Swift - with a custom implementation of grapheme walking instead of using the stdlib 2026-10-08 16:41:20 -07:00
Karoy Lorentey c6c659c25a Merge pull request #750 from rksharma-owg/codex/collections-73-heap-permutations
[Heap] Add exhaustive permutations and duplicate-value coverage
2026-10-08 16:29:19 -07:00
Joseph Cursio 13bda5d66d Merge remote-tracking branch 'origin/main' into sortedcollections-hashable 2026-10-08 08:48:15 -05:00
RKS 234e946302 [Heap] Add exhaustive permutations and duplicate-value coverage 2026-10-05 22:39:35 -04:00
kwy404 ea599358e6 [BitCollections] Fix BitSet.Counted.isEqualSet(to:) rejecting sequences with duplicates
The generic `isEqualSet(to: some Sequence<Int>)` overload returned false
whenever `other.underestimatedCount` exceeded `count`. A sequence with
duplicate items can be longer than the set it equals, so
`([1, 2, 3, 4] as BitSet.Counted).isEqualSet(to: [4, 1, 1, 2, 3, 3, 4] as [Int])`
returned false, contradicting the documented behavior.

Forward straight to `BitSet.isEqualSet(to:)`, which already handles
duplicates and keeps the count shortcut for unique collections.
2026-10-02 17:54:38 -03:00
Karoy Lorentey 3b69cedbaa Merge pull request #747 from lorentey/strict-memory-safety
Enable strict memory safety on Swift 6.4
1.7.2
2026-10-01 14:18:10 -07:00
Karoy Lorentey 017f766cb9 Update package manifest for benchmarks
- Bump required toolchain to 6.4
- Add availability macros for 6.4 and 6.5.
2026-10-01 13:41:06 -07:00
Karoy Lorentey 1b936eda0b Disable strict memory safety on older toolchains
It would take too much effort to try to mitigate stdlib differences.

Fix low-hanging warnings, but turn off `.strictMemorySafety` on older toolchains by splitting the package manifest.
2026-10-01 13:40:27 -07:00
Karoy Lorentey 9e7949017a Tests: add unsafe keywords where needed 2026-10-01 11:44:47 -07:00
Karoy Lorentey d07dc32dfa Sources: Add unsafe keywords where needed 2026-10-01 11:14:29 -07:00
Karoy Lorentey 13f71ad927 Enable strict memory safety 2026-09-30 20:40:09 -07:00
Aniket 0d731a673c SortedSet: generalize set operations to arbitrary Sequences
SortedSet's set operations only accepted another SortedSet, so
SortedSet([1, 2]).union(0 ..< 10) did not compile and the type could
not conform to SetAPIChecker.

Add the customary Sequence generalizations for all 13 operations,
keeping the existing Self overloads as the fast path (concrete beats
generic in overload resolution). Arbitrary sequences fall back through
a temporary SortedSet or, for the membership predicates, allSatisfy.

Fixes #743.

Signed-off-by: Aniket <aniketkomailkro@gmail.com>
2026-09-30 03:14:10 -07:00
Karoy Lorentey a5b094974f Merge pull request #745 from lorentey/migrate-from-spi-to-package
Stop using `@_spi` attribute and `@testable import`
2026-09-29 18:51:34 -07:00
Karoy Lorentey c991c8543a Update SortedCollections for un-@testable testing 2026-09-29 18:32:58 -07:00
Karoy Lorentey 0ec72a9532 Stop using @_spi attribute and @testable import 2026-09-29 18:32:55 -07:00
Karoy Lorentey afb6141ea0 Merge pull request #744 from lorentey/separate-containers-preview
[Xcode, CMake]: Build ContainersPreview as a standalone module
2026-09-29 16:24:25 -07:00