Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
9567a65
FragmentMetadata checks that number of tiles matches dense domain
rroelke Jul 24, 2025
254fdcb
GlobalOrderWriter::dense
rroelke Sep 24, 2025
fac092f
GlobalOrderWriter::identify_fragment_tile_boundaries
rroelke Sep 26, 2025
b9cb68f
Test "C++ API: Max fragment size dense array" with one example
rroelke Sep 29, 2025
0271827
Non-const Range::start_fixed and Range::end_fixed
rroelke Sep 29, 2025
2f584e9
Domain::update_cell_num_per_tile
rroelke Sep 29, 2025
5dedb00
WriterBase::create_fragment optional domain arg
rroelke Sep 29, 2025
42e8068
Fix global order writer dense fragment domain with max fragment size
rroelke Sep 29, 2025
eda3603
Add 'Rectangle Tiles' section
rroelke Sep 29, 2025
cd8a6c7
Attribute::set_fill_value<T>
rroelke Sep 30, 2025
ec4026f
Fix GlobalOrderWriter::clean_up if no fragment is started yet
rroelke Sep 30, 2025
4bf45f0
Fix rectangle tiles test
rroelke Sep 30, 2025
6177812
Test handles fragments being written out of order
rroelke Sep 30, 2025
b58d9ac
Global writer aligns dense domains to tile row
rroelke Sep 30, 2025
091e8ed
Fix tile bounds for larger subarray inputs
rroelke Sep 30, 2025
6a8fc4e
Fix 'Row tiles' section for larger inputs
rroelke Sep 30, 2025
520f344
Dimension::num_tiles
rroelke Oct 1, 2025
150ab8d
rapidcheck fix Domain show linking issue and add some more specializa…
rroelke Oct 1, 2025
5b186e4
Query::CoordsInfo constructor
rroelke Oct 2, 2025
4becf64
FragmentMetadata::fragment_meta_size
rroelke Oct 2, 2025
c99a104
rc::make_dimension with extent bound
rroelke Oct 2, 2025
5472d20
Add rapidcheck 2d test and some fixes for issues found
rroelke Oct 2, 2025
46fda11
Add doc for Attribute::set_fill_value overload
rroelke Oct 2, 2025
eb52b4f
Fix only fragment happening during finalize (for sparse)
rroelke Oct 2, 2025
929432b
Add test function comments
rroelke Oct 2, 2025
b6a3953
Fix weird uninitialized value false positive with fragment_end
rroelke Oct 2, 2025
35ca55f
Fixes to rapidcheck test
rroelke Oct 3, 2025
c01b3dd
NDRangeTypedAccess
rroelke Oct 7, 2025
02b05af
Fix fragment metadata domain when resuming fragment from previous submit
rroelke Oct 7, 2025
7bf6229
Fix writing with multiple submits
rroelke Oct 13, 2025
ffecac3
Revert "Add doc for Attribute::set_fill_value overload"
rroelke Oct 13, 2025
be2fefb
make format
rroelke Oct 13, 2025
04851b7
Remove incorrect assert
rroelke Oct 13, 2025
33ac816
Tile::filtered_buffer() const
rroelke Oct 15, 2025
60e887b
Add start/end tile idx args to WriterBase methods
rroelke Oct 16, 2025
8e8d617
Col tile order, and also keeping a tail of tiles in memory
rroelke Oct 17, 2025
c063fce
Fix num tiles for sparse
rroelke Oct 17, 2025
37be646
Do not always start new fragment with unpopulated tiles
rroelke Oct 17, 2025
2866645
Validate fragment domains before fragment size
rroelke Oct 17, 2025
309516d
start new fragment if needed for lingering tiles
rroelke Oct 17, 2025
2acd928
Fix rapidcheck num_tiles_per_hyperrow calc
rroelke Oct 17, 2025
ecfa947
Add 3D rapidcheck test
rroelke Oct 17, 2025
1b5a408
Add extra validation that adjacent fragments must exceed the max frag…
rroelke Oct 20, 2025
f9a9289
Refactor positive rapidcheck tests and add 1D
rroelke Oct 20, 2025
bbe2609
Refactor to return struct FragmentTileBoundaries
rroelke Oct 20, 2025
3dc2559
WriterTileTuple::filtered_size
rroelke Oct 20, 2025
9a5383a
Add test for requirement about how tiles kept in memory after submit
rroelke Oct 20, 2025
ea72c85
unit_domain_tile_offset.cc, is_rectangular_domain passes for 2D
rroelke Oct 22, 2025
59b450f
is_rectangular_domain 3d
rroelke Oct 23, 2025
ce75d5b
domain_tile_offset with passing example tests for 2D
rroelke Oct 27, 2025
6ffb569
Fix instance_domain_tile_offset total_tiles
rroelke Oct 27, 2025
0be85dd
Add 2d rapidcheck test
rroelke Oct 27, 2025
eaed3eb
domain_tile_offset 3d test
rroelke Oct 27, 2025
541c75d
Move tile arithmetic functions into tiledb/sm/tile/arithmetic.h
rroelke Oct 27, 2025
7167bf6
Update for col major
rroelke Oct 27, 2025
13e6917
Un-comment GENERATEs
rroelke Oct 27, 2025
c3d3d64
Use tile arithmetic functions in global order writer
rroelke Oct 27, 2025
591629e
tiledb/sm/tile/test/arithmetic.h
rroelke Oct 28, 2025
5914606
More precise assertion of fragments covering the subarray
rroelke Oct 28, 2025
7e6dc22
Flat rectangular prism tiles
rroelke Oct 28, 2025
dc04226
If fragment size is not set always flush tiles
rroelke Oct 28, 2025
713c541
Add shrinking examples
rroelke Oct 28, 2025
3b45c6e
Clamp domain_tile_offset output to the domain arg
rroelke Oct 28, 2025
e4c2e3f
Pad subarray to domain tiles
rroelke Oct 28, 2025
c7eaf8e
REQUIRE_THROWS needs matcher arg
rroelke Oct 28, 2025
325b943
Revert "Domain::update_cell_num_per_tile"
rroelke Oct 28, 2025
2590377
Revert "Attribute::set_fill_value<T>"
rroelke Oct 28, 2025
050b976
Remove duplicate rapidcheck checked_sub function
rroelke Oct 28, 2025
46589a4
Revert "NDRangeTypedAccess"
rroelke Oct 28, 2025
0ffb91f
Fix domain padding in domain_tile_offset
rroelke Oct 29, 2025
646a726
Fix fragment order in size comparisons
rroelke Oct 29, 2025
0722fbe
Update GlobalOrderWriter comments/docs
rroelke Oct 29, 2025
f0de1c0
Add definitions to top of tile/arithmetic.h
rroelke Oct 29, 2025
70aa993
pragma for __GNUC__ only
rroelke Oct 29, 2025
4e73daa
Strengthen last_tiles_ buffering check
rroelke Oct 29, 2025
1be1ec3
C++ API: Test consolidation dense array with max fragment size
rroelke Oct 31, 2025
8674d2e
Avoid uninitialized false positive for max_fragment_size
rroelke Oct 31, 2025
952b263
Overflow checks in tile arithmetic functions
rroelke Oct 31, 2025
9c62085
Fix narrowing conversion that is suddenly showing up
rroelke Oct 31, 2025
bce40a7
fragment_end is not std::option to avoid false positive uninitialized…
rroelke Oct 31, 2025
e569c32
constexpr tile_order
rroelke Oct 31, 2025
750f988
instance_dense_consolidation sorts in global order
rroelke Oct 31, 2025
060f69c
validate_fragment_domains missed a spot for tile order
rroelke Oct 31, 2025
f26fe05
gen_fragment_size produces minimum 1 tile
rroelke Oct 31, 2025
a50040c
Remove SKIP and fix max_fragment_size
rroelke Oct 31, 2025
ef35f1b
Add write_unit_num_cells to rapidcheck test and capture a failing exa…
rroelke Nov 1, 2025
3b2e549
Add and fix Example 4 with fragment starting at end of row
rroelke Nov 1, 2025
78fe4fa
enum IsRectangularDomain
rroelke Nov 1, 2025
bb36143
Update unit_tile to expect IsRectangularDomain::No or IsRectangularDo…
rroelke Nov 1, 2025
1293f4b
Use IsRectangularDomain::Never to stop buffering tiles
rroelke Nov 2, 2025
2b9ed25
Use VFSTestSetup and per-test array_name
rroelke Nov 3, 2025
9b60e8f
Revert back to initial fragment allocation since it helps serialization
rroelke Nov 3, 2025
f4398d3
Disable dense global order writes setting max fragment size for REST
rroelke Nov 4, 2025
2e9d9d2
Genericize instance_dense_global_order
rroelke Nov 4, 2025
5dd97f4
Fix bad value_size with var length query_buffers
rroelke Nov 4, 2025
888099c
Add simple var-length example
rroelke Nov 4, 2025
3a35494
Some Skew examples
rroelke Nov 4, 2025
a93b368
Really fix make_field_size with offset
rroelke Nov 4, 2025
6f063f3
make_field_sizes const ref
rroelke Nov 4, 2025
e29a582
Fragment::slice
rroelke Nov 4, 2025
b826171
Use write_unit_num_cells in var examples
rroelke Nov 4, 2025
e4f7479
Fix Fragment::num_cells to use dimension if present
rroelke Nov 4, 2025
47648e6
Two rows of tiles in var length example
rroelke Nov 4, 2025
25bf184
Remove unused
rroelke Nov 5, 2025
b75bd59
Correctly use VFSTestSetup context
rroelke Nov 5, 2025
6026daf
Merge remote-tracking branch 'origin/main' into rr/core-290-dense-con…
rroelke Nov 5, 2025
a1640a8
Add test for large write num cells and update FIXME comment
rroelke Nov 5, 2025
0dead5b
Attempt to fix false positive Wmaybe-uninitialized
rroelke Nov 5, 2025
5ac3752
make_subcol code cleanliness
rroelke Nov 5, 2025
dabdc1d
Review comments
rroelke Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
425 changes: 425 additions & 0 deletions test/src/unit-cppapi-consolidation.cc

