Commit Graph
1249 Commits
Author SHA1 Message Date
Max Desiatov 434d30dae3 Build and run tests for Wasm in pull_request.yml 2025-08-28 13:38:55 +01:00
Max Desiatov 868884d743 Add checks for Wasm compatibility to pull_request.yml
This library currently has no PR testing for Wasm, even though it's a dependency of other libraries that declare Wasm support. To prevent possible future regressions, let's add Wasm build checks to the CI workflows.

rdar://135961596
2025-08-20 10:46:57 +02:00
Karoy Lorentey dc55a17401 Merge pull request #507 from viere1234/patch
[SortedCollections] Fix B-tree root reduction during element removal causing data loss
2025-08-17 21:32:30 -07:00
Karoy Lorentey b115390475 Merge pull request #506 from viere1234/main
[SortedCollections] Fix incorrect offset calculation in BTree.findAnyIndex
2025-08-17 21:32:12 -07:00
Brian Chang 21757b6add [BTree] Fix root reduction during element removal causing data loss
When removing elements from a B-tree, the root node could become empty while still having children. The previous code incorrectly called drop() which deallocated all children, causing massive data loss during removal operations.

This fix implements proper root reduction by moving the single remaining child out of the empty root, then safely dropping the now-empty parent node and promoting the extracted child to become the new root.

This fixes `test_modifySubscriptRemoval` in `SortedDictionaryTests`, so we re-enable SortedDictionary tests which now all pass.
2025-08-15 23:21:22 +08:00
Brian Chang 4ea19dd03e [SortedSet] Add test case for indexOf 2025-08-13 13:47:48 +08:00
Brian Chang e0b68624ba [BTree] Fix incorrect offset calculation in findAnyIndex
`findAnyIndex(forKey:)` miscomputed the global offset when a key was found in an internal B-tree node, due to missing child subtree counts in the calculation.
2025-08-13 13:43:18 +08:00
Karoy Lorentey e7ffe90ae7 Merge pull request #501 from faimin/main
Add the missing COLLECTIONS_SINGLE_MODULE when import InternalCollectionsUtils
2025-08-11 17:29:38 -07:00
Karoy Lorentey 990d4b30fb Merge pull request #502 from viere1234/main
[SortedSet] Fix subtreeCount inconsistency after remove at index
2025-08-11 17:29:25 -07:00
Karoy Lorentey 0713f4ebaa Merge pull request #503 from t089/patch-1
fix minor typo in init docs for Deque.swift
2025-08-11 17:29:12 -07:00
Tobias 8db0c6eb75 fix typo in init docs for Deque.swift 2025-08-07 10:29:59 +02:00
Brian Chang a98fbaba8b [SortedSet] Fix subtreeCount inconsistency after remove at index
Previously, when removing an element from a child node, the subtreeCount
of the current internal node wasn't updated, leading to incorrect counts.
2025-08-01 22:45:17 +08:00
faimin f6256df262 Add the missing macro condition when import InternalCollectionsUtilities 2025-07-30 14:44:22 +08:00
Christopher Thielen f590186720 Merge pull request #495 from cthielen/cthielen/add-deque-for-foundation-toolchain
Include DequeModule in the Foundation toolchain build
2025-07-23 09:44:32 -07:00
Christopher Thielen f44eabc30e Include DequeModule in the Foundation toolchain build 2025-07-22 15:58:24 -07:00
Karoy Lorentey 8fb8949d13 Merge pull request #494 from parkera/parkera/embedded_collections
Add support for embedded Swift mode
2025-07-22 15:39:55 -07:00
Tony Parker c883a1729a Add support for embedded Swift mode
Remove calls to `debugPrint` (which does not exist), and ifdef out support for `Codable` and `Reflection`.
2025-07-17 16:36:56 -07:00
Karoy Lorentey dcee718843 Merge pull request #491 from azarovalex/fix-orderedset-usage
Fix OrderedSet example usage
2025-07-08 17:30:16 -07:00
Karoy Lorentey df19207b2c Merge pull request #493 from apple/action-xcode-versions
Skip Xcode 16.0 and 16.1 in PR workflow
2025-07-07 16:33:59 -07:00
Nate Cook 1f8dcd4726 Skip Xcode 16.0 and 16.1 in PR workflow 2025-07-07 12:13:37 -05:00
Karoy Lorentey c1b1ea9982 Merge pull request #490 from azarovalex/fix-api-docs
Fix API documentation links in README.md
2025-07-03 14:28:15 -07:00
Alex Azarov 9f68408a70 Update OrderedSet.swift
Make values immutable if they are never mutated in example usage docs.
2025-06-30 11:35:45 +02:00
Alex Azarov d7301b7278 Fix OrderedSet example usage 2025-06-29 16:48:57 +02:00
Alex Azarov 2d5ed365ff Fix API documentation links in README.md 2025-06-28 17:36:05 +02:00
Karoy Lorentey b45c41445b Merge pull request #483 from apple/shahmishal/macos
Enable macOS testing on GitHub Actions
2025-06-24 16:37:21 -07:00
Karoy Lorentey 437c517302 Merge pull request #487 from lorentey/merge-1.2-to-main
Merge changes on `release/1.2` to `main` branch
2025-06-24 16:37:03 -07:00
Karoy Lorentey 98a5744e89 Merge pull request #482 from etcwilde/ewilde/fix-cmake-build
Fix CMake build
2025-06-24 15:28:04 -07:00
Karoy Lorentey 05ad8633a8 Merge branch 'release/1.2' 2025-06-24 15:06:25 -07:00
Karoy Lorentey 96bf8b85f5 Merge pull request #486 from lorentey/BigString-easy-speedups
[BigString] Harvest some low-hanging performance fruit
2025-06-24 15:05:22 -07:00
Karoy Lorentey fc411858ee [BigString] Speed up index distance calculations
This implements a roughly 40-45% improvement for distance measurements over `BigString`’s character and Unicode Scalar views.

