76 Commits
Author SHA1 Message Date
Karoy Lorentey a731a7fdad [BasicContainers] Don’t define LLDB formatter symbol on Wasm
While we’re here, follow our explicit access control rule when defining the variable.
2026-05-12 15:33:22 -07:00
Karoy Lorentey f83bd74aea Move FormatterFixtures into a nested package 2026-05-07 16:15:02 -07:00
Dave Lee 863607d6af Added missing "the" 2026-04-30 13:47:37 -07:00
Dave Lee e2999f6e0d typo 2026-04-30 13:43:39 -07:00
Dave Lee 9343151f98 Fix breakpoint set command 2026-04-30 13:40:28 -07:00
Dave Lee 356345c4b7 Minor cleanups 2026-04-30 13:35:28 -07:00
Dave Lee 9e592f752b Update docstrings 2026-04-30 13:35:01 -07:00
Dave Lee edf640d5dc Add lldb integration test 2026-04-30 12:48:16 -07:00
Dave Lee c8734cb10c Vendor formatter_bytecode.py 2026-03-31 13:03:38 -07:00
Dave Lee a2c67046c1 Support single-module mode
When `COLLECTIONS_SINGLE_MODULE` is set, a single `Collections` module is
built. Type names need to match accordingly.
2026-03-31 12:53:53 -07:00
Dave Lee f93d09ec67 Fix copyright dates 2026-03-31 12:53:52 -07:00
Dave Lee 3d4a9de02f Add license headers to introduced scripts 2026-03-31 10:07:25 -07:00
Dave Lee 86d184d89c Add generate_formatters.sh script 2026-03-31 09:56:00 -07:00
Dave Lee 7d721cbf7c Add license header 2026-03-31 09:55:49 -07:00
Dave Lee a6cefb8eda Update RigidArray+Formatter.swift 2026-03-30 11:02:31 -07:00
Dave Lee 01f2c9101b [Debugging] Add lldb data formatter for RigidArray
This introduces a debugging data formatter for RigidArray using a new feature of LLDB:
[Formatter Bytecode][1]. The scope of this PR is a single initial data type, with the
short and long term plan being to support all types vended by Swift Collections.

The bytecode for this implementation is produced using a Python -> Formatter Bytecode
compiler, contained in the [`formatter_bytecode`][2] module.

The workflow for authoring and shipping the formatter is:

1. Update RigidArray.py as needed
2. Compile RigidArray.py to RigidArray+Formatter.swift (again, `formatter_bytecode`)
3. Compile RigidArray+Formatter.swift as part of the BasicContainers module

By including the bytecode in the binary, lldb can load RigidArray's data formatter
automatically, without any friction that comes with installation, setup, config,
updating, or versioning.

[1]: https://lldb.llvm.org/resources/formatterbytecode.html
[2]: https://github.com/llvm/llvm-project/blob/main/lldb/examples/python/formatter_bytecode.py
2026-03-18 18:40:36 -07:00
Karoy Lorentey 80878519f2 [doc] Fix most issues reported by docc
DocC keeps changing its link syntax. The latest iteration appears to have trouble dealing with `Self`-taking or `Self`-returning methods, so change our API to replace `Self` with a direct mention of the concrete type. ¯\\\_(ツ)\_/¯

That said, the new compiler also found a large number of mismatching parameter names, and that was really helpful.
2026-03-09 14:14:51 -07:00
Karoy Lorentey 11a49663d0 [Benchmarks] Update benchmarking sub-package
- Fix issues with the main package no longer exposing internal helper functions
- Move Rust benchmarks behind an EnableRustBenchmarks trait
- Allow traits to be enabled in `Utils/run-benchmarks.sh` through the BENCHMARK_TRAITS environment variable.
2026-03-05 19:39:22 -08:00
Karoy Lorentey d9b09ecde8 Update copyright dates 2026-03-05 19:39:20 -08:00
Karoy Lorentey bb8d566833 Adopt package access modifier and get rid of gybbing 2025-09-29 11:56:14 -07:00
Karoy Lorentey 987ae0b5c3 run-benchmarks.sh: Invoke swift through xcrun on Darwin 2025-09-27 11:51:52 -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 e337c2b936 Remove SortedCollections scheme 2025-05-20 15:37:27 -07:00
Karoy Lorentey e004cd36fa Merge branch 'release/1.1' into merge.1.1→main
# Conflicts:
#	CMakeLists.txt
#	README.md
2024-02-07 17:35:40 -08:00
Karoy Lorentey ffa4a58bc1 Update remaining copyright notices 2024-02-02 16:20:22 -08:00
Karoy Lorentey 3f4d8f9912 Merge branch 'release/1.1' into 'main'
# Conflicts:
#	Package.swift
2023-04-24 14:24:15 -07:00
Karoy Lorentey 454c84b5e4 Make most of Rope inlinable 2023-04-10 16:56:30 -07:00
Karoy Lorentey 1666222de2 Add READMEs calling out the fact that the contents of Tests/, Utils/ & Xcode/ are unstable 2023-03-23 13:43:01 -07:00
Karoy Lorentey 688dbdf5c7 Add gyb 😞 2023-03-22 18:56:31 -07:00
Karoy Lorentey 3cc5a3888a _Rope: Add a leaf node reference to indices. Implement explicit index invalidation 2023-03-20 13:12:09 -07:00
Karoy Lorentey 150a165d73 Add experimental rope implementation 2023-03-20 13:11:21 -07:00
Karoy Lorentey 10a01bd9fb Merge branch 'release/1.1'
# Conflicts:
#	Package.swift
2022-11-30 16:36:22 -08:00
Karoy Lorentey 3d66da5f5b [Xcode] Adjust scheme for Collections module 2022-11-28 21:35:39 -08:00
Karoy Lorentey b8ef14f0c0 ShareableHashedCollections → HashTreeCollections 2022-11-28 21:35:37 -08:00
Karoy Lorentey e8fc3ee4cd [PersistentCollections] Rename to SharableHashedCollections
`PersistentSet` → `ShareableSet`
`PersistentDictionary` → `ShareableDictionary`
`PersistentCollections` → `ShareableHashedCollections`
2022-11-07 18:10:16 -08:00
Karoy Lorentey a32048d44e Merge branch 'release/1.1' to ‘main’ 2022-10-28 18:21:18 -07:00
Karoy Lorentey 6af8954d5b [doc] Add generate-docs.sh 2022-10-28 12:34:14 -07:00
Karoy Lorentey 68bc6567be [Xcode] Disable implicit dependencies 2022-10-27 18:36:04 -07:00
Karoy Lorentey 2df7f6d3a8 Update xcode schemes 2022-10-20 17:15:21 -07:00
Karoy Lorentey b1506b6225 [SortedCollections] Remove for now
These are still on track for 1.2.0, but I’ll need to bump them from
the release/1.1 branch.
2022-10-11 17:55:35 -07:00
Karoy Lorentey 48ac82c029 [Deque] Modernize code base for Swift 5.5 2022-10-09 20:11:51 -07:00
Karoy Lorentey c7c0a094f9 Update Xcode schemes 2022-10-09 15:44:56 -07:00
Karoy Lorentey 7d6fe857da [Benchmark] Add Xcode scheme for memory benchmark target 2022-09-27 14:18:39 -07:00
Karoy Lorentey 27626fa703 [Xcode] Clean up the schemes situation 2022-09-19 17:09:04 -07:00
Karoy Lorentey 9d113c8c6a [Benchmarks] Update dependencies 2022-09-19 16:59:53 -07:00
Karoy Lorentey f4dc3aa4a9 Merge branch 'feature/SortedCollections' into release/1.1
# Conflicts:
#	Package.swift
#	Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/SortedCollections.xcscheme
2022-09-19 16:06:24 -07:00
Karoy Lorentey de31437ee5 Merge branch 'feature/PersistentCollections' into release/1.1 2022-09-19 16:02:51 -07:00
Karoy Lorentey 31eca4a02c Merge branch 'feature/BitSet' into release/1.1
# Conflicts:
#	Utils/swift-collections.xcworkspace/xcshareddata/xcschemes/Collections.xcscheme
2022-09-19 16:00:20 -07:00
Karoy Lorentey c9ca59fbb9 [PersistentCollections] Improved storage representation
- Switch to using `ManagedBuffer` to represent node storage. This has
  useful performance benefits, but it significantly complicates access
  to node data. We no longer have direct access to the underlying raw
  storage: everything needs to go through closures passed to
  `ManagedBuffer.withUnsafeMutablePointers`.

- Introduce `struct _Node` and `struct _Node.UnsafeHandle` to
  represent a (strong) reference to a hash tree node, and a
  convenient handle for node storage, respectively. Use these instead
  of directly accessing the ManagedBuffer object, whenever feasible.

- Implement separate paths for in-place mutations vs copy-on-write
  operation, optimizing both flavors.

- Go to great lengths to eliminate unnecessary retain-release traffic,
  whenever possible.

- Push subtree counts into parent nodes by moving the corresponding
  field from the node header into the `_Node` struct. (This results in
  a cool ~20x speedup for jumping around in the tree by integer
  offsets.)

- Implement a type-punned empty root singleton, to allow creating
  empty trees without allocating anything.
2022-09-13 23:48:54 -07:00
Karoy Lorentey 14f90620c8 [PersistentCollections] Introduce _Bucket, _Bitmap, _HashPath, and _HashValue
These provide nicer tools for slicing up hash values and dealing with node bitmaps.

_Bucket is a logical entry in the hash table inside a node.
_Bitmap is a set of bucket values, represented by a bitset.
_HashPath facilitates slicing up a hash value into a series of bucket values.
_HashValue represents a hash value.

This is still just mostly superficial refactoring, with little to no functional changes.
2022-09-09 00:47:10 -07:00