Large diffs are not rendered by default.

1,160 changes: 1,160 additions & 0 deletions test/src/unit-cppapi-max-fragment-size.cc

Large diffs are not rendered by default.

24 changes: 2 additions & 22 deletions test/src/unit-sparse-global-order-reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3713,19 +3713,7 @@ void CSparseGlobalOrderFx::run_execute(Instance& instance) {
ASSERTER(cursor_cells + num_cells <= expect.size());

// accumulate
std::apply(
[&](auto&... field) {
std::apply(
[&](auto&... field_cursor) {
std::apply(
[&](const auto&... field_size) {
(field.accumulate_cursor(field_cursor, field_size), ...);
},
field_sizes);
},
outcursor);
},
std::tuple_cat(outdims, outatts));
templates::query::accumulate_cursor(out, outcursor, field_sizes);

if (status == TILEDB_COMPLETED) {
break;
Expand All @@ -3735,15 +3723,7 @@ void CSparseGlobalOrderFx::run_execute(Instance& instance) {
// Clean up.
tiledb_query_free(&query);

std::apply(
[outcursor](auto&... outfield) {
std::apply(
[&](const auto&... field_cursor) {
(outfield.finish_multipart_read(field_cursor), ...);
},
outcursor);
},
std::tuple_cat(outdims, outatts));
templates::query::resize(out, outcursor);

ASSERTER(expect.dimensions() == outdims);

Expand Down
3 changes: 2 additions & 1 deletion test/support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ list(APPEND TILEDB_CORE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/tiledb/sm/c_api")

# Gather the test source files
set(TILEDB_TEST_SUPPORT_SOURCES
rapidcheck/show.cc
rapidcheck/show/array_schema_templates.cc
rapidcheck/show/query_ast.cc
src/array_helpers.cc
src/array_schema_helpers.cc
src/ast_helpers.h
Expand Down
198 changes: 198 additions & 0 deletions test/support/rapidcheck/array_schema_templates.h
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the definitions used in the file from test/support/src/array_templates.h into test/support/src/array_schema_templates.h.
I did this because the first header had some API stuff which required including tiledb.h which was not compatible with using these structures in a unit test.
The changes to this file follow up on that, applying similar reason to our rapidcheck generators.\

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some actual new code in this file, such as the "bound" arguments to make_extent, make_domain, and make_dimension.

Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
/**
* @file test/support/rapidcheck/array_schema_templates.h
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2025 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @section DESCRIPTION
*
* This file defines rapidcheck generators for the structures
* defined in test/support/src/array_schema_templates.h.
*/

#ifndef TILEDB_RAPIDCHECK_ARRAY_SCHEMA_H
#define TILEDB_RAPIDCHECK_ARRAY_SCHEMA_H

#include <test/support/src/array_schema_templates.h>
#include <test/support/stdx/tuple.h>
#include <test/support/tdb_rapidcheck.h>

#include "tiledb/common/arithmetic.h"

namespace rc {

using namespace tiledb::test;
using namespace tiledb::test::templates;

template <DimensionType D>
Gen<templates::Domain<D>> make_domain(std::optional<D> bound = std::nullopt) {
auto bounds = gen::mapcat(gen::arbitrary<D>(), [bound](D lb) {
const D ub_limit =
(bound.has_value() ?
tiledb::common::checked_arithmetic<D>::add(lb, bound.value())
.value_or(std::numeric_limits<D>::max()) :
std::numeric_limits<D>::max());
if constexpr (std::is_same_v<D, int64_t> || std::is_same_v<D, uint64_t>) {
return gen::pair(gen::just(lb), gen::inRange(lb, ub_limit));
} else {
// NB: `gen::inRange` is exclusive at the upper end but tiledb domain is
// inclusive. So we have to use `int64_t` to avoid overflow.
return gen::pair(
gen::just(lb),
gen::cast<D>(gen::inRange(int64_t(lb), int64_t(ub_limit) + 1)));
}
});

return gen::map(bounds, [](std::pair<D, D> bounds) {
return templates::Domain<D>(bounds.first, bounds.second);
});
}

template <DimensionType D>
struct Arbitrary<templates::Domain<D>> {
static Gen<templates::Domain<D>> arbitrary() {
return make_domain<D>();
}
};

template <DimensionType D>
Gen<D> make_extent(
const templates::Domain<D>& domain, std::optional<D> bound = std::nullopt) {
// upper bound on all possible extents to avoid unreasonably
// huge tile sizes
static constexpr D extent_limit = static_cast<D>(
std::is_signed<D>::value ?
std::min(
static_cast<int64_t>(std::numeric_limits<D>::max()),
static_cast<int64_t>(1024 * 16)) :
std::min(
static_cast<uint64_t>(std::numeric_limits<D>::max()),
static_cast<uint64_t>(1024 * 16)));

const D extent_bound =
(bound.has_value() ? std::min(bound.value(), extent_limit) :
extent_limit);

// NB: `gen::inRange` is exclusive at the upper end but tiledb domain is
// inclusive. So we have to be careful to avoid overflow.

D extent_lower_bound = 1;
D extent_upper_bound;

const auto bound_distance = tiledb::common::checked_arithmetic<D>::sub(
domain.upper_bound, domain.lower_bound);
if (bound_distance.has_value()) {
extent_upper_bound =
(bound_distance.value() < extent_bound ? bound_distance.value() + 1 :
extent_bound);
} else {
extent_upper_bound = extent_bound;
}

return gen::inRange(extent_lower_bound, extent_upper_bound + 1);
}

template <tiledb::sm::Datatype D>
Gen<templates::Dimension<D>> make_dimension(
std::optional<typename templates::Dimension<D>::value_type> extent_bound =
std::nullopt,
std::optional<typename templates::Dimension<D>::value_type> domain_bound =
std::nullopt) {
using CoordType = templates::Dimension<D>::value_type;
auto tup = gen::mapcat(
make_domain<CoordType>(domain_bound),
[extent_bound](Domain<CoordType> domain) {
return gen::pair(gen::just(domain), make_extent(domain, extent_bound));
});

return gen::map(tup, [](std::pair<Domain<CoordType>, CoordType> tup) {
return templates::Dimension<D>(tup.first, tup.second);
});
}

template <tiledb::sm::Datatype D>
struct Arbitrary<templates::Dimension<D>> {
static Gen<templates::Dimension<D>> arbitrary() {
return make_dimension<D>();
}
};

template <DimensionType D>
Gen<D> make_coordinate(const templates::Domain<D>& domain) {
// `gen::inRange` does an exclusive upper bound,
// whereas the domain upper bound is inclusive.
// As a result some contortion is required to deal
// with numeric_limits.
if constexpr (std::is_same_v<D, StringDimensionCoordType>) {
// NB: poor performance with small domains for sure
return gen::suchThat(
gen::map(
gen::string<std::string>(),
[](std::string s) {
StringDimensionCoordType v(s.begin(), s.end());
return v;
}),
[domain](const StringDimensionCoordType& s) {
return domain.lower_bound <= s && s <= domain.upper_bound;
});
} else if constexpr (std::is_signed<D>::value) {
if (int64_t(domain.upper_bound) < std::numeric_limits<int64_t>::max()) {
return gen::cast<D>(gen::inRange(
int64_t(domain.lower_bound), int64_t(domain.upper_bound + 1)));
} else {
return gen::inRange(domain.lower_bound, domain.upper_bound);
}
} else {
if (uint64_t(domain.upper_bound) < std::numeric_limits<uint64_t>::max()) {
return gen::cast<D>(gen::inRange(
uint64_t(domain.lower_bound), uint64_t(domain.upper_bound + 1)));
} else {
return gen::inRange(domain.lower_bound, domain.upper_bound);
}
}
}

template <DimensionType D>
Gen<templates::Domain<D>> make_range(const templates::Domain<D>& domain) {
return gen::apply(
[](D p1, D p2) { return templates::Domain<D>(p1, p2); },
make_coordinate<D>(domain),
make_coordinate<D>(domain));
}

template <>
void show<Domain<int>>(const templates::Domain<int>& domain, std::ostream& os);

template <>
void show<Domain<uint64_t>>(
const templates::Domain<uint64_t>& domain, std::ostream& os);

template <>
void show<Dimension<tiledb::sm::Datatype::UINT64>>(
const templates::Dimension<tiledb::sm::Datatype::UINT64>& dimension,
std::ostream& os);

} // namespace rc

#endif
Loading
Loading