Interestingly, we don’t see an improvement for UTF-16 views — I’m guessing this is due to String’s breadcrumbing. (And it will go away with the upcoming UTF8Span-ification of this type.)

The benchmarks I added only show an improvement for multi-chunk big string instances, but this is merely an artifact of the specific algorithm that is being measured — for single-chunk strings, the existing measurement method is already optimal, so the new heuristic never triggers for this particular payload.
2025-06-23 15:21:40 -07:00
Karoy Lorentey f1b0eba948 [BigString] Add some basic benchmarks 2025-06-23 15:21:36 -07:00
Karoy Lorentey f02550b23f Merge pull request #485 from lorentey/fix-character-distance-1.2
[BigString] Fix character indexing operations
2025-06-23 15:19:53 -07:00
Karoy Lorentey 65f99e3eff [BigString] Fix character indexing operations
BigString sometimes miscounted distances in its character view due to alignment issues. Resolve this by overhauling distance calculations in the character metric:

- Introduce a `prefixSize` function in `_StringMetric`, distinct from `distance`.
- In the metric-agnostic index distance algorithm, use `prefixCount` to avoid double-counting characters that cross (or end on) chunk boundaries.
- Simplify `_StringMetric.distance` by requiring that `start <= end`.
- Crucially, change character-index operations to start by rounding each input index down to the nearest character break.
2025-06-17 17:28:02 -07:00
Karoy Lorentey 96a16f6dc1 [BigString] Add new tests exercising broken indexing operations 2025-06-17 17:27:58 -07:00
Mishal Shah d5568ee899 Enable macOS testing on GitHub Actions 2025-06-13 00:30:24 -07:00
Evan Wilde 83457e19c8 CMake: Remove duplicate platform info includes
It looks like something was merged in a funny way resulting in the
platform info module being included twice in the top-level CMakeLists
files. Removing one of them.
2025-06-11 16:42:06 -07:00
Evan Wilde fd9137b989 CMake: Fix typo
Misspelled Swift in the Platform info compiler target check.
Fixing that.
2025-06-11 16:41:08 -07:00
Karoy Lorentey d402bec934 Merge pull request #481 from lorentey/bump-benchmarks
Bump requirements of nested benchmarking package
2025-05-22 15:48:13 -07:00
Karoy Lorentey c50c57f52e Bump requirements of nested benchmarking package
- swift-collections-benchmark 0.0.4
- Swift 6.1 minimum toolchain version
- macOS 15 minimum deployment target
2025-05-21 21:20:52 -07:00
Karoy Lorentey 4216d2ad1b Merge pull request #478 from ozumin/patch-1
fix comment for OrderedSet.appending(contentsOf:)
2025-05-21 09:24:42 -07:00
Karoy Lorentey 4d5a06f10c Merge pull request #480 from lorentey/enable-member-import-visibility
Enable MemberImportVisibility and fix issues uncovered
2025-05-20 22:41:12 -07:00
Karoy Lorentey 6819c6d149 Enable MemberImportVisibility and fix issues uncovered 2025-05-20 18:11:44 -07:00
Karoy Lorentey 30135b8c38 Merge pull request #479 from lorentey/disable-sorted-collections
Disable `SortedCollections` module
2025-05-20 16:47:59 -07:00
Karoy Lorentey e337c2b936 Remove SortedCollections scheme 2025-05-20 15:37:27 -07:00
Karoy Lorentey ecf44620d2 Also disable SortedCollections benchmarks 2025-05-20 15:23:02 -07:00
Karoy Lorentey 0b9f4064b3 Disable SortedCollections module
The sorted collection types are not yet ready for production use. Remove them from the package manifest.

Keep the code in place for now, although it will likely make more sense to track their development in a separate feature branch of this package.
2025-05-20 15:13:39 -07:00
Karoy Lorentey d4946c5dcb Remove obsolete language checks 2025-05-20 15:12:32 -07:00
Karoy Lorentey 6bcb663b41 Merge pull request #450 from lorentey/merge.release-1.2→main
Merge release/1.2 to main
2025-05-20 15:11:35 -07:00
Karoy Lorentey 0f73f0ace7 Merge branch 'release/1.2'
# Conflicts:
#	.github/workflows/pull_request.yml
#	.swiftci/5_10_ubuntu2204
#	.swiftci/5_7_ubuntu2204
#	.swiftci/5_8_ubuntu2204
#	.swiftci/5_9_ubuntu2204
#	.swiftci/nightly_6_0_macos
#	.swiftci/nightly_6_0_ubuntu2204
#	.swiftci/nightly_main_macos
#	.swiftci/nightly_main_ubuntu2204
2025-05-20 11:13:32 -07:00
Mizuo Nagayama 1812091001 fix comment for OrderedSet.appending(contentsOf:) 2025-05-20 18:38:06 +09:00