Skip to content

Commit 40159df

Browse files
authored
Fix spelling mistakes (#140)
Signed-off-by: Colin Ian King <[email protected]>
1 parent 2c5b83c commit 40159df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+163
-163
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ target_include_directories(
4747
)
4848

4949
# We use C++ 20 features in our exposed headers.
50-
# Anyone using us as a depdency and including our headers will need to be C++20 compatible.
50+
# Anyone using us as a dependency and including our headers will need to be C++20 compatible.
5151
#
5252
# Keep this variable in-sync with the `SVS_CXX_STANDARD` given below.
5353
# We need to manually set the standard for `spdlog`
@@ -148,7 +148,7 @@ configure_package_config_file(
148148
INSTALL_DESTINATION "${LIB_CONFIG_INSTALL_DIR}"
149149
)
150150

151-
# Don't make compatibility guarentees until we reach a compatibility milestone.
151+
# Don't make compatibility guarantees until we reach a compatibility milestone.
152152
write_basic_package_version_file(
153153
${VERSION_CONFIG}
154154
VERSION ${SVS_VERSION}

HISTORY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Finally, if environment variable based initialization is not desired, it can be
161161
**Reconstruction Semantics**
162162
* Uncompressed data is returned directly (potentially promoting to `float32`).
163163
* LVQ compressed data is reconstructed using this highest precision possible. For two
164-
level datasets, boths levels will be used.
164+
level datasets, both levels will be used.
165165
* LeanVec datasets will reconstruct using the full-precision secondary dataset.
166166

167167
* Added an upgrade tool `pysvs.upgrader.upgrade` to upgrade the serialization layout of SVS
@@ -440,7 +440,7 @@ removal.
440440
* Version `v0.0.2` of serialized LVQ datasets is *broken*, the current version is now
441441
`v0.0.3`. This change was made to facilitate a canonical on-disk representation of LVQ.
442442

443-
Goind forward, previously saved LVQ formats can be reloaded using different runtime
443+
Going forward, previously saved LVQ formats can be reloaded using different runtime
444444
alignments and different packing strategies without requiring whole dataset recompression.
445445

446446
Any previously saved datasets will need to be regenerated from uncompressed data.

benchmark/include/svs-benchmark/benchmark.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class ExecutableDispatcher {
242242
// new results as they become available and regularly saves results.
243243
//
244244
// It *does* involve many copies of the underlying TOML data, but I believe the tradoff in
245-
// data safety greatly outweights any extra time spent moving around TOML data.
245+
// data safety greatly outweighs any extra time spent moving around TOML data.
246246
class Checkpoint {
247247
private:
248248
toml::table data_{};
@@ -265,7 +265,7 @@ class Checkpoint {
265265
// Make sure to handle the case where this is the first data being registered
266266
// with the given key.
267267
//
268-
// This is not the most efficient implemenation because we make unnecessary copies,
268+
// This is not the most efficient implementation because we make unnecessary copies,
269269
// but the complexitry required to correctly applying incremental data does not
270270
// seem to be worth it.
271271
auto data_copy = data_;
@@ -304,7 +304,7 @@ struct BuildTime {
304304
}
305305
};
306306

307-
/// Class shared to record the time taken to load an index into a useable form.
307+
/// Class shared to record the time taken to load an index into a usable form.
308308
struct LoadTime {
309309
public:
310310
double load_time_;

benchmark/include/svs-benchmark/executable.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ inline constexpr IsValidate is_validate{};
7171
/// // Return an example job to serve as a prototype.
7272
/// job_type example() const;
7373
///
74-
/// // The name assoicated with the job. This will be used to both pull jobs from
74+
/// // The name associated with the job. This will be used to both pull jobs from
7575
/// // the input TOML file as well as be the key under which results will be collected
7676
/// // in output TOML file.
7777
/// std::convertible_to<std::string> name() const;
@@ -100,7 +100,7 @@ inline constexpr IsValidate is_validate{};
100100
///
101101
template <typename Implementation>
102102
class JobBasedExecutable : private Implementation, public Benchmark {
103-
// Type Alises
103+
// Type Aliases
104104
public:
105105
using job_type = typename Implementation::job_type;
106106
using dispatcher_type = typename Implementation::dispatcher_type;
@@ -254,13 +254,13 @@ class JobBasedExecutable : private Implementation, public Benchmark {
254254
///
255255
/// // Return a dispatcher for the executable.
256256
/// // Each test must take `const job_type&` as an argument and return a destructurable
257-
/// // pair consiting of a string key and a `toml::table` of results.
257+
/// // pair consisting of a string key and a `toml::table` of results.
258258
/// std::vector</*implementation-defined*/> tests() const;
259259
///
260260
/// // Return an example job to serve as a prototype.
261261
/// job_type example() const;
262262
///
263-
/// // The name assoicated with the job. This will be used to both pull jobs from
263+
/// // The name associated with the job. This will be used to both pull jobs from
264264
/// // the input TOML file as well as be the key under which results will be collected
265265
/// T // in output TOML file.
266266
/// std::convertible_to<std::string> name() const;
@@ -289,7 +289,7 @@ class JobBasedExecutable : private Implementation, public Benchmark {
289289
///
290290
template <typename Implementation>
291291
class TestBasedExecutable : private Implementation, public Benchmark {
292-
// Type Alises
292+
// Type Aliases
293293
public:
294294
using job_type = typename Implementation::job_type;
295295

benchmark/include/svs-benchmark/vamana/build.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ struct BuildJobBase {
146146
size_t num_threads_;
147147

148148
public:
149-
///// Contructor
149+
///// Constructor
150150
BuildJobBase(
151151
std::string_view description,
152152
svsbenchmark::Dataset dataset,

benchmark/include/svs-benchmark/vamana/search.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct SearchJob {
131131
return search_parameters_;
132132
}
133133

134-
// Compatbility with `ExpectedResults`
134+
// Compatibility with `ExpectedResults`
135135
static std::nullopt_t get_build_parameters() { return std::nullopt; }
136136
svs::DistanceType get_distance() const { return distance_; }
137137

benchmark/src/vamana/build.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Compiled specializations are listed below:
102102

103103
template <typename BenchmarkType> struct Exe {
104104
public:
105-
// type alises
105+
// type aliases
106106
using job_type = associated_job_t<BenchmarkType>;
107107
using dispatcher_type = typename BuildDispatcher<BenchmarkType>::type;
108108

bindings/python/microarch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def resolve_microarch(name: str):
5050
"native": cpu.host().name,
5151
}
5252
# Allow the custom aliases to override the current name.
53-
# If an alias doesn't exist, juse pass the name straight through.
53+
# If an alias doesn't exist, just pass the name straight through.
5454
return custom_aliases.get(name, name)
5555

5656
def dump_flags_for_cmake(flags: list, path: str):

bindings/python/src/dynamic_vamana.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ the index monotonically increasing.
154154
const char* COMPACT_DOCSTRING = R"(
155155
Remove any holes created in the graph and data by renumbering internal IDs.
156156
Shrink the underlying data structures.
157-
Following ``consolidate``, this can potentialy reduce the memory footprint of the index
157+
Following ``consolidate``, this can potentially reduce the memory footprint of the index
158158
if a sufficient number of points were deleted.
159159
)";
160160

@@ -264,7 +264,7 @@ void wrap(py::module& m) {
264264
add_threading_interface(vamana);
265265
add_data_interface(vamana);
266266

267-
// Vamana specific extentions.
267+
// Vamana specific extensions.
268268
vamana::add_interface(vamana);
269269

270270
// Dynamic interface.
@@ -358,7 +358,7 @@ auxiliary files that are needed when saving the various components of the index.
358358
359359
If the directory does not exist, it will be created if its parent exists.
360360
361-
It is the caller's responsibilty to ensure that no existing data will be
361+
It is the caller's responsibility to ensure that no existing data will be
362362
overwritten when saving the index to this directory.
363363
)"
364364
);

bindings/python/src/python_bindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class ScopedModuleNameOverride {
136136
} // namespace
137137

138138
PYBIND11_MODULE(_svs, m) {
139-
// Internall, the top level `__init__.py` imports everything from the C++ module named
139+
// Internally, the top level `__init__.py` imports everything from the C++ module named
140140
// `_svs`.
141141
//
142142
// Performing the name override makes the definitions inside the C++ bindings

bindings/python/src/svs/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def read_svs(filename: str, dtype = np.float32):
133133
with open(filename, "rb") as fin:
134134
# Read through the magic number
135135
struct.unpack('q', fin.read(8))
136-
# Read throug the UUID
136+
# Read through the UUID
137137
_uuid = struct.unpack('q', fin.read(8))
138138
_uuid = struct.unpack('q', fin.read(8))
139139

@@ -159,7 +159,7 @@ def write_vecs(array: np.array, filename: str, skip_check: bool = False):
159159
Result:
160160
The array is saved to the requested file.
161161
162-
File extention to array element type:
162+
File extension to array element type:
163163
164164
* fvecs: np.float32
165165
* hvecs: np.float16
@@ -201,7 +201,7 @@ def write_vecs(array: np.array, filename: str, skip_check: bool = False):
201201
io.write(array[i,:].tobytes())
202202

203203
def random_dataset(nvectors: int, ndims: int, dtype = np.float32, seed = None):
204-
# Use the `RandomState` generator for it's strong backward-compatibility guarentee.
204+
# Use the `RandomState` generator for it's strong backward-compatibility guarantee.
205205
# I.E., we don't care about performance. We want reproducibility here.
206206
rng = np.random.RandomState(seed = seed)
207207
if dtype in (np.float16, np.float32):

bindings/python/src/vamana.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@ auxiliary files that are needed when saving the various components of the index.
541541
542542
If the directory does not exist, it will be created if its parent exists.
543543
544-
It is the caller's responsibilty to ensure that no existing data will be
544+
It is the caller's responsibility to ensure that no existing data will be
545545
overwritten when saving the index to this directory.
546546
)"
547547
);
548548
}
549-
} // namespace svs::python::vamana
549+
} // namespace svs::python::vamana

bindings/python/tests/dynamic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def ids(self):
7272
return self.current_ids
7373

7474
def ground_truth(self, num_neighbors: int):
75-
# Gather the dataset into a contiguous chunck to pass to the ground truth
75+
# Gather the dataset into a contiguous chunk to pass to the ground truth
7676
# calculation.
7777
ids_np = np.array(list(self.current_ids), dtype = np.uint64)
7878
sub_dataset = self.raw_data[ids_np, :]

bindings/python/tests/test_dynamic_vamana.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def recall_check(
7676
I, D = reloaded.search(reference.queries, num_neighbors)
7777
reloaded_recall = svs.k_recall_at(gt, I, num_neighbors, num_neighbors)
7878

79-
# Because saving triggers graph compaction, we can't guarentee that the reloaded
79+
# Because saving triggers graph compaction, we can't guarantee that the reloaded
8080
# recall is the same as the original index.
8181
print(f" Reloaded Recall: {reloaded_recall}")
8282
self.assertTrue(reloaded_recall < expected_recall + recall_delta)

bindings/python/tests/test_flat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _do_test(self, flat, queries, groundtruth, distance, data = svs.read_vecs(te
102102
)
103103

104104
# Test querying.
105-
# Return as many neighbors as we have exising groundtruth for.
105+
# Return as many neighbors as we have existing groundtruth for.
106106
num_neighbors = groundtruth.shape[-1]
107107
results = flat.search(queries, num_neighbors)
108108

examples/cpp/custom_thread_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,6 @@ int svs_main(std::vector<std::string> args) {
278278
return 0;
279279
}
280280

281-
// Special main providing some helpful utilties.
281+
// Special main providing some helpful utilities.
282282
SVS_DEFINE_MAIN();
283283
//! [Example All]

examples/cpp/saveload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ContextFreeSaveable {
5757
// Serialized objects need a schema as well, which is essentially a unique name
5858
// associated with the serialized TOML table.
5959
//
60-
// The combination of schema and name allow speculative loading code some guarentee
60+
// The combination of schema and name allow speculative loading code some guarantee
6161
// as to the expected contents and types of a table.
6262
static constexpr std::string_view serialization_schema = "example_context_free";
6363

examples/cpp/shared/shared.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ int svs_main(std::vector<std::string> SVS_UNUSED(args)) {
136136
return 0;
137137
}
138138

139-
// Special main providing some helpful utilties.
139+
// Special main providing some helpful utilities.
140140
SVS_DEFINE_MAIN();

examples/cpp/vamana.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,6 @@ int svs_main(std::vector<std::string> args) {
191191
return 0;
192192
}
193193

194-
// Special main providing some helpful utilties.
194+
// Special main providing some helpful utilities.
195195
SVS_DEFINE_MAIN();
196196
//! [Example All]

include/svs/concepts/data.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ namespace data {
6161
/// // Require that ``T`` has the type alias ``T::value_type``.
6262
/// //
6363
/// // Note that the the alias does not necessarily need to be a "value_type" in the
64-
/// // sence of C++ value type. In other words, it can (and probably should be for
64+
/// // sense of C++ value type. In other words, it can (and probably should be for
6565
/// // performance reasons be a reference).
6666
/// typename T::value_type;
6767
///
6868
/// // Require that ``T`` has the type alias ``T::const_value_type``.
6969
/// //
7070
/// // Note that the the alias does not necessarily need to be a "value_type" in the
71-
/// // sence of C++ value type. In other words, it can (and probably should be for
71+
/// // sense of C++ value type. In other words, it can (and probably should be for
7272
/// // performance reasons be a reference).
7373
/// typename T::const_value_type;
7474
/// };

include/svs/core/allocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
///
2020
/// @file
21-
/// @brief Implements commont large-scale allocators used by the many data structures.
21+
/// @brief Implements common large-scale allocators used by the many data structures.
2222
///
2323

2424
///
@@ -44,7 +44,7 @@
4444

4545
// <linux/mman.h> provides some linux-specific flags like
4646
// MAP_POPULATE, MAP_NORESERVE, MAP_HUGETLB.
47-
// They can be used only with linux, and are not availiable
47+
// They can be used only with linux, and are not available
4848
// for MacOS
4949

5050
#if defined(__linux__)

include/svs/core/data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct UnspecializedVectorDataLoader {
9191
///
9292
/// @tparam T The element type of the encoded vectors.
9393
/// Typically, this will be a floating point type like ``float`` or ``svs::Float16``
94-
/// but may be an integer type as well for certain datsets.
94+
/// but may be an integer type as well for certain datasets.
9595
/// @tparam Extent The compile-time dimensionality of the vectors to be read.
9696
/// May provide a performance boost if given. Default: ``svs::Dynamic``.
9797
/// @tparam Allocator The allocator to use for the memory backing the data when loaded.

include/svs/core/data/io.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace svs::io {
3131
// Dispatch tags to control the loading and saving pipeline.
3232
constexpr lib::PriorityTag<2> default_populate_tag = lib::PriorityTag<2>();
3333

34-
// Some specialized datasets may need to perform aritrary computation
34+
// Some specialized datasets may need to perform arbitrary computation
3535
// or rearrangement of the saved data prior to committing it to the dataset.
3636
//
3737
// These datasets are expected to provide their own custom accessor in this case.
@@ -187,7 +187,7 @@ inline bool special_by_file_extension(std::string_view path) {
187187
/// the dataset and (2) the number of dimensions for each vector and return an allocated
188188
/// dataset capable of holding a dataset with those dimensions.
189189
///
190-
/// Recognized file extentions:
190+
/// Recognized file extensions:
191191
/// * .svs: The native file format for this library.
192192
/// * .vecs: The usual [f/b/i]vecs form.
193193
/// * .bin: Files generated by DiskANN.

include/svs/core/data/simple.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ struct Matcher {
150150
}
151151

152152
// Don't support deduction on the try-load path.
153-
// Deduction throws too many exceptions to handle corectly right now.
153+
// Deduction throws too many exceptions to handle correctly right now.
154154
static lib::TryLoadResult<Matcher> try_load_direct(
155155
const std::filesystem::path& SVS_UNUSED(path),
156156
svs::DataType SVS_UNUSED(type_hint) = svs::DataType::undef,
@@ -478,7 +478,7 @@ class SimpleData {
478478
void compact(
479479
std::span<const I> new_to_old, Pool& threadpool, size_t batchsize = 1'000'000
480480
) {
481-
// Alllocate scratch space.
481+
// Allocate scratch space.
482482
batchsize = std::min(batchsize, size());
483483
auto buffer = data::SimpleData<T, Extent>(batchsize, dimensions());
484484
compact_data(*this, buffer, new_to_old, threadpool);
@@ -771,7 +771,7 @@ class SimpleData<T, Extent, Blocked<Alloc>> {
771771
template <std::integral I, threads::ThreadPool Pool>
772772
void
773773
compact(std::span<const I> new_to_old, Pool& threadpool, size_t batchsize = 1'000'000) {
774-
// Alllocate scratch space.
774+
// Allocate scratch space.
775775
batchsize = std::min(batchsize, size());
776776
auto buffer = data::SimpleData<T, Extent>(batchsize, dimensions());
777777
compact_data(*this, buffer, new_to_old, threadpool);

include/svs/core/distance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class DistanceDispatcher {
155155
/// to construct the dispatcher.
156156
///
157157
/// All other arguments will be forwarded to ``f`` beginning at argument position 2.
158-
/// @param args Arguements to forward to ``f``.
158+
/// @param args Arguments to forward to ``f``.
159159
///
160160
template <typename F, typename... Args> auto operator()(F&& f, Args&&... args) {
161161
switch (distance_type_) {

include/svs/core/distance/cosine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CosineSimilarity {
5353
);
5454
}
5555
if (__builtin_expect(svs::detail::avx_runtime_flags.is_avx2_supported(), 1)) {
56-
// We do not support AVX2 on CS yet, but it will fallabck to generic anyway
56+
// We do not support AVX2 on CS yet, but it will fallback to generic anyway
5757
return CosineSimilarityImpl<Dynamic, Ea, Eb, AVX_AVAILABILITY::AVX2>::compute(
5858
a, b, a_norm, lib::MaybeStatic(N)
5959
);
@@ -146,7 +146,7 @@ inline constexpr bool operator==(DistanceCosineSimilarity, DistanceCosineSimilar
146146
///
147147
/// @ingroup distance_overload
148148
/// @anchor compute_distancecosine
149-
/// @brief Compute the Cosine simmilarity between two vectors in R^n.
149+
/// @brief Compute the Cosine similarity between two vectors in R^n.
150150
///
151151
/// @tparam Ea The element type for each component of the left-hand argument.
152152
/// @tparam Eb The element type for each component of the right-hand argument.

0 commit comments

Comments
 (